After some tests, with surprise I see that UBC is used only for step command (not for break-point). My idea was that
UBC is a device to avoid write operation in code segment after download :-(
When gdb make a breakpoint it still substitute opcode. A problem for me if the code is in flash.
What mode to debug in flash memory ?
My idea is to determine in gdbstub if a message is a write is for download or for break-point operation.
Catch the break operation and use the UBC. If gdb wants to insert more than one break an error message is
sent to gbd.
I'm not a gdb expert, so I ask you if it is possible...
Thank you
PS Now I'm working to improve actual UBC function :-)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
> After some tests, with surprise I see that UBC is used only for step
> command (not for break-point). My idea was that UBC is a device to
> avoid write operation in code segment after download :-(
Right. I haven't found time to implement gdb's "hbreak" command. Turn on remote logging ("set remote debug 1" for gdb 5.0, "set remotedebug 1" for gdb 4.x), play with the hbreak command, and see what gdb needs to make it work. Should be pretty easy.
The alternative is to hack gdb.c and the memory writing code to detect the writing of the breakpoint opcode (trapa #32, 0xc320, on the SH), and use that to configure the UBC rather than modifying program memory.
I vote for the first approach, because that's what the hbreak command is for.
b.g.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
After some tests, with surprise I see that UBC is used only for step command (not for break-point). My idea was that
UBC is a device to avoid write operation in code segment after download :-(
When gdb make a breakpoint it still substitute opcode. A problem for me if the code is in flash.
What mode to debug in flash memory ?
My idea is to determine in gdbstub if a message is a write is for download or for break-point operation.
Catch the break operation and use the UBC. If gdb wants to insert more than one break an error message is
sent to gbd.
I'm not a gdb expert, so I ask you if it is possible...
Thank you
PS Now I'm working to improve actual UBC function :-)
Gulix:
> After some tests, with surprise I see that UBC is used only for step
> command (not for break-point). My idea was that UBC is a device to
> avoid write operation in code segment after download :-(
Right. I haven't found time to implement gdb's "hbreak" command. Turn on remote logging ("set remote debug 1" for gdb 5.0, "set remotedebug 1" for gdb 4.x), play with the hbreak command, and see what gdb needs to make it work. Should be pretty easy.
The alternative is to hack gdb.c and the memory writing code to detect the writing of the breakpoint opcode (trapa #32, 0xc320, on the SH), and use that to configure the UBC rather than modifying program memory.
I vote for the first approach, because that's what the hbreak command is for.
b.g.