问题描述
can anyone guide on how to debug a jni code on linux using gdb debugger(if possible please suggest other options).
-my jni project when running on linux is leading to a jvm crash. -the cpp code has been compiled into .so files. -i run the project like this : *java xyz.jar -commandline_args_to_project*.
i have the gdb installed but am not getting how we can debug the project using it. also do i necessarily need to compile the .cpp files with -g option t debug .so files?
百家乐凯发k8的解决方案
- start your java application
- look up the pid using top, ps, ...
- start gdb with this pid
- attach your program code
- debug as usual using gdb
this blog post explains the whole thing.