简体   繁体   English

在Eclipse CDT中使用Zylin调试Arm-elf C代码

[英]Debugging arm-elf C code using Zylin in Eclipse CDT

I'm using Eclipse CDT with Zylin embedded debug (native) and arm-elf-gdb 6.6 on OS X 10.5.8. 我在OS X 10.5.8上使用带有Zylin嵌入式调试(本机)和arm-elf-gdb 6.6的Eclipse CDT。 I've got an OCD debugger connecting to a board with an ARM processor. 我有一个OCD调试器连接到带有ARM处理器的电路板。

Eclipse is able to stop at the first breakpoint and gather variables from memory, but any subsequent breakpoints or single-steps fail. Eclipse能够在第一个断点处停止并从内存中收集变量,但是任何后续断点或单步操作都会失败。 I can set breakpoints ok when using commandline gdb, but setting breakpoints at the exact same location gives me these errors in Eclipse: 我可以在使用命令行gdb时将断点设置为ok,但是在完全相同的位置设置断点会使我在Eclipse中出现以下错误:

Warning:
Cannot insert breakpoint 2.
Error accessing memory address 0x3f6: Unknown error: -1.

And my OCD connection dies with "Error: unexpected error -308" 并且我的OCD连接死于"Error: unexpected error -308"

I'm using the same OCD script in both cases. 在两种情况下,我都使用相同的OCD脚本。

The only differences I see are (1) Eclipse uses Zylin and the mi protocol to talk to gdb, and (2) my gdb script is invoked differently in this way: 我看到的唯一区别是(1)Eclipse使用Zylin和mi协议与gdb进行通信,以及(2)我的gdb脚本以这种方式被不同地调用:

When running from gdb, I use a script file that ends with these two lines: 从gdb运行时,我使用以以下两行结尾的脚本文件:

load        filename.out
symbol-file filename.out

In Eclipse, I copy the contents of this script file into "Debug Configurations | Commands" (I've tried both the "'Initialize' Commands" and "'Run' Commands" boxes. I replace the last two lines with load , and specify filename.out in the "Debug Configurations | Main | C/C++ Application" box. 在Eclipse中,我将此脚本文件的内容复制到“调试配置|命令”中(我已经尝试了“'Initialize'Commands”和“'Run'Commands”框。我用load替换最后两行,并在“调试配置|主| C / C ++应用程序”框中指定filename.out

I'd appreciate any suggestions about how to get Zylin+Eclipse to behave. 我将对有关如何使Zylin + Eclipse正常运行的任何建议表示感谢。 Thanks. 谢谢。

I'm using the same solution on a LPC2103. 我在LPC2103上使用相同的解决方案。

Go to Eclipse, in Zylin Debug Configurations > Embedded Debug (Native) : 转到Eclipse,在Zylin Debug Configurations > Embedded Debug (Native)

Main tab: C/C++ Application = you_elf_file.elf 主选项卡: C / C ++应用程序= you_elf_file.elf

Debugger tab: GDB debugger = arm-elf-gdb ; 调试器标签: GDB debugger = arm-elf-gdb ; GDB command set = Standard ; GDB命令集= Standard Protocol = mi2 协议= mi2

Commands: 命令:

'Initialize' commands: '初始化'命令:

target remote localhost:3333

monitor arm7_9 dcc_downloads enable
monitor arm7_9 fast_memory_access enable
monitor arm7_9 dbgrq enable

monitor reset halt
monitor wait_halt
monitor sleep 500
load

'Run' commands: “运行”命令:

continue

I'm using parallel port Wiggler and OpenOCD [Open On-Chip Debugger 0.4.0] with the cfgs that came with the installation: 我将并行端口Wiggler和OpenOCD [Open On-Chip Debugger 0.4.0]与安装随附的cfgs结合使用:

openocd -f interface/parport.cfg -f target/lpc2103.cfg

It works most of the time for me. 它对我大多数时间都有效。

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

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