mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-03 07:14:18 +08:00
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.
This commit is contained in:
parent
57ab1952fc
commit
ea54f7806b
@ -17,6 +17,7 @@ import gdb
|
|||||||
|
|
||||||
from .frames import frame_for_id
|
from .frames import frame_for_id
|
||||||
from .server import request
|
from .server import request
|
||||||
|
from .sources import make_source
|
||||||
from .startup import in_gdb_thread
|
from .startup import in_gdb_thread
|
||||||
from .varref import BaseReference
|
from .varref import BaseReference
|
||||||
|
|
||||||
@ -93,7 +94,9 @@ class _ScopeReference(BaseReference):
|
|||||||
result["namedVariables"] = self.child_count()
|
result["namedVariables"] = self.child_count()
|
||||||
if self.line is not None:
|
if self.line is not None:
|
||||||
result["line"] = self.line
|
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
|
return result
|
||||||
|
|
||||||
def has_children(self):
|
def has_children(self):
|
||||||
|
@ -59,6 +59,7 @@ set scopes [dict get [lindex $scopes 0] body scopes]
|
|||||||
# just in case something changes.
|
# just in case something changes.
|
||||||
lassign $scopes scope _ignore
|
lassign $scopes scope _ignore
|
||||||
gdb_assert {[dict get $scope name] == "Locals"} "scope is locals"
|
gdb_assert {[dict get $scope name] == "Locals"} "scope is locals"
|
||||||
|
gdb_assert {[dict get $scope source name] == "prog.adb"} "scope has source"
|
||||||
|
|
||||||
gdb_assert {[dict get $scope namedVariables] == 2} "two vars in scope"
|
gdb_assert {[dict get $scope namedVariables] == 2} "two vars in scope"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user