In order to test this out, I add the following crasher line to my
project:
id junk = (id)5 ; [junk description] ;
It is at line Migration.m line 1014, in -[Migration awakeFromNib].
Then I build and verify that a new .app and a new .dSYM are produced
in my Builds/Release:
Jerrys-Mac-Mini:Release jk$ pwd
/Users/jk/Documents/Programming/Builds/Release
Jerrys-Mac-Mini:Release jk$ ls -al
<snip></snip>
drwxrwxrwx 3 jk 501 102 Feb 25 14:10 Bookdog.app
drwxrwxrwx 3 jk 501 102 Feb 25 14:10 Bookdog.app.dSYM
<snip></snip>
Next, I run that Bookdog.app, open a Migration window, and as expected
it crashes:
Examining line 9 there, I expect that 0x0005befa should be my
crasher. So I create a command file like Jason did:
echo 'info line *0x5befa' > /tmp/gdbcmds
Then cd Builds/Release, and batch the command to gdb, targetting the
new executable:
gdb --batch --quiet -x /tmp/gdbcmds Bookdog.app/Contents/MacOS/Bookdog
No symbol table is loaded. Use the "file" command.
Breakpoint 1 (-[NSException raise]) pending.
No symbol table is loaded. Use the "file" command.
Breakpoint 2 (objc_exception_throw()) pending.
No symbol table is loaded. Use the "file" command.
Breakpoint 3 (-[_NSZombie release]) pending.
No symbol table is loaded. Use the "file" command.
Breakpoint 4 (szone_error) pending.
Reading symbols for shared libraries ................. done
Breakpoint 1 at 0xebd66
Pending breakpoint 1 - "-[NSException raise]" resolved
Breakpoint 4 at 0xe2626
Pending breakpoint 4 - "szone_error" resolved
Line 113 of "/Users/jk/Documents/Programming/Projects/Bookdog/
NSApplicationBookdogScripting.m" starts at address 0x5befa <-
[NSData(NSData) isEqualToData:]+10> and ends at 0x5bf05 <-
[NSData(NSData) isEqualToData:]+21>.
It does not seem to identify the crasher line that I was expecting.
What might I have done wrong?
I tried a couple other target files; the .app itself and the .dSYM,
and got similarly wrong results...
gdb --batch --quiet -x /tmp/gdbcmds Bookdog.app
No symbol table is loaded. Use the "file" command.
Breakpoint 1 (-[NSException raise]) pending.
No symbol table is loaded. Use the "file" command.
Breakpoint 2 (objc_exception_throw()) pending.
No symbol table is loaded. Use the "file" command.
Breakpoint 3 (-[_NSZombie release]) pending.
No symbol table is loaded. Use the "file" command.
Breakpoint 4 (szone_error) pending.
Reading symbols for shared libraries ................. done
Breakpoint 1 at 0xebd66
Pending breakpoint 1 - "-[NSException raise]" resolved
Breakpoint 4 at 0xe2626
Pending breakpoint 4 - "szone_error" resolved
Line 113 of "/Users/jk/Documents/Programming/Projects/Bookdog/
NSApplicationBookdogScripting.m" starts at address 0x5befa <-
[NSData(NSData) isEqualToData:]+10> and ends at 0x5bf05 <-
[NSData(NSData) isEqualToData:]+21>.
gdb --batch --quiet -x /tmp/gdbcmds Bookdog.app.dSYM/Contents/
Resources/DWARF/BookdogNo symbol table is loaded. Use the "file"
command.
Breakpoint 1 (-[NSException raise]) pending.
No symbol table is loaded. Use the "file" command.
Breakpoint 2 (objc_exception_throw()) pending.
No symbol table is loaded. Use the "file" command.
Breakpoint 3 (-[_NSZombie release]) pending.
No symbol table is loaded. Use the "file" command.
Breakpoint 4 (szone_error) pending.
Line 113 of "/Users/jk/Documents/Programming/Projects/Bookdog/
NSApplicationBookdogScripting.m" starts at address 0x5befa <-
[NSApplication(NSApplicationBookdogScripting) newMigrationDocument:]
+74> and ends at 0x5bf05 <-
[NSApplication(NSApplicationBookdogScripting) newMigrationDocument:]
+85>.
It looks in the same folder as the executable. If the executable is
in a bundle (framework, app, etc), it also looks in the directory
that the bundle is in.
Thanks for that tip! Guessing is difficult when tools are "smart"
like that.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/xcode-users/email@hidden