From: Tom Tromey <tromey@adacore.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 4/5] Simplify FrameVars
Date: Wed, 14 Jun 2023 10:30:50 -0600 [thread overview]
Message-ID: <20230614-dap-frame-decor-v1-4-af87db6467b2@adacore.com> (raw)
In-Reply-To: <20230614-dap-frame-decor-v1-0-af87db6467b2@adacore.com>
FrameVars implements its own variant of Symbol.is_variable and/or
Symbol.is_control. This patch replaces this code.
---
gdb/python/lib/gdb/FrameDecorator.py | 27 +--------------------------
1 file changed, 1 insertion(+), 26 deletions(-)
diff --git a/gdb/python/lib/gdb/FrameDecorator.py b/gdb/python/lib/gdb/FrameDecorator.py
index 7293be86185..fc3aa51c7c4 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 or sym.is_constant:
lvars.append(SymValueWrapper(sym, None))
# Stop when the function itself is seen, to avoid showing
--
2.40.1
next prev parent reply other threads:[~2023-06-14 16:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-14 16:30 [PATCH 0/5] Reimplement DAP backtrace using frame filters Tom Tromey
2023-06-14 16:30 ` [PATCH 1/5] Fix execute_frame_filters doc string Tom Tromey
2023-06-14 16:30 ` [PATCH 2/5] Add new interface to frame filter iteration Tom Tromey
2023-06-14 16:30 ` [PATCH 3/5] Fix oversights in frame decorator code Tom Tromey
2023-06-14 16:30 ` Tom Tromey [this message]
2023-06-22 16:09 ` [PATCH 4/5] Simplify FrameVars Tom Tromey
2023-06-14 16:30 ` [PATCH 5/5] Reimplement DAP stack traces using frame filters Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230614-dap-frame-decor-v1-4-af87db6467b2@adacore.com \
--to=tromey@adacore.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).