我试图避免在每个 GDB 会话中输入相同的命令。为此,我已按照rust discovery book中的说明进行操作,但是当我通过 cargo run 运行程序时,程序无法按照书中所述运行,它给出以下错误:
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"