No more gdb in XCode console when build for iPhone simulator
Asked Answered
S

5

6

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)?

Siobhansion answered 9/7, 2010 at 15:33 Comment(0)
T
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.

Tequilater answered 11/7, 2010 at 20:23 Comment(0)
A
0

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.

Anodize answered 9/7, 2010 at 16:1 Comment(3)
Usually as soon as I launch the app, the blue gdb word should appear on console, and if the app crashes, I can use backtrace. Now I have none of this. Clean, reset simulator, restart simulator, restart XCode, restart Mac... don't help, maybe the only solution left is to reinstall the SDK.Siobhansion
So, does the Xcode just return to the 'app not running state' (i.e. the Task button on the toolbar is grayed out) or does the Task button stay enabled on the toolbar?Anodize
Sounds like something is hanging during the load process. I recall seeing this when things were wired incorrectly between the .xib file and the view controller. I don't think it's a problem with your environment, is probably some basic configuration issue with your startup resources. Without seeing code and the other stuff I really cannot say for sure. jackAnodize
H
0

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.

Hillari answered 22/8, 2010 at 5:39 Comment(0)
T
0

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?

Tasty answered 27/8, 2010 at 18:50 Comment(0)
Y
0

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.

Yellows answered 28/8, 2010 at 14:47 Comment(1)
I don't think it's important. I've tried to switch the Base SDK from device to simulator but the problem still persists, and from my memory it used to work well no matter what value the Base SDK was.Siobhansion

© 2022 - 2024 — McMap. All rights reserved.