Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions crates/libafl_qemu/src/modules/calls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,24 @@ impl FullBacktraceCollector {
}
}
}

pub fn backtrace_full() -> Option<Vec<&'static Vec<GuestAddr>>> {
// # Safety
// This accesses the global [`CALLSTACKS`] variable.
// However, the actual variable access is behind a `ThreadLocal` class.
let callstacks_ptr = &raw mut CALLSTACKS;
unsafe {
if let Some(c) = (*callstacks_ptr).as_mut() {
let mut res = Vec::new();
for tls in &mut *c {
res.push(&*tls.get());
}
Some(res)
} else {
None
}
}
}
}

impl CallTraceCollector for FullBacktraceCollector {
Expand Down
Loading