aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/lib
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2024-07-05 09:57:03 -0600
committerTom Tromey <tromey@adacore.com>2024-08-14 10:08:58 -0600
commit0c3bfda0ac6044b3515193f25b1555d912e22baf (patch)
treef524bb9f8eec90e87d1ee78ad5a4ba2ba8448dd4 /gdb/python/lib
parent0341f2767adab5281f040eadd276d711afec96f0 (diff)
downloadbinutils-0c3bfda0ac6044b3515193f25b1555d912e22baf.zip
binutils-0c3bfda0ac6044b3515193f25b1555d912e22baf.tar.gz
binutils-0c3bfda0ac6044b3515193f25b1555d912e22baf.tar.bz2
Make DAP instruction breakpoints unverified
Currently, when a DAP client uses setInstructionBreakpoints, the resulting breakpoints are created as "verified", even though there is no symbol file and thus the breakpoint can't possibly have a source location. This patch changes the DAP code to assume that all breakpoints are unverified before launch. Reviewed-by: Keith Seitz <keiths@redhat.com>
Diffstat (limited to 'gdb/python/lib')
-rw-r--r--gdb/python/lib/gdb/dap/breakpoint.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/gdb/python/lib/gdb/dap/breakpoint.py b/gdb/python/lib/gdb/dap/breakpoint.py
index 0ffb507..d44e50b 100644
--- a/gdb/python/lib/gdb/dap/breakpoint.py
+++ b/gdb/python/lib/gdb/dap/breakpoint.py
@@ -104,11 +104,16 @@ breakpoint_map = {}
@in_gdb_thread
def _breakpoint_descriptor(bp):
"Return the Breakpoint object descriptor given a gdb Breakpoint."
+ # If there are no objfiles (that is, before the launch request),
+ # we consider all breakpoints to be pending. This is done to work
+ # around the gdb oddity that setting a breakpoint by address will
+ # always succeed.
+ pending = bp.pending or len(gdb.objfiles()) == 0
result = {
"id": bp.number,
- "verified": not bp.pending,
+ "verified": not pending,
}
- if bp.pending:
+ if pending:
result["reason"] = "pending"
if bp.locations:
# Just choose the first location, because DAP doesn't allow