aboutsummaryrefslogtreecommitdiff
path: root/gdbserver/netbsd-low.cc
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2024-11-18 10:58:26 +0000
committerAndrew Burgess <aburgess@redhat.com>2024-11-22 16:36:07 +0000
commit26522e34802f32406eb653d91a3bbb509f919b30 (patch)
tree0c974af46ea3ffbafbee4c8be864e125348c4025 /gdbserver/netbsd-low.cc
parent8a7f13063a6d5314cfde5b4f1dc49afa2922cf8c (diff)
downloadbinutils-26522e34802f32406eb653d91a3bbb509f919b30.zip
binutils-26522e34802f32406eb653d91a3bbb509f919b30.tar.gz
binutils-26522e34802f32406eb653d91a3bbb509f919b30.tar.bz2
gdb/disasm: fix demangling when disassembling the current function
When disassembling function symbols in C++ code, if GDB is asked to disassemble a function by name then the function name in the header line can be demangled by turning on `set print asm-demangle on`, e.g.: (gdb) disassemble foo_type::some_function Dump of assembler code for function _ZN8foo_type13some_functionE7my_type: 0x0000000000401142 <+0>: push %rbp ... etc ... End of assembler dump. (gdb) set print asm-demangle on (gdb) disassemble foo_type::some_function Dump of assembler code for function foo_type::some_function(my_type): 0x0000000000401142 <+0>: push %rbp ... etc ... │ End of assembler dump. │ However, if GDB is disassembling the current function, then this demangling doesn't work, e.g.: (gdb) break foo_type::some_function Breakpoint 1 at 0x401152: file mangle.cc, line 16. (gdb) run Starting program: /tmp/mangle Breakpoint 1, foo_type::some_function (this=0x7fffffffa597, obj=...) at mangle.cc:16 16 obj.update (); (gdb) disassemble Dump of assembler code for function _ZN8foo_type13some_functionE7my_type: 0x0000000000401142 <+0>: push %rbp ... etc ... End of assembler dump. (gdb) set print asm-demangle on (gdb) disassemble Dump of assembler code for function _ZN8foo_type13some_functionE7my_type: 0x0000000000401142 <+0>: push %rbp ... etc ... End of assembler dump. This commit fixes this issue, and extends gdb.cp/disasm-func-name.exp, which was already testing the first case (disassemble by name) to also cover disassembling the current function. Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdbserver/netbsd-low.cc')
0 files changed, 0 insertions, 0 deletions