【问题标题】:GDB throws "Illegal Instruction" when linking -lcurl链接 -lcurl 时 GDB 抛出“非法指令”
【发布时间】:2017-02-17 17:28:40
【问题描述】:

程序编译和执行完美,只是 GDB 调试器在执行开始时中断,出现以下对话框:

我可以按继续,程序就会正常运行,但是每次执行都必须这样做很烦人。

我正在使用this MVS extension 远程交叉编译到 Linux-ARM,并且只有在我链接 -lcurl 时才会发生这种情况

我尝试在异常设置中禁用“抛出时中断”下方的每个复选框,但至少我不会再被打扰了,但它仍然会出现对话框。

【问题讨论】:

    标签: gdb signals


    【解决方案1】:

    我注意到它不是 MVS,而是 linux 上的远程 GBD,因为我尝试从 CLI 调试我的程序并且遇到了同样的问题:

    root@server:/.../Debug# gdb --exec=myapp
    GNU gdb (Raspbian 7.7.1+dfsg-5+rpi1) 7.7.1
    Copyright (C) 2014 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
    and "show warranty" for details.
    This GDB was configured as "arm-linux-gnueabihf".
    Type "show configuration" for configuration details.
    For bug reporting instructions, please see:
    <http://www.gnu.org/software/gdb/bugs/>.
    Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.
    For help, type "help".
    Type "apropos word" to search for commands related to "word".
    (gdb) run
    Starting program: /.../Debug/myapp
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
    Cannot access memory at address 0x0
    
    Program received signal SIGILL, Illegal instruction.
    0x76a5fde8 in ?? () from /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.0
    (gdb) continue
    Continuing.
    Hello World
    
    [Inferior 1 (process 5879) exited normally]
    (gdb)
    

    在那之后,我很快找到了一个解决方法,让 gdb 忽略这个信号,这样它就不会再打扰我停止进程了:

    我刚刚将handle SIGILL nostop 添加到/etc/gdb/gdbinit

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-01-11
      • 2015-12-14
      • 2018-07-09
      • 2021-11-26
      • 2021-06-08
      • 1970-01-01
      相关资源
      最近更新 更多