diff options
Diffstat (limited to 'gdb/python')
-rw-r--r-- | gdb/python/lib/gdb/dap/breakpoint.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gdb/python/lib/gdb/dap/breakpoint.py b/gdb/python/lib/gdb/dap/breakpoint.py index 76ff129..1622ae6 100644 --- a/gdb/python/lib/gdb/dap/breakpoint.py +++ b/gdb/python/lib/gdb/dap/breakpoint.py @@ -273,7 +273,13 @@ def set_breakpoint(*, source, breakpoints: Sequence = (), **args): if "path" not in source: result = [] else: - specs = [_rewrite_src_breakpoint(source=source, **bp) for bp in breakpoints] + # Setting 'source' in BP avoids any Python error if BP already + # has a 'source' parameter. Setting this isn't in the spec, + # but it is better to be safe. See PR dap/30820. + specs = [] + for bp in breakpoints: + bp["source"] = source + specs.append(_rewrite_src_breakpoint(**bp)) # Be sure to include the path in the key, so that we only # clear out breakpoints coming from this same source. key = "source:" + source["path"] |