* [Qemu-devel] [DEBUG] how to use GDB to debug qemu?
@ 2010-04-27 8:24 robert song
2010-04-29 13:21 ` [Qemu-devel] " robert song
0 siblings, 1 reply; 3+ messages in thread
From: robert song @ 2010-04-27 8:24 UTC (permalink / raw)
To: qemu-devel
Hello, everyone.
Now I am trying to read the QEMU source code.
And sometimes it's helpful to use GDB to do the debug for me to
understand the code.
For example, in the qemu environment,
I use gdb to attach to the qemu process.
Then I just run "info cpus" as following.
(QEMU) info cpus
But now how can I get into the rountine of "info cpus" ?
Of course, set trace point to the function can do the work, but if I
don't know where the routine is, is there any way to step into the
rountine?
Maybe it's sometimes about the usage of gdb, but I will be very
thankful if anyone can tell me some debug tips during the QEMU
development.
Best Regards,
robert
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Qemu-devel] Re: [DEBUG] how to use GDB to debug qemu?
2010-04-27 8:24 [Qemu-devel] [DEBUG] how to use GDB to debug qemu? robert song
@ 2010-04-29 13:21 ` robert song
2010-04-29 13:22 ` robert song
0 siblings, 1 reply; 3+ messages in thread
From: robert song @ 2010-04-29 13:21 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 832 bytes --]
> Then I just run "info cpus" as following.
> (QEMU) info cpus
>
> But now how can I get into the rountine of "info cpus" ?
> Of course, set trace point to the function can do the work, but if I
> don't know where the routine is, is there any way to step into the
> rountine?
>
Regarding to the question,
I found one tool named as tracef.
http://binary.nahi.to/hogetrace/#dl
It's in Japanese.
The tool can trace the functions called by qemu while recompling
qemu with exra options like -finstrument-functions.
It's just like strace and ltrace, but used to trace userland function.
Attach it to qemu, and the result can be got.
For exmaple:
[pid 26180] do_info_cpus() at 0x08056870
so do_info_cpus is used while you call "info cpus".
Currently tracef only supports x86 arch.
Hope this will help someone.
Best Regards,
robert
[-- Attachment #2: Type: text/html, Size: 1190 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-04-29 13:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-27 8:24 [Qemu-devel] [DEBUG] how to use GDB to debug qemu? robert song
2010-04-29 13:21 ` [Qemu-devel] " robert song
2010-04-29 13:22 ` robert song
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).