diff options
| author | Tom Tromey <tromey@adacore.com> | 2025-12-19 05:51:39 -0700 |
|---|---|---|
| committer | Tom Tromey <tromey@adacore.com> | 2026-01-05 06:37:42 -0700 |
| commit | f33058a1fcea5f3b95df38ebcdd0c81b79e5c59e (patch) | |
| tree | 393aec48b9c19aee738d17d34f0ee98e1c524714 /gdb/python/lib | |
| parent | 5d33cb5d4bfefd5458b4268fe3fbc0eaa9dfc6b6 (diff) | |
| download | binutils-f33058a1fcea5f3b95df38ebcdd0c81b79e5c59e.tar.gz binutils-f33058a1fcea5f3b95df38ebcdd0c81b79e5c59e.tar.bz2 binutils-f33058a1fcea5f3b95df38ebcdd0c81b79e5c59e.zip | |
Change handling of over-long DAP variables requests
In PR dap/33228, we changed gdb to gracefully report an error if a DAP
'variables' request asked for more variables than had been reported.
This behavior was clarified in the spec, see
https://github.com/microsoft/debug-adapter-protocol/issues/571
This patch changes gdb to conform to the specified approach, namely
truncating the list rather than erroring.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33228
Approved-By: Andrew Burgess <aburgess@redhat.com>
Diffstat (limited to 'gdb/python/lib')
| -rw-r--r-- | gdb/python/lib/gdb/dap/varref.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gdb/python/lib/gdb/dap/varref.py b/gdb/python/lib/gdb/dap/varref.py index f5ffe34f7f5..e7d114c9d51 100644 --- a/gdb/python/lib/gdb/dap/varref.py +++ b/gdb/python/lib/gdb/dap/varref.py @@ -146,10 +146,12 @@ class BaseReference(ABC): if self._children is None: self._children = [None] * self.child_count() for idx in range(start, start + count): + # DAP was clarified to say that if too many children are + # requested, this is not an error, but instead the result + # is just truncated. + # https://github.com/microsoft/debug-adapter-protocol/issues/571 if idx >= len(self._children): - raise DAPException( - f"requested child {idx} outside range of variable {self._ref}" - ) + break if self._children[idx] is None: (name, value) = self.fetch_one_child(idx) name = self._compute_name(name) |
