【问题标题】:Yocto - can not execute debug packageYocto - 无法执行调试包
【发布时间】:2018-10-04 17:41:53
【问题描述】:

我正在尝试安装由 Yocto 构建的应用程序的调试包。

安装后,可执行文件位于.debug 目录中。

但是,当我尝试执行这些时,我得到以下错误

-sh: /etc/.debug/app: cannot execute binary file: Exec format error

文件命令显示:

file /etc/.debug/app
/etc/.debug/app: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter *empty*, for GNU/Linux 2.6.32, BuildID[sha1]=1dfc051dc47683e0715b842998daadd4d12c541e, not stripped

arch 命令输出为armv7l

该应用程序似乎运行良好 [没有调试信息的应用程序]。

应用程序上的file 命令是

file /etc/app
/etc/app: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 2.6.32, BuildID[sha1]=1dfc051dc47683e0715b842998daadd4d12c541e, stripped

我想要的是执行使用调试符号编译的应用程序,这样当应用程序崩溃时它会给出coredump

有没有办法解决这个问题,或者有没有其他更好的方法来使用调试信息[使用 Yocto 框架]运行程序?

【问题讨论】:

    标签: linux yocto openembedded


    【解决方案1】:

    调试包只包含调试符号,你不能直接运行它们。运行标准可执行文件,gdb 将读取调试包安装的符号。

    【讨论】:

    • 我不想尝试从 gdb 运行应用程序。我认为从 gdb 运行可能会降低我的性能。相反,希望运行应用程序并使其崩溃,以便生成 coredump 文件。获得 coredump 文件后,我可以稍后对其进行分析。
    • 只需将 gdb 指向核心转储,它将自动从调试包中读取符号。
    猜你喜欢
    • 1970-01-01
    • 2016-06-01
    • 2020-11-06
    • 1970-01-01
    • 2019-05-16
    • 1970-01-01
    • 1970-01-01
    • 2013-01-04
    • 2017-01-01
    相关资源
    最近更新 更多