blob: d58de98953ecb58c8ef15cdd3fe8c0ebf7d04a4d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
use crate::gdb::Emu;
use gdbstub::target;
use gdbstub::target::ext::catch_syscalls::SyscallNumbers;
// This implementation is for illustrative purposes only. If the target doesn't
// support syscalls then there is no need to implement this extension
impl target::ext::catch_syscalls::CatchSyscalls for Emu {
fn enable_catch_syscalls(
&mut self,
filter: Option<SyscallNumbers<'_, u32>>,
) -> target::TargetResult<(), Self> {
match filter {
Some(numbers) => eprintln!(
"Enabled catching syscalls: {:?}",
numbers.collect::<Vec<u32>>()
),
None => eprintln!("Enabled catching all syscalls"),
}
Ok(())
}
fn disable_catch_syscalls(&mut self) -> target::TargetResult<(), Self> {
eprintln!("Disabled catching syscalls");
Ok(())
}
}
|