Created
January 1, 2024 14:39
-
-
Save ClarkeRemy/e55864a69c7f95eec3fb1ba8946bbf56 to your computer and use it in GitHub Desktop.
gdb breakpoints no line numbers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cargo build && gdb --command="my.gdb" ./target/debug/asm_learn |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fn main() { | |
| let mut b = 7; | |
| let mut a = 0; | |
| breakpoint!{_main01} | |
| a = 1; | |
| core::hint::black_box(&a); | |
| a = 2; | |
| println!("a : {}",a); | |
| breakpoint!{_main02} | |
| } | |
| fn _main01() {} | |
| fn _main02() {} | |
| macro_rules! breakpoint {($FN_LABEL:ident) => { | |
| #[cfg(debug_assertions)] | |
| { | |
| extern crate core; | |
| core::hint::black_box::<()>($FN_LABEL()); | |
| } | |
| };} | |
| pub(crate) use breakpoint; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set width 0 | |
| set height 0 | |
| set verbose off | |
| set debuginfod enabled off | |
| # set logging on | |
| break asm_learn::_main01 | |
| break asm_learn::_main02 | |
| run | |
| # _main01 | |
| finish | |
| info locals | |
| continue | |
| # _main02 | |
| finish | |
| info locals | |
| continue | |
| q | |
| y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment