gdb riscv 寄存器


For help, type "help".
Type "apropos word" to search for commands related to "word".
0x0000000000001000 in ?? ()
(gdb) b xPortStartFirstTask
Breakpoint 1 at 0x80003700: file ../..//Source/portable/GCC/RISC-V/portASM.S, line 306.
(gdb) c
Continuing.

Breakpoint 1, xPortStartFirstTask () at ../..//Source/portable/GCC/RISC-V/portASM.S:306
306             la t0, freertos_risc_v_trap_handler
(gdb) bt
#0  xPortStartFirstTask () at ../..//Source/portable/GCC/RISC-V/portASM.S:306
#1  0x00000000800034ba in xPortStartScheduler () at ../..//Source/portable/GCC/RISC-V/port.c:196
#2  0x000000008000151c in vTaskStartScheduler () at ../..//Source/tasks.c:2067
#3  0x0000000080000228 in main_blinky () at ./blinky_demo/main_blinky.c:142
#4  0x0000000080000120 in main () at main.c:113
(gdb) p /x $mxstatus
$1 = void
(gdb) p /x $mstatus
$2 = 0x8000000000007880
(gdb) i registers
ra             0x800034ba       0x800034ba 74>
sp             0x8002ff80       0x8002ff80
gp             0x800208b0       0x800208b0 1208>
tp             0x0      0x0
t0             0x0      0
t1             0x1880   6272
t2             0x0      0
fp             0x8002ffa0       0x8002ffa0
s1             0x0      0
a0             0x1      1
a1             0x8000293a       2147494202
a2             0x800201c8       2147615176
a3             0x1      1
a4             0x127fd  75773
a5             0x880    2176
a6             0x800216a0       2147620512
a7             0x0      0
s2             0x0      0
s3             0x0      0
s4             0x0      0
s5             0x0      0
s6             0x0      0
s7             0x0      0
s8             0x0      0
s9             0x0      0
s10            0x0      0
s11            0x0      0
t3             0x0      0
t4             0x0      0
t5             0x0      0
t6             0x0      0
pc             0x80003700       0x80003700 
(gdb) x /4i $pc
=> 0x80003700 :    auipc   t0,0x0
   0x80003704 4>:  addi    t0,t0,-512
   0x80003708 8>:  csrw    mtvec,t0
   0x8000370c 12>: auipc   sp,0x1d
(gdb) x /6i 0x00000000800034ba
   0x800034ba 74>: li      a5,0
   0x800034bc 76>: mv      a0,a5
   0x800034be 78>: ld      ra,24(sp)
   0x800034c0 80>: ld      s0,16(sp)
   0x800034c2 82>: addi    sp,sp,32
   0x800034c4 84>: ret
(gdb)