Valgrinding QEMU
As of today, the Valgrind 3 development line supports applications which use self-modifying code on x86 and amd64. So it may now be possible to use Valgrind to debug/profile an unmodified build of QEMU (at least the softmmu variants).
See http://www.valgrind.org/devel/cvs_svn.html for details of how to check out and build the 3 line -- it's easy.
If anybody tries this I would be interested to hear the results.
J
---------- Forwarded Message ----------
Subject: [Valgrind-developers] valgrind: r4122 - trunk/coregrind
Date: Thursday 07 July 2005 11:05
From: [email protected]
To: [email protected]
Author: sewardj
Date: 2005-07-07 11:05:05 +0100 (Thu, 07 Jul 2005) New Revision: 4122
Log:
Support for self modifying code on unfriendly platforms (x86, amd64) via the use of self-checking translations. (Friendly platforms which have icache-invalidation instructions we can observe, such as ppc32, are already handled correctly.) This should finally fix the longstanding problem of V incorrectly handling calls of statically nested functions (a gcc extension), and more generally make it a lot easier to use V to debug dynamic code generation systems.
Since self-checking is a large performance overhead, there is some control via a command line flag:
--smc-support=none
Don't make any translations self-checking.
--smc-support=stack
Add checking code for translations taken from segments which have the SF_GROWDOWN flag set -- stacks, basically. This is the default. It should make gcc nested functions and GNU Ada work correctly with no intervention from the user.
--smc-support=all
Make all translations self-checking. This is expensive and you want to do this if you're debugging a JIT compiler or some such.
Modified:
trunk/coregrind/m_main.c
trunk/coregrind/m_options.c
trunk/coregrind/m_translate.c
trunk/coregrind/m_transtab.c
trunk/coregrind/pub_core_options.h
trunk/coregrind/pub_core_transtab.h
[... diff deleted ...]