Skip to content

Commit 77ebe1b

Browse files
committed
[Rust] More session scoped logs
Assign the `session_id` span field before calling into the relocation handler so logs get scoped to the specific view.
1 parent 9717943 commit 77ebe1b

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

rust/src/function_recognizer.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ where
5050
let bv = unsafe { BinaryView::from_raw(bv).to_owned() };
5151
let func = unsafe { Function::from_raw(func).to_owned() };
5252
let llil = unsafe { LowLevelILFunction::from_raw(llil).to_owned() };
53+
let _span = ffi_span!("FunctionRecognizer::recognize_low_level_il", bv);
5354
context.recognizer.recognize_low_level_il(&bv, &func, &llil)
5455
}
5556

@@ -66,6 +67,7 @@ where
6667
let bv = unsafe { BinaryView::from_raw(bv).to_owned() };
6768
let func = unsafe { Function::from_raw(func).to_owned() };
6869
let mlil = unsafe { MediumLevelILFunction::from_raw(mlil).to_owned() };
70+
let _span = ffi_span!("FunctionRecognizer::recognize_medium_level_il", bv);
6971
context
7072
.recognizer
7173
.recognize_medium_level_il(&bv, &func, &mlil)

rust/src/relocation.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,7 @@ where
442442
.iter()
443443
.map(RelocationInfo::from_raw)
444444
.collect::<Vec<_>>();
445+
let _span = ffi_span!("RelocationHandler::get_relocation_info", bv);
445446
let ok =
446447
custom_handler.get_relocation_info(bv.as_ref(), arch.as_ref(), info.as_mut_slice());
447448
for (result, info) in result.iter_mut().zip(info.iter()) {
@@ -466,6 +467,7 @@ where
466467
let arch = unsafe { CoreArchitecture::from_raw(arch) };
467468
let reloc = unsafe { Relocation::from_raw(reloc) };
468469
let dest = unsafe { core::slice::from_raw_parts_mut(dest, len) };
470+
let _span = ffi_span!("RelocationHandler::apply_relocation", bv);
469471
custom_handler.apply_relocation(bv.as_ref(), arch.as_ref(), &reloc, dest)
470472
}
471473

0 commit comments

Comments
 (0)