سؤال

Xcode 5.1 no longer officially supports GDB, instead defaulting only to LLDB. The problem with LLDB is that it shows no useful debug information on app crashes. Furthermore, all Exception Breakpoints simply break on main.m. This makes debugging ridiculously tedious. I read here on SO that this is a common problem with LLDB and that GDB does a better job.

How do I enable GDB for xcode 5.1?

هل كانت مفيدة؟

المحلول

There is no way to use gdb with more recent Xcodes.

I don't know what you mean by "it shows no useful debug information on app crashes." Probably best to file a bug with bugreporter.apple.com with some more detail, there may be a way to get lldb to work correctly for you.

I am also not sure what you are seeing when you say "all Exception Breakpoints break on main.m". If you go to the lldb console and do:

(lldb) break list

are the breakpoints actually on main.m?

One thing to be a little careful about with the Xcode 5 Debugging UI (maybe this started with 4, I can't remember.) When your program stops due to a crash or exception in a stack frame that starts with frames that have no debug information, Xcode will actually select the first frame up the stack that has debug information. This is to avoid showing people screens full of disassembly, which some folks find frightening... So the source frame will show, say, main.m, though the actual bottom-most frame is something else.

Xcode also has a "stack compression" feature that will hide "uninteresting" frames. That can also make this kind of stop confusing - though it will generally show the bottom-most frame you might miss that and only see your source frame. The stack compression can be turned off if you don't like it.

Make sure that is not what you are seeing.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top