如何获取gdb tui程序集输出以显示指令? [英] How to get gdb tui assembly output to show instruction?

查看:48
本文介绍了如何获取gdb tui程序集输出以显示指令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想查看程序集的输出,但是发现在TUI中,它将输出 function signature + offset:,这很酷,除了我使用C ++编程和函数签名的事实已完全解决,因此我得到了使函数sig 2或更多行长的名称空间和模板参数.当然,这会在TUI中被截断,因此甚至无法显示汇编指令.

是否有任何方法可以缩短,更改前缀(也许更改为文件/行格式)或根本不向汇编指令输出此前缀?

解决方案

尽管目前无法截断该前缀,但一种解决方法是使用 focus asm 命令(如果asm窗口不是焦点所在的窗口),然后使用右箭头键,您可以将窗口向右滚动,最终将显示程序集输出.

注意:

    这是一种解决方法,但仍然存在问题,因为当您步进或滚动 CMD 窗口时,它将迅速回到第一列.而且,似乎当您执行 next 命令时,当前命令的完整前缀及其汇编代码会在ASM窗口中显示(即不被截断),环绕屏幕,显示错误信息.向上显示.尽管很烦人,但可以使用 Ctrl-L 刷新屏幕来解决此问题.
    ,滚动 ASM 窗口向上和向下实际上可能导致调试器崩溃.这可能是由于缓冲区溢出造成的,因此不建议这样做,最好只在需要时才显示装配窗口,而在不需要时将其隐藏.

hasturkun 建议的另一个解决方法选项是N.将N设置为1会删除大多数前缀,但会让您猜测关于哪个指令匹配哪个源代码行.

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. This gets truncated in the TUI of course so it doesn't even get to display the assembly instruction.

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.

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. Also, it seems that when you do a next command, the entire prefix for the current command and it's assembly code is displayed (i.e. it is not truncated) in the ASM window, wrapping around the screen, buggering up the display. Though annoying, this can be fixed using Ctrl-L to refresh the screen.
    Also, scrolling the ASM window up and down can actually cause the debugger to crash. 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.

这篇关于如何获取gdb tui程序集输出以显示指令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆