Re: Problems debugging shared object code called from Java JNI
From: Wiseguy (noone_at_all.com)
Date: 12/02/04
- Previous message: Jerry McBride: "Re: newsreader?"
- In reply to: Exits Funnel: "Problems debugging shared object code called from Java JNI"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 2 Dec 2004 00:50:48 -0600
Exits Funnel <exitsfunnel@noyahoospam.com> mumbled in news:khurd.464
$wk4.54@fe12.lga:
> Hello,
>
> I'm currently working a project which comprises a Java API layer and a
> native C++ piece (which I'll call the driver). Only the java API is
> exposed to our clients. Internally, the java makes calls to the C++
> through JNI. We port the native stuff to several platforms including
> RedHat linux on which we generate from it a shared object. I'm trying
> to figure out how to use gdb to debug the driver but having no luck.
I
> want to be able to set a breakpoint in one of the native source files
> and then launch the java process on some java test code which results
in
> calls into the shared object - thereby letting me do source level
> debugging in the shared object. Just to be clear, I'm not trying to
> debug the java code, just the shared object. I can do this in the
> developer studio on Windows so I'd be surprised if I couldn't do it
with
> gdb but I can't figure it out.
>
> I've tried this:
>
> gdb --args java MyTest
>
> run
>
> but gdb complains about 'no debugging symbols found' and also that it
> 'Cannot find user-level thread for LWP 4494: generic error.'
>
> Does anyone have any suggestions. Thanks in advance for any help.
>
> -exits
>
I'm kind of shooting in the dark here because I've never done it myself,
but IIRC you can attach gdb to a running process. Maybe put some kind
of an explicit wait at the point where JNI takes over and then run gdb
as a separate task. Use gdb to attach to the process of the running
thread that will go JNI after the wait passes.
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
- Previous message: Jerry McBride: "Re: newsreader?"
- In reply to: Exits Funnel: "Problems debugging shared object code called from Java JNI"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|