summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2023-10-16 21:41:31 +0200
committerSanto Cariotti <santo@dcariotti.me>2023-10-16 21:41:31 +0200
commit38e07fae8b3d06cd43b4c9793c07c2048b32d095 (patch)
tree7cb620e87e0c12f911bdb2416b44750f016607d2
parente3731c8de1aa317eee447dcb8afb6e495f04436d (diff)
Add generic `syscall_name` function
-rw-r--r--src/arch/mod.rs6
-rw-r--r--src/registers.rs2
2 files changed, 8 insertions, 0 deletions
diff --git a/src/arch/mod.rs b/src/arch/mod.rs
index 057cec9..d34a135 100644
--- a/src/arch/mod.rs
+++ b/src/arch/mod.rs
@@ -1 +1,7 @@
+#![allow(dead_code)]
pub mod linux;
+
+/// Generic `syscalll_name` called by a not-defined table
+pub fn syscall_name(rax: u64) -> String {
+ rax.to_string()
+}
diff --git a/src/registers.rs b/src/registers.rs
index f31e46d..ec2e12c 100644
--- a/src/registers.rs
+++ b/src/registers.rs
@@ -8,6 +8,8 @@ use ratatui::{
#[cfg(all(target_arch = "x86_64", target_os = "linux"))]
use crate::arch::linux::x86_64::syscall_name;
+#[cfg(not(all(target_arch = "x86_64", target_os = "linux")))]
+use crate::arch::syscall_name;
/// Struct used to manipulate registers data from https://docs.rs/libc/0.2.147/libc/struct.user_regs_struct.html
#[derive(Debug)]