Trying to use gdb on OS X
- Posted by jaygade Jun 06, 2013
- 3606 views
Argh! I'm trying to figure out how to use gdb to figure out why some integers and bitwise ops aren't being handled correctly in Euphoria 4.05 on OS X. While I understand basic C, and basic machine layout, it can be a bit tough, and I'm very new to gdb debugging.
The worst part is that two times when I set a break point, it altered the execution of the program. The first time, I set a breakpoint in be_runtime.c at binary_op line 2337, with a condition of fn=56 (which is and_bits). When I stepped into the breakpoint, I ended up crashing with an access violation. When I cleard the fn=56 condition and then continued past the breakpoint, I seemed to get stuck in an infinite loop.
And to top it all off, even with the -g3 or -ggdb3 compiler switches, I don't get macro expansion, and this area of the interpreter is riddled with C macros. Then trying to figure out how to properly examine a Euphoria object in the debugger to see what it's doing while manually referring back to the macro definition. I find myself bouncing back and forth between terminal window and gvim source window.
Ah, well, just venting. I'll figure it out. But if anyone has any good gdb tips I'd be glad to hear them. Still, it makes me appreciate the Euphoria debugger, that's for sure! I have a couple ideas and there are still lots of websites to refer to. It's just a learning curve.