(jni_env: *mut JNIEnv)
| 302 | } |
| 303 | |
| 304 | unsafe fn get_stack_params_field(jni_env: *mut JNIEnv) -> Result<jfieldID, String> { |
| 305 | static mut STACK_PARAMS_FIELD: jfieldID = 0 as jfieldID; |
| 306 | static ONCE: Once = ONCE_INIT; |
| 307 | ONCE.call_once(|| { |
| 308 | let throwable_class = get_throwable_class(jni_env).unwrap_or(ptr::null_mut()); |
| 309 | if !throwable_class.is_null() { |
| 310 | // We swallow exceptions in here on purpose |
| 311 | let field_name_str = CString::new("stackParams").unwrap(); |
| 312 | let field_sig_str = CString::new("[[Ljava/lang/Object;").unwrap(); |
| 313 | STACK_PARAMS_FIELD = (**jni_env).GetFieldID.unwrap()(jni_env, |
| 314 | throwable_class, |
| 315 | field_name_str.as_ptr(), |
| 316 | field_sig_str.as_ptr()); |
| 317 | let _ = util::result_or_jni_ex((), jni_env); |
| 318 | } |
| 319 | }); |
| 320 | if STACK_PARAMS_FIELD.is_null() { return Result::Err("No stackParams field".to_string()); } |
| 321 | return Result::Ok(STACK_PARAMS_FIELD); |
| 322 | } |
| 323 | |
| 324 | unsafe fn get_stack_trace_depth(jni_env: *mut JNIEnv, this: jobject) -> Result<jint, String> { |
| 325 | static mut STACK_DEPTH_METH: jmethodID = 0 as jmethodID; |
no test coverage detected