diff options
author | Tom Tromey <tromey@adacore.com> | 2023-07-27 10:31:32 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2023-07-27 10:35:00 -0600 |
commit | 2f01a2b9eaa44cdf5d7c9ec926705831f8ce4c16 (patch) | |
tree | f0e458157d0ccc90a98151bf82a4fdcc64fef0aa | |
parent | 2902e6682d63183d373f385d4efaf8597fd22544 (diff) | |
download | binutils-2f01a2b9eaa44cdf5d7c9ec926705831f8ce4c16.zip binutils-2f01a2b9eaa44cdf5d7c9ec926705831f8ce4c16.tar.gz binutils-2f01a2b9eaa44cdf5d7c9ec926705831f8ce4c16.tar.bz2 |
Report supportsBreakpointLocationsRequest
While looking at the DAP spec, I noticed that the breakpointLocations
request is gated behind a capability. This patch changes gdb to
report this capability.
I've also added a comment to explain the fact that arguments to
breakpointLocations are not optional, even though the spec says they
are.
-rw-r--r-- | gdb/python/lib/gdb/dap/locations.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gdb/python/lib/gdb/dap/locations.py b/gdb/python/lib/gdb/dap/locations.py index 6c59157..594f1ba 100644 --- a/gdb/python/lib/gdb/dap/locations.py +++ b/gdb/python/lib/gdb/dap/locations.py @@ -18,7 +18,7 @@ import gdb # This is deprecated in 3.9, but required in older versions. from typing import Optional -from .server import request +from .server import capability, request from .startup import in_gdb_thread, send_gdb_with_response @@ -32,7 +32,15 @@ def _find_lines(filename, start_line, end_line): return {"breakpoints": [{"line": x} for x in sorted(lines)]} +# Note that the spec says that the arguments to this are optional. +# However, calling this without arguments is nonsensical. This is +# discussed in: +# https://github.com/microsoft/debug-adapter-protocol/issues/266 +# This points out that fixing this would be an incompatibility but +# goes on to propose "if arguments property is missing, debug adapters +# should return an error". @request("breakpointLocations") +@capability("supportsBreakpointLocationsRequest") def breakpoint_locations(*, source, line: int, endLine: Optional[int] = None, **extra): if endLine is None: endLine = line |