Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LLDB stack trace only shows last 2 calls in XCode

Tags:

xcode

ios

lldb

Currently having trouble debugging with XCode. All stack traces only show last two calls made. Can't use lldb console too. For example a simple unrecognized selector error only shows this trace log

* thread #1: tid = 0x2503, 0x32d2e960 libobjc.A.dylib`objc_exception_throw, stop reason = breakpoint 1.1
    frame #0: 0x32d2e960 libobjc.A.dylib`objc_exception_throw
    frame #1: 0x37c4ae06 CoreFoundation`-[NSObject(NSObject) doesNotRecognizeSelector:] + 170
like image 326
Cemal Eker Avatar asked Mar 06 '13 15:03

Cemal Eker


People also ask

What is the most recent function call in the stack trace?

The first line in the call stack represents the last executed function call, so remember to always read a stack trace top-down.

What does LLDB mean in Xcode?

lldb is the default debugger in Xcode on macOS and supports debugging C, Objective-C and C++ on the desktop and iOS devices and simulator. All of the code in the LLDB project is available under the Apache 2.0 License with LLVM exceptions.

How do you set a breakpoint in LLDB?

In lldb you can set breakpoints by typing either break or b followed by information on where you want the program to pause. After the b command, you can put either: a function name (e.g., b my_subroutine ) a line number (e.g., b 12 )


2 Answers

Try printing [NSThread callStackSymbols] from the debugger, which sometimes works when the debugger doesn't. It doesn't really surprise me that

Additionally, my experience is that GDB is far more reliable.

like image 53
tc. Avatar answered Sep 23 '22 23:09

tc.


A simple XCode restart solved the problem. But this bug keep happening after a while later. I'll report a bug about this.

like image 5
Cemal Eker Avatar answered Sep 19 '22 23:09

Cemal Eker