mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-12-17 16:18:37 +08:00
Fix oversights in frame decorator code
The frame decorator "FrameVars" code misses a couple of cases, discovered when working on related DAP changes. First, fetch_frame_locals does not stop when reaching a function boundary. This means it would return locals from any enclosing functions. Second, fetch_frame_args assumes that all arguments are at the outermost scope, but this doesn't seem to be required by gdb.
This commit is contained in:
@@ -269,6 +269,11 @@ class FrameVars(object):
|
|||||||
if self.fetch_b(sym):
|
if self.fetch_b(sym):
|
||||||
lvars.append(SymValueWrapper(sym, None))
|
lvars.append(SymValueWrapper(sym, None))
|
||||||
|
|
||||||
|
# Stop when the function itself is seen, to avoid showing
|
||||||
|
# variables from outer functions in a nested function.
|
||||||
|
if block.function is not None:
|
||||||
|
break
|
||||||
|
|
||||||
block = block.superblock
|
block = block.superblock
|
||||||
|
|
||||||
return lvars
|
return lvars
|
||||||
@@ -286,14 +291,18 @@ class FrameVars(object):
|
|||||||
block = None
|
block = None
|
||||||
|
|
||||||
while block is not None:
|
while block is not None:
|
||||||
if block.function is not None:
|
if block.is_global or block.is_static:
|
||||||
break
|
break
|
||||||
block = block.superblock
|
|
||||||
|
|
||||||
if block is not None:
|
|
||||||
for sym in block:
|
for sym in block:
|
||||||
if not sym.is_argument:
|
if not sym.is_argument:
|
||||||
continue
|
continue
|
||||||
args.append(SymValueWrapper(sym, None))
|
args.append(SymValueWrapper(sym, None))
|
||||||
|
|
||||||
|
# Stop when the function itself is seen, to avoid showing
|
||||||
|
# variables from outer functions in a nested function.
|
||||||
|
if block.function is not None:
|
||||||
|
break
|
||||||
|
|
||||||
|
block = block.superblock
|
||||||
|
|
||||||
return args
|
return args
|
||||||
|
|||||||
Reference in New Issue
Block a user