qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] sh4: more patches


From: Magnus Damm
Subject: Re: [Qemu-devel] sh4: more patches
Date: Wed, 4 Jul 2007 13:44:03 +0900

On 6/26/07, Blue Swirl <address@hidden> wrote:
On 6/22/07, Magnus Damm <address@hidden> wrote:
> The method used to locate emulation bugs may be of value for other
> fellow qemu hackers. I've written a small gdb script that single steps
> in an endless loop dumping registers between each instruction. Then
> I've used this script on both real target hardware (using gdbserver)
> and using the gdbstub provided by qemu. Finally the traces have been
> compared. I have more patches for this if anyone is interested...

I'm interested in the scripts, those could be helpful to get Sparc64
bugs exterminated.

Ok, to begin with I've attached two patches needed for this to work on
sh4. They are in quite hairy shape and not ready for upstream merge. I
don't plan on submitting them upstream any time in the future - they
are just useful for debugging. Anyway, I suspect you need to implement
something similar for sparc64 as well.

Together with the patches I've attached two gdb scripts.

This is how I generate a trace on the target system:

1. Boot up a recent Linux kernel on your target hardware.
2. Bring up your network interfaces.
3. Disable vma randomization and maybe vdso as well using:
 # echo 0 > /proc/sys/vm/vdso_enabled
 # echo 0 > /proc/sys/kernel/randomize_va_space
4. Start your test program on the target using gdbserver and "env -i":
 # env -i ./gdbserver localhost:1234 test-static-sh4
5. Start cross-gdb on your host and pass the target script:
 $ ./gdb -x gdb-script-target > trace-target
6. Wait until gdb exits, ignore error message

Then I do the same thing on the host using qemu-sh4:

1. Make sure vma randomization is disabled on the host:
 # echo 0 > /proc/sys/kernel/randomize_va_space
2. Start your test program using qemu-sh4 and "env -i"
 $ env -i /path/to/qemu-sh4 -g 1234 test-static-sh4
3. Start cross-gdb on your host and pass the host script:
 $ ./gdb -x gdb-script > trace
4. Wait until gdb exits, ignore error message

Then just diff the two traces! Have fun!

/ magnus

Attachment: qemu-cvs_20070703-sh4-behave-as-gdbserver.patch
Description: Binary data

Attachment: qemu-cvs_20070607-sh4-stack-placement-elf-auxv.patch
Description: Binary data

Attachment: gdb-script
Description: Binary data

Attachment: gdb-script-target
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]