gdb_breakpoint

Crates.iogdb_breakpoint
lib.rsgdb_breakpoint
version0.2.0
sourcesrc
created_at2022-03-30 05:35:05.745422
updated_at2023-01-07 02:43:28.033974
descriptionCall gdb to the current process and atatch in a new tmux window
homepage
repositoryhttps://github.com/fx-kirin/rust_gdb_breakpoint
max_upload_size
id558998
size513,672
fx-kirin (fx-kirin)

documentation

README

GDB breakpoint like python's breakpoint

Launch ugdb and attach to current process with new tmux window.

DEMO

use gdb_breakpoint::breakpoint;

pub fn main() {
    let x = 3 + 4;
    breakpoint();
}

Require nightly.

set ptrace_scope

echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope

Make gdb to attach to the program.

Recommendation

Multithreadding rust programs can call SIGSTOP many times. I recommend you to add following command into your .gdbinit file. So I used SIGINT instead of SIGSTOP on the second and later breakpoint calls.

handle SIGSTOP "nostop" "pass" "noprint"
Commit count: 14

cargo fmt