|
From: Julian S. <js...@ac...> - 2006-02-11 01:31:18
|
> I slightly changed your test program, to something that's closer to what
> we do in Wine... and it doesn't work under VG :-(
Wow. That's a really ugly hack :-)
> I left in the test code for both forms for linux signal handlers (< 2.2
> and >= 2.1.48), and both fail identically
I can't make it fail using the current svn head + the 1-line patch to
restore EIP after the handler returns:
Index: coregrind/m_sigframe/sigframe-x86-linux.c
===================================================================
--- coregrind/m_sigframe/sigframe-x86-linux.c (revision 5629)
+++ coregrind/m_sigframe/sigframe-x86-linux.c (working copy)
@@ -630,8 +630,7 @@
tst->arch.vex.guest_ESI = sc->esi;
tst->arch.vex.guest_EDI = sc->edi;
//:: tst->arch.vex.guest_eflags = sc->eflags;
-//:: tst->arch.vex.guest_EIP = sc->eip;
-
+ tst->arch.vex.guest_EIP = sc->eip;
tst->arch.vex.guest_CS = sc->cs;
tst->arch.vex.guest_SS = sc->ss;
tst->arch.vex.guest_DS = sc->ds;
Here's what I get:
sewardj@suse10:~/VgTRUNK/trunk$ uname -a
Linux suse10 2.6.13-15-default #1 Tue Sep 13 14:56:15 UTC 2005 i686 i686
i386 GNU/Linux
sewardj@suse10:~/VgTRUNK/trunk$ gcc -g -Wall -o gruesome gruesome.c
-I./Inst/include
sewardj@suse10:~/VgTRUNK/trunk$ ./gruesome
before
in handler2, setting EIP to 0x8048608
diversion 12 foo-bar!
after 12
sewardj@suse10:~/VgTRUNK/trunk$ ./Inst/bin/valgrind --tool=none ./gruesome
==7115== Nulgrind, a binary JIT-compiler
==7115== Copyright (C) 2002-2005, and GNU GPL'd, by Nicholas Nethercote.
[...]
==7115==
before
in handler2, setting EIP to 0x8048608
diversion 12 foo-bar!
after 12
==7115==
Admittedly with --tool=memcheck there are a bunch of bogus-looking
error reports, but it still runs and gets the right answer.
This is SuSE 10.0 on x86.
When you say "valgrind fails", exactly what happens?
J
|