-
Notifications
You must be signed in to change notification settings - Fork 34
Description
I was having problems getting gdb-multiarch to install on the latest macOS (26) so I decided to try the vanilla gdb:
`
gdb ../../../target/thumbv7em-none-eabihf/debug/examples/init
GNU gdb (GDB) 16.3
Copyright (C) 2024 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "--host=aarch64-apple-darwin25.0.0 --target=x86_64-apple-darwin20".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
https://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Redefine command "allreadq"? (y or n) [answered Y; input not from terminal]
Redefine command "allasoc"? (y or n) [answered Y; input not from terminal]
Reading symbols from ../../../target/thumbv7em-none-eabihf/debug/examples/init...
(gdb) target remote :1337
Remote debugging using :1337
init::__cortex_m_rt_main_trampoline ()
at mdbook/src/05-meet-your-software/examples/init.rs:10
10 #[entry]
(gdb) b main
Breakpoint 1 at 0x15c: file mdbook/src/05-meet-your-software/examples/init.rs, line 10.
┌─mdbook/src/05-meet-your-software/examples/init.rs────────────────────────────┐
│ 5 use cortex_m::asm; │
│ 6 use cortex_m_rt::entry; │
│ 7 use microbit as _; │
│ 8 use panic_halt as _; │
│ 9 │
│B+ 10 #[entry] │
│ > 11 fn main() -> ! { │
│ 12 #[allow(clippy::needless_late_init)] │
│ 13 let _y; │
│ 14 let x = 42; │
│ 15 _y = x; │
│ 16 │
│ 17 // infinite loop; just so we don't leave this stack frame │
│ 18 loop { │
└──────────────────────────────────────────────────────────────────────────────┘
remote Thread 1.1 (src) In: init::__cortex_m_rt_main L11 PC: 0x160
Note: automatically using hardware breakpoints for read-only addresses.
(gdb) monitor reset halt
Resetting and halting target
Target halted
(gdb) c
Continuing.
Program received signal SIGINT, Interrupt.
cortex_m_rt::DefaultPreInit () at src/lib.rs:1117
1117 pub unsafe extern "C" fn DefaultPreInit() {}
(gdb) c
Continuing.
Breakpoint 1, init::__cortex_m_rt_main_trampoline ()
at mdbook/src/05-meet-your-software/examples/init.rs:10
10 #[entry]
(gdb) c
Continuing.
Program received signal SIGINT, Interrupt.
init::__cortex_m_rt_main ()
at mdbook/src/05-meet-your-software/examples/init.rs:11
11 fn main() -> ! {
(gdb) layout src
Detaching from program: /Volumes/Repos/Rust/discovery-mb2/target/thumbv7em-none-eabihf/debug/examples/init, process 1
Ending remote debugging.
[Inferior 1 (process 1) detached]
`
I do have this installed: arm-none-eabi-gdb so maybe that's helping? But I think it's just vanilla gdb from homebrew "just works.