{"id":1003,"date":"2011-06-27T10:06:05","date_gmt":"2011-06-27T15:06:05","guid":{"rendered":"http:\/\/www.jaimerios.com\/?p=1003"},"modified":"2011-06-27T10:06:05","modified_gmt":"2011-06-27T15:06:05","slug":"more-fun-with-symbols","status":"publish","type":"post","link":"https:\/\/jaimerios.com\/?p=1003","title":{"rendered":"More fun with symbols"},"content":{"rendered":"<p>I found some very useful environment variables you can set on the application you are debugging when you need to see what symbols are being recorded by dlopen when it opens all of the libraries in your application: <a href=\"http:\/\/developer.apple.com\/library\/mac\/#documentation\/DeveloperTools\/Conceptual\/DynamicLibraries\/100-Articles\/LoggingDynamicLoaderEvents.html#\/\/apple_ref\/doc\/uid\/TP40002077-SW1\" target=\"_blank\" rel=\"noopener\">click on me, click on me please!<\/a><\/p>\n<p>So, from your Xcode project, double click your debug app:<\/p>\n<p><a href=\"https:\/\/jaimerios.com\/wp-content\/uploads\/2011\/06\/project_shot.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jaimerios.com\/wp-content\/uploads\/2011\/06\/project_shot.png\" alt=\"Double click the debug app to get to the environment variables\" title=\"project_shot\" width=\"187\" height=\"83\" class=\"alignleft size-full wp-image-1004\" \/><\/a><\/p>\n<p>Now, set the following variables to YES, or NO, depending on what info you need:<\/p>\n<p><a href=\"https:\/\/jaimerios.com\/wp-content\/uploads\/2011\/06\/environment_variables.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jaimerios.com\/wp-content\/uploads\/2011\/06\/environment_variables.png\" alt=\"There are more details on the Apple developer site\" title=\"environment_variables\" width=\"534\" height=\"673\" class=\"alignleft size-full wp-image-1007\" srcset=\"https:\/\/jaimerios.com\/wp-content\/uploads\/2011\/06\/environment_variables.png 534w, https:\/\/jaimerios.com\/wp-content\/uploads\/2011\/06\/environment_variables-238x300.png 238w\" sizes=\"auto, (max-width: 534px) 100vw, 534px\" \/><\/a><\/p>\n<p>\nYou are going to get a ton of information in the debugger console, which is very useful when trying to figure out if there are any offending symbols that could be tripping up your project.<\/p>\n<p><strong>Here is a rundown of the variables:<\/strong><\/p>\n<ul>\n<li>DYLD_PRINT_LIBRARIES &#8211; Logs when images are loaded.<\/li>\n<li>DYLD_PRINT_LIBRARIES_POST_LAUNCH &#8211; Logs when images are loaded as a result of a dlopen call. Includes a dynamic libraries\u2019 dependent libraries.<\/li>\n<li>DYLD_PRINT_APIS &#8211; Logs the invocation that causes the dynamic loader to return the address of a symbol.<\/li>\n<li>DYLD_PRINT_STATISTICS &#8211; Logs statistical information on an application\u2019s launch process, such as how many images were loaded, when the application finishes launching.<\/li>\n<li>DYLD_PRINT_INITIALIZERS &#8211; Logs when the dynamic loader calls initializer and finalizer functions.\n<\/li>\n<li>DYLD_PRINT_SEGMENTS &#8211; Logs when the dynamic loader maps a segment of a dynamic library to the current process\u2019s address space.\n<\/li>\n<li>DYLD_PRINT_BINDINGS &#8211; Logs when the dynamic loader binds an undefined external symbol with its definition.\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>I found some very useful environment variables you can set on the application you are debugging when you need to see what symbols are being recorded by dlopen when it opens all of the libraries in your application: click on me, click on me please! So, from your Xcode project, double click your debug app: &#8230; <a title=\"More fun with symbols\" class=\"read-more\" href=\"https:\/\/jaimerios.com\/?p=1003\" aria-label=\"Read more about More fun with symbols\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[169,170,179,291,431,506],"class_list":["post-1003","post","type-post","status-publish","format-standard","hentry","category-coding","tag-dlopen","tag-dlsym","tag-dyld","tag-macos","tag-symbols","tag-xcode"],"_links":{"self":[{"href":"https:\/\/jaimerios.com\/index.php?rest_route=\/wp\/v2\/posts\/1003","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jaimerios.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jaimerios.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jaimerios.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jaimerios.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1003"}],"version-history":[{"count":0,"href":"https:\/\/jaimerios.com\/index.php?rest_route=\/wp\/v2\/posts\/1003\/revisions"}],"wp:attachment":[{"href":"https:\/\/jaimerios.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1003"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jaimerios.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1003"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jaimerios.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1003"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}