Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spike executed wrongly when GDB controlled it in single-step mode #101

Open
zhenbohu opened this issue May 16, 2017 · 0 comments
Open

Spike executed wrongly when GDB controlled it in single-step mode #101

zhenbohu opened this issue May 16, 2017 · 0 comments

Comments

@zhenbohu
Copy link

Hi,

When I try to use Spike to run with GDB for single-step mode, I found the execution sequence is not expected, and one instruction is lost.

If I run spike with the isa-test rv32uc-p-rvc (from the riscv-tests/isa directory), I can see the instruction trace is like this:

core 0: 0xffffffff800000b0 (0x34129073) csrw mepc, t0
core 0: 0xffffffff800000b4 (0xf1402573) csrr a0, mhartid
core 0: 0xffffffff800000b8 (0x30200073) mret
core 0: 0x00000000800000bc (0x00200e13) li t3, 2 //<---------------------------------------> This instruction
core 0: 0xffffffff800000c0 (0x29a00593) li a1, 666
core 0: 0xffffffff800000c4 (0x00100613) li a2, 1

But when I run this test with GDB in single-step-mode, I can see the trace is like this:
0x800000ac in reset_vector ()
(gdb) ni
0x800000b0 in reset_vector ()
(gdb) ni
0x800000b4 in reset_vector ()
(gdb) ni
0x800000b8 in reset_vector ()
(gdb) ni
0x800000c0 in reset_vector ()//<------------------> We can see after the 0x800000b8, the next instruction here is 0x800000c0. This should not happen, the original 800000bc instruction is lost.
(gdb) ni
0x800000c4 in reset_vector ()
(gdb)

I guess this should be a bug, so report it here.

Thanks
Bob

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant