[ale] 'gdb' and *.so libs

Christopher Fowler cfowler at outpostsentinel.com
Wed Nov 5 07:32:41 EST 2003


Did you place the shared object in LD_LIBRARY_PATH ?

Maybe try using the -c option of gcc so you'll have access to the code.


On Wed, Nov 05, 2003 at 04:15:40AM +0000, John Mills wrote:
> ALErs -
> 
> This may be a building question, or a 'gdb' question.
> 
> I am trying to debug a shared library I built, but find I can't step down 
> from my top-level app into the library routines. I built the individual 
> function objects with:
> 
> $ g++ -g -O0 -W -march=i586 -Wall -Wpointer-arith -fexceptions -c \
> -shared <objname>.cpp $(INCLUDES) -o <objname>.o
> 
> and pulled them together by:
> $ g++ -g -march=i586 -shared -o <libname>.so $(OBJS)
> 
> I didn't run anything else on the lib. 'nm' shows the expected entries for 
> routines.
> 
> When I run 'gdb' on the top-level app, I can step along fine until it uses 
> one of my lib routines, then I can't set breaks or step into that code.
> 
> Questions:
>  1) Did I make the lib in a sensible way? It seems to have linked OK.
> 
>  2) Should I be able to debug into it from the app which uses it?
> 
> I expect if the answer to (2) is NO, I need to make a statically linked
> version of the app. This should not be a big problem, but I do want to
> know how to work with the shared version. (Ultimately I will be running
> multiple threads, which I expect to be another "learning experience" to
> debug. &8-)
> 
> TIA for any suggestions.
> 
>  - John Mills
>    john.m.mills at alum.mit.edu
> 
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale



More information about the Ale mailing list