From: Tom Tromey Date: Wed, 3 Dec 2025 14:48:00 +0000 (-0700) Subject: Explicitly use print_name in DAP X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=02ae0785e38f08a26d5b6be5bbe2753ae9ea4836;p=thirdparty%2Fbinutils-gdb.git Explicitly use print_name in DAP 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. --- diff --git a/gdb/python/lib/gdb/dap/disassemble.py b/gdb/python/lib/gdb/dap/disassemble.py index 8826fce4a5b..0558a3ce84e 100644 --- a/gdb/python/lib/gdb/dap/disassemble.py +++ b/gdb/python/lib/gdb/dap/disassemble.py @@ -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 diff --git a/gdb/python/lib/gdb/dap/globalvars.py b/gdb/python/lib/gdb/dap/globalvars.py index 13a05942d7c..c90404362c4 100644 --- a/gdb/python/lib/gdb/dap/globalvars.py +++ b/gdb/python/lib/gdb/dap/globalvars.py @@ -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 diff --git a/gdb/python/lib/gdb/dap/scopes.py b/gdb/python/lib/gdb/dap/scopes.py index cd53f6f36fb..98a710f2df5 100644 --- a/gdb/python/lib/gdb/dap/scopes.py +++ b/gdb/python/lib/gdb/dap/scopes.py @@ -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