Add ARM Cortex-M OpenOCD arch, command, and session manager#83
Conversation
3b4a00a to
74dd0f7
Compare
74dd0f7 to
16f140a
Compare
|
Still needs work, mostly in the gef project, but want to have a way for an arch to hint to the memory manager how to map. |
17f762b to
e5123db
Compare
|
Does this PR still make sense (after #99 got merged)? |
e5123db to
4cdfad5
Compare
Yes. That was for BlackMagicProbe, this is for OpenOCD. Updated the description so it makes sense. Still need to do more testing and write docs. |
4cdfad5 to
975604c
Compare
hugsy
left a comment
There was a problem hiding this comment.
very cool stuff, too bad I can't test it I'd love to try but the code is sound (very minor stuff to fix)
e5a9b0c to
ed2908b
Compare
ed2908b to
a328286
Compare
|
I tested this on a Tiva C-series ( |
|
@PowerUser64 thanks for testing this out. I just applied what should be a no-op change as suggested by @hugsy . Any chance you could try to ensure it still works? We can merge then. I just don't have the hardware accessible for a few days and I basically forgot this PR was still open, so it would be nice to merge. |
|
Seems to work! I'm able to place (hardware) breakpoints, go to next instructions, watch variables (done by halting pc every frame), and I get registers, stack, code, threads, and trace from gef's data printout. Would you like me to test loading arm-openocd.py in any way other than |
|
Ah, you should use the |
|
I've been using this command to start openocd and connect to the board: gef -ex 'target extended-remote | openocd -f board/ek-tm4c1294xl.cfg -c "gdb_port pipe; log_output openocd.log"; monitor reset; monitor halt' ./build/debug.axfUsing # *first, launched openocd from another terminal like this: openocd -f board/ti_ek-tm4c123gxl.cfg
# ...
gef> gef-openocd-remote localhost 3333
0x0000048e in SystemInit () at src/system_TM4C123.c:608608 for (i = 0; i < 10000; i++); /* wait a while */
[*] Using `target remote` with GEF should work in most cases, but use `gef-remote` if you can. You can disable the overwrite of the `target remote` command by toggling `gef.disable_target_remote_overwrite` in the config.
[!] Command 'gef-openocd-remote' failed to execute properly, reason: Specified arch ARMOPENOCD is not supported In the error, it looks like it's capitalizing the architecture name. When I use However, I'm also noticing that I don't get the |
|
I manually source mine after gef.py and the rest of gef-extras. The arch selection should not be case sensitive. I can't repro this (without hardware atm) but will test with hardware this week. If what you have is working, that's great! I've never seen the |
|
I finally had a use for this, and saw that lower case issue. Pushed a fix in hugsy/gef#1159 |
|
Should be ok to merge after that PR. |
|
I can't merge for some reason |
e2f9af4 to
61db76f
Compare
This is for debugging ARM cortex-m targets through JTAG/SWD using the gdbserver implemented in OpenOCD.
Manually tested with a debugger and openocd