rust-embedded / book

Documentation on how to use the Rust Programming Language to develop firmware for bare metal (microcontroller) devices
https://docs.rust-embedded.org/book/
Apache License 2.0
1.08k stars 173 forks source link

Apple Silicon can't install gdb, lldb instructions needed? #325

Open aguynamedben opened 2 years ago

aguynamedben commented 2 years ago

Hi, this book is great, but I have an Apple Silicon (M1) computer and brew install gdb fails with:

$ brew install gdb
gdb: The x86_64 architecture is required for this software.
Error: gdb: An unsatisfied requirement failed this build

It seems that gdb is just not supported on Apple Silicon computers.

I'm new to gdb, lldb, and debuggers. It'd be cool if the QEMU chapter showed how to use lldb to debug embedded Rust apps. Thank you!

aguynamedben commented 2 years ago

I'm not sure how it works under the hood, but QEMU and hardware debugging works if you use VS Code + cortex-m-quickstart + these instructions:

https://christopherjmcclellan.wordpress.com/2019/12/31/debugging-rust-cortex-m-with-vs-code-take-2/

toblux commented 2 years ago

Using arm-none-eabi-gdb instead of gdb works for me. It's installed with arm-none-eabi-gcc. See https://docs.rust-embedded.org/book/intro/install/macos.html

Velnbur commented 1 month ago

lldb worked for me thanks by this stack overflow comment