Linux 环境下使用 GCC 编译 C 语言程序再使用 GDB 反汇编二进制文件

我把过程截图如下。

首先是 hello world 程序:

helloworld.c

备注:

这里没有执行程序。如果执行,会出现:

username@ubuntu:~$./helloworld
Hello World!
username@ubuntu:~$

当然,前面要加 ./,在当前目录寻找 helloworld 文件执行。

再来一个略微复杂的 C 语言程序:

add.c
我把几幅截图拼了起来

Comments

您可以匿名发表评论,无需登录 Disqus 账号,勾选“我更想匿名评论”后,姓名和电子邮件分别填写“匿名”和“someone@example.com”然后发表评论即可。您也可以登录 Disqus 账号后发表评论。您的评论可能需要经过我审核后才能显示。点赞投票按钮(Reactions)无需登录即可点击。Disqus 评论系统在中国大陆可能无法正常加载和使用。

Statements

Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License

本作品采用知识共享署名—非商业性使用—禁止演绎 4.0 许可协议国际版(CC BY-NC-ND 4.0)进行许可。

This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License (CC BY-NC-ND 4.0).

Written by a Human, Not by AI

本作品由人类创作,整体内容符合 Not By AI 90% 规则。人工智能工具仅在有限程度上提供灵感启发、错别字与语法检查,以及在不改变原意的前提下进行润色。所有修改在采纳前均经过作者仔细审阅。

This work was created by a human author, and the overall content complies with the Not By AI 90% Rule. Artificial intelligence tools were used only to a limited extent for idea inspiration, typo and grammar checking, and stylistic refinement without altering the original meaning. All modifications were carefully reviewed by the author before adoption.

Top