{"id":5532,"date":"2014-03-30T23:46:27","date_gmt":"2014-03-30T23:46:27","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/xcode-4-break-on-exception-or-assert-with-good-call-stack-and-printing-of-the-exception-collection-of-common-programming-errors\/"},"modified":"2014-03-30T23:46:27","modified_gmt":"2014-03-30T23:46:27","slug":"xcode-4-break-on-exception-or-assert-with-good-call-stack-and-printing-of-the-exception-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/xcode-4-break-on-exception-or-assert-with-good-call-stack-and-printing-of-the-exception-collection-of-common-programming-errors\/","title":{"rendered":"Xcode 4 break on exception or assert with good call stack AND printing of the exception-Collection of common programming errors"},"content":{"rendered":"<p>Using Xcode 4.3.2. I looked at many different similar issues including this one<\/p>\n<p>no-call-stack-on-exception-in-xcode-4<\/p>\n<p>but cannot get the debugger (gdb or lldb) to give me a good stack trace that shows the location of the exception AND to also prints what the exception is<\/p>\n<p>Setting either a symbolic exception on <code>objc_exception_throw<\/code> or an &#8220;All Exceptions&#8221; exception breakpoint, lldb would not give me a good stack trace but would show the following:<\/p>\n<blockquote>\n<ul>\n<li>thread #1: tid = 0x1c03, 0x34455238 libobjc.A.dylib<code>objc_exception_throw, stop reason = breakpoint 1.1 frame #0: 0x34455238 libobjc.A.dylib<\/code>objc_exception_throw frame #1: 0x323ff788 CoreFoundation`+[NSException raise:format:arguments:] + 100<\/li>\n<\/ul>\n<\/blockquote>\n<p>That is the whole thing, either through <code>bt<\/code> or at full magnification in the graphical breakpoint\/debugger view.<\/p>\n<p>If I hit continue a few time at this point it will eventually tell me the exception\/assertion, for example<\/p>\n<blockquote>\n<p><em>*<\/em> Terminating app due to uncaught exception &#8216;NSInternalInconsistencyException&#8217;, reason: &#8216;_endUndoGroupRemovingIfEmpty:: NSUndoManager 0x2b7610 is in invalid state, endUndoGrouping called with no matching begin<\/p>\n<\/blockquote>\n<p>But I have no idea where it is at.<\/p>\n<p>gdb, using the same breakpoint, WILL stop and show me where it is at, but does not print the exception text. If I hit continue a few times it does but I have lost my context of the back trace.<\/p>\n<p>I would like to know how to print the exception text so I know WHY it stopped, without having to do a few continues and losing my place. I would also like to get it to stop in lldb at the point of the exception like it does in gdb.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Using Xcode 4.3.2. I looked at many different similar issues including this one no-call-stack-on-exception-in-xcode-4 but cannot get the debugger (gdb or lldb) to give me a good stack trace that shows the location of the exception AND to also prints what the exception is Setting either a symbolic exception on objc_exception_throw or an &#8220;All Exceptions&#8221; [&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-5532","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5532","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=5532"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5532\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=5532"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=5532"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=5532"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}