Debug shared library

Keith Seitz keiths@redhat.com
Mon Aug 16 19:04:00 GMT 2004


On Mon, 2004-08-16 at 11:51, Schifanella Rossano wrote:
> I wrote a simple Java application and I use JNI for implementing native 
> code written in C. I created a shared library and I load it from a Java 
> class. How I can debug my shared library in such context?  More 
> generally speaking, how I can debug a shared library (loaded by a 
> program not written in C) ?

I'm no authority on this (and you're really better off asking on the gdb
mailing list, where the real experts are hiding), but I'll mention what
I've done...

I wait for the shared library to be loaded, then set a break in it.
This, of course, means that you'll have to wait for the dlopen to
complete. This isn't usually quite so difficult as it is annoying.

However, as I recall, there should be some new gdb feature, pending
breakpoints. In GDB 6.1:
http://sources.redhat.com/gdb/current/onlinedocs/gdb_6.html#IDX151

You should be able to use this, but you'll have to set it in the
console, since Insight itself does not yet understand these.

Keith



More information about the Insight mailing list