public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Filter out types from DAP scopes request
@ 2023-04-10 14:19 Tom Tromey
  2023-05-05 19:55 ` Tom Tromey
  0 siblings, 1 reply; 2+ messages in thread
From: Tom Tromey @ 2023-04-10 14:19 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

The DAP scopes request examines the symbols in a block tree, but
neglects to omit types.  This patch fixes the problem.
---
 gdb/python/lib/gdb/dap/scopes.py |  2 +-
 gdb/testsuite/gdb.dap/scopes.c   | 12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/gdb/python/lib/gdb/dap/scopes.py b/gdb/python/lib/gdb/dap/scopes.py
index 9ab454aa57b..be4f8fc28a0 100644
--- a/gdb/python/lib/gdb/dap/scopes.py
+++ b/gdb/python/lib/gdb/dap/scopes.py
@@ -41,7 +41,7 @@ def _block_vars(block):
         for var in block:
             if var.is_argument:
                 args.append(var)
-            else:
+            elif var.is_variable or var.is_constant:
                 locs.append(var)
         if block.function is not None:
             break
diff --git a/gdb/testsuite/gdb.dap/scopes.c b/gdb/testsuite/gdb.dap/scopes.c
index 7b35036cce1..ce87db1f13d 100644
--- a/gdb/testsuite/gdb.dap/scopes.c
+++ b/gdb/testsuite/gdb.dap/scopes.c
@@ -15,14 +15,14 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-struct dei_struct
-{
-  int x;
-  int more[5];
-};
-
 int main ()
 {
+  struct dei_struct
+  {
+    int x;
+    int more[5];
+  };
+
   struct dei_struct dei = { 2, { 3, 5, 7, 11, 13 } };
 
   static int scalar = 23;
-- 
2.39.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Filter out types from DAP scopes request
  2023-04-10 14:19 [PATCH] Filter out types from DAP scopes request Tom Tromey
@ 2023-05-05 19:55 ` Tom Tromey
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2023-05-05 19:55 UTC (permalink / raw)
  To: Tom Tromey via Gdb-patches; +Cc: Tom Tromey

>>>>> "Tom" == Tom Tromey via Gdb-patches <gdb-patches@sourceware.org> writes:

Tom> The DAP scopes request examines the symbols in a block tree, but
Tom> neglects to omit types.  This patch fixes the problem.

I'm going to check this in.

Tom

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-05-05 19:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-10 14:19 [PATCH] Filter out types from DAP scopes request Tom Tromey
2023-05-05 19:55 ` Tom Tromey

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).