开发者

Help with Exception Breakpoint in XCode 4

I've set up an Exception Breakpoint in XCode 4. Will it break for exceptions that originate within the Cocoa Touch framework AND are handled by the framework? I.E. Will the debugger s开发者_JAVA百科top for all exceptions, even if they are a natural part of the framework and handled by it internally?

My debugger keeps halting for a seemingly harmless exception from deep down in the framework and I need to know if I can safely ignore it.


If you're like me, there are times you want to ignore particular exceptions (like Apple's intermittently buggy CMMThrowExceptionOnError, which Apple neglects to provide any feedback to my bug reports for months)

So, my not-very-efficient solution is to add the following breakpoint instead of 'Add C++ Exception Breakpoint...'

from gdb command line, enter break __cxa_throw

Then, in the XCode breakpoints editor, add the following 'Debugger Command' to this breakpoint. By substituting the offending address of $eip, you can exclude individual exceptions from your breakpoint.

silent
# go up one stack frame silently
up-silently
# in my particular app, address of CMMThrowExceptionOnError is 0x9704d22e
if ( $eip == 0x9704d22e )
   # echo gdb ignore exception\n
   #print $eip
   cont
end

If you can devise a better solution which doesn't incur the overhead of a debugger script, please let me know.


The exception breakpoint is just that: a breakpoint for exceptions. This includes those within the framework. It doesn't matter whose exception it is - if it's raised, it should break.


Just a short note on LLDB used by defat in Xcode 4.3 Commands have a different syntax.

set $eip = xxxx

is now

reg write tip 0x006373ec

a full map of commands is available at http://lldb.llvm.org/lldb-gdb.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜