diff options
author | Santo Cariotti <santo@dcariotti.me> | 2023-10-16 21:06:08 +0200 |
---|---|---|
committer | Santo Cariotti <santo@dcariotti.me> | 2023-10-16 21:06:08 +0200 |
commit | 9808de10b9d47eb2341844e31e3db4a938787ddd (patch) | |
tree | 971d826dc23c819cf336dc0920679bfd3f4f3b21 /src/registers.rs | |
parent | ce8fb33087b449f8d0c18dafd35e0d5503d60192 (diff) |
Show sysname instead of the code
Diffstat (limited to 'src/registers.rs')
-rw-r--r-- | src/registers.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/registers.rs b/src/registers.rs index 0fc4296..f31e46d 100644 --- a/src/registers.rs +++ b/src/registers.rs @@ -6,6 +6,9 @@ use ratatui::{ style::Modifier, }; +#[cfg(all(target_arch = "x86_64", target_os = "linux"))] +use crate::arch::linux::x86_64::syscall_name; + /// Struct used to manipulate registers data from https://docs.rs/libc/0.2.147/libc/struct.user_regs_struct.html #[derive(Debug)] pub struct RegistersData { @@ -40,7 +43,7 @@ impl RegistersData { format!( "[{}]: {}({:x}, {:x}, {:x}, ...) = {:x}", self.date(), - self.orig_rax.bold(), + syscall_name(self.orig_rax).bold(), self.rdi, self.rsi, self.rdx, @@ -53,7 +56,7 @@ impl RegistersData { Line::from(vec![ Span::raw(format!("[{}]: ", self.date())), Span::styled( - format!("{}", self.orig_rax), + format!("{}", syscall_name(self.orig_rax)), Style::default().add_modifier(Modifier::BOLD), ), Span::raw(format!( |