Subject: Re: FW: Debugging shared objects in GDB
To: Stephane St Hilaire <>
From: Brett Lymn <>
List: tech-kern
Date: 05/03/2001 22:28:08
According to Stephane St Hilaire:
>Second try with a diffrent group, sorry if this is not really kernel

It is not kernel related.

>I'm having the following problem (or annoyance) while debugging a shared
>object on netBSD. Basically I can't STEP in a shared object function (from
>outside the lib).

I see this too - also that gdb can "lose control" of the process being
debugged such that instead of a single step the process starts
running, yet the next time through single step will work correctly.

> The only way I can get into a function, is to put a break
>point on it. I'm no netBSD expert so perhaps there is a work around in gdb
>or some compiler/linker switch to fix this ?

Not that I know of - about the only thing that would work would be to
make the binary statically linked and debug that.  This is a royal
PITA since you need to relink your test frame every time you update
the library.  Your other alternative is using printf and treading
lightly with gdb - the combination can make your debugging quicker
than sitting there single stepping through zillions of lines hoping to
spot a bug.

Brett Lymn, Computer Systems Administrator, BAE SYSTEMS