MCPcopy Create free account
hub / github.com/cretz/stackparam / get_stack_trace

Function get_stack_trace

src/native.rs:473–485  ·  view source on GitHub ↗
(thread: jthread, max_depth: jint)

Source from the content-addressed store, hash-verified

471}
472
473unsafe fn get_stack_trace(thread: jthread, max_depth: jint) -> Result<Vec<jvmtiFrameInfo>, String> {
474 let mut frames: Vec<jvmtiFrameInfo> = Vec::with_capacity(max_depth as usize);
475 let mut frame_count: jint = 0;
476 let trace_res = (**JVMTI_ENV).GetStackTrace.unwrap()(JVMTI_ENV,
477 thread,
478 0,
479 max_depth,
480 frames.as_mut_ptr(), &mut frame_count);
481 util::unit_or_jvmti_err(trace_res)?;
482 frames.set_len(frame_count as usize);
483 frames.shrink_to_fit();
484 return Result::Ok(frames);
485}
486
487unsafe fn get_frame_params(jni_env: *mut JNIEnv, thread: jthread, frame: &jvmtiFrameInfo, depth: jint) -> Result<MethodInfo, String> {
488 if log_enabled!(Trace) { trace!("Getting info for {}", method_name(frame.method)?); }

Callers 1

get_paramsFunction · 0.85

Calls 1

unit_or_jvmti_errFunction · 0.85

Tested by

no test coverage detected