You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am working on primes.c and I can't get my gdb environment setup so I can debug the code visually. I have the same .gdbinit.tmpl-riscv file and put $U/_primes\ in my Makefile. I am also running on a Raspberry Pi OS.
I run make qemu-gdb and then run gdb-multiarch user/_primes. After I run lay next, press enter and get the gdb environment in the picture.
The text was updated successfully, but these errors were encountered:
When you run make qemu-gdb, you are debugging the kernel, not user processes like user/_primes.
You might want to take a look at trampoline.S, which has a 'sret' instruction for returning to user mode. I think after 'sret' you won't be able to debug into user process and you will get back to gdb once you are back somewhere in the kernel, (probably via a syscal or timer interrupt).
In GDB, use "b trap.c:128" to break before jumping to userret. Then use "si" to step by instruction, until you reach to 'sret'. after that you will see that GDB sill not step from supervisor mode into user mode.
I am working on primes.c and I can't get my gdb environment setup so I can debug the code visually. I have the same .gdbinit.tmpl-riscv file and put $U/_primes\ in my Makefile. I am also running on a Raspberry Pi OS.
I run
make qemu-gdb
and then rungdb-multiarch user/_primes
. After I runlay next
, press enter and get the gdb environment in the picture.The text was updated successfully, but these errors were encountered: