Re: why gdb try to read address 0x0 when I set $pc，how to suppress this behavior?

Tom Tromey
2023-07-26T16:09:44Z

>>>>> 庄秋彬 <mark.zhuang@spacemit.com> writes:

Sorry about the delay on this.

> I use gdb with openocd to debug a riscv board, and found that when set
> $pc=xxx(a non-zero value) in gdb, gdb would first read the address
> 0x0, which caused an error on this riscv device. Is there any
> documentation or suggestions for reading the source code to solve this
> problem?

I don't think so. Reading 0x0 when trying to set $pc is unexpected to
me at least. I'd normally approach this by debugging gdb to try to
understand why it is happening.

Tom