我的应用程序运行良好,但gdb无法调试并显示以下错误 (gdb) run Starting program: /path/to/app Unable to find Mach task port for process-id 83767: (os/kern) failure (0x5). 我在OS X Lion上。GDB版本是 $ gdb --version GNU gdb 6.3.50-20050815 (Apple version gdb-1752) (Sat Jan 28 03:02:46 UTC 2012) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU …
我有以下堆栈跟踪。可以从中得出一些有用的调试信息吗? Program received signal SIGSEGV, Segmentation fault. 0x00000002 in ?? () (gdb) bt #0 0x00000002 in ?? () #1 0x00000001 in ?? () #2 0xbffff284 in ?? () Backtrace stopped: previous frame inner to this frame (corrupt stack?) (gdb) 当获得时,从哪里开始看代码Segmentation fault,而堆栈跟踪不是那么有用? 注意:如果我发布代码,则SO专家会给我答案。我想从SO那里获得指导,自己找到答案,所以我不在这里发布代码。道歉。
我去了OS X v10.9(Mavericks)中使用GDB,但它不存在。它去哪了? # /usr/lib/gdb -bash: /usr/bin/gdb: No such file or directory # gdb -bash: gdb: command not found 我还启动了Xcode 5.0.1: 首选项>下载 ..并且不再有命令行工具可用-ffs!
我在osx 10.8.4下安装了带有自制软件的gdb 7.5.1(动机是使用新功能(如--with-python等)获得新的gdb) 长话短说,当我在c ++ Eclipse项目中运行调试时,我得到: Error in final launch sequence Failed to execute MI command: -exec-run Error message from debugger back end: Unable to find Mach task port for process-id 46234: (os/kern) failure (0x5). (please check gdb is codesigned - see taskgated(8)) Unable to find Mach task port for …
如何在C或C ++代码中以编程方式设置一个断点,该断点将在Linux上适用于gdb? 即: int main(int argc, char** argv) { /* set breakpoint here! */ int a = 3; a++; /* In gdb> print a; expect result to be 3 */ return 0; }