I’m trying to debug a problem in my app, and am
getting the run around from GDB.
When debugging C++ code the XCode stepping functions rarely
seem to let me trace the full code path and, as many have pointed out before,
seems to skip over quite a bit (often multiple lines). Because my bug
seems to happen deep between where “Step Into” button skips, I’ve
come to rely on the debugger console and ‘stepi’ in GDB.
But lately even that has been failing me. For much of the
code, Xcode can’t seem to track where it is at all, and I’ve come
to rely on watching $pc in the Expressions window and looking at the disassembly
pane to keep up. There is no red arrow following along to help me,
although I can’t see why not given I can look at $pc and that address is
often showing in the disassembly pane.
Now even that is failing me. I’ve stepped into a
cast operator and can’t get Xcode to show me any disassembly. The
GDB console puts up the message:
Unable to disassemble Foo::operator Bar.
When I type “disassem $pc” I get:
No function contains specified
address
It would be wonderful if the debugger could help me walk through
my code, but failing that could it at least show me what instruction I am about
to perform by typing “stepi”? I would think the disassem
command would disassemble the memory passed to it, but it seems to just look
within the loaded code for it…
Dave
P.S. Some details: This is code running in a
.dylib I’ve loaded with dlopen(). All my executables have no
optimizations and full symbols.