Skip to content

Commit

Permalink
Fix broken showcase example not building
Browse files Browse the repository at this point in the history
  • Loading branch information
jamcleod committed Sep 5, 2024
1 parent 31adb94 commit ec9ce24
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions panda-rs/examples/showcase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fn sys_write_test(cpu: &mut CPUState, _pc: SyscallPc, _fd: u32, buf: target_ulon
// print out the pc and syscall number of the first syscall to run
#[panda::on_all_sys_enter]
fn on_sys_enter(cpu: &mut CPUState, pc: SyscallPc, callno: target_ulong) {
println!("pc: {:#x?} | syscall: {}", pc, callno);
println!("pc: {:#x?} | syscall: {}", pc.pc(), callno);

// remove the hook once the first syscall has been printed out
SYSCALLS.remove_callback_on_all_sys_enter(on_sys_enter);
Expand All @@ -43,7 +43,10 @@ fn every_basic_block(cpu: &mut CPUState, tb: &mut TranslationBlock) {
// every 1000 basic blocks visited
if NUM_BB.fetch_add(1, Ordering::SeqCst) % 1000 == 0 {
println!("pc: {:X}", tb.pc);
let proc = OSI.get_current_process(cpu);
let Some(proc) = OSI.get_current_process(cpu) else {
println!("Current Process is null");
return;
};
println!("pid: {:X}", (*proc).pid);

if (*proc).pid == 0x1f {
Expand Down

0 comments on commit ec9ce24

Please sign in to comment.