]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Explicitly use print_name in DAP
authorTom Tromey <tromey@adacore.com>
Wed, 3 Dec 2025 14:48:00 +0000 (07:48 -0700)
committerTom Tromey <tromey@adacore.com>
Fri, 9 Jan 2026 15:37:26 +0000 (08:37 -0700)
This changes some DAP code to explicitly use a symbol's print name.
Some places were using '.name'; and while 'str' does use the print
name, it seems better to be both consistent and explicit.

gdb/python/lib/gdb/dap/disassemble.py
gdb/python/lib/gdb/dap/globalvars.py
gdb/python/lib/gdb/dap/scopes.py

index 8826fce4a5bd1531ca45355e1034b1a5c6347fab..0558a3ce84ee440d0ba6d5c32110a527e82bdd37 100644 (file)
@@ -38,10 +38,10 @@ class _BlockTracker:
                 return
             self._blocks.add(block)
             if block.function is not None:
-                self._labels[block.start] = block.function.name
+                self._labels[block.start] = block.function.print_name
             for sym in block:
                 if sym.addr_class == gdb.SYMBOL_LOC_LABEL:
-                    self._labels[int(sym.value())] = sym.name
+                    self._labels[int(sym.value())] = sym.print_name
             block = block.superblock
 
     # Add PC to this tracker.  Update RESULT as appropriate with
index 13a05942d7c509b130ac99d36f9b0ca0d4f1f5ed..c90404362c441401cbc05c70085b7314f3195aa7 100644 (file)
@@ -61,7 +61,7 @@ class _Globals(BaseReference):
     @in_gdb_thread
     def fetch_one_child(self, idx):
         sym = self._var_list[idx]
-        return (sym.name, sym.value())
+        return (sym.print_name, sym.value())
 
 
 @in_gdb_thread
index cd53f6f36fbb847a9b4dfbfd1e4e6cacb53edb01..98a710f2df5e2f7b9d8822e51cf759d8e46eeb86 100644 (file)
@@ -64,7 +64,7 @@ def symbol_value(sym, frame):
     # be needed, but this is a way to set the current language
     # properly so that language-dependent APIs will work.
     inf_frame.select()
-    name = str(sym.symbol())
+    name = sym.symbol().print_name
     val = sym.value()
     if val is None:
         # No synthetic value, so must read the symbol value