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

Qemu hangs after execute instruction "mret" in start #84

Closed
yodalee opened this issue Jun 28, 2021 · 1 comment
Closed

Qemu hangs after execute instruction "mret" in start #84

yodalee opened this issue Jun 28, 2021 · 1 comment

Comments

@yodalee
Copy link

yodalee commented Jun 28, 2021

I encounter following issued on my computer, and I have no clue how to solve it or what the problem is.
Here is my environment:

  • Linux kernel: 5.12.12-arch1-1
  • Compiler: riscv64-unknown-elf-gcc (Arch User Repository) 9.2.0
  • qemu-system-riscv64: QEMU emulator version 6.0.0
  • gdb: GNU gdb (GDB) 10.2

The problem is that, my breakpoint does not work in main function. I can step to the line asm volatile("mret"); in function start.
However, the debugger just hangs after this instruction, it does not hit my breakpoint set on main function. I can send interrupt by press Ctrl+C, it seems that sometimes it will stop in function timervec.
I think the timer interrupt is worked as expected.
Have no clue what the problem is and how to fix it. Does anyone face same issue?

@yodalee
Copy link
Author

yodalee commented Jun 29, 2021

I just found that, the problem is caused by qemu v6. I switch to qemu v5.2 and I can break at main function now.

@yodalee yodalee closed this as completed Jun 29, 2021
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