< prev index next >

jdk/src/java.base/share/native/libjava/Throwable.c

Print this page




  32 #include <stdio.h>
  33 #include <signal.h>
  34 
  35 #include "jni.h"
  36 #include "jvm.h"
  37 
  38 #include "java_lang_Throwable.h"
  39 
  40 /*
  41  * Fill in the current stack trace in this exception.  This is
  42  * usually called automatically when the exception is created but it
  43  * may also be called explicitly by the user.  This routine returns
  44  * `this' so you can write 'throw e.fillInStackTrace();'
  45  */
  46 JNIEXPORT jobject JNICALL
  47 Java_java_lang_Throwable_fillInStackTrace(JNIEnv *env, jobject throwable, jint dummy)
  48 {
  49     JVM_FillInStackTrace(env, throwable);
  50     return throwable;
  51 }
  52 
  53 JNIEXPORT void JNICALL
  54 Java_java_lang_Throwable_getStackTraceElements(JNIEnv *env,
  55                                                jobject throwable, jobjectArray elements)
  56 {
  57     JVM_GetStackTraceElements(env, throwable, elements);
  58 }


  32 #include <stdio.h>
  33 #include <signal.h>
  34 
  35 #include "jni.h"
  36 #include "jvm.h"
  37 
  38 #include "java_lang_Throwable.h"
  39 
  40 /*
  41  * Fill in the current stack trace in this exception.  This is
  42  * usually called automatically when the exception is created but it
  43  * may also be called explicitly by the user.  This routine returns
  44  * `this' so you can write 'throw e.fillInStackTrace();'
  45  */
  46 JNIEXPORT jobject JNICALL
  47 Java_java_lang_Throwable_fillInStackTrace(JNIEnv *env, jobject throwable, jint dummy)
  48 {
  49     JVM_FillInStackTrace(env, throwable);
  50     return throwable;
  51 }







< prev index next >