I just discovered (thanks to another very useful post) that I can use GDB commands to create breakpoints that write information to the GDB console, regardless of whether it is being debugged on the device or the simulator. This is similar to NSLog, but much nicer is that you do not have to wait until the console catches up with you, you do not have annoying timestamps, and you can turn them on / off at run time through the Xcode breakpoint view).
Very nice, and I took the time to figure out how best to write messages and variables together. (Use the GDB po [NSString stringWithFormat: @"Your message: %d %@",variable,[[object expression] description]] command) for maximum versatility.
Everything worked perfectly in the simulator. When I finally got to debugging the devices, I was getting messages just fine, but GDB was STOPPING at every breakpoint, even though I set them to continue automatically by checking the box as a breakpoint.
I tried adding a โcontinueโ commmand to each breakpoint, and it worked, but GDB also started spewing out information about every hit of the breakpoint and telling me โContinuingโ after each line.
My questions:
- Is this happening for you?
- Can I change something to automatically continue to work on the device.
- Can I tell GDB to be less verbose and only give me the output I'm printing?
Please, help!
David
source share