| Debugging JNI code under Linux ? [message #201178] | 
Thu, 06 September 2007 06:25   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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 
>> 
>  
>  
>
 |  
 |  
  | 
Powered by 
FUDForum. Page generated in 0.37758 seconds