{"id":10930,"date":"2015-04-01T20:30:30","date_gmt":"2015-04-02T00:30:30","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=10930"},"modified":"2015-04-01T20:30:30","modified_gmt":"2015-04-02T00:30:30","slug":"printing-objective-c-invocations-in-lldb","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2015\/04\/01\/printing-objective-c-invocations-in-lldb\/","title":{"rendered":"Printing Objective-C Invocations in LLDB"},"content":{"rendered":"<p><a href=\"http:\/\/arigrant.com\/blog\/2014\/2\/18\/chisels-print-invocation-command\">Ari Grant<\/a>:<\/p>\n<blockquote cite=\"http:\/\/arigrant.com\/blog\/2014\/2\/18\/chisels-print-invocation-command\"><p>A while ago Facebook open-sourced <a href=\"https:\/\/github.com\/facebook\/chisel\">Chisel<\/a>, a collection of commands and functions to assist in debugging iOS apps in LLDB.<\/p><p>[&#8230;]<\/p>&#8232;<p>There is one command that I find particularly fun and interesting yet haven&rsquo;t had the chance to write about, until this post.<\/p><p>The command is <em>pinvocation<\/em> (for <em><strong>p<\/strong><\/em>rint <em><strong>invocation<\/strong><\/em>) which is most useful for debugging Objective-C methods in Apple&rsquo;s code (or anything where you don&rsquo;t have access to the source and thus symbols). <em>pinvocation <\/em>finds the values for <em>self<\/em> and <em>_cmd<\/em>, packages them up into an <em>NSInvocation<\/em> and then prints it all out for you, including the arguments.<\/p><\/blockquote>\n<p>It sounds like a wonderful idea, but I tried it with several applications and was not able to get it to work. I kept getting errors like:<\/p>\n<pre>error: error: 0 errors parsing expression\nerror: The expression could not be prepared to run in the target<\/pre>\n<p>Currently, only 32-bit x86 (Mac and iOS simulator) is supported.<\/p>","protected":false},"excerpt":{"rendered":"<p>Ari Grant: A while ago Facebook open-sourced Chisel, a collection of commands and functions to assist in debugging iOS apps in LLDB.[&#8230;]&#8232;There is one command that I find particularly fun and interesting yet haven&rsquo;t had the chance to write about, until this post.The command is pinvocation (for print invocation) which is most useful for debugging [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[56,25,31,317,30,54,74,71],"class_list":["post-10930","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-debugging","tag-facebook","tag-ios","tag-lldb","tag-mac","tag-objective-c","tag-opensource","tag-programming"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/10930","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=10930"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/10930\/revisions"}],"predecessor-version":[{"id":10931,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/10930\/revisions\/10931"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=10930"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=10930"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=10930"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}