forked from Imagelibrary/binutils-gdb
Fix a bug in DAP scopes code
While working on static links, I noticed that the DAP scopes code does not handle the scenario where a frame decorator returns None. This situation should be handled identically to a frame decorator returning an empty iterator.
This commit is contained in:
@@ -107,10 +107,14 @@ def _get_scope(id):
|
|||||||
else:
|
else:
|
||||||
frame = frame_for_id(id)
|
frame = frame_for_id(id)
|
||||||
scopes = []
|
scopes = []
|
||||||
args = frame.frame_args()
|
# Make sure to handle the None case as well as the empty
|
||||||
|
# iterator case.
|
||||||
|
args = tuple(frame.frame_args() or ())
|
||||||
if args:
|
if args:
|
||||||
scopes.append(_ScopeReference("Arguments", "arguments", frame, args))
|
scopes.append(_ScopeReference("Arguments", "arguments", frame, args))
|
||||||
locs = frame.frame_locals()
|
# Make sure to handle the None case as well as the empty
|
||||||
|
# iterator case.
|
||||||
|
locs = tuple(frame.frame_locals() or ())
|
||||||
if locs:
|
if locs:
|
||||||
scopes.append(_ScopeReference("Locals", "locals", frame, locs))
|
scopes.append(_ScopeReference("Locals", "locals", frame, locs))
|
||||||
scopes.append(_RegisterReference("Registers", frame))
|
scopes.append(_RegisterReference("Registers", frame))
|
||||||
|
|||||||
Reference in New Issue
Block a user