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