diff options
| author | Tom Tromey <tromey@adacore.com> | 2025-12-03 07:48:00 -0700 |
|---|---|---|
| committer | Tom Tromey <tromey@adacore.com> | 2026-01-09 08:37:26 -0700 |
| commit | 02ae0785e38f08a26d5b6be5bbe2753ae9ea4836 (patch) | |
| tree | 39199149d49e04ddd21fbf02a3d081dca3d3591b /gdb/python/lib | |
| parent | 682190fe966bd3d8e937ec28a4f742c1109e375e (diff) | |
| download | binutils-02ae0785e38f08a26d5b6be5bbe2753ae9ea4836.tar.gz binutils-02ae0785e38f08a26d5b6be5bbe2753ae9ea4836.tar.bz2 binutils-02ae0785e38f08a26d5b6be5bbe2753ae9ea4836.zip | |
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.
Diffstat (limited to 'gdb/python/lib')
| -rw-r--r-- | gdb/python/lib/gdb/dap/disassemble.py | 4 | ||||
| -rw-r--r-- | gdb/python/lib/gdb/dap/globalvars.py | 2 | ||||
| -rw-r--r-- | gdb/python/lib/gdb/dap/scopes.py | 2 |
3 files changed, 4 insertions, 4 deletions
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 |
