diff options
author | Tom Tromey <tromey@adacore.com> | 2024-04-29 12:57:11 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2024-06-04 10:36:34 -0600 |
commit | ea54f7806ba8d58e9c3fb0fa37e44e75157e72e6 (patch) | |
tree | 9267113454389faef3beb78f9b906c4ed0b73ac3 /gdb/python/lib | |
parent | 57ab1952fcf921f06ac47ee4b0fa13798bf7a230 (diff) | |
download | binutils-ea54f7806ba8d58e9c3fb0fa37e44e75157e72e6.zip binutils-ea54f7806ba8d58e9c3fb0fa37e44e75157e72e6.tar.gz binutils-ea54f7806ba8d58e9c3fb0fa37e44e75157e72e6.tar.bz2 |
Put "source" into DAP scope
I noticed a FIXME comment in the DAP code about adding a "source"
field to a scope. This is easy to implement; I don't know why I
didn't do this originally.
Diffstat (limited to 'gdb/python/lib')
-rw-r--r-- | gdb/python/lib/gdb/dap/scopes.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gdb/python/lib/gdb/dap/scopes.py b/gdb/python/lib/gdb/dap/scopes.py index 8cd8601..09f440e 100644 --- a/gdb/python/lib/gdb/dap/scopes.py +++ b/gdb/python/lib/gdb/dap/scopes.py @@ -17,6 +17,7 @@ import gdb from .frames import frame_for_id from .server import request +from .sources import make_source from .startup import in_gdb_thread from .varref import BaseReference @@ -93,7 +94,9 @@ class _ScopeReference(BaseReference): result["namedVariables"] = self.child_count() if self.line is not None: result["line"] = self.line - # FIXME construct a Source object + filename = self.frame.filename() + if filename is not None: + result["source"] = make_source(filename) return result def has_children(self): |