From c6fafaedc2fd532c3495a1322b49ee43d497b1c4 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Fri, 26 May 2017 15:10:44 -0500 Subject: [PATCH] set default runner to arm-none-eabi-gdb with this `xargo run` will build the program *and* immediately start a GDB session. --- .cargo/config | 4 ++++ Cargo.toml | 2 +- src/lib.rs | 10 ++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.cargo/config b/.cargo/config index e584d33..56eb049 100644 --- a/.cargo/config +++ b/.cargo/config @@ -1,4 +1,5 @@ [target.thumbv6m-none-eabi] +runner = 'arm-none-eabi-gdb' rustflags = [ "-C", "link-arg=-Tlink.x", "-C", "linker=arm-none-eabi-ld", @@ -6,6 +7,7 @@ rustflags = [ ] [target.thumbv7m-none-eabi] +runner = 'arm-none-eabi-gdb' rustflags = [ "-C", "link-arg=-Tlink.x", "-C", "linker=arm-none-eabi-ld", @@ -13,6 +15,7 @@ rustflags = [ ] [target.thumbv7em-none-eabi] +runner = 'arm-none-eabi-gdb' rustflags = [ "-C", "link-arg=-Tlink.x", "-C", "linker=arm-none-eabi-ld", @@ -20,6 +23,7 @@ rustflags = [ ] [target.thumbv7em-none-eabihf] +runner = 'arm-none-eabi-gdb' rustflags = [ "-C", "link-arg=-Tlink.x", "-C", "linker=arm-none-eabi-ld", diff --git a/Cargo.toml b/Cargo.toml index c3ccea7..4e9dd86 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ keywords = ["arm", "cortex-m", "template"] license = "MIT OR Apache-2.0" name = "cortex-m-quickstart" repository = "https://github.com/japaric/cortex-m-quickstart" -version = "0.1.5" +version = "0.1.6" [dependencies] cortex-m = "0.2.6" diff --git a/src/lib.rs b/src/lib.rs index 5c0aa34..c81a403 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -121,6 +121,16 @@ //! $ arm-none-eabi-gdb target/.. //! ``` //! +//! **NOTE** As of nightly-2017-05-14 or so and cortex-m-quickstart v0.1.6 you +//! can simply run `cargo run` or `cargo run --example $ex` to build and flash +//! the program, and immediately start a debug session. IOW, it lets you omit +//! `arm-none-eabi-gdb` command. +//! +//! ``` +//! $ cargo run --example hello +//! > # drop you into GDB session +//! ``` +//! //! # Examples //! //! Check the [examples module](./examples/index.html)