How to backtrace an assertion failure?
If an assert() fails during the execution of the program, there doesn't seem to be any way of backtracing the function call stack up to that point. If I open the console from the 'Run' menu and try to write 'bt', it doesn't let me. gdb seems to be in a strange state where you can write just one character and then it's stuck until you press return, after which nothing happens. Backtracing works ok if eg. the program crashes with a segmentation fault, but it doesn't work if it crashes with an assertion failure.
This is extremely irritating. I have a bug in my program which is causing an assertion failure very, very rarely (making it extremely hard to reproduce), and in the very rare occasions where it's happening, I can't find the exact chain of function calls leading to that failure because xcode won't let me backtrace. (And no, the file/line where the assertion failure is happening, which xcode is reporting, is not helpful in this particular case because it's being called from many different places.)
This is extremely irritating. I have a bug in my program which is causing an assertion failure very, very rarely (making it extremely hard to reproduce), and in the very rare occasions where it's happening, I can't find the exact chain of function calls leading to that failure because xcode won't let me backtrace. (And no, the file/line where the assertion failure is happening, which xcode is reporting, is not helpful in this particular case because it's being called from many different places.)
iPhone OS 3.1