This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
Re: Debug shared library
- From: Keith Seitz <keiths at redhat dot com>
- To: Schifanella Rossano <schifane at di dot unito dot it>
- Cc: "insight at sources dot redhat dot com" <insight at sources dot redhat dot com>
- Date: Mon, 16 Aug 2004 12:07:14 -0700
- Subject: Re: Debug shared library
- References: <41210226.3010908@di.unito.it>
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