Here is the patch to list/save/restore breakpoints.

Usage:

-----------------------------------------------------------------------
"bpsave <filename>" : saves a script file that can be used to restore breakpoints in this format:

bp 0x00000040 0x00000004 hw
bp 0x00000100 0x00000004 hw
bp 0x00000200 0x00000004 sw

if <filename> is omitted it defaults to "BreakPoints.bpt" in the current working dir.

-----------------------------------------------------------------------
To restore breakpoints run the generated script:

"script <filename>"

e.g.: "script BreakPoints.bpt"

-----------------------------------------------------------------------
"bplist" : list breakpoints in a more readable format than simply typing "bp":

hardware breakpoint at 0x00000040 of length 0x00000004 unset
hardware breakpoint at 0x00000100 of length 0x00000004 unset
software breakpoint at 0x00000200 of length 0x00000004 unset

-----------------------------------------------------------------------
Note that this patch also modify the "rbp" command: without arguments it clear all breakpoints:

"bp" : clear all breakpoints

-----------------------------------------------------------------------
Next steps:

it would be nice to manage enable/disable of each breakpoint.
It would also be nice to refer to a breakpoint (for remove/enable/disable) by its order number.
e.g.:
bplist
00 hardware breakpoint at 0x00000040 of length 0x00000004 unset
01 hardware breakpoint at 0x00000100 of length 0x00000004 unset
02 software breakpoint at 0x00000200 of length 0x00000004 unset

rbpn 2
remove breakpoint number 2

ebpn 1
enable breakpoint number 1

dbpn 1
disable breakpoint number 1

The "n" version of the commands access breakpoints by number

dbp 0x40
disable breakpoint by address

dbp all
disable all breakpoints

A field to breakpoint struct should be added to record the enabled state and used when setting breakpoints.

Feel free to modify the patch, commands name or whatever you want.
This is obviously a help for command line users, it make no sense for gui clients. Sometimes happens to have only a telnet shell to debug a system in the real world. Hopefully a full debugger with a character gui through telnet (I mean an interface like mc, midnight commander) could be optionally added as an OpenOCD server.

Regards,

Dario

Attachment: BreakPoints.patch
Description: Binary data

_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to