It would be excellent for debugging if this were supported: http://wiki.winehq.org/Wine_and_Valgrind
Aha! I came across an automagic dependency on valgrind from libdrm [*]. So until there is a dedicated USE-Flag you might simply want to install valgrind and reemerge wine. [*] https://bugs.gentoo.org/show_bug.cgi?id=481120
It requires a patch too.
There already is a dedicated USE=valgrind so that unsupported architectures can conveniently mask its use.
If I read this correctly, valgrind needs the patch from https://bugs.kde.org/show_bug.cgi?id=253657 to be useful with wine; that patch is only incompatible with valgrind-3.5; and the oldest version of valgrind we have in portage is 3.7 If you got valgrind working with wine manually, please describe exactly how you did it, so that we can see if it's possible to do the same in the ebuild.
(In reply to Alexandre Rostovtsev from comment #4) > only incompatible with valgrind-3.5 Meant to say: "only compatible"
I applied the patch in http://bugs.winehq.org/show_bug.cgi?id=24164 to wine 1.4.1. Valgrind isn't working perfectly, but it's not a complete failure either. http://bugs.winehq.org/show_bug.cgi?id=24164 seems amd64-specific. I run x86.
To elaborate a bit, I get the correct addresses on the stack, but no symbols. I can correlate the addresses with those from objdump's disassembly. So, it's not very nice, but it's usable.