Skip to content

Commit

Permalink
larger overhaul, 0.4.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
sectordistrict committed Dec 15, 2024
1 parent 0018897 commit 976eb98
Show file tree
Hide file tree
Showing 9 changed files with 5,242 additions and 1,618 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "intentrace"
version = "0.3.3"
version = "0.4.0"
description = "intentrace is strace with intent, it goes all the way for you instead of half the way."
edition = "2021"
license = "MIT"
Expand Down
12 changes: 7 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ use utilities::{
};

mod syscall_object;
mod syscalls_map;
mod syscall_object_annotations;
mod syscall_annotations_map;
mod types;
mod syscall_skeleton_map;
use syscall_object::{SyscallObject, SyscallState};
mod one_line_formatter;
mod utilities;
Expand Down Expand Up @@ -236,7 +238,7 @@ fn ptrace_ptracer(mut ptracer: Ptracer, child: Pid) {
}
let syscall_pid = Pid::from_raw(tracee.pid.as_raw());
match tracee.stop {
Stop::SyscallEnter => 'label_for_early_break: {
Stop::SyscallEnter => 'for_exiting: {
match nix::sys::ptrace::getregs(syscall_pid) {
Ok(registers) => {
if syscall_pid != last_pid {
Expand All @@ -258,7 +260,7 @@ fn ptrace_ptracer(mut ptracer: Ptracer, child: Pid) {
}
syscall_will_run(&mut syscall);
if syscall.is_exiting() {
break 'label_for_early_break;
break 'for_exiting;
}
last_sysno = syscall.sysno;
syscall.state = SyscallState::Exiting;
Expand Down Expand Up @@ -301,13 +303,13 @@ fn syscall_will_run(syscall: &mut SyscallObject) {

// handle program break point
if syscall.is_mem_alloc_dealloc() {
set_memory_break(syscall.child);
set_memory_break(syscall.process_pid);
}
if FOLLOW_FORKS.load(Ordering::SeqCst) || syscall.is_exiting() {
syscall.format();
if syscall.is_exiting() {
let exited = " EXITED ".on_bright_red();
let pid = format!(" {} ", syscall.child).on_black();
let pid = format!(" {} ", syscall.process_pid).on_black();
print!("\n\n {pid}{exited}\n",);
}
}
Expand Down
Loading

0 comments on commit 976eb98

Please sign in to comment.