让GDB显示汇编指令而不是C [英] Make gdb display assembly instructions instead of C

查看:117
本文介绍了让GDB显示汇编指令而不是C的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:结果
  切换到组件GDB

我调试的GDB一些code。当我运行 NI (为下一条指令)命令,它会显示C $ C $℃。显示执行的汇编指令会使我更有意义。

I am debugging some code in gdb. When I run the ni (for next instruction) command, it displays the C code. Displaying the executed assembly instructions would make more sense to me.

(gdb) ni
0x0804845a  28          tmp = *lpp;
(gdb) ni
0x0804845c  28          tmp = *lpp;
(gdb) ni
0x0804846a  29          **lpp = (unsigned long) &buf;
(gdb) ni
0x0804846c  29          **lpp = (unsigned long) &buf;

有没有什么办法让GDB显示装配code来代替,而不调用 disassm 每次

编辑:我知道这显示在一个readline的窗口code有关布局ASM 命令。我想看到的GDB命令行拆卸,而不是在GDB窗口。

I know about the layout asm command which displays the code in a readline window. I would like to see the disassembly on the gdb commandline, not in a gdb window.

推荐答案

当您通过 NI 步骤,显示汇编指令的下一个少数往往是非常有用的。

When you step via ni, displaying the next handful of assembly instructions is often very useful.

(gdb) display/4i $pc

将显示未来4指示每GDB停止时间。

will show the next 4 instructions every time GDB stops.

这篇关于让GDB显示汇编指令而不是C的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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