Re: How to debug invalidated core data object
Re: How to debug invalidated core data object
- Subject: Re: How to debug invalidated core data object
- From: Gideon King <email@hidden>
- Date: Mon, 14 Jun 2010 11:19:17 +1000
Thanks Jerry
>
> Whoops/sorry. I forgot that -[NSManagedObject valueForKey:] is an Apple method so all you get is stupid registers and no symbols. (Text is not colorized in email.)
>
> So there are two ways to do this. One way would be, assuming that all of your managed objects descend from some subclass of NSManagedObject which you have defined, override -valueForKey: and NSLog in there. Mercifully, -valueForKey: is *not* listed in "Methods you Must Not Override" or "Methods you Are Discouraged From Overriding", so it might work. You may be able to reduce the fire-hose of log messages by conditioning it with if ([self isFault]). But maybe you can stand the fire-hose because it's just the last one before the exception that you're interested in. Too bad we don't have -isInvalidated. The other way is to do same logging in a Method Replacement of -valueForKey:.
>
> You see why I try and go top-down.
Good idea - yes I do already have a subclass of NSManagedObject that my objects all inherit from, so that would be easy to implement. It's still looking at the symptoms rather than the causes though, so I'll work my way through the other things as the core attack, but put this logging in there too so I can see what's being triggered - should help speed up the process...
>
>> I sort of stumble across some registers that have some interesting data in them. I've tried to look at the GDB and Apple documentation (Debugging with GDB, Getting started with GDB), but it all seems to assume that you already know which registers are what, and how to find what you are looking for once you are at a particular frame. Are there any resources that would fill in this missing information for me so that I can debug more effectively?
>
> After spending several hours reading about it one day I concluded that, because of all the indirection in Objective C, looking at registers and picking out method parameters, etc. is more much more complicated than rocket science. If anyone can explain a procedure for doing such, it would be a real "contribution to the community" :)
>
So glad to hear that this is not just me being thick ;-) _______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden