To be more specific, the charter of this task group was to standardize
run-halt debug. A later separate task group can work on standardizing
trace.
Krste
| 1. save pc of instruction (ebreak) in dpc
| 2. save cause in dcsr
| 3. update mepc and mcause as well (Should this happen?)
| 4. Jump to mtvec. (should I jump here or somewhere else?)
| Now the trap_entry corresponding to mtvec would look like something
| below
| 0x00100 csrr t5, mcause; # trap_entry
| 0x00104 li t6, 3;
| 0x00108 beq t5, t6, 0x10000 # if the cause is that of
| breakpoint go to debug_trap_entry
| ...
| ...
| ...
| 0x10000: fence.i # debug_trap_entry
| 0x10004: j 0x10000
| My concern is that the trap entry changes the register t5 (and
| possibly others for a full fledged trap_entry code). I would then
| end up at a wrong context of registers when I halt.
| So here are my questions:
| 1. Is there a different way to enter the debug_trap_entry? Should
| I be jumping to mtvec at all during a breakpoint/haltrep or
| should I jump to an "implementation defined" memory mapped
| address which contains the debug_entry only?
| 2. Also when I "resume" from halt state (probably using dret or
| resumereq from the debugger) I will be jumping back to the pc
| stored in dpc (which is that of the ebreak instruction). I
| would again enter the debug mode. Shouldn't the pc stored in
| dpc be that of ebreak+4?
| 3. Additionally also wanted to know for a single core with just
| one hart, while executing the ProgramBuffer should the
| "anyhalted" bit in the debug status register be kept raised?
| 4. What does hart unavailable mean in the dmstatus register? Can
|
groups.riscv.org/d/msgid/debug/CAFrQjCFUZ-VGUuSDG22XXY%2B49crb%
| 2BCcsERxmL5NWrnxRGih4Vw%
40mail.gmail.com.
| CAGDihemnBhrHjYibtSSPzM2ZtNrWjfnpC0ob8U8%3D7s1F8diE%3DQ%
40mail.gmail.com.