{"id":4100,"date":"2014-03-30T07:42:38","date_gmt":"2014-03-30T07:42:38","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/profiling-ncurses-application-with-instruments-on-osx-collection-of-common-programming-errors\/"},"modified":"2014-03-30T07:42:38","modified_gmt":"2014-03-30T07:42:38","slug":"profiling-ncurses-application-with-instruments-on-osx-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/profiling-ncurses-application-with-instruments-on-osx-collection-of-common-programming-errors\/","title":{"rendered":"Profiling ncurses application with instruments on OSX-Collection of common programming errors"},"content":{"rendered":"<p>I have a C command-line application that uses ncurses and I am using Xcode 4.4 (OSX Lion) to develop this. So far I have been running the code from the terminal after building it with Xcode. Now I need to profile the multi-threaded part of the code and I want to use Instruments for this. If I do run &#8216;profile&#8217; in Xcode, it fires up Instruments, but crashes immediately possibly for the same reason that it crashes in Xcode, namely that it can&#8217;t open the terminal. If I switch off all curses parts of the code, it runs fine in Instruments, but obviously I get no output (and it is crucial for me to follow the code progress). And finally, if I run the code from the terminal and try to attach to the process from within Instruments, I get the following message &#8220;Attaching requires that the target utilizes CoreFoundation.framework&#8221; when doing memory profiling and &#8220;Current Instrumentation Disallow Attach&#8221; when doing multicore profiling.<\/p>\n<p>Can anyone please explain to me how this can be done, that is to profile the code and simultaneously see the curses output in a terminal window?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have a C command-line application that uses ncurses and I am using Xcode 4.4 (OSX Lion) to develop this. So far I have been running the code from the terminal after building it with Xcode. Now I need to profile the multi-threaded part of the code and I want to use Instruments for this. [&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-4100","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4100","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=4100"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4100\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4100"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4100"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4100"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}