aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2023-06-14 08:32:08 -0600
committerTom Tromey <tromey@adacore.com>2023-07-10 13:17:30 -0600
commitf921fe93188991bf20fa2b9b5e7de6e591097b72 (patch)
treed58ed5545d307c80c8fef980798e1d648882d244 /gdb
parent4a1311ba0c46c673fd933375209da38e058982c6 (diff)
downloadgdb-f921fe93188991bf20fa2b9b5e7de6e591097b72.zip
gdb-f921fe93188991bf20fa2b9b5e7de6e591097b72.tar.gz
gdb-f921fe93188991bf20fa2b9b5e7de6e591097b72.tar.bz2
Simplify FrameVars
FrameVars implements its own variant of Symbol.is_variable. This patch replaces this code.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/python/lib/gdb/FrameDecorator.py27
1 files changed, 1 insertions, 26 deletions
diff --git a/gdb/python/lib/gdb/FrameDecorator.py b/gdb/python/lib/gdb/FrameDecorator.py
index 7293be8..050cb93 100644
--- a/gdb/python/lib/gdb/FrameDecorator.py
+++ b/gdb/python/lib/gdb/FrameDecorator.py
@@ -223,31 +223,6 @@ class FrameVars(object):
def __init__(self, frame):
self.frame = frame
- self.symbol_class = {
- gdb.SYMBOL_LOC_STATIC: True,
- gdb.SYMBOL_LOC_REGISTER: True,
- gdb.SYMBOL_LOC_ARG: True,
- gdb.SYMBOL_LOC_REF_ARG: True,
- gdb.SYMBOL_LOC_LOCAL: True,
- gdb.SYMBOL_LOC_REGPARM_ADDR: True,
- gdb.SYMBOL_LOC_COMPUTED: True,
- }
-
- def fetch_b(self, sym):
- """Local utility method to determine if according to Symbol
- type whether it should be included in the iterator. Not all
- symbols are fetched, and only symbols that return
- True from this method should be fetched."""
-
- # SYM may be a string instead of a symbol in the case of
- # synthetic local arguments or locals. If that is the case,
- # always fetch.
- if isinstance(sym, str):
- return True
-
- sym_type = sym.addr_class
-
- return self.symbol_class.get(sym_type, False)
def fetch_frame_locals(self):
"""Public utility method to fetch frame local variables for
@@ -266,7 +241,7 @@ class FrameVars(object):
for sym in block:
if sym.is_argument:
continue
- if self.fetch_b(sym):
+ if sym.is_variable:
lvars.append(SymValueWrapper(sym, None))
# Stop when the function itself is seen, to avoid showing