Xcode 4 doesn't show "EXC_BAD_ACCESS" in debug area. Why not?
I'm intentionally creating an "EXC_BAD_ACCESS" fault.. The app crashes of course, BUT the debugger somehow lacks the "EXC_BAD_ACCESS" message.. Why is that?
This is the code I'm using:
NSString *str = [[NSString alloc] initWithFormat:@"Foo"];
开发者_JS百科NSArray *a = [[NSArray alloc ]initWithObjects:str, nil];
[str release];
[a release];
NSLog(@"%@",str);
And this is the debugger log:
GNU gdb 6.3.50-20050815 (Apple version gdb-1518) (Sat Feb 12 02:52:12 UTC 2011)
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".Attaching to process 41313.
sharedlibrary apply-load-rules all
(gdb)
In an effort to regurgitate what was told to me asking a similar question to a colleague, I was told it is the Apple equivalent to "object instance not set to an instance of an object". The debugger will sometimes show the dump of what (may have) caused it, and other times completely ignore it. I'm sure there is a rhyme to the reason, but it could very well be somewhere hidden in the documents deep in the halls of Apple. Up to this point, I have never found any patterns with the EXC_BAD_ACCESS dumps (or lack thereof). I have just learned to overlook the missing info and start looking for pointer issues!
Although not overly helpful, I figured I would share this anyway!
May be an issue with NSLog... Try another way to create a segfault. For instance:
char * str;
str = ( char * )666;
str[ 0 ] = 0;
精彩评论