debugging a shared library using gdb on linux

debugging a shared library using gdb on linux

Post by coolhusk » Wed, 09 Apr 2003 05:08:58



Hi,

I have two source files a.sqc, b.c and from these i created a shared
object called db.so. This shared object acts as a Tcl interface for
connecting to database and executing queries.

From the tcl shell, i run it as follows:
% load ./db.so
% db database abcd ( this opens connection to database abcd)
0
% db open "Select * from test"
0
Segmentation fault

I am wondering how I can debug it using gdb. This is the first time I
am using  gdb. I know the segmentation fault is coming from a function
open()(line no: 694)  in a.sqc . I do not know how i can feed this
information into gdb de* so that i can run it and see each step
in my program. Any help is greatly appreciated.

Thanks in advance