Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent "Execution was interrupted, reason: internal ObjC exception breakpoint(-3)" on lldb

Tags:

I've written some code that dumps all ivars of a class into a dictionary in Objective C. This uses valueForKey: to get the data from the class. Sometimes, KVC throws an internal exception that is also captured properly - but this disrupts lldb's feature and all I get is:

error: Execution was interrupted, reason: internal ObjC exception breakpoint(-3).. The process has been returned to the state before expression evaluation.

There are no breakpoints set. I even tried with -itrue -ufalse as expression options, but it doesn't make a difference. This totally defeats for what I want to use lldb for, and it seems like such a tiny issue. How can I bring clang to simply ignore if there are internal, captured ObjC exceptions while calling a method?

I tried this both from within Xcode, and directly via calling clang from the terminal and connecting to a remote debug server - no difference.

like image 310
steipete Avatar asked Jan 10 '14 23:01

steipete


2 Answers

I ran into the same issue. My solution was to wrap a try/catch around it (I only use this code for debugging). See: DALIntrospection.m line #848

NSDictionary *DALPropertyNamesAndValuesMemoryAddressesForObject(NSObject *instance) 

Or, if you're running on iOS 7, the private instance method _ivarDescription will print all the ivars for you (similar instance methods are _methodDescription and _shortMethodDescription).

like image 111
haShalosh Avatar answered Oct 30 '22 02:10

haShalosh


I met the same problem.

My solution is simply alloc init the property before assigning it to the value which caused the crash.

like image 31
mollysmile.ye Avatar answered Oct 30 '22 03:10

mollysmile.ye