diff options
author | Tom Tromey <tromey@adacore.com> | 2024-07-05 10:53:43 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2024-08-14 10:08:58 -0600 |
commit | f2387377574992655490996e46e25cc5fb7993da (patch) | |
tree | f90ddc1479e4ba090562a5824a67427f9b70275d /gdb/python | |
parent | 0c3bfda0ac6044b3515193f25b1555d912e22baf (diff) | |
download | binutils-f2387377574992655490996e46e25cc5fb7993da.zip binutils-f2387377574992655490996e46e25cc5fb7993da.tar.gz binutils-f2387377574992655490996e46e25cc5fb7993da.tar.bz2 |
Fix failure with C++ exceptions in DAP
While working on earlier patches, I noticed that the DAP C++ exception
test had some strange results in the log. Digging into this, I found
that while the Ada catchpoints emit a "bkptno" field in the MI result,
the C++ ones do not -- but the DAP code was relying on this.
This patch fixes the problem by changing which field is examined, and
then updates the tests to verify this.
Reviewed-by: Keith Seitz <keiths@redhat.com>
Diffstat (limited to 'gdb/python')
-rw-r--r-- | gdb/python/lib/gdb/dap/breakpoint.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gdb/python/lib/gdb/dap/breakpoint.py b/gdb/python/lib/gdb/dap/breakpoint.py index d44e50b..db8ac10 100644 --- a/gdb/python/lib/gdb/dap/breakpoint.py +++ b/gdb/python/lib/gdb/dap/breakpoint.py @@ -381,9 +381,12 @@ def _catch_exception(filterId, **args): else: raise DAPException("Invalid exception filterID: " + str(filterId)) result = exec_mi_and_log(cmd) + # While the Ada catchpoints emit a "bkptno" field here, the C++ + # ones do not. So, instead we look at the "number" field. + num = result["bkpt"]["number"] # A little lame that there's no more direct way. for bp in gdb.breakpoints(): - if bp.number == result["bkptno"]: + if bp.number == num: return bp # Not a DAPException because this is definitely unexpected. raise Exception("Could not find catchpoint after creating") |