I'm debugging a program in C, using a UNIX Makefile, and Xcode 2.1 (previously 2.0, which didn't work, although 1.5 worked fine).
The program runs, but when it comes to a breakpoint, it ignores it completely. The debugger never halts, never shows anything but the bare debugger window (no code, stack, or variables)
Has anyone else met this problem?
The program loads into gdb okay, evidenced by the output in the GDB console. I noticed, however, that there is a warning about a source file that cannot be found.
[Session started at 2005-06-10 13:41:42 +1200.] GNU gdb 6.1-20040303 (Apple version gdb-413) (Wed May 18 10:17:02 GMT 2005) 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 "powerpc-apple-darwin". Loading program into debugger…
tty /dev/ttyp1 Program loaded. No source file named crnl.c. run [Switching to process 14897 local thread 0xf03] Running… Debug1: Logging to "logfile" Debug1: Logs going to stderr:yes, logfile:yes
I was able, at one stage, to type in 'pwd' while gdb was still accepting my commands, and it said it was /. This would explain why it can't find crnl.c (one of my files). However, on further investigation, the current working directories of the programs involved are listed as such. (via lsof)
Xcode /
gdb-powercp-apple-darwin /Users/cameron/Documents/Work/2005/tele/402/assignments/asgn1/code/Asgn1
server /Users/cameron/Documents/Work/2005/tele/402/assignments/asgn1/code/Asgn1
My gut reaction is that Xcode or gdb is not changing the cwd early enough to find the crnl.c file, which it would otherwise find in the CWD or gdb or server
This hypothesis would be supported by the fact that there is a logfile my program creates in the current directory, and I found that file in /, although that may have been 2.0, as it no-longer exhibits that behavior.
However, this hypothesis doesn't really mesh well with the fact that it was working this morning. Nor does it work after a reboot.
PS. I'm running Mac OS X 10.4.1
PPS. I've removed the project and recreated it using the native build tools (ie. not External Build System, but a Standard Tool. So far, the problem has not resurfaced. -- Cameron Kerr Telecommunications Teaching Fellow & SysAdmin |