public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@adacore.com>
To: gdb-patches@sourceware.org
Subject: [PATCH v2 4/7] Simplify FrameVars
Date: Thu, 22 Jun 2023 10:19:30 -0600	[thread overview]
Message-ID: <20230614-dap-frame-decor-v2-4-10628dfa6b60@adacore.com> (raw)
In-Reply-To: <20230614-dap-frame-decor-v2-0-10628dfa6b60@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..050cb934b7c 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

-- 
2.40.1


  parent reply	other threads:[~2023-06-22 16:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-22 16:19 [PATCH v2 0/7] Reimplement DAP backtrace using frame filters Tom Tromey
2023-06-22 16:19 ` [PATCH v2 1/7] Fix execute_frame_filters doc string Tom Tromey
2023-06-22 16:19 ` [PATCH v2 2/7] Add new interface to frame filter iteration Tom Tromey
2023-06-22 16:19 ` [PATCH v2 3/7] Fix oversights in frame decorator code Tom Tromey
2023-06-22 16:19 ` Tom Tromey [this message]
2023-06-26 15:02   ` [PATCH v2 4/7] Simplify FrameVars Tom Tromey
2023-06-22 16:19 ` [PATCH v2 5/7] Reimplement DAP stack traces using frame filters Tom Tromey
2023-06-22 16:19 ` [PATCH v2 6/7] Handle typedefs in no-op pretty printers Tom Tromey
2023-06-22 16:19 ` [PATCH v2 7/7] Add Ada scope test for DAP Tom Tromey
2023-06-26 15:07 ` [PATCH v2 0/7] Reimplement DAP backtrace using frame filters Tom Tromey
2023-07-10 19:14 ` 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-v2-4-10628dfa6b60@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).