aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2023-05-24 14:22:55 -0600
committerTom Tromey <tromey@adacore.com>2023-06-22 09:46:23 -0600
commit44fc43e5c8cdd8fc1611daa95f3bb7b450926efc (patch)
tree6676e84c4a9d6e2500d23ee909a93c8714a2f421
parent32594d975aa9d886face03ee146fe82aa34a3145 (diff)
downloadbinutils-44fc43e5c8cdd8fc1611daa95f3bb7b450926efc.zip
binutils-44fc43e5c8cdd8fc1611daa95f3bb7b450926efc.tar.gz
binutils-44fc43e5c8cdd8fc1611daa95f3bb7b450926efc.tar.bz2
Reuse breakpoints more frequently in DAP
The DAP breakpoint code tries to reuse a breakpoint when possible. Currently it uses the condition and the hit condition (aka ignore count) when making this determination. However, these attributes are just going to be reset anyway, so this patch changes the code to exclude these from the reuse decision.
-rw-r--r--gdb/python/lib/gdb/dap/breakpoint.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/gdb/python/lib/gdb/dap/breakpoint.py b/gdb/python/lib/gdb/dap/breakpoint.py
index 2cb8db6..f15f905 100644
--- a/gdb/python/lib/gdb/dap/breakpoint.py
+++ b/gdb/python/lib/gdb/dap/breakpoint.py
@@ -85,9 +85,11 @@ def _set_breakpoints_callback(kind, specs, creator):
breakpoint_map[kind] = {}
result = []
for spec in specs:
- keyspec = frozenset(spec.items())
-
+ # It makes sense to reuse a breakpoint even if the condition
+ # or ignore count differs, so remove these entries from the
+ # spec first.
(condition, hit_condition) = _remove_entries(spec, "condition", "hitCondition")
+ keyspec = frozenset(spec.items())
if keyspec in saved_map:
bp = saved_map.pop(keyspec)