How to get gdb tui assembly to output instructions?

I wanted to see the output of the assembly, but found that in TUI it outputs function signature + offset: which is cool, except for the fact that I program in C ++ and the signature of the function is fully enabled, so I get namespaces and template parameters that make the sig function 2 or more lines long. This, of course, is truncated in TUI, therefore it does not even display the assembly instruction.

Is there a way to shorten, change the prefix (possibly the file / line format), or not display this prefix in the assembly instruction at all?

+4
source share
2 answers

Although there is currently no way to truncate this prefix, the job is to set the focus on the assembly window using the focus asm command (if the asm window is not focus), and then using the right arrow key , you can scroll the window to the right, which will eventually display the output of the assembly.

NOTE.

  • This is a workaround and still has problems, as it will snap to the first column when you step or scroll the window
CMD In addition, it seems that when you execute the next command, the entire prefix for the current command and its assembly code is displayed (i.e., not truncated) in the ASM window, wrapping the screen, selecting the display. Although this is annoying, it can be fixed with Ctrl-L to refresh the screen. Also , scrolling the ASM window up and down can cause the debugger to crash. This is probably caused by a buffer overflow, so it is not practical to do this, and it might be better to show the build window only when necessary, and hide it if not.

Another workaround suggested by hasturkun is set print max-symbolic-offset N (you will have to scroll down to find its description) , which says: "gdb displays only the symbolic shape of the address, if the offset is between the nearest earlier character and an address less than "N. Setting N to 1 will remove most of the prefixes, but it will not let you guess which command matches that source string.

+2
source

I do not believe that there is a way.

I think this will be a reasonable feature request for bugzilla, although it should be warned that TUI is not very fond of.

0
source

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


All Articles