mac gdb SIG113
mac自从升级至Sierra系统后,gdb调试程序后出错:
During startup program terminated with signal SIG113, Real-time event 113
网上方案:升级gdb,修改gdb配置:
brew upgrade gdb cat "set startup-with-shell off" > ~/.gdbinit
该方案只适合v12.10.2及以下版本,v10.12.6依然无法工作。
上述错误是由于mac的安全保护策略所致,阻止gdb调试程序。网上提出可使用lldb调试,毕竟是苹果自家的产品,亲测可行,命令与gdb基本一致。
lingdeMacBook-Pro:test lingsun$ lldb 1 (lldb) target create "1" Current executable set to '1' (x86_64). (lldb) b main Breakpoint 1: where = 1`main + 42 at 1.cpp:8, address = 0x00000001000013aa (lldb) r Process 2551 launched: '/Users/lingsun/test/1' (x86_64) Process 2551 stopped * thread #1: tid = 0xd38d, 0x00000001000013aa 1`main(argc=1, argv=0x00007fff5fbff9a0) + 42 at 1.cpp:8, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1 frame #0: 0x00000001000013aa 1`main(argc=1, argv=0x00007fff5fbff9a0) + 42 at 1.cpp:8 5 6 int main( int argc, char **argv ) 7 { -> 8 int a[] = {-1, 1, 1, 1, -1, -1, 0,0,0}; 9 vector<int> n(a, a+sizeof(a)/sizeof(int)); 10 int pa = 0; 11 cout << n.size() << "---" << pa << endl; (lldb) n
相关推荐
lhtzbj 2020-08-13
zmjzhangmj 2020-05-01
猫师 2020-03-16
zhongcanw 2020-02-03
amazingbo 2020-01-06
Proudoffaith 2019-12-12
fenxinzi 2019-12-10
菇星獨行 2019-12-10
sunln00 2019-12-10
LUOPING0 2019-12-06
zhongcanw 2019-12-06
RayDon 2011-03-04
fouweng 2011-08-27
wenxiHuang 2011-06-01
柯利南 2011-05-31
七夕小子 2019-11-04
farwang 2011-04-01
jiangxinyu 2011-10-06
IZZY 2012-02-02