如何让cgdb显示汇编代码?

发布于 2025-01-02 15:54:06 字数 97 浏览 1 评论 0原文

我找不到 cgdb 反汇编二进制文件并在代码窗口中使用当前指令显示汇编代码的方法。这可能吗?我应该使用什么命令?我使用的是 Mac OS X 并从自制软件存储库中获取了 cgdb。

I can't find a way for cgdb to disassemble a binary and show the assembly code with the current instruction in the code window. Is this possible and what command should I use? I'm using Mac OS X and got cgdb from the homebrew repository.

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

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

发布评论

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

评论(3

君勿笑 2025-01-09 15:54:06

cgdb 最近的更新(2017 年 2 月)使这成为可能。您将需要 cgdb 版本 0.7.0 或更高版本。 (在撰写本文时,这是最新版本)。鉴于它是最新的,您可能需要自己从源代码编译它。

有关添加反汇编支持的更多详细信息可以在此处找到:
https://github.com/cgdb/cgdb/issues/44

查看反汇编代码在 cgdb 中,点击 esc 并输入 :set disenter

要返回源(如果有),请重复此操作,但键入 :set nodis 除外。

A recent update (Feb 2017) to cgdb makes it possible to do this. You will need cgdb version 0.7.0 or newer. (At the time of writing this is the latest release). You may need to compile this from source yourself given how recent it is.

More details on adding disassembly support can be found here:
https://github.com/cgdb/cgdb/issues/44

To view the disassembly in cgdb hit esc and type :set disenter.

To go back to the source (if available), repeat this, except type :set nodis.

逆光下的微笑 2025-01-09 15:54:06

display/i $pc 在控制台窗口中始终显示当前指令的反汇编。

要显示更多指令的反汇编,请在 i 前面加上指令数。

例如,

display/5i $pc

始终显示接下来 5 条指令的反汇编。

display/i $pc shows disassembly always for the current instruction, in the console window.

To show disassembly for more instructions, prefix i with the number of instructions.

For example,

display/5i $pc

shows disassembly always for the next 5 instructions.

南街女流氓 2025-01-09 15:54:06

我正在 MacOS 上拆除二进制炸弹,找到 "gdb -tui" 会有所帮助。我发现“cgdb”可以让代码变得丰富多彩。但我们希望看到的是在代码窗口上显示反汇编代码,上面的答案只显示逐行代码或仅显示不变的行。

不幸的是,我发现一篇文章说“cgdb 还不支持程序集显示。”
https://groups.google.com/forum/#!topic /cgdb-users/E-jZCJiBAQQ

   Sorry guys, cgdb does not support assembly display (yet).  It's a 
frequently requested feature, and when we get a little more time to 
work on cgdb we will probably add this. 
Starting cgdb with the -tui option is a bad idea -- the TUI (text user 
interface) is an alternative curses interface to gdb, not a part of 
cgdb.  It will not play nice with cgdb. 
Mike 
-- 
Mike Mueller

嗯,已经是15年12月11日了,但是似乎仍然无法像tui模式下的gdb那样在代码窗口上显示汇编代码。

I am working on MacOS to defuse a binary bomb and find "gdb -tui" will be helpful. Than I found "cgdb" can make code colorful. But what we want to see is show disassembled code on the code window, the answer above only show the code line by line or only changeless lines.

Unfortunately, I find a post said that "the cgdb does not support assembly display (yet)."
https://groups.google.com/forum/#!topic/cgdb-users/E-jZCJiBAQQ

   Sorry guys, cgdb does not support assembly display (yet).  It's a 
frequently requested feature, and when we get a little more time to 
work on cgdb we will probably add this. 
Starting cgdb with the -tui option is a bad idea -- the TUI (text user 
interface) is an alternative curses interface to gdb, not a part of 
cgdb.  It will not play nice with cgdb. 
Mike 
-- 
Mike Mueller

Well, it's 12/11/15, but it seems still couldn't show the assembly code on code window like gdb in tui mode.

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