Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Debugging JNI code under Linux ?
Debugging JNI code under Linux ? [message #201178] Thu, 06 September 2007 06:25 Go to next message
Eclipse UserFriend
Has anyone been able to do this easily ? When I tried I found that GDB version 6.4 failed to work
(aparantly due to the use of execve in java) so I upgraded to 6.6 and this stopped GDB from failing
to find the user thread, but it never stops in my breakpoints. The problem seems to stem from the
fact that when java is loaded, the debugger stops on shared library events and attempts to set the
breakpoints (which doesn't work because the JNI library isn't loaded). It then continues and the
shared library is loaded (but no shared library event occurs) and the java code (and native code)
execute to completion because no breakpoints were set.

Anyone have any suggestions ? I don't really need to debug the java code, just the JNI code so was
only looking to setting breakpoints in the JNI code and then debugging once these hit.

Dave Kelsey
Re: Debugging JNI code under Linux ? [message #201187 is a reply to message #201178] Thu, 06 September 2007 08:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: christian.klemke.irisgmbh.de

Try looking here:
http://wiki.eclipse.org/index.php/Support_seamless_debugging _between_JDT_and_CDT
I have not used the toolset yet, but it sounds promising.

Regards,
Christian

"Dave Kelsey" <dkel50@hotmail.com> schrieb im Newsbeitrag
news:fbokja$sn7$1@build.eclipse.org...
> Has anyone been able to do this easily ? When I tried I found that GDB
> version 6.4 failed to work
> (aparantly due to the use of execve in java) so I upgraded to 6.6 and this
> stopped GDB from failing
> to find the user thread, but it never stops in my breakpoints. The problem
> seems to stem from the
> fact that when java is loaded, the debugger stops on shared library events
> and attempts to set the
> breakpoints (which doesn't work because the JNI library isn't loaded). It
> then continues and the
> shared library is loaded (but no shared library event occurs) and the java
> code (and native code)
> execute to completion because no breakpoints were set.
>
> Anyone have any suggestions ? I don't really need to debug the java code,
> just the JNI code so was
> only looking to setting breakpoints in the JNI code and then debugging
> once these hit.
>
> Dave Kelsey
>
Re: Debugging JNI code under Linux ? [message #201439 is a reply to message #201187] Wed, 12 September 2007 09:34 Go to previous message
Eclipse UserFriend
Have given this a go now and it seems to be more often than not that it won't stop
on breakpoints set in the C code. It looks like it suffers from the same problem
I see where a shared library event is not being seen and so break points are not
being set in the shared library code.

Dave Kelsey


iris Christian Klemke wrote:
> Try looking here:
> http://wiki.eclipse.org/index.php/Support_seamless_debugging _between_JDT_and_CDT
> I have not used the toolset yet, but it sounds promising.
>
> Regards,
> Christian
>
> "Dave Kelsey" <dkel50@hotmail.com> schrieb im Newsbeitrag
> news:fbokja$sn7$1@build.eclipse.org...
>> Has anyone been able to do this easily ? When I tried I found that GDB
>> version 6.4 failed to work
>> (aparantly due to the use of execve in java) so I upgraded to 6.6 and this
>> stopped GDB from failing
>> to find the user thread, but it never stops in my breakpoints. The problem
>> seems to stem from the
>> fact that when java is loaded, the debugger stops on shared library events
>> and attempts to set the
>> breakpoints (which doesn't work because the JNI library isn't loaded). It
>> then continues and the
>> shared library is loaded (but no shared library event occurs) and the java
>> code (and native code)
>> execute to completion because no breakpoints were set.
>>
>> Anyone have any suggestions ? I don't really need to debug the java code,
>> just the JNI code so was
>> only looking to setting breakpoints in the JNI code and then debugging
>> once these hit.
>>
>> Dave Kelsey
>>
>
>
>
Previous Topic:Adding .so library to my project
Next Topic:Debuggin RMI
Goto Forum:
  


Current Time: Tue Nov 04 03:38:23 EST 2025

Powered by FUDForum. Page generated in 0.04383 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top