]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
When delivering SIGFPE make sure we patch up si_addr in any siginfo
authorTom Hughes <tom@compton.nu>
Thu, 26 Aug 2004 23:09:26 +0000 (23:09 +0000)
committerTom Hughes <tom@compton.nu>
Thu, 26 Aug 2004 23:09:26 +0000 (23:09 +0000)
structure to match the address of the instruction in the client program
which caused the fault.

CCMAIL: 88115-done@bugs.kde.org

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2623

coregrind/vg_signals.c

index 683b93adf35143cd96af370c07995af1c6182e56..41c2b89b8e51ae14823d58db9570ee61ce4d19c8 100644 (file)
@@ -1024,6 +1024,9 @@ void vg_push_signal_frame ( ThreadId tid, const vki_ksiginfo_t *siginfo )
       VG_TRACK( pre_mem_write, Vg_CoreSignal, tid, "signal handler frame (siginfo)", 
                (Addr)&frame->sigInfo, sizeof(frame->sigInfo) );
       VG_(memcpy)(&frame->sigInfo, siginfo, sizeof(vki_ksiginfo_t));
+      if (sigNo == VKI_SIGFPE) {
+         frame->sigInfo._sifields._sigfault._addr = (void *)tst->m_eip;
+      }
       VG_TRACK( post_mem_write, (Addr)&frame->sigInfo, sizeof(frame->sigInfo) );
 
       VG_TRACK( pre_mem_write, Vg_CoreSignal, tid, "signal handler frame (siginfo)",