GDB/DDD problems when linking to object lib not created with -g
Gauthier, Dave <dave.gauthier <at> intel.com>
2002-04-24 14:49:09 GMT
Hi:
I'm working on a Tru64 machine, writing in C with embedded SQL calls. It
needs to be linked to an .so supplied by Oracle in order for the thing to
work. I get SIGTRAP and SIGILL and SIGSEGV and other errors when I try to
run the program under debug, but only if I try stepping through (never see
any of these errors if I simply RUN). Anyway, in my experiments, I actually
stripped away all the Oracle/SQL stuff leaving a very simple, pure C program
which just has 2 printf statements.. a "Hi\n" and a "Bye\n". The
compilation looks like...
cc -o test_dbg -g2 test_dbg.c -L$ORACLE_HOME/lib -lclntsh
The simple program fails with one of the 3 messages I cited. Behavior is
unpredictable, any one of the messages may pop up, or, sometimes none (the
program runs). But it usually fails. Also seen at times was a "heuristic
fencepost" limit problem. But a "show heuristic-fence-post" shows "0" (no
limit).
If I get rid of the link to the libclntsh.so, GDB and DDD run fine. Mind
you, the simple 2-line program never calls anything in the .so, but simply
linking to it causes the problem. libclntsh.so was provided to us by
Oracle. It's not the kind of thing that I can recreate with -g (which might
fix the problem). In other words, I need to live with it as it is, and, I
really have no interest in ever stepping into it in a debug session.
So, the questions are:
- Given that I'll never want to debug the Oracle functions, is there a way
that I can tell GDB to ignore them in a way that would solve my problem?
(Continue reading)