How can I truncate garbled C ++ ids shown by the GDB disassembly command?

The GDB disassembly command is good for short C identifiers, for example. main . For long, crippled C ++ identifiers, verbosity is full. For example, using icpc, I see results similar to

(gdb) disassemble 0x49de2f 0x49de5b
Dump of assembler code from 0x49de2f to 0x49de5b:
0x000000000049de2f <_ZN5pecos8suzerain16fftw_multi_array6detail18c2c_buffer_processIPA2_dPKSt7complexIdEilNS2_26complex_copy_differentiateIS4_EEEEvT_T1_T2_T0_SD_SE_RKT3_+167>: mov    0x18(%rsp),%rsi

Shows that the CLI is annoying for a long time. They make the GDB TUI assembly a collection, but they are useless.

Is there a way to tell GDB about the truncated identifier? Tell me the clip is only 50 characters?

+3
source share
2 answers

Current CVS GDB behaves the way you want it to when it knows that there is only one function in disassembly:

(gdb) disas 0x000000000040071c
Dump of assembler code for function _ZNKSt8_Rb_treeIPiSt4pairIKS0_S0_ESt10_Select1stIS3_ESt4lessIS0_ESaIS3_EE21_M_get_Node_allocatorEv:
   0x000000000040071c <+0>: push   %rbp
   0x000000000040071d <+1>: mov    %rsp,%rbp
   0x0000000000400720 <+4>: mov    %rdi,-0x8(%rbp)
   0x0000000000400724 <+8>: mov    -0x8(%rbp),%rax
   0x0000000000400728 <+12>:    leaveq 
   0x0000000000400729 <+13>:    retq   
End of assembler dump.

GDB , , "" :

(gdb) disas 0x000000000040071c 0x000000000040071c+1
Dump of assembler code from 0x40071c to 0x40071d:
   0x000000000040071c <_ZNKSt8_Rb_treeIPiSt4pairIKS0_S0_ESt10_Select1stIS3_ESt4lessIS0_ESaIS3_EE21_M_get_Node_allocatorEv+0>:   push   %rbp
End of assembler dump.

patch, " ".

+1

, , , , :

set print asm-demangle on

+1

Source: https://habr.com/ru/post/1721320/


All Articles