简体   繁体   English

如何获取gdb tui程序集输出来显示指令?

[英]How to get gdb tui assembly output to show instruction?

I wanted to see the assembly output but found that in TUI, it would output function signature + offset: which is cool, except for the fact that I'm programming in C++ and the function signature is fully resolved so I get namespaces and template parameters which make the function sig 2 or more lines long. 我想查看程序集输出,但发现在TUI中,它会输出function signature + offset:这很酷,除了我用C ++编程并且函数签名完全解析的事实,所以我得到命名空间和模板参数这使得函数sig 2或更多行。 This gets truncated in the TUI of course so it doesn't even get to display the assembly instruction. 这在TUI中被截断,当然它甚至不能显示汇编指令。

Is there any way to shorten, change the prefix (perhaps to a file/line format) or not output this prefix at all to the assembly instruction? 有没有办法缩短,更改前缀(可能是文件/行格式)或根本不输出此前缀到汇编指令?

Although there is no way at the moment to truncate this prefix, a work around is to set the focus to the assembly window using the focus asm command (if the asm window is not the one in focus) and then by using the right arrow key , you can scroll the window to the right which will eventually show the assembly output. 虽然目前无法截断此前缀,但解决方法是使用focus asm命令将focus asm设置到程序集窗口(如果asm窗口不是焦点窗口),然后使用right arrow key ,您可以向右滚动窗口,最终显示组件输出。

NOTE: 注意:

    This is a workaround, and still has problems as it will snap back to the first column when you step or scroll the CMD window. 这是一种解决方法,但仍然存在问题,因为当您步进或滚动CMD窗口时它将快照回到第一列。 Also, it seems that when you do a next command, the entire prefix for the current command and it's assembly code is displayed (ie it is not truncated) in the ASM window, wrapping around the screen, buggering up the display. 此外,当您执行next命令时,似乎在ASM窗口中显示当前命令的整个前缀及其汇编代码(即,它没有被截断),环绕屏幕,使显示屏变形。 Though annoying, this can be fixed using Ctrl-L to refresh the screen. 虽然烦人,但可以使用Ctrl-L修复屏幕。
    Also , scrolling the ASM window up and down can actually cause the debugger to crash. 此外 ,向上和向下滚动ASM窗口实际上可能导致调试器崩溃。 This is probably caused by a buffer overrun, so it is inadvisable to do this, and is possibly better to only show the assembly window only when needed and hide it when not. 这可能是由缓冲区溢出引起的,因此不建议这样做,最好只在需要时显示程序集窗口,而不是在需要时隐藏它。

Another workaround option as suggested by hasturkun is set print max-symbolic-offset N (you will have to scroll down to find it's description) which tells "gdb to only display the symbolic form of an address if the offset between the closest earlier symbol and the address is less than" N. Setting N to 1 would remove most of the prefixes, but keeps you guessing as to what instruction matches which source line. hasturkun建议的另一个解决方法是set print max-symbolic-offset N (你必须向下滚动才能找到它的描述) ,它告诉“gdb只显示地址的符号形式,如果最近的早期符号和地址小于“ N.将N设置为1会删除大多数前缀,但会让您猜测哪条指令与哪条源线匹配。

I don't believe there is a way. 我不相信有办法。

I think this would be a reasonable feature request for bugzilla, though be warned that the TUI doesn't get much love. 我认为这对于bugzilla来说是一个合理的功能请求,但是要注意TUI并没有得到太多的爱。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM