debug dynamically linked modules..

Daniel Jacobowitz drow@mvista.com
Thu Oct 16 19:44:00 GMT 2003


On Thu, Oct 16, 2003 at 12:39:35PM -0700, Jack J wrote:
> Hi,
> 
> I would like to know how to debug using gdb
> (set breakpoint on routine, etc.) a dynmically linked,
> relocated code.
> 
> The platform is RH Linux 9.0. There is some
> application
> module compiled with -fPIC and -shared, and
> -export-dynamic options.  
> A global structure containing functions is exported by
> the DLL module.
> The problem: I would like to set breakpoint on one
> of the (file static) functions contained in this
> structure.
> 
> >From mainline code after call to dlsym(..) (to the
> global structure), I try to set break point, and I
> get error: "Function xxx not defined.".
> 
> I do 'info shared' on gdb and do see the file being
> loaded. Also I do see that "-g" option to add
> debug symbols in gcc.
> 
> Is there anything I am missing ? How does one 
> normally use gdb in such scenario ?
> 
> Any tips, pointers/hints is appreciated.

We'd need to see a complete testcase.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer



More information about the Gdb mailing list