aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/lib
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2023-05-26 13:35:52 -0600
committerTom Tromey <tromey@adacore.com>2023-06-22 09:46:23 -0600
commit59e75852dd9edff2199c5cd27a9be9f596a2fba6 (patch)
tree9e4b2f16887749aedfd285527ad535d5456fe6f6 /gdb/python/lib
parent5ad513ae6288b186b982017bc20e7d492220a2ba (diff)
downloadbinutils-59e75852dd9edff2199c5cd27a9be9f596a2fba6.zip
binutils-59e75852dd9edff2199c5cd27a9be9f596a2fba6.tar.gz
binutils-59e75852dd9edff2199c5cd27a9be9f596a2fba6.tar.bz2
Handle supportsVariablePaging in DAP
A bug report about the supportsVariablePaging capability in DAP resulted in a clarification: when this capability is not present, DAP implementations should ignore the paging parameters to the "variables" request. This patch implements this clarification.
Diffstat (limited to 'gdb/python/lib')
-rw-r--r--gdb/python/lib/gdb/dap/evaluate.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/gdb/python/lib/gdb/dap/evaluate.py b/gdb/python/lib/gdb/dap/evaluate.py
index af7bf43..a0b199a 100644
--- a/gdb/python/lib/gdb/dap/evaluate.py
+++ b/gdb/python/lib/gdb/dap/evaluate.py
@@ -20,7 +20,7 @@ import gdb.printing
from typing import Optional
from .frames import frame_for_id
-from .server import capability, request
+from .server import capability, request, client_bool_capability
from .startup import send_gdb_with_response, in_gdb_thread
from .varref import find_variable, VariableReference
@@ -98,6 +98,11 @@ def _variables(ref, start, count):
# Note that we ignore the 'filter' field. That seems to be
# specific to javascript.
def variables(*, variablesReference: int, start: int = 0, count: int = 0, **args):
+ # This behavior was clarified here:
+ # https://github.com/microsoft/debug-adapter-protocol/pull/394
+ if not client_bool_capability("supportsVariablePaging"):
+ start = 0
+ count = 0
result = send_gdb_with_response(
lambda: _variables(variablesReference, start, count)
)