Tutorial :No more gdb in XCode console when build for iPhone simulator



Question:

Usually I use gdb backtrace to debug my application, but recently I can no longer do it when testing on iPhone simulator. The blue gdb word stops being displayed on console, and nothing happens when I type "bt" or "backtrace". I can still build and debug properly on the device though.

My XCode version is 3.2.3. Is there any way to manually activate the gdb (more importantly the backtrace)?


Solution:1

As Jack points out, the Pause button will manually activate gdb & the back trace, which is what you asked. You may have a bad install -- it happens, sometimes, try deleting your /Developer folder & re-installing. XCode 3.2.3 and the debugger work just fine, I use it several times a day.

In particular, CMD-Y is "build & run with debugger", whereas CMD-R is just "build & run" (no debugger, by default), so make sure you're using CMD-Y.

Aside: An issue I keep running into is, after the app quits, the red-stop-sign icon doesn't recognize that the app has finished, so I have to "stop" it again. I believe this is due to iOS-4's keeping apps running in the background.


Solution:2

If the program is hanging, which is what this sounds like. You can press the 'Pause' button on the Debugger Console or in the Debugger window to interrupt the app and see where it is currently executing.


Solution:3

Also, check and make sure your home folder .gdbinit file is in good order. Move it aside if it exists and see if the problem goes away.


Solution:4

Don't know if this is the exact same situation, but it may help. My iPhone was at firmware 4.0.2, but my Xcode SDK was for firmware 4.0.1. Normally Xcode would complain that I would need to upgrade to a newer Xcode that supported 4.0.2, this time it didn't.

Was banging my head why breakpoints could be set but the debugger did not stop at my breakpoint (the breakpoints were orange - signalling that symbols were not loaded). I decided to reboot my iPhone and now Xcode showed the warning (when it didn't before). Upgrading to Xcode for 4.0.2 fixed my problem of course. So perhaps your Xcode is not updated for newer firmware?


Solution:5

Had similar issue, but can't remember the exact circumstances. Turned out the Base SDK (in the project info build tab) was set to the device and not the simulator. Bit of a shot in the dark, but probably worthwhile verifying.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »