How to debug C++ library called by JNI wrapper [message #1061436] |
Fri, 31 May 2013 15:38 |
Jorge Arévalo Messages: 1 Registered: May 2013 |
Junior Member |
|
|
Hello,
I'm executing a Java desktop application. At some point, the code calls a C++ library, via JNI wrapper. This call causes an error that kills the jvm. The error message is: double free or corruption. I want to be able to debug the C code, to look what's happening.
I've read the CDT FAQs about debugging C++ code. I've also tried these steps. I'm stuck in the "launch the cdt debugger" part. I've tried it, creating a new "C++ attach to application" debug configuration, selecting as application the .so library that contains the C++ code.
I add a breakpoint just before the JNI call. And I add a breakpoint in the C++ code to be called to. When the JNI call is reached, I launch the new debug configuration, and I attach it to the existent java process. The debugger starts, but I get the error:
No source file named /path/to/my/source_file.c
Being source_file.c the C++ file where I put the breakpoint. But the fact is the file does exist. Eclipse/GDB can't find it. So, the debugger starts running, and I can even hit 'next' or 'step' buttons. But every time I hit one of them, I get a message like this:
No source available for <hexadecimal_number>
And I must kill the debug session.
I've added the path to the folder where my C++ sources are to the debug configuration, but still, the debugger is not able to find them. Am I missing some needed configuration option?
Many thanks in advance, and best regards
|
|
|
Powered by
FUDForum. Page generated in 0.03332 seconds