javaandroiddebuggingstack-tracebacktrace

Difference between dumpstack() and printStackTrace()


I am trying to get the stack trace of the underlying C code that is called from the android Java app code and tried using dumpStack() and printStackTrace() without any success. Just was curious is there a difference between the two if any?

Also is there a way to print a stack trace of the underlying C code the uses JNI to call the java functions on the android side?


Solution

  • Thread.dumpStack() dumps the current stack trace of the thread it is invoked on.

    Throwable.printStackTrace() prints the stack trace as it was when the throwable was thrown.