{"id":5466,"date":"2014-03-30T22:24:09","date_gmt":"2014-03-30T22:24:09","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/cocoa-break-on-every-method-call-collection-of-common-programming-errors\/"},"modified":"2014-03-30T22:24:09","modified_gmt":"2014-03-30T22:24:09","slug":"cocoa-break-on-every-method-call-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/cocoa-break-on-every-method-call-collection-of-common-programming-errors\/","title":{"rendered":"Cocoa: Break on every method call?-Collection of common programming errors"},"content":{"rendered":"<p>I think your current approach of putting a breakpoint on each method of interest is the best bet. As @Tommy explained, there&#8217;s a small number of message dispatch functions in the runtime that you can break on, but I having the debugger evaluate a conditional breakpoint on every single message send will probably slow your application down significantly.<\/p>\n<p>One way to make setting your breakpoints a little easier is to do it from a GDB command file. Put the commands to set the breakpoints for all the methods of interest in a single file that you can load at the beginning of your debug session. Setting all the breakpoints in a single file gives you one place to edit the list, and editing the file should be easy with copy and paste.<\/p>\n<p>Perhaps the best solution, but the one that&#8217;ll take a little time to master, is to use Instruments. You&#8217;ll want to read up on the DTrace mechanism first, but you can easily create a custom instrument with probes on each of the methods of interest. Instruments is incredibly powerful, but it takes some time to learn to really use it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I think your current approach of putting a breakpoint on each method of interest is the best bet. As @Tommy explained, there&#8217;s a small number of message dispatch functions in the runtime that you can break on, but I having the debugger evaluate a conditional breakpoint on every single message send will probably slow your [&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-5466","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5466","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=5466"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5466\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=5466"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=5466"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=5466"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}