aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/python.c
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2021-09-08 13:27:38 +0100
committerAndrew Burgess <andrew.burgess@embecosm.com>2021-10-05 10:05:40 +0100
commit1cb56ad3f3bd378a5adde648c56c48b0a293e2b9 (patch)
treefae24a250e632dd0edb4e49c780ccfeab0fa786b /gdb/python/python.c
parentdb0768c320ec61f47da74f3c8e18313fac5964dc (diff)
downloadbinutils-1cb56ad3f3bd378a5adde648c56c48b0a293e2b9.zip
binutils-1cb56ad3f3bd378a5adde648c56c48b0a293e2b9.tar.gz
binutils-1cb56ad3f3bd378a5adde648c56c48b0a293e2b9.tar.bz2
gdb/python: update events test to handle missing exit_code
The test gdb.python/py-events.exp sets up a handler for the gdb.exited event. Unfortunately the handler is slightly broken, it assumes that the exit_code attribute will always be present. This is not always the case. In a later commit I am going to add more tests to py-events.exp test script, and in so doing I expose the bug in our handling of gdb.exited events. Just to be clear, GDB itself is fine, it is the test that is not written correctly according to the Python Events API. So, in this commit I fix the Python code in the test, and extend the test case to exercise more paths through the Python code. Additionally, I noticed that the gdb.exited event is used as an example in the documentation for how to write an event handler. Unfortunately the same bug that we had in our test was also present in the example code in the manual. So I've fixed that too. After this commit there is no functional change to GDB.
Diffstat (limited to 'gdb/python/python.c')
0 files changed, 0 insertions, 0 deletions