【问题标题】:How to run debug with c如何用c运行调试
【发布时间】:2020-09-17 00:30:36
【问题描述】:

您好,我只有以下文件: 示例_:ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, for GNU/Linux 2.2.5, not stripped

当我运行它时,它会出现分段错误。我尝试用gdb调试,结果是:Reading symbols from sample_...(no debugging symbols found)...done.

然后我尝试使用file 命令:

(gdb) file sample_ 
Reading symbols from sample_...(no debugging symbols found)...done.

我没有 .c 文件本身。

如何调试它?

【问题讨论】:

  • 打开-g 标志编译。
  • 我无法编译,我只有一个文件本身,没有其他 .c 文件
  • 然后它没有在-g标志上编译,没什么可做的:(
  • 还有其他方法吗?我可以转储它,但是汇编代码很多,很难理解
  • 如果你没有它的源代码,你只能检查汇编代码。如果没有调试符号,可能会变得非常难以阅读

标签: c debugging


【解决方案1】:

似乎该程序尚未使用调试标志构建。如果您没有使用调试标志重新编译它的源代码,则据我所知无法正确调试它。你可以试试decompile the executable but good luck with that

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-12-20
    • 1970-01-01
    • 1970-01-01
    • 2012-03-31
    • 1970-01-01
    • 1970-01-01
    • 2020-11-22
    • 2021-09-28
    相关资源
    最近更新 更多