{"id":5335,"date":"2014-03-30T20:50:43","date_gmt":"2014-03-30T20:50:43","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/what-happens-to-objc-runtime-and-dynamic-accessors-in-gdb-collection-of-common-programming-errors\/"},"modified":"2014-03-30T20:50:43","modified_gmt":"2014-03-30T20:50:43","slug":"what-happens-to-objc-runtime-and-dynamic-accessors-in-gdb-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/what-happens-to-objc-runtime-and-dynamic-accessors-in-gdb-collection-of-common-programming-errors\/","title":{"rendered":"What happens to ObjC runtime and dynamic accessors in gdb?-Collection of common programming errors"},"content":{"rendered":"<p>Gdb includes its own code to resolve message implementations. It knows about the object&#8217;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 &#8220;step into&#8221;, i.e. jump into an implementation and stop there (instead of jumping into <code>objc_msgSend<\/code> and stopping there, which you wouldn&#8217;t want).<\/p>\n<p>Since NSManagedObject doesn&#8217;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&#8217;re always there; since they execute natively, they&#8217;ll use the proper dispatch mechanism, which NSManagedObject then uses to resolve the proper accessors.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Gdb includes its own code to resolve message implementations. It knows about the object&#8217;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 &#8220;step into&#8221;, i.e. jump into an implementation and stop there (instead of [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5335","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5335","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=5335"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5335\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=5335"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=5335"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=5335"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}