Make QEMU more friendly for kernel debug
Hello everyone,
I find that I can't single step OS kernels use qemu.When I use "step"
or "next" command in gdb,the kernel always enter its interrupt route instead of executing the next instruction after the breakpoint.So I modify QEMU's source code to disable interrupts in single step mode,and now I can use "step" or "next" command in gdb to single step functions.
Should I post the patch? It is a very small modification.
--
Three passions, simple but overwhelmingly strong, have governed my life:
the longing for love, the search for knowledge, and unbearable pity for the suffering of mankind.
---------Bertrand Russell
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 10 lines · Tace
Hi,
Please do...I got a question, doesn't disable the interrupts changes the
underlying system? Perhaps a good way would be to monitor the completion of the interrupt routine before singlestepping to the next instruction?
Quoted 26 lines
Quoted 2 lines · prime
Hello everyone,
I find that I can't single step OS kernels use qemu.When I use"step"
Quoted 2 lines
or "next" command in gdb,the kernel always enter its interrupt route instead of executing the next instruction after the breakpoint.So I
modify
Quoted 18 lines
QEMU's source code to disable interrupts in single step mode,and now I can use "step" or "next" command in gdb to single step functions.
Should I post the patch? It is a very small modification.
--
Three passions, simple but overwhelmingly strong, have governed my life:
the longing for love, the search for knowledge, and unbearable pity for the suffering of mankind.---------Bertrand Russell_______________________________________________
Qemu-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/qemu-devel
Hi,
I have post the patch here http://qemu.dad-answers.com/viewtopic.php?t=921
Disable interrupts in single step has very few
effects on the underlying system,in my opinion.
In normal mode(without single step),many
instructions are executed between two interrupts,
but in single step mode,we have done too much extra
ministrant work besides execute one instruction while the "virtual clock" running. So only one
instruction can be executed between two clock
interrupts.And I think,disable interrupts in single
step mode is a simple method to cancel the "virtual time" we have used for doing extra ministrant work.
For example,if we define CONFIG_SLIRP,then aftergdb_handle_packet() starts "virtual clock" by vm_start(),we have to do much work to handle slirp, and it needs lots "virtual time".This is just a simple instance,and there are many cases elsewhere.
PS. Please forgive my poor English,and it is my second language.
--
Three passions, simple but overwhelmingly strong, have governed my life:
the longing for love, the search for knowledge, and unbearable pity for the suffering of mankind.
---------Bertrand Russell