简体   繁体   中英

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. I've got an OCD debugger connecting to a board with an ARM processor.

Eclipse is able to stop at the first breakpoint and gather variables from memory, but any subsequent breakpoints or single-steps fail. I can set breakpoints ok when using commandline gdb, but setting breakpoints at the exact same location gives me these errors in Eclipse:

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

And my OCD connection dies with "Error: unexpected error -308"

I'm using the same OCD script in both cases.

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:

When running from gdb, I use a script file that ends with these two lines:

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.

I'd appreciate any suggestions about how to get Zylin+Eclipse to behave. Thanks.

I'm using the same solution on a LPC2103.

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

Main tab: C/C++ Application = you_elf_file.elf

Debugger tab: GDB debugger = arm-elf-gdb ; GDB command set = Standard ; Protocol = 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:

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

It works most of the time for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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