Re: debugging dynamically linked modules
Klaus Schilling (Klaus.Schilling@home.ivm.de)
Mon, 17 Aug 1998 00:13:42 +0200 (MET DST)
Christian Lynbech writes:
> >>>>> "Klaus" == Klaus Schilling <Klaus.Schilling@home.ivm.de> writes:
>
> Klaus> What is a viable method to debug dynamically loaded modules? gdb can't find
> Klaus> their symbols before they are loaded, so one can't set breakpoints etc. before
> Klaus> running guile.
>
> I usually put a breakpoint at `main', hit run, and when stopping at
> main, I can now set other breakpoints since the libraries has been
> linked in. When restarting the debugged process, gdb will temporarily
> disable the breakpoints in shared libraries and automagically enable
> them when the library is in place.
>
I'm talking about modules that are loaded from within scheme code, like
(dynamic-link "libstallman.so"), through the libdl-interface of guile.
Those are not known to gdb when main is encountered, but only when the
procedure (dynamic-link ...) gets evaluated. ... maybe 'break dl_open'
will help then?
> The alternative is to link guile statically (use something like
> `--with-shared=no' to configure). If guile is the only program using
> libguile, there isn't really anything gained from making it shared.
>
I am testing C-written extension modules for guile, like my ncurses stuff and
the like. I'm not eager on recompiling guile each time from scratch for testing
a minor change in one of the added modules...
Klaus Schilling