简体   繁体   English

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

[英]Rust discovery, config file not working as expected

I am trying to avoid entering the same commands in each GDB sessions. 我试图避免在每个GDB会话中输入相同的命令。 For this, I have followed the instructions in rust discovery book but the program is not working as mentioned in the book when I run the program through cargo run it is giving the following error: 为此,我遵循了锈发现书中的说明,但是当我通过货运运行程序时,程序无法按书中所述运行,它给出以下错误:

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)

My openocd.gdb file contains these content: 我的openocd.gdb文件包含以下内容:

   target remote: 3333
    load
    break main
    continue

My config file contain these content: 我的配置文件包含以下内容:

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

Please change runner = "arm-none-eabi-gdb -q -x openocd.gdb" to this runner = "gdb-multiarch -q -x openocd.gdb". 请将runner =“ arm-none-eabi-gdb -q -x openocd.gdb”更改为runner =“ gdb-multiarch -q -x openocd.gdb”。 Because, if you are using the Ubuntu 18.04 LTS version then this command will be used as the book mention. 因为,如果您使用的是Ubuntu 18.04 LTS版本,那么此命令将用作书中提到的内容。

Ubuntu 18.04 or newer / Debian stretch or newer Ubuntu 18.04或更高版本/ Debian Stretch或更高版本

NOTE gdb-multiarch is the GDB command you'll use to debug your ARM Cortex-M programs 注意gdb-multiarch是用于调试ARM Cortex-M程序的GDB命令

Ubuntu 14.04 and 16.04 Ubuntu 14.04和16.04

NOTE arm-none-eabi-gdb is the GDB command you'll use to debug your ARM Cortex-M programs 注意arm-none-eabi-gdb是用于调试ARM Cortex-M程序的GDB命令

While flashing the STM32F3, we have to connect to the respective GDB server. 刷新STM32F3时,我们必须连接到相应的GDB服务器。 It may be arm-none-eabi-gdb , gdb-multiarch or gdb . 它可能是arm-none-eabi-gdbgdb-multiarchgdb You may have to try all the three. 您可能必须尝试所有这三个。

Now, as far as your question is concerned, you have to use the same parameter in your openocd.gdb. 现在,就您的问题而言,您必须在openocd.gdb中使用相同的参数。 In my case, I have successfully tried with arm-none-eabi-gdb . 就我而言,我已经成功尝试了arm-none-eabi-gdb Remember, I am using rust on Windows 10. 请记住,我在Windows 10上使用rust。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM