Gdb通过C编译objdump的汇编输出 [英] Gdb step through assembly output of objdump from C compiled

查看:72
本文介绍了Gdb通过C编译objdump的汇编输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个由gcc在IA32上编译的二进制可执行文件.它最初是用C编写的.我希望能够逐步调试它.我可以运行objdump并将其铲到要读取的文件中.

I have a binary executable compiled by gcc on an IA32. It was originally coded in C. I would like to be able to step through and debug it. I can run objdump and shovel that to a file to read.

objdump -d mybinary > mytext.txt

我希望能够逐步通过objdump看到的组装线.我已经使用了gdb一点,我希望能够在objdump的输出上运行gdb.这可能吗,还是有一个很好的方法来做到这一点?我脑子里想的是尝试执行以下操作,这显然行不通.

I would like to be able to step through the assembly lines that I can see through objdump. I have used gdb a little bit and I would like to be able to run gdb on the output of an objdump. Is this possible or is there a good way to do this? What I'm thinking in my head is trying to do the following which obviously doesn't work.

objdump -d mybinary > gdb

有人可以指出我正确的方向还是向我展示如何以可以在gdb中使用它的形式获取二进制文件?

Can someone point me in the right direction or show me how to get my binary in a form where I can use it with gdb?

推荐答案

我希望能够在objdump的输出上运行gdb

I would like to be able to run gdb on the output of an objdump

该请求毫无意义.

您可能要问的是我是否可以在GDB中单步执行,一次只执行一条指令?",在这种情况下,答案是肯定的:使用 stepi 命令.

What you are probably asking is "can I single-step in GDB, one instruction at a time?", in which case the answer is yes: use stepi command.

这篇关于Gdb通过C编译objdump的汇编输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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