From 419a3dee1d89701deeaf9c0b6e41c5fe64d4d8f3 Mon Sep 17 00:00:00 2001 From: Max Barnash Date: Tue, 28 Mar 2023 20:24:07 +0100 Subject: [PATCH 1/2] Add a note regarding `target` dir location --- microbit/src/05-led-roulette/debug-it.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/microbit/src/05-led-roulette/debug-it.md b/microbit/src/05-led-roulette/debug-it.md index 64210e8c0..1d4f14d15 100644 --- a/microbit/src/05-led-roulette/debug-it.md +++ b/microbit/src/05-led-roulette/debug-it.md @@ -28,6 +28,18 @@ $ gdb target/thumbv6m-none-eabi/debug/led-roulette [chapter 3]: ../03-setup/index.md#tools +> **NOTE**: If you are getting `target/thumbv7em-none-eabihf/debug/led-roulette: No such file or directory` +> error, try adding `../../` to the file path, for example: +> +> ```shell +> $ gdb ../../target/thumbv7em-none-eabihf/debug/led-roulette +> ``` +> +> This is caused by each example project being in a `workspace` that contains the entire book, and workspaces have +> a single `target` directory. Check out [Workspaces chapter in Rust Book] for more. + +[Workspaces chapter in Rust Book]: https://doc.rust-lang.org/book/ch14-03-cargo-workspaces.html#creating-a-workspace + > **NOTE**: If `cargo-embed` prints a lot of warnings here don't worry about it. As of now it does not fully > implement the GDB protocol and thus might not recognize all the commands your GDB is sending to it, > as long as it does not crash, you are fine. From fd17c3e7eaeaab5a54019418b1f9c7314598ebff Mon Sep 17 00:00:00 2001 From: Max Barnash Date: Wed, 29 Mar 2023 21:54:11 +0100 Subject: [PATCH 2/2] Also add note the the f3disco version --- f3discovery/src/05-led-roulette/flash-it.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/f3discovery/src/05-led-roulette/flash-it.md b/f3discovery/src/05-led-roulette/flash-it.md index 31831e411..0b18a832d 100644 --- a/f3discovery/src/05-led-roulette/flash-it.md +++ b/f3discovery/src/05-led-roulette/flash-it.md @@ -97,6 +97,17 @@ gdb-multiarch -q -ex "target remote :3333" target/thumbv7em-none-eabihf/debug/le ``` console gdb -q -ex "target remote :3333" target/thumbv7em-none-eabihf/debug/led-roulette ``` + +> **NOTE**: If you are getting `target/thumbv7em-none-eabihf/debug/led-roulette: No such file or directory` +> error, try adding `../../` to the file path, for example: +> +> ```shell +> $ gdb -q -ex "target remote :3333" ../../target/thumbv7em-none-eabihf/debug/led-roulette +> ``` +> +> This is caused by each example project being in a `workspace` that contains the entire book, and workspaces have +> a single `target` directory. Check out [Workspaces chapter in Rust Book] for more. + ### **Failing case** You can detect a failing case if there is a `warning` or `error` after the `Remote debugging using :3333` line: