我只是试图在Mac OSX版本10.12上使用gdb调试代码,但在gdb中启动程序时总是会收到此未知错误.
我在安装后对gdb进行了编码,并使用-g标志编译了我的代码.
这就是发生的事情:
computer:hello user$ gdb a.out
GNU gdb (GDB) 7.12
Copyright (C) 2016 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 "x86_64-apple-darwin16.0.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB …Run Code Online (Sandbox Code Playgroud)