[PATCH][gdb] Make execute_command_to_string return string on throw

Tom de Vries tdevries@suse.de
Wed Oct 20 20:43:51 GMT 2021


On 10/20/21 8:53 PM, Tom Tromey wrote:
>>> The code LGTM, but could you write / update a test for this?
> 
> Tom> The patch "[gdb/testsuite] Reimplement gdb.gdb/python-interrupts.exp as
> Tom> unittest" uses this.  It checks the output of a command that is also
> Tom> throwing a "Error while executing Python code".
> 
> FWIW the new self-test fails for me:
> 
> (gdb) maint selftest python
> Running selftest python.
> 5
> Self test failed: self-test failed at ../../binutils-gdb/gdb/python/python.c:1932
> Ran 1 unit tests, 1 failed

Hmm, I get:
...
$ gdb -q
(gdb) maint selftest python
Running selftest python.
Ran 1 unit tests, 0 failed
(gdb)
...

Do you have any idea how I could reproduce the fail you're seeing?

FWIW, I don't understand the '5' showing up.  The test is using
execute_fn_to_ui_file which should take care of redirecting things.

Thanks,
- Tom


More information about the Gdb-patches mailing list