调试装配

发布于 2024-08-18 12:08:56 字数 62 浏览 4 评论 0原文

如何调试汇编代码?我在 Linux 上并且有 gdb 方便。我知道我可以查看寄存器。调试汇编代码的方法有哪些?

How do I debug assembly code? I'm on Linux and have gdb handy. I know I can watch registers. What are some methods for debugging assembly code?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

吻风 2024-08-25 12:08:56

您当然可以像使用 C 或任何其他编译语言一样使用 断点,也。 这篇文章稍微介绍了调试汇编程序的过程。

You can of course use breakpoints just as with C or any other compiled language, too. This article describes the process of debugging an assembly program a bit.

娜些时光,永不杰束 2024-08-25 12:08:56

使用 "disassemble" gdb 命令可以看到汇编代码即将被执行。这与监视寄存器相结合,可以让您深入了解 CPU 的实际用途。

Using the "disassemble" gdb command you can see the assembly code that is about to be executed. This, in conjunction with watching registers, can give you insight into what the CPU is really doing.

饮惑 2024-08-25 12:08:56

当然,您可以使用带有可执行 elf 文件参数的 nm 命令,它会显示可用的标签和地址。由此,您可以在特定地址上设置断点,然后使用“si”调试命令执行单个指令。

Of course you can use nm command with a parameter of executable elf file, it will shows you the available labels with address. From this you can set a breakpoint on a specific address, then execute a single instruction by using "si" debug command.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文