recipeNoD002 - Debugging JNI code with IntelliJ/CLion

By: JNI Cookbook

10   0   1200

Uploaded on 05/16/2016

You are free to:

Share — copy and redistribute the material in any medium or format
Adapt — remix, transform, and build upon the material
for any purpose, even commercially.
The licensor cannot revoke these freedoms as long as you follow the license terms.

Under the following terms:

Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.
No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.

Notices:

You do not have to comply with the license for elements of the material in the public domain or where your use is permitted by an applicable exception or limitation.
No warranties are given. The license may not give you all of the permissions necessary for your intended use. For example, other rights such as publicity, privacy, or moral rights may limit how you use the material.

Dj Rkod - Pulse (George Ellinas Remix) by George Ellinas - published under CC (ccMixter)

IntelliJ and CLion used in this tutorial was granted with Open Source based license.

JNI Cook Book: http://jnicookbook.owsiak.org
GitHub: https://github.com/mkowsiak/jnicookbook

Comments (4):

By anonymous    2017-09-20

Use IntelliJ ;)

https://youtu.be/8Cjeq4l5COU

This way, you can easily debug JNI ;)

Original Thread

By anonymous    2017-09-20

If you want to take a look at exact chain of execution I suggest to connect to JVM using gdb (or CLion) and take a look at backtrace.

Take a look here to see how to do it:

http://www.owsiak.org/?p=2095

You can also take a look here:

https://www.youtube.com/watch?v=8Cjeq4l5COU

Once you are attached to JVM, you can set breakpoint in your C code and check the backtrace from top to bottom.

Alternatively, you can create SIGSEGV and generate full backtrace of JVM (take a look here: http://jnicookbook.owsiak.org/recipe-No-015/)

Original Thread

Recommended Books

    Popular Videos 1226

    Google Developers

    Submit Your Video

    If you have some great dev videos to share, please fill out this form.