Rust 发现,配置文件未按预期工作

Rust discovery, config file not working as expected

我试图避免在每个 GDB 会话中输入相同的命令。为此,我已按照 rust discovery book 中的说明进行操作,但是当我通过 cargo 运行 程序 运行 时,该程序没有像书中提到的那样工作,它给出了以下错误:

ts/project/discovery/src/06-hello-world$ cargo run
   error: could not load Cargo configuration  
cargo run --target thumbv7em-none-eabihf
    Finished dev [unoptimized + debuginfo] target(s) in 0.04s
     Running `arm-none-eabi-gdb -q -x openocd.gdb /home/jawwad-turabi/Documents/project/discovery/target/thumbv7em-none-eabihf/debug/led-roulette`
error: could not execute process `arm-none-eabi-gdb -q -x openocd.gdb /home/jawwad-turabi/Documents/project/discovery/target/thumbv7em-none-eabihf/debug/led-roulette` (never executed)

Caused by:
  No such file or directory (os error 2)

我的 openocd.gdb 文件包含以下内容:

   target remote: 3333
    load
    break main
    continue

我的配置文件包含这些内容:

 [target.thumbv7em-none-eabihf]
   runner = "arm-none-eabi-gdb -q -x openocd.gdb"
   rustflags = [
   "-C", "link-arg=-Tlink.x",
   ]
   +[build]
   +target = "thumbv7em-none-eabihf"

请将runner = "arm-none-eabi-gdb -q -x openocd.gdb"改成这个 跑步者 = "gdb-multiarch -q -x openocd.gdb"。 因为,如果您使用的是 Ubuntu 18.04 LTS 版本,那么此命令将用作本书提及。

Ubuntu 18.04 或更新版本/Debian stretch 或更新版本

NOTE gdb-multiarch is the GDB command you'll use to debug your ARM Cortex-M programs

Ubuntu 14.04 和 16.04

NOTE arm-none-eabi-gdb is the GDB command you'll use to debug your ARM Cortex-M programs

刷STM32F3时,我们必须连接到相应的GDB服务器。可能是 arm-none-eabi-gdb, gdb-multiarch 或者 gdb .您可能需要尝试所有这三个。

现在,就您的问题而言,您必须在 openocd.gdb 中使用相同的参数。就我而言,我已成功尝试使用 arm-none-eabi-gdb。请记住,我在 Windows 10.

上使用 rust