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


I have two source files a.sqc, b.c and from these i created a shared
object called 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 database abcd ( this opens connection to database abcd)
% db open "Select * from test"
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