gdb在macos High Sierra 10.13.3上不起作用 [英] gdb doesn't work on macos High Sierra 10.13.3
问题描述
我已经用brew安装了gdb 8.1。
我还有codeign gdb和.gdbinit,如下所示:
我禁用了SIP功能: 但是gdb仍然不起作用: 编译命令: gdb输出: 使gdb能够在macos sierra上工作的正确步骤? 这是由最新的gdb 8.1引起的,将gdb降级到8.0.1可以解决这个问题。 I have installed gdb 8.1 with brew. I have codesign gdb also and .gdbinit as below: I have disabled SIP feature: But gdb still doesn't work: Compile command: gdb output: What correct steps to make gdb work on macos sierra? This is caused by latest gdb 8.1, degrade gdb to 8.0.1 could solve this problem. 这篇关于gdb在macos High Sierra 10.13.3上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! set startup-
$ csrutil status
系统完整性保护状态:已禁用。
#include< iostream>
使用namespace std;
int main(){
cout<< 你好,世界! << ENDL;
返回0;
g ++ -g test.cpp
GNU gdb(GDB)8.1
版权所有(C)2018自由软件基金会,
许可证GPLv3 + :GNU GPL版本3或更高版本< http://gnu.org/licenses/gpl.html>
这是免费软件:您可以自由更改和重新分配它。
在法律允许的范围内,不存在任何担保。有关详细信息,请键入显示复制
和显示保修。
这个GDB被配置为x86_64-apple-darwin17.3.0。
输入显示配置以获取配置详细信息。
有关错误报告的说明,请参阅:
< http://www.gnu.org/software/gdb/bugs/> ;.
在线查找GDB手册和其他文档资源:
< http://www.gnu.org/software/gdb/documentation/> ;.
如需帮助,请输入help。
输入apropos word搜索与word相关的命令...
读取a.out中的符号...读取/Users/mypc/Downloads/a.out.dSYM/中的符号内容/资源/ DWARF / a.out的...来完成。
完成。
(gdb)运行
启动程序:/Users/mypc/Downloads/a.out
[进程802的新线程0x2503]
[进程802的新线程0x2303]
启动程序在信号?,未知信号时终止。
(gdb)
如何降级到gdb 8.0.1
brew unlink gdb
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/9ec9fb27a33698fc7636afce5c1c16787e9ce3f3/Formula /gdb.rb
brew pin gdb
set startup-with-shell off
.$ csrutil status
System Integrity Protection status: disabled.
#include <iostream>
using namespace std;
int main() {
cout << "hello world!" << endl;
return 0;
}
g++ -g test.cpp
GNU gdb (GDB) 8.1
Copyright (C) 2018 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-darwin17.3.0".
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"...
Reading symbols from a.out...Reading symbols from /Users/mypc/Downloads/a.out.dSYM/Contents/Resources/DWARF/a.out...done.
done.
(gdb) run
Starting program: /Users/mypc/Downloads/a.out
[New Thread 0x2503 of process 802]
[New Thread 0x2303 of process 802]
During startup program terminated with signal ?, Unknown signal.
(gdb)
How to degrade to gdb 8.0.1
brew unlink gdb
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/9ec9fb27a33698fc7636afce5c1c16787e9ce3f3/Formula/gdb.rb
brew pin gdb