gdb + native code + Java + linux
My question is about Java, C, and Debugging with gdb under Linux
So I am not shure in which group should I post it.
I have a Java Program (Proba.java) that loads the native library
I generate the native library (libmydll.so) from a file Proba.cpp. So I have
the code for the Java Program and the code for the native library.
Now I have a problem with the code in the native library and I want to debug
The jdb (Java Debugger) obviously do not fit my needs.
I am trying gdb (The GNU Debugger). I am trying the following
1.Start the Java application.
2. Wait for the native library to load
3. See what the PID of the Java process is
4. Start the 'gdb' with two parameters. The java executable file and the PID
of the process
gdb <java_executable_file> <PID>
5. The 'gdb' connects to the process and the Java application freezes, couse
it is being debugged
6. I try to put a breakpoint in Proba.cpp at line 330 and I receive the
following response from 'gdb'
(gdb) break Proba.cpp:330
No symbol table is loaded. Use the "file" command.
7. I try to use the 'file' command In the following way
(gdb) file libmydll.so
A program is being debugged already. Kill it? (y or n) n
Program not killed.
Obviously I choose 'no'
8. I try the load command in the 'gdb'
(gdb) load libmudll.so
You can't do that when your target is `multi-thread'
9. I give up.
Does anybody know how can I debug this. I have the code of the Java-App and
code of the native library, but I do not have the code of the JVM.
Any response will be appreciated.
Jordan Nedelchev Jorgo17@abv.bg