我有这样的情况:
当我使用断点运行我的项目时,编译器将转到第一个断点,并像往常一样停止程序,直到按下下一步按钮为止。但当我下一步要做的时候——他那边没有反应,然后我点击2-3次“下一步”(进入)按钮——之后他就一直运行程序,没有反应。
我尝试过这样做:构建-清除所有目标-但没有结果。
试图重新启动计算机-效果相同。
调试程序日志如下:
[Session started at 2010-11-11 12:51:11 +0200.]
GNU gdb 6.3.50-20050815 (Apple version gdb-1472) (Wed Jul 21 10:53:12 UTC 2010)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin".sharedlibrary apply-load-rules all
Attaching to process 1032.
Pending breakpoint 1 - ""RootViewController.m":34" resolved
2010-11-11 12:51:14.542 PhoneBook[1032:207] ******* Accessibility Status Changed: On
2010-11-11 12:51:14.602 PhoneBook[1032:207] ********** Loading AX for: com.yourcompany.PhoneBook ************
The Debugger has exited due to signal 15 (SIGTERM).The Debugger has exited due to signal 15 (SIGTERM).
经过进一步的审查,这段代码似乎是原因:
NSArray *path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [path objectAtIndex: 0];
NSString *fname = [documentsDirectory stringByAppendingPathComponent: @"phoneBook.sqlite3"];
这段代码获取可执行文件的当前目录,然后在那里创建数据库文件。第一次都好,第二次都坏。这可能是什么原因,我该如何解决?