Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fx-kirin/rust_gdb_breakpoint
Like Python's breakpoint, you can use breakpoint in Rust.
https://github.com/fx-kirin/rust_gdb_breakpoint
Last synced: about 2 months ago
JSON representation
Like Python's breakpoint, you can use breakpoint in Rust.
- Host: GitHub
- URL: https://github.com/fx-kirin/rust_gdb_breakpoint
- Owner: fx-kirin
- Created: 2022-03-30T05:27:40.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-07T02:43:17.000Z (about 2 years ago)
- Last Synced: 2024-11-18T07:48:40.741Z (2 months ago)
- Language: Rust
- Homepage:
- Size: 491 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GDB breakpoint like python's breakpoint
Launch `ugdb` and attach to current process with new tmux window.
![DEMO](gdb_breakpoint_demo.gif "GDB DEMO")
``` rust
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"
```