What happens to ObjC runtime and dynamic accessors in gdb?-Collection of common programming errors

Gdb includes its own code to resolve message implementations. It knows about the object’s structure, walks its class hierarchy, resolves the selector to an IMP and calls that via its own mechanism. I believe it does that so it can do stuff like “step into”, i.e. jump into an implementation and stop there (instead of jumping into objc_msgSend and stopping there, which you wouldn’t want).

Since NSManagedObject doesn’t synthesize method IMPs, but rather uses dynamic dispatch and forwarding to resolve its setters/getters, gdb cannot find the IMPs, and so fails. The KVC methods are provided by NSObject, so they’re always there; since they execute natively, they’ll use the proper dispatch mechanism, which NSManagedObject then uses to resolve the proper accessors.