You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(122) |
Nov
(152) |
Dec
(69) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(6) |
Feb
(25) |
Mar
(73) |
Apr
(82) |
May
(24) |
Jun
(25) |
Jul
(10) |
Aug
(11) |
Sep
(10) |
Oct
(54) |
Nov
(203) |
Dec
(182) |
| 2004 |
Jan
(307) |
Feb
(305) |
Mar
(430) |
Apr
(312) |
May
(187) |
Jun
(342) |
Jul
(487) |
Aug
(637) |
Sep
(336) |
Oct
(373) |
Nov
(441) |
Dec
(210) |
| 2005 |
Jan
(385) |
Feb
(480) |
Mar
(636) |
Apr
(544) |
May
(679) |
Jun
(625) |
Jul
(810) |
Aug
(838) |
Sep
(634) |
Oct
(521) |
Nov
(965) |
Dec
(543) |
| 2006 |
Jan
(494) |
Feb
(431) |
Mar
(546) |
Apr
(411) |
May
(406) |
Jun
(322) |
Jul
(256) |
Aug
(401) |
Sep
(345) |
Oct
(542) |
Nov
(308) |
Dec
(481) |
| 2007 |
Jan
(427) |
Feb
(326) |
Mar
(367) |
Apr
(255) |
May
(244) |
Jun
(204) |
Jul
(223) |
Aug
(231) |
Sep
(354) |
Oct
(374) |
Nov
(497) |
Dec
(362) |
| 2008 |
Jan
(322) |
Feb
(482) |
Mar
(658) |
Apr
(422) |
May
(476) |
Jun
(396) |
Jul
(455) |
Aug
(267) |
Sep
(280) |
Oct
(253) |
Nov
(232) |
Dec
(304) |
| 2009 |
Jan
(486) |
Feb
(470) |
Mar
(458) |
Apr
(423) |
May
(696) |
Jun
(461) |
Jul
(551) |
Aug
(575) |
Sep
(134) |
Oct
(110) |
Nov
(157) |
Dec
(102) |
| 2010 |
Jan
(226) |
Feb
(86) |
Mar
(147) |
Apr
(117) |
May
(107) |
Jun
(203) |
Jul
(193) |
Aug
(238) |
Sep
(300) |
Oct
(246) |
Nov
(23) |
Dec
(75) |
| 2011 |
Jan
(133) |
Feb
(195) |
Mar
(315) |
Apr
(200) |
May
(267) |
Jun
(293) |
Jul
(353) |
Aug
(237) |
Sep
(278) |
Oct
(611) |
Nov
(274) |
Dec
(260) |
| 2012 |
Jan
(303) |
Feb
(391) |
Mar
(417) |
Apr
(441) |
May
(488) |
Jun
(655) |
Jul
(590) |
Aug
(610) |
Sep
(526) |
Oct
(478) |
Nov
(359) |
Dec
(372) |
| 2013 |
Jan
(467) |
Feb
(226) |
Mar
(391) |
Apr
(281) |
May
(299) |
Jun
(252) |
Jul
(311) |
Aug
(352) |
Sep
(481) |
Oct
(571) |
Nov
(222) |
Dec
(231) |
| 2014 |
Jan
(185) |
Feb
(329) |
Mar
(245) |
Apr
(238) |
May
(281) |
Jun
(399) |
Jul
(382) |
Aug
(500) |
Sep
(579) |
Oct
(435) |
Nov
(487) |
Dec
(256) |
| 2015 |
Jan
(338) |
Feb
(357) |
Mar
(330) |
Apr
(294) |
May
(191) |
Jun
(108) |
Jul
(142) |
Aug
(261) |
Sep
(190) |
Oct
(54) |
Nov
(83) |
Dec
(22) |
| 2016 |
Jan
(49) |
Feb
(89) |
Mar
(33) |
Apr
(50) |
May
(27) |
Jun
(34) |
Jul
(53) |
Aug
(53) |
Sep
(98) |
Oct
(206) |
Nov
(93) |
Dec
(53) |
| 2017 |
Jan
(65) |
Feb
(82) |
Mar
(102) |
Apr
(86) |
May
(187) |
Jun
(67) |
Jul
(23) |
Aug
(93) |
Sep
(65) |
Oct
(45) |
Nov
(35) |
Dec
(17) |
| 2018 |
Jan
(26) |
Feb
(35) |
Mar
(38) |
Apr
(32) |
May
(8) |
Jun
(43) |
Jul
(27) |
Aug
(30) |
Sep
(43) |
Oct
(42) |
Nov
(38) |
Dec
(67) |
| 2019 |
Jan
(32) |
Feb
(37) |
Mar
(53) |
Apr
(64) |
May
(49) |
Jun
(18) |
Jul
(14) |
Aug
(53) |
Sep
(25) |
Oct
(30) |
Nov
(49) |
Dec
(31) |
| 2020 |
Jan
(87) |
Feb
(45) |
Mar
(37) |
Apr
(51) |
May
(99) |
Jun
(36) |
Jul
(11) |
Aug
(14) |
Sep
(20) |
Oct
(24) |
Nov
(40) |
Dec
(23) |
| 2021 |
Jan
(14) |
Feb
(53) |
Mar
(85) |
Apr
(15) |
May
(19) |
Jun
(3) |
Jul
(14) |
Aug
(1) |
Sep
(57) |
Oct
(73) |
Nov
(56) |
Dec
(22) |
| 2022 |
Jan
(3) |
Feb
(22) |
Mar
(6) |
Apr
(55) |
May
(46) |
Jun
(39) |
Jul
(15) |
Aug
(9) |
Sep
(11) |
Oct
(34) |
Nov
(20) |
Dec
(36) |
| 2023 |
Jan
(79) |
Feb
(41) |
Mar
(99) |
Apr
(169) |
May
(48) |
Jun
(16) |
Jul
(16) |
Aug
(57) |
Sep
(19) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
|
1
(1) |
2
|
|
3
(5) |
4
(7) |
5
(16) |
6
(7) |
7
(5) |
8
|
9
|
|
10
(3) |
11
(7) |
12
(7) |
13
(15) |
14
(4) |
15
(8) |
16
(10) |
|
17
(1) |
18
(7) |
19
(5) |
20
(17) |
21
(10) |
22
(5) |
23
|
|
24
|
25
|
26
(10) |
27
(21) |
28
(18) |
29
(7) |
30
(4) |
|
From: <sv...@va...> - 2011-04-11 22:14:11
|
Author: sewardj
Date: 2011-04-11 23:14:03 +0100 (Mon, 11 Apr 2011)
New Revision: 11691
Log:
Get rid of shadowing causing a perl warning. Minor fallout from
r11686.
Modified:
trunk/coregrind/link_tool_exe_darwin.in
Modified: trunk/coregrind/link_tool_exe_darwin.in
===================================================================
--- trunk/coregrind/link_tool_exe_darwin.in 2011-04-11 22:08:06 UTC (rev 11690)
+++ trunk/coregrind/link_tool_exe_darwin.in 2011-04-11 22:14:03 UTC (rev 11691)
@@ -178,7 +178,7 @@
print "link_tool_exe_darwin: $cmd\n";
-my $r = system("$cmd");
+$r = system("$cmd");
if ($r != 0) {
exit 1;
|
|
From: <sv...@va...> - 2011-04-11 22:08:15
|
Author: sewardj
Date: 2011-04-11 23:08:06 +0100 (Mon, 11 Apr 2011)
New Revision: 11690
Log:
Make MacOS builds work again following fixes for #259977
(revs 11687,8,9)
Modified:
trunk/coregrind/m_coredump/coredump-macho.c
trunk/coregrind/m_initimg/initimg-darwin.c
trunk/coregrind/m_sigframe/sigframe-amd64-darwin.c
trunk/coregrind/m_sigframe/sigframe-x86-darwin.c
trunk/coregrind/m_syswrap/syswrap-amd64-darwin.c
trunk/coregrind/m_syswrap/syswrap-darwin.c
trunk/coregrind/m_syswrap/syswrap-main.c
trunk/coregrind/m_syswrap/syswrap-x86-darwin.c
Modified: trunk/coregrind/m_coredump/coredump-macho.c
===================================================================
--- trunk/coregrind/m_coredump/coredump-macho.c 2011-04-11 21:26:27 UTC (rev 11689)
+++ trunk/coregrind/m_coredump/coredump-macho.c 2011-04-11 22:08:06 UTC (rev 11690)
@@ -33,6 +33,7 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
#include "pub_core_coredump.h"
+#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
void VG_(make_coredump)(ThreadId tid, const vki_siginfo_t *si, UInt max_size)
Modified: trunk/coregrind/m_initimg/initimg-darwin.c
===================================================================
--- trunk/coregrind/m_initimg/initimg-darwin.c 2011-04-11 21:26:27 UTC (rev 11689)
+++ trunk/coregrind/m_initimg/initimg-darwin.c 2011-04-11 22:08:06 UTC (rev 11690)
@@ -47,6 +47,7 @@
#include "pub_core_ume.h"
#include "pub_core_options.h"
#include "pub_core_tooliface.h" /* VG_TRACK */
+#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h" /* ThreadArchState */
#include "priv_initimg_pathscan.h"
#include "pub_core_initimg.h" /* self */
Modified: trunk/coregrind/m_sigframe/sigframe-amd64-darwin.c
===================================================================
--- trunk/coregrind/m_sigframe/sigframe-amd64-darwin.c 2011-04-11 21:26:27 UTC (rev 11689)
+++ trunk/coregrind/m_sigframe/sigframe-amd64-darwin.c 2011-04-11 22:08:06 UTC (rev 11690)
@@ -34,6 +34,7 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
#include "pub_core_vkiscnums.h"
+#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_libcbase.h"
Modified: trunk/coregrind/m_sigframe/sigframe-x86-darwin.c
===================================================================
--- trunk/coregrind/m_sigframe/sigframe-x86-darwin.c 2011-04-11 21:26:27 UTC (rev 11689)
+++ trunk/coregrind/m_sigframe/sigframe-x86-darwin.c 2011-04-11 22:08:06 UTC (rev 11690)
@@ -34,6 +34,7 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
#include "pub_core_vkiscnums.h"
+#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_libcbase.h"
Modified: trunk/coregrind/m_syswrap/syswrap-amd64-darwin.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-amd64-darwin.c 2011-04-11 21:26:27 UTC (rev 11689)
+++ trunk/coregrind/m_syswrap/syswrap-amd64-darwin.c 2011-04-11 22:08:06 UTC (rev 11690)
@@ -32,6 +32,7 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
+#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_xarray.h"
Modified: trunk/coregrind/m_syswrap/syswrap-darwin.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-darwin.c 2011-04-11 21:26:27 UTC (rev 11689)
+++ trunk/coregrind/m_syswrap/syswrap-darwin.c 2011-04-11 22:08:06 UTC (rev 11690)
@@ -33,6 +33,7 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
#include "pub_core_vkiscnums.h"
+#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_xarray.h"
Modified: trunk/coregrind/m_syswrap/syswrap-main.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-main.c 2011-04-11 21:26:27 UTC (rev 11689)
+++ trunk/coregrind/m_syswrap/syswrap-main.c 2011-04-11 22:08:06 UTC (rev 11690)
@@ -2267,7 +2267,7 @@
sci->status.what = SsIdle;
vg_assert(tst->sched_jmpbuf_valid);
- VG_MINIMAL_LONGJMP(tst->sched_jmpbuf, True);
+ VG_MINIMAL_LONGJMP(tst->sched_jmpbuf);
/* NOTREACHED */
vg_assert(0);
Modified: trunk/coregrind/m_syswrap/syswrap-x86-darwin.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-x86-darwin.c 2011-04-11 21:26:27 UTC (rev 11689)
+++ trunk/coregrind/m_syswrap/syswrap-x86-darwin.c 2011-04-11 22:08:06 UTC (rev 11690)
@@ -32,6 +32,7 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
+#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_xarray.h"
|
|
From: <sv...@va...> - 2011-04-11 21:26:36
|
Author: sewardj
Date: 2011-04-11 22:26:27 +0100 (Mon, 11 Apr 2011)
New Revision: 11689
Log:
Add an alternative implementation of VG_MINIMAL_{SET,LONG}JMP
for ppc32-linux, that works for gcc >= 4.4. Related to #259977.
(modified version of patch from Maynard Johnson <may...@us...>)
Modified:
trunk/coregrind/m_libcsetjmp.c
trunk/include/pub_tool_libcsetjmp.h
Modified: trunk/coregrind/m_libcsetjmp.c
===================================================================
--- trunk/coregrind/m_libcsetjmp.c 2011-04-11 18:36:34 UTC (rev 11688)
+++ trunk/coregrind/m_libcsetjmp.c 2011-04-11 21:26:27 UTC (rev 11689)
@@ -39,11 +39,13 @@
/* The only alternative implementations are for ppc{32,64}-linux. See
#259977. */
+/* ------------ ppc32-linux ------------ */
+
#if defined(VGP_ppc32_linux)
__asm__(
".text" "\n"
-"" "\n"
+"" "\n"
".global VG_MINIMAL_SETJMP" "\n" // r3 = jmp_buf
"VG_MINIMAL_SETJMP:" "\n"
" stw 0, 0(3)" "\n"
@@ -85,7 +87,7 @@
" stw 4, 132(3)" "\n"
" li 3, 0" "\n"
" blr" "\n"
-"" "\n"
+"" "\n"
".global VG_MINIMAL_LONGJMP" "\n"
@@ -135,15 +137,140 @@
" lwz 31, 124(3)" "\n"
" lwz 3, 12(3)" "\n"
" blr" "\n"
-"" "\n"
+"" "\n"
-
".previous" "\n"
);
#endif /* VGP_ppc32_linux */
+/* ------------ ppc64-linux ------------ */
+
+#if defined(VGP_ppc64_linux)
+
+__asm__(
+".section \".toc\",\"aw\"" "\n"
+
+".section \".text\"" "\n"
+".align 2" "\n"
+".p2align 4,,15" "\n"
+".globl VG_MINIMAL_SETJMP" "\n"
+
+".section \".opd\",\"aw\"" "\n"
+".align 3" "\n"
+"VG_MINIMAL_SETJMP:" "\n"
+".quad .L.VG_MINIMAL_SETJMP,.TOC.@tocbase,0" "\n"
+".previous" "\n"
+
+".type VG_MINIMAL_SETJMP, @function" "\n"
+".L.VG_MINIMAL_SETJMP:" "\n"
+" std 0, 0(3)" "\n"
+" std 1, 8(3)" "\n"
+" std 2, 16(3)" "\n"
+" std 3, 24(3)" "\n"
+" std 4, 32(3)" "\n"
+" std 5, 40(3)" "\n"
+" std 6, 48(3)" "\n"
+" std 7, 56(3)" "\n"
+" std 8, 64(3)" "\n"
+" std 9, 72(3)" "\n"
+" std 10, 80(3)" "\n"
+" std 11, 88(3)" "\n"
+" std 12, 96(3)" "\n"
+" std 13, 104(3)" "\n"
+" std 14, 112(3)" "\n"
+" std 15, 120(3)" "\n"
+" std 16, 128(3)" "\n"
+" std 17, 136(3)" "\n"
+" std 18, 144(3)" "\n"
+" std 19, 152(3)" "\n"
+" std 20, 160(3)" "\n"
+" std 21, 168(3)" "\n"
+" std 22, 176(3)" "\n"
+" std 23, 184(3)" "\n"
+" std 24, 192(3)" "\n"
+" std 25, 200(3)" "\n"
+" std 26, 208(3)" "\n"
+" std 27, 216(3)" "\n"
+" std 28, 224(3)" "\n"
+" std 29, 232(3)" "\n"
+" std 30, 240(3)" "\n"
+" std 31, 248(3)" "\n"
+ // must use a caller-save register here as scratch, hence r4
+" mflr 4" "\n"
+" std 4, 256(3)" "\n"
+" mfcr 4" "\n"
+" std 4, 264(3)" "\n"
+" li 3, 0" "\n"
+" blr" "\n"
+"" "\n"
+
+
+".globl VG_MINIMAL_LONGJMP" "\n"
+
+".section \".opd\",\"aw\"" "\n"
+".align 3" "\n"
+"VG_MINIMAL_LONGJMP:" "\n"
+".quad .L.VG_MINIMAL_LONGJMP,.TOC.@tocbase,0" "\n"
+".previous" "\n"
+
+".type VG_MINIMAL_LONGJMP, @function" "\n"
+".L.VG_MINIMAL_LONGJMP:" "\n"
+ // do r4 = 1
+ // and park it in the restore slot for r3 (the ret reg)
+" li 4, 1" "\n"
+" std 4, 24(3)" "\n"
+ // restore everything except r3
+ // then r3 last of all
+ // then blr
+" ld 0, 256(3)" "\n"
+" mtlr 0" "\n"
+" ld 0, 264(3)" "\n"
+" mtcr 0" "\n"
+" ld 0, 0(3)" "\n"
+" ld 1, 8(3)" "\n"
+" ld 2, 16(3)" "\n"
+ // r3 is done at the end
+" ld 4, 32(3)" "\n"
+" ld 5, 40(3)" "\n"
+" ld 6, 48(3)" "\n"
+" ld 7, 56(3)" "\n"
+" ld 8, 64(3)" "\n"
+" ld 9, 72(3)" "\n"
+" ld 10, 80(3)" "\n"
+" ld 11, 88(3)" "\n"
+" ld 12, 96(3)" "\n"
+" ld 13, 104(3)" "\n"
+" ld 14, 112(3)" "\n"
+" ld 15, 120(3)" "\n"
+" ld 16, 128(3)" "\n"
+" ld 17, 136(3)" "\n"
+" ld 18, 144(3)" "\n"
+" ld 19, 152(3)" "\n"
+" ld 20, 160(3)" "\n"
+" ld 21, 168(3)" "\n"
+" ld 22, 176(3)" "\n"
+" ld 23, 184(3)" "\n"
+" ld 24, 192(3)" "\n"
+" ld 25, 200(3)" "\n"
+" ld 26, 208(3)" "\n"
+" ld 27, 216(3)" "\n"
+" ld 28, 224(3)" "\n"
+" ld 29, 232(3)" "\n"
+" ld 30, 240(3)" "\n"
+" ld 31, 248(3)" "\n"
+" ld 3, 24(3)" "\n"
+" blr" "\n"
+"" "\n"
+
+".previous" "\n"
+".previous" "\n"
+);
+
+
+#endif /* VGP_ppc64_linux */
+
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/include/pub_tool_libcsetjmp.h
===================================================================
--- trunk/include/pub_tool_libcsetjmp.h 2011-04-11 18:36:34 UTC (rev 11688)
+++ trunk/include/pub_tool_libcsetjmp.h 2011-04-11 21:26:27 UTC (rev 11689)
@@ -71,6 +71,12 @@
Int VG_MINIMAL_SETJMP(VG_MINIMAL_JMP_BUF(_env));
void VG_MINIMAL_LONGJMP(VG_MINIMAL_JMP_BUF(_env));
+#elif defined(VGP_ppc64_linux)
+
+#define VG_MINIMAL_JMP_BUF(_name) ULong _name [32+1+1]
+Int VG_MINIMAL_SETJMP(VG_MINIMAL_JMP_BUF(_env));
+void VG_MINIMAL_LONGJMP(VG_MINIMAL_JMP_BUF(_env));
+
#else
/* The default implementation. */
|
|
From: Christian B. <bor...@de...> - 2011-04-11 20:36:41
|
Nightly build on sless390 ( SUSE Linux Enterprise Server 11 SP1 gcc 4.3.4 on z10 (s390x) ) Started at 2011-04-11 22:10:01 CEST Ended at 2011-04-11 22:36:32 CEST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 458 tests, 6 stderr failures, 0 stdout failures, 0 post failures == none/tests/faultstatus (stderr) helgrind/tests/tc06_two_races_xml (stderr) helgrind/tests/tc23_bogus_condwait (stderr) drd/tests/tc04_free_lock (stderr) drd/tests/tc09_bad_unlock (stderr) drd/tests/tc23_bogus_condwait (stderr) |
|
From: Christian B. <bor...@de...> - 2011-04-11 20:30:49
|
Nightly build on fedora390 ( Fedora 13/14/15 mix with gcc 3.5.3 on z196 (s390x) ) Started at 2011-04-11 22:10:01 CEST Ended at 2011-04-11 22:29:56 CEST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 458 tests, 6 stderr failures, 0 stdout failures, 0 post failures == helgrind/tests/tc06_two_races_xml (stderr) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc23_bogus_condwait (stderr) drd/tests/tc04_free_lock (stderr) drd/tests/tc09_bad_unlock (stderr) drd/tests/tc23_bogus_condwait (stderr) |
|
From: <sv...@va...> - 2011-04-11 18:36:44
|
Author: sewardj
Date: 2011-04-11 19:36:34 +0100 (Mon, 11 Apr 2011)
New Revision: 11688
Log:
Add an alternative implementation of VG_MINIMAL_{SET,LONG}JMP
for ppc32-linux, that works for gcc >= 4.4. Related to #259977.
Modified:
trunk/coregrind/m_debuginfo/readdwarf3.c
trunk/coregrind/m_libcsetjmp.c
trunk/coregrind/m_machine.c
trunk/coregrind/pub_core_threadstate.h
trunk/include/pub_tool_libcsetjmp.h
trunk/memcheck/mc_leakcheck.c
Modified: trunk/coregrind/m_debuginfo/readdwarf3.c
===================================================================
--- trunk/coregrind/m_debuginfo/readdwarf3.c 2011-04-11 16:17:51 UTC (rev 11687)
+++ trunk/coregrind/m_debuginfo/readdwarf3.c 2011-04-11 18:36:34 UTC (rev 11688)
@@ -3955,7 +3955,7 @@
static Bool d3rd_jmpbuf_valid = False;
static HChar* d3rd_jmpbuf_reason = NULL;
-static VG_MINIMAL_JMP_BUF d3rd_jmpbuf;
+static VG_MINIMAL_JMP_BUF(d3rd_jmpbuf);
static __attribute__((noreturn)) void barf ( HChar* reason ) {
vg_assert(d3rd_jmpbuf_valid);
Modified: trunk/coregrind/m_libcsetjmp.c
===================================================================
--- trunk/coregrind/m_libcsetjmp.c 2011-04-11 16:17:51 UTC (rev 11687)
+++ trunk/coregrind/m_libcsetjmp.c 2011-04-11 18:36:34 UTC (rev 11688)
@@ -36,9 +36,114 @@
/* See include/pub_tool_libcsetjmp.h for background and rationale. */
-/* No alternative implementations at present. */
+/* The only alternative implementations are for ppc{32,64}-linux. See
+ #259977. */
+#if defined(VGP_ppc32_linux)
+__asm__(
+".text" "\n"
+"" "\n"
+".global VG_MINIMAL_SETJMP" "\n" // r3 = jmp_buf
+"VG_MINIMAL_SETJMP:" "\n"
+" stw 0, 0(3)" "\n"
+" stw 1, 4(3)" "\n"
+" stw 2, 8(3)" "\n"
+" stw 3, 12(3)" "\n"
+" stw 4, 16(3)" "\n"
+" stw 5, 20(3)" "\n"
+" stw 6, 24(3)" "\n"
+" stw 7, 28(3)" "\n"
+" stw 8, 32(3)" "\n"
+" stw 9, 36(3)" "\n"
+" stw 10, 40(3)" "\n"
+" stw 11, 44(3)" "\n"
+" stw 12, 48(3)" "\n"
+" stw 13, 52(3)" "\n"
+" stw 14, 56(3)" "\n"
+" stw 15, 60(3)" "\n"
+" stw 16, 64(3)" "\n"
+" stw 17, 68(3)" "\n"
+" stw 18, 72(3)" "\n"
+" stw 19, 76(3)" "\n"
+" stw 20, 80(3)" "\n"
+" stw 21, 84(3)" "\n"
+" stw 22, 88(3)" "\n"
+" stw 23, 92(3)" "\n"
+" stw 24, 96(3)" "\n"
+" stw 25, 100(3)" "\n"
+" stw 26, 104(3)" "\n"
+" stw 27, 108(3)" "\n"
+" stw 28, 112(3)" "\n"
+" stw 29, 116(3)" "\n"
+" stw 30, 120(3)" "\n"
+" stw 31, 124(3)" "\n"
+ // must use a caller-save register here as scratch, hence r4
+" mflr 4" "\n"
+" stw 4, 128(3)" "\n"
+" mfcr 4" "\n"
+" stw 4, 132(3)" "\n"
+" li 3, 0" "\n"
+" blr" "\n"
+"" "\n"
+
+
+".global VG_MINIMAL_LONGJMP" "\n"
+"VG_MINIMAL_LONGJMP:" "\n" // r3 = jmp_buf
+ // do r4 = 1
+ // and park it in the restore slot for r3 (the ret reg)
+" li 4, 1" "\n"
+" stw 4, 12(3)" "\n"
+ // restore everything except r3
+ // then r3 last of all
+ // then blr
+" lwz 0, 128(3)" "\n"
+" mtlr 0" "\n"
+" lwz 0, 132(3)" "\n"
+" mtcr 0" "\n"
+" lwz 0, 0(3)" "\n"
+" lwz 1, 4(3)" "\n"
+" lwz 2, 8(3)" "\n"
+ // r3 is done at the end
+" lwz 4, 16(3)" "\n"
+" lwz 5, 20(3)" "\n"
+" lwz 6, 24(3)" "\n"
+" lwz 7, 28(3)" "\n"
+" lwz 8, 32(3)" "\n"
+" lwz 9, 36(3)" "\n"
+" lwz 10, 40(3)" "\n"
+" lwz 11, 44(3)" "\n"
+" lwz 12, 48(3)" "\n"
+" lwz 13, 52(3)" "\n"
+" lwz 14, 56(3)" "\n"
+" lwz 15, 60(3)" "\n"
+" lwz 16, 64(3)" "\n"
+" lwz 17, 68(3)" "\n"
+" lwz 18, 72(3)" "\n"
+" lwz 19, 76(3)" "\n"
+" lwz 20, 80(3)" "\n"
+" lwz 21, 84(3)" "\n"
+" lwz 22, 88(3)" "\n"
+" lwz 23, 92(3)" "\n"
+" lwz 24, 96(3)" "\n"
+" lwz 25, 100(3)" "\n"
+" lwz 26, 104(3)" "\n"
+" lwz 27, 108(3)" "\n"
+" lwz 28, 112(3)" "\n"
+" lwz 29, 116(3)" "\n"
+" lwz 30, 120(3)" "\n"
+" lwz 31, 124(3)" "\n"
+" lwz 3, 12(3)" "\n"
+" blr" "\n"
+"" "\n"
+
+
+".previous" "\n"
+);
+
+#endif /* VGP_ppc32_linux */
+
+
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_machine.c
===================================================================
--- trunk/coregrind/m_machine.c 2011-04-11 16:17:51 UTC (rev 11687)
+++ trunk/coregrind/m_machine.c 2011-04-11 18:36:34 UTC (rev 11688)
@@ -423,7 +423,7 @@
#if defined(VGA_ppc32) || defined(VGA_ppc64) \
|| defined(VGA_arm) || defined(VGA_s390x)
#include "pub_tool_libcsetjmp.h"
-static VG_MINIMAL_JMP_BUF env_unsup_insn;
+static VG_MINIMAL_JMP_BUF(env_unsup_insn);
static void handler_unsup_insn ( Int x ) {
VG_MINIMAL_LONGJMP(env_unsup_insn);
}
Modified: trunk/coregrind/pub_core_threadstate.h
===================================================================
--- trunk/coregrind/pub_core_threadstate.h 2011-04-11 16:17:51 UTC (rev 11687)
+++ trunk/coregrind/pub_core_threadstate.h 2011-04-11 18:36:34 UTC (rev 11688)
@@ -356,7 +356,7 @@
/* Per-thread jmp_buf to resume scheduler after a signal */
Bool sched_jmpbuf_valid;
- VG_MINIMAL_JMP_BUF sched_jmpbuf;
+ VG_MINIMAL_JMP_BUF(sched_jmpbuf);
}
ThreadState;
Modified: trunk/include/pub_tool_libcsetjmp.h
===================================================================
--- trunk/include/pub_tool_libcsetjmp.h 2011-04-11 16:17:51 UTC (rev 11687)
+++ trunk/include/pub_tool_libcsetjmp.h 2011-04-11 18:36:34 UTC (rev 11688)
@@ -64,10 +64,21 @@
second function (eg, VG_(minimal_setjmp)) doesn't seem to work for
whatever reason -- returns via a VG_(minimal_longjmp) go wrong.
*/
-#define VG_MINIMAL_JMP_BUF jmp_buf
+
+#if defined(VGP_ppc32_linux)
+
+#define VG_MINIMAL_JMP_BUF(_name) UInt _name [32+1+1]
+Int VG_MINIMAL_SETJMP(VG_MINIMAL_JMP_BUF(_env));
+void VG_MINIMAL_LONGJMP(VG_MINIMAL_JMP_BUF(_env));
+
+#else
+
+/* The default implementation. */
+#define VG_MINIMAL_JMP_BUF(_name) jmp_buf _name
#define VG_MINIMAL_SETJMP(_env) __builtin_setjmp((_env))
#define VG_MINIMAL_LONGJMP(_env) __builtin_longjmp((_env),1)
+#endif
#endif // __PUB_TOOL_LIBCSETJMP_H
Modified: trunk/memcheck/mc_leakcheck.c
===================================================================
--- trunk/memcheck/mc_leakcheck.c 2011-04-11 16:17:51 UTC (rev 11687)
+++ trunk/memcheck/mc_leakcheck.c 2011-04-11 18:36:34 UTC (rev 11688)
@@ -635,7 +635,7 @@
}
-static VG_MINIMAL_JMP_BUF memscan_jmpbuf;
+static VG_MINIMAL_JMP_BUF(memscan_jmpbuf);
static
void scan_all_valid_memory_catcher ( Int sigNo, Addr addr )
|
Author: sewardj
Date: 2011-04-11 17:17:51 +0100 (Mon, 11 Apr 2011)
New Revision: 11687
Log:
Create new module m_libcsetjmp, which wraps up uses of
__builtin_setjmp and __builtin_longjmp so that they can be selectively
replaced, on a platform by platform basis. Does not change any
functionality. Related to #259977.
Added:
trunk/coregrind/m_libcsetjmp.c
trunk/coregrind/pub_core_libcsetjmp.h
trunk/include/pub_tool_libcsetjmp.h
Modified:
trunk/coregrind/Makefile.am
trunk/coregrind/m_coredump/coredump-elf.c
trunk/coregrind/m_debugger.c
trunk/coregrind/m_debuginfo/debuginfo.c
trunk/coregrind/m_debuginfo/readdwarf3.c
trunk/coregrind/m_errormgr.c
trunk/coregrind/m_execontext.c
trunk/coregrind/m_initimg/initimg-linux.c
trunk/coregrind/m_initimg/initimg-pathscan.c
trunk/coregrind/m_libcassert.c
trunk/coregrind/m_machine.c
trunk/coregrind/m_main.c
trunk/coregrind/m_mallocfree.c
trunk/coregrind/m_scheduler/scheduler.c
trunk/coregrind/m_sigframe/sigframe-amd64-linux.c
trunk/coregrind/m_sigframe/sigframe-arm-linux.c
trunk/coregrind/m_sigframe/sigframe-ppc32-linux.c
trunk/coregrind/m_sigframe/sigframe-ppc64-linux.c
trunk/coregrind/m_sigframe/sigframe-s390x-linux.c
trunk/coregrind/m_sigframe/sigframe-x86-linux.c
trunk/coregrind/m_signals.c
trunk/coregrind/m_stacktrace.c
trunk/coregrind/m_syswrap/syswrap-amd64-linux.c
trunk/coregrind/m_syswrap/syswrap-arm-linux.c
trunk/coregrind/m_syswrap/syswrap-generic.c
trunk/coregrind/m_syswrap/syswrap-linux-variants.c
trunk/coregrind/m_syswrap/syswrap-linux.c
trunk/coregrind/m_syswrap/syswrap-main.c
trunk/coregrind/m_syswrap/syswrap-ppc32-linux.c
trunk/coregrind/m_syswrap/syswrap-ppc64-linux.c
trunk/coregrind/m_syswrap/syswrap-s390x-linux.c
trunk/coregrind/m_syswrap/syswrap-x86-linux.c
trunk/coregrind/m_threadstate.c
trunk/coregrind/m_translate.c
trunk/coregrind/pub_core_basics.h
trunk/coregrind/pub_core_threadstate.h
trunk/include/Makefile.am
trunk/memcheck/mc_leakcheck.c
Modified: trunk/coregrind/Makefile.am
===================================================================
--- trunk/coregrind/Makefile.am 2011-04-06 11:17:16 UTC (rev 11686)
+++ trunk/coregrind/Makefile.am 2011-04-11 16:17:51 UTC (rev 11687)
@@ -154,6 +154,7 @@
pub_core_libcfile.h \
pub_core_libcprint.h \
pub_core_libcproc.h \
+ pub_core_libcsetjmp.h \
pub_core_libcsignal.h \
pub_core_mach.h \
pub_core_machine.h \
@@ -239,6 +240,7 @@
m_libcfile.c \
m_libcprint.c \
m_libcproc.c \
+ m_libcsetjmp.c \
m_libcsignal.c \
m_machine.c \
m_main.c \
Modified: trunk/coregrind/m_coredump/coredump-elf.c
===================================================================
--- trunk/coregrind/m_coredump/coredump-elf.c 2011-04-06 11:17:16 UTC (rev 11686)
+++ trunk/coregrind/m_coredump/coredump-elf.c 2011-04-11 16:17:51 UTC (rev 11687)
@@ -42,6 +42,7 @@
#include "pub_core_libcproc.h" // VG_(geteuid), VG_(getegid)
#include "pub_core_libcassert.h" // VG_(exit), vg_assert
#include "pub_core_mallocfree.h" // VG_(malloc), VG_(free)
+#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_xarray.h"
#include "pub_core_clientstate.h"
Modified: trunk/coregrind/m_debugger.c
===================================================================
--- trunk/coregrind/m_debugger.c 2011-04-06 11:17:16 UTC (rev 11686)
+++ trunk/coregrind/m_debugger.c 2011-04-11 16:17:51 UTC (rev 11687)
@@ -30,6 +30,7 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
+#include "pub_core_libcsetjmp.h"
#include "pub_core_threadstate.h"
#include "pub_core_xarray.h"
#include "pub_core_clientstate.h"
Modified: trunk/coregrind/m_debuginfo/debuginfo.c
===================================================================
--- trunk/coregrind/m_debuginfo/debuginfo.c 2011-04-06 11:17:16 UTC (rev 11686)
+++ trunk/coregrind/m_debuginfo/debuginfo.c 2011-04-11 16:17:51 UTC (rev 11687)
@@ -31,6 +31,7 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
+#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_debuginfo.h" /* self */
#include "pub_core_demangle.h"
Modified: trunk/coregrind/m_debuginfo/readdwarf3.c
===================================================================
--- trunk/coregrind/m_debuginfo/readdwarf3.c 2011-04-06 11:17:16 UTC (rev 11686)
+++ trunk/coregrind/m_debuginfo/readdwarf3.c 2011-04-11 16:17:51 UTC (rev 11687)
@@ -139,6 +139,7 @@
#include "pub_core_libcbase.h"
#include "pub_core_libcassert.h"
#include "pub_core_libcprint.h"
+#include "pub_core_libcsetjmp.h" // setjmp facilities
#include "pub_core_options.h"
#include "pub_core_tooliface.h" /* VG_(needs) */
#include "pub_core_xarray.h"
@@ -3952,18 +3953,14 @@
/*--- ---*/
/*------------------------------------------------------------*/
-/* --- !!! --- EXTERNAL HEADERS start --- !!! --- */
-#include <setjmp.h> /* For jmp_buf */
-/* --- !!! --- EXTERNAL HEADERS end --- !!! --- */
+static Bool d3rd_jmpbuf_valid = False;
+static HChar* d3rd_jmpbuf_reason = NULL;
+static VG_MINIMAL_JMP_BUF d3rd_jmpbuf;
-static Bool d3rd_jmpbuf_valid = False;
-static HChar* d3rd_jmpbuf_reason = NULL;
-static jmp_buf d3rd_jmpbuf;
-
static __attribute__((noreturn)) void barf ( HChar* reason ) {
vg_assert(d3rd_jmpbuf_valid);
d3rd_jmpbuf_reason = reason;
- __builtin_longjmp(&d3rd_jmpbuf, 1);
+ VG_MINIMAL_LONGJMP(d3rd_jmpbuf);
/*NOTREACHED*/
vg_assert(0);
}
@@ -3991,7 +3988,7 @@
vg_assert(d3rd_jmpbuf_reason == NULL);
d3rd_jmpbuf_valid = True;
- jumped = __builtin_setjmp(&d3rd_jmpbuf);
+ jumped = VG_MINIMAL_SETJMP(d3rd_jmpbuf);
if (jumped == 0) {
/* try this ... */
new_dwarf3_reader_wrk( di, barf,
Modified: trunk/coregrind/m_errormgr.c
===================================================================
--- trunk/coregrind/m_errormgr.c 2011-04-06 11:17:16 UTC (rev 11686)
+++ trunk/coregrind/m_errormgr.c 2011-04-11 16:17:51 UTC (rev 11687)
@@ -30,6 +30,7 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
+#include "pub_core_libcsetjmp.h"
#include "pub_core_threadstate.h" // For VG_N_THREADS
#include "pub_core_debugger.h"
#include "pub_core_debuginfo.h"
Modified: trunk/coregrind/m_execontext.c
===================================================================
--- trunk/coregrind/m_execontext.c 2011-04-06 11:17:16 UTC (rev 11686)
+++ trunk/coregrind/m_execontext.c 2011-04-11 16:17:51 UTC (rev 11687)
@@ -37,6 +37,7 @@
#include "pub_core_stacktrace.h"
#include "pub_core_machine.h" // VG_(get_IP)
#include "pub_core_vki.h" // To keep pub_core_threadstate.h happy
+#include "pub_core_libcsetjmp.h" // Ditto
#include "pub_core_threadstate.h" // VG_(is_valid_tid)
#include "pub_core_execontext.h" // self
Modified: trunk/coregrind/m_initimg/initimg-linux.c
===================================================================
--- trunk/coregrind/m_initimg/initimg-linux.c 2011-04-06 11:17:16 UTC (rev 11686)
+++ trunk/coregrind/m_initimg/initimg-linux.c 2011-04-11 16:17:51 UTC (rev 11687)
@@ -48,6 +48,7 @@
#include "pub_core_options.h"
#include "pub_core_syscall.h"
#include "pub_core_tooliface.h" /* VG_TRACK */
+#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h" /* ThreadArchState */
#include "priv_initimg_pathscan.h"
#include "pub_core_initimg.h" /* self */
Modified: trunk/coregrind/m_initimg/initimg-pathscan.c
===================================================================
--- trunk/coregrind/m_initimg/initimg-pathscan.c 2011-04-06 11:17:16 UTC (rev 11686)
+++ trunk/coregrind/m_initimg/initimg-pathscan.c 2011-04-11 16:17:51 UTC (rev 11687)
@@ -44,7 +44,6 @@
#include "pub_core_ume.h"
#include "pub_core_options.h"
#include "pub_core_tooliface.h" /* VG_TRACK */
-#include "pub_core_threadstate.h" /* ThreadArchState */
#include "pub_core_initimg.h" /* self */
#include "priv_initimg_pathscan.h"
Modified: trunk/coregrind/m_libcassert.c
===================================================================
--- trunk/coregrind/m_libcassert.c 2011-04-06 11:17:16 UTC (rev 11686)
+++ trunk/coregrind/m_libcassert.c 2011-04-11 16:17:51 UTC (rev 11687)
@@ -31,6 +31,7 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
#include "pub_core_vkiscnums.h"
+#include "pub_core_libcsetjmp.h" // to keep threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_libcbase.h"
#include "pub_core_libcassert.h"
Added: trunk/coregrind/m_libcsetjmp.c
===================================================================
--- trunk/coregrind/m_libcsetjmp.c (rev 0)
+++ trunk/coregrind/m_libcsetjmp.c 2011-04-11 16:17:51 UTC (rev 11687)
@@ -0,0 +1,44 @@
+
+/*--------------------------------------------------------------------*/
+/*--- A minimal setjmp/longjmp implementation. m_libcsetjmp.c ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ This file is part of Valgrind, a dynamic binary instrumentation
+ framework.
+
+ Copyright (C) 2010-2010 Mozilla Inc
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The GNU General Public License is contained in the file COPYING.
+*/
+
+/* Contributed by Julian Seward <js...@ac...> */
+
+
+#include "pub_core_basics.h"
+#include "pub_core_libcsetjmp.h" /* self */
+
+
+/* See include/pub_tool_libcsetjmp.h for background and rationale. */
+
+/* No alternative implementations at present. */
+
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_machine.c
===================================================================
--- trunk/coregrind/m_machine.c 2011-04-06 11:17:16 UTC (rev 11686)
+++ trunk/coregrind/m_machine.c 2011-04-11 16:17:51 UTC (rev 11687)
@@ -30,6 +30,7 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
+#include "pub_core_libcsetjmp.h" // setjmp facilities
#include "pub_core_threadstate.h"
#include "pub_core_libcassert.h"
#include "pub_core_libcbase.h"
@@ -418,11 +419,14 @@
/* fixs390: anything for s390x here ? */
/* For hwcaps detection on ppc32/64 and arm we'll need to do SIGILL
- testing, so we need a jmp_buf. */
-#if defined(VGA_ppc32) || defined(VGA_ppc64) || defined(VGA_arm) || defined(VGA_s390x)
-#include <setjmp.h> // For jmp_buf
-static jmp_buf env_unsup_insn;
-static void handler_unsup_insn ( Int x ) { __builtin_longjmp(env_unsup_insn,1); }
+ testing, so we need a VG_MINIMAL_JMP_BUF. */
+#if defined(VGA_ppc32) || defined(VGA_ppc64) \
+ || defined(VGA_arm) || defined(VGA_s390x)
+#include "pub_tool_libcsetjmp.h"
+static VG_MINIMAL_JMP_BUF env_unsup_insn;
+static void handler_unsup_insn ( Int x ) {
+ VG_MINIMAL_LONGJMP(env_unsup_insn);
+}
#endif
@@ -462,7 +466,7 @@
vg_assert(dcbz_szB == 32 || dcbz_szB == 64 || dcbz_szB == 128);
/* dcbzl clears 128B on G5/PPC970, and usually 32B on other platforms */
- if (__builtin_setjmp(env_unsup_insn)) {
+ if (VG_MINIMAL_SETJMP(env_unsup_insn)) {
dcbzl_szB = 0; /* indicates unsupported */
}
else {
@@ -689,7 +693,7 @@
/* standard FP insns */
have_F = True;
- if (__builtin_setjmp(env_unsup_insn)) {
+ if (VG_MINIMAL_SETJMP(env_unsup_insn)) {
have_F = False;
} else {
__asm__ __volatile__(".long 0xFC000090"); /*fmr 0,0 */
@@ -697,7 +701,7 @@
/* Altivec insns */
have_V = True;
- if (__builtin_setjmp(env_unsup_insn)) {
+ if (VG_MINIMAL_SETJMP(env_unsup_insn)) {
have_V = False;
} else {
/* Unfortunately some older assemblers don't speak Altivec (or
@@ -710,7 +714,7 @@
/* General-Purpose optional (fsqrt, fsqrts) */
have_FX = True;
- if (__builtin_setjmp(env_unsup_insn)) {
+ if (VG_MINIMAL_SETJMP(env_unsup_insn)) {
have_FX = False;
} else {
__asm__ __volatile__(".long 0xFC00002C"); /*fsqrt 0,0 */
@@ -718,7 +722,7 @@
/* Graphics optional (stfiwx, fres, frsqrte, fsel) */
have_GX = True;
- if (__builtin_setjmp(env_unsup_insn)) {
+ if (VG_MINIMAL_SETJMP(env_unsup_insn)) {
have_GX = False;
} else {
__asm__ __volatile__(".long 0xFC000034"); /* frsqrte 0,0 */
@@ -808,7 +812,7 @@
/* standard FP insns */
have_F = True;
- if (__builtin_setjmp(env_unsup_insn)) {
+ if (VG_MINIMAL_SETJMP(env_unsup_insn)) {
have_F = False;
} else {
__asm__ __volatile__("fmr 0,0");
@@ -816,7 +820,7 @@
/* Altivec insns */
have_V = True;
- if (__builtin_setjmp(env_unsup_insn)) {
+ if (VG_MINIMAL_SETJMP(env_unsup_insn)) {
have_V = False;
} else {
__asm__ __volatile__(".long 0x10000484"); /*vor 0,0,0*/
@@ -824,7 +828,7 @@
/* General-Purpose optional (fsqrt, fsqrts) */
have_FX = True;
- if (__builtin_setjmp(env_unsup_insn)) {
+ if (VG_MINIMAL_SETJMP(env_unsup_insn)) {
have_FX = False;
} else {
__asm__ __volatile__(".long 0xFC00002C"); /*fsqrt 0,0*/
@@ -832,7 +836,7 @@
/* Graphics optional (stfiwx, fres, frsqrte, fsel) */
have_GX = True;
- if (__builtin_setjmp(env_unsup_insn)) {
+ if (VG_MINIMAL_SETJMP(env_unsup_insn)) {
have_GX = False;
} else {
__asm__ __volatile__(".long 0xFC000034"); /*frsqrte 0,0*/
@@ -899,7 +903,7 @@
is not supported on z900. */
have_LDISP = True;
- if (__builtin_setjmp(env_unsup_insn)) {
+ if (VG_MINIMAL_SETJMP(env_unsup_insn)) {
have_LDISP = False;
} else {
/* BASR loads the address of the next insn into r1. Needed to avoid
@@ -910,7 +914,7 @@
}
have_EIMM = True;
- if (__builtin_setjmp(env_unsup_insn)) {
+ if (VG_MINIMAL_SETJMP(env_unsup_insn)) {
have_EIMM = False;
} else {
__asm__ __volatile__(".long 0xc0090000\n\t" /* iilf r0,0 */
@@ -918,7 +922,7 @@
}
have_GIE = True;
- if (__builtin_setjmp(env_unsup_insn)) {
+ if (VG_MINIMAL_SETJMP(env_unsup_insn)) {
have_GIE = False;
} else {
__asm__ __volatile__(".long 0xc2010000\n\t" /* msfi r0,0 */
@@ -926,7 +930,7 @@
}
have_DFP = True;
- if (__builtin_setjmp(env_unsup_insn)) {
+ if (VG_MINIMAL_SETJMP(env_unsup_insn)) {
have_DFP = False;
} else {
__asm__ __volatile__(".long 0xb3d20000"
@@ -1004,7 +1008,7 @@
/* VFP insns */
have_VFP = True;
- if (__builtin_setjmp(env_unsup_insn)) {
+ if (VG_MINIMAL_SETJMP(env_unsup_insn)) {
have_VFP = False;
} else {
__asm__ __volatile__(".word 0xEEB02B42"); /* VMOV.F64 d2, d2 */
@@ -1016,7 +1020,7 @@
/* NEON insns */
have_NEON = True;
- if (__builtin_setjmp(env_unsup_insn)) {
+ if (VG_MINIMAL_SETJMP(env_unsup_insn)) {
have_NEON = False;
} else {
__asm__ __volatile__(".word 0xF2244154"); /* VMOV q2, q2 */
@@ -1026,7 +1030,7 @@
archlevel = 5; /* v5 will be base level */
if (archlevel < 7) {
archlevel = 7;
- if (__builtin_setjmp(env_unsup_insn)) {
+ if (VG_MINIMAL_SETJMP(env_unsup_insn)) {
archlevel = 5;
} else {
__asm__ __volatile__(".word 0xF45FF000"); /* PLI [PC,#-0] */
@@ -1034,7 +1038,7 @@
}
if (archlevel < 6) {
archlevel = 6;
- if (__builtin_setjmp(env_unsup_insn)) {
+ if (VG_MINIMAL_SETJMP(env_unsup_insn)) {
archlevel = 5;
} else {
__asm__ __volatile__(".word 0xE6822012"); /* PKHBT r2, r2, r2 */
Modified: trunk/coregrind/m_main.c
===================================================================
--- trunk/coregrind/m_main.c 2011-04-06 11:17:16 UTC (rev 11686)
+++ trunk/coregrind/m_main.c 2011-04-11 16:17:51 UTC (rev 11687)
@@ -31,6 +31,7 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
#include "pub_core_vkiscnums.h"
+#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_xarray.h"
#include "pub_core_clientstate.h"
Modified: trunk/coregrind/m_mallocfree.c
===================================================================
--- trunk/coregrind/m_mallocfree.c 2011-04-06 11:17:16 UTC (rev 11686)
+++ trunk/coregrind/m_mallocfree.c 2011-04-11 16:17:51 UTC (rev 11687)
@@ -38,6 +38,7 @@
#include "pub_core_libcprint.h"
#include "pub_core_mallocfree.h"
#include "pub_core_options.h"
+#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h" // For VG_INVALID_THREADID
#include "pub_core_tooliface.h"
#include "valgrind.h"
Modified: trunk/coregrind/m_scheduler/scheduler.c
===================================================================
--- trunk/coregrind/m_scheduler/scheduler.c 2011-04-06 11:17:16 UTC (rev 11686)
+++ trunk/coregrind/m_scheduler/scheduler.c 2011-04-11 16:17:51 UTC (rev 11687)
@@ -61,6 +61,7 @@
#include "pub_core_debuglog.h"
#include "pub_core_vki.h"
#include "pub_core_vkiscnums.h" // __NR_sched_yield
+#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_clreq.h" // for VG_USERREQ__*
@@ -581,7 +582,7 @@
do { \
ThreadState * volatile _qq_tst = VG_(get_ThreadState)(tid); \
\
- (jumped) = __builtin_setjmp(_qq_tst->sched_jmpbuf); \
+ (jumped) = VG_MINIMAL_SETJMP(_qq_tst->sched_jmpbuf); \
if ((jumped) == 0) { \
vg_assert(!_qq_tst->sched_jmpbuf_valid); \
_qq_tst->sched_jmpbuf_valid = True; \
Modified: trunk/coregrind/m_sigframe/sigframe-amd64-linux.c
===================================================================
--- trunk/coregrind/m_sigframe/sigframe-amd64-linux.c 2011-04-06 11:17:16 UTC (rev 11686)
+++ trunk/coregrind/m_sigframe/sigframe-amd64-linux.c 2011-04-11 16:17:51 UTC (rev 11687)
@@ -33,6 +33,7 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
+#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_libcbase.h"
Modified: trunk/coregrind/m_sigframe/sigframe-arm-linux.c
===================================================================
--- trunk/coregrind/m_sigframe/sigframe-arm-linux.c 2011-04-06 11:17:16 UTC (rev 11686)
+++ trunk/coregrind/m_sigframe/sigframe-arm-linux.c 2011-04-11 16:17:51 UTC (rev 11687)
@@ -38,6 +38,7 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
#include "pub_core_vkiscnums.h"
+#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_libcbase.h"
Modified: trunk/coregrind/m_sigframe/sigframe-ppc32-linux.c
===================================================================
--- trunk/coregrind/m_sigframe/sigframe-ppc32-linux.c 2011-04-06 11:17:16 UTC (rev 11686)
+++ trunk/coregrind/m_sigframe/sigframe-ppc32-linux.c 2011-04-11 16:17:51 UTC (rev 11687)
@@ -36,6 +36,7 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
#include "pub_core_vkiscnums.h"
+#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_libcbase.h"
Modified: trunk/coregrind/m_sigframe/sigframe-ppc64-linux.c
===================================================================
--- trunk/coregrind/m_sigframe/sigframe-ppc64-linux.c 2011-04-06 11:17:16 UTC (rev 11686)
+++ trunk/coregrind/m_sigframe/sigframe-ppc64-linux.c 2011-04-11 16:17:51 UTC (rev 11687)
@@ -36,6 +36,7 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
#include "pub_core_vkiscnums.h"
+#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_libcbase.h"
Modified: trunk/coregrind/m_sigframe/sigframe-s390x-linux.c
===================================================================
--- trunk/coregrind/m_sigframe/sigframe-s390x-linux.c 2011-04-06 11:17:16 UTC (rev 11686)
+++ trunk/coregrind/m_sigframe/sigframe-s390x-linux.c 2011-04-11 16:17:51 UTC (rev 11687)
@@ -33,6 +33,7 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
#include "pub_core_vkiscnums.h"
+#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_libcbase.h"
Modified: trunk/coregrind/m_sigframe/sigframe-x86-linux.c
===================================================================
--- trunk/coregrind/m_sigframe/sigframe-x86-linux.c 2011-04-06 11:17:16 UTC (rev 11686)
+++ trunk/coregrind/m_sigframe/sigframe-x86-linux.c 2011-04-11 16:17:51 UTC (rev 11687)
@@ -33,6 +33,7 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
+#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_aspacemgr.h" /* find_segment */
#include "pub_core_libcbase.h"
Modified: trunk/coregrind/m_signals.c
===================================================================
--- trunk/coregrind/m_signals.c 2011-04-06 11:17:16 UTC (rev 11686)
+++ trunk/coregrind/m_signals.c 2011-04-11 16:17:51 UTC (rev 11687)
@@ -197,6 +197,7 @@
#include "pub_core_vki.h"
#include "pub_core_vkiscnums.h"
#include "pub_core_debuglog.h"
+#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_xarray.h"
#include "pub_core_clientstate.h"
@@ -1779,7 +1780,7 @@
if (tst->sched_jmpbuf_valid) {
/* Can't continue; must longjmp back to the scheduler and thus
enter the sighandler immediately. */
- __builtin_longjmp(tst->sched_jmpbuf, True);
+ VG_MINIMAL_LONGJMP(tst->sched_jmpbuf);
}
}
Modified: trunk/coregrind/m_stacktrace.c
===================================================================
--- trunk/coregrind/m_stacktrace.c 2011-04-06 11:17:16 UTC (rev 11686)
+++ trunk/coregrind/m_stacktrace.c 2011-04-11 16:17:51 UTC (rev 11687)
@@ -30,6 +30,7 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
+#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_debuginfo.h" // XXX: circular dependency
#include "pub_core_aspacemgr.h" // For VG_(is_addressable)()
Modified: trunk/coregrind/m_syswrap/syswrap-amd64-linux.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-amd64-linux.c 2011-04-06 11:17:16 UTC (rev 11686)
+++ trunk/coregrind/m_syswrap/syswrap-amd64-linux.c 2011-04-11 16:17:51 UTC (rev 11687)
@@ -33,6 +33,7 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
#include "pub_core_vkiscnums.h"
+#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_debuglog.h"
Modified: trunk/coregrind/m_syswrap/syswrap-arm-linux.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-arm-linux.c 2011-04-06 11:17:16 UTC (rev 11686)
+++ trunk/coregrind/m_syswrap/syswrap-arm-linux.c 2011-04-11 16:17:51 UTC (rev 11687)
@@ -35,6 +35,7 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
#include "pub_core_vkiscnums.h"
+#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_debuglog.h"
Modified: trunk/coregrind/m_syswrap/syswrap-generic.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-generic.c 2011-04-06 11:17:16 UTC (rev 11686)
+++ trunk/coregrind/m_syswrap/syswrap-generic.c 2011-04-11 16:17:51 UTC (rev 11687)
@@ -34,6 +34,7 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
#include "pub_core_vkiscnums.h"
+#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_debuginfo.h" // VG_(di_notify_*)
#include "pub_core_aspacemgr.h"
Modified: trunk/coregrind/m_syswrap/syswrap-linux-variants.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-linux-variants.c 2011-04-06 11:17:16 UTC (rev 11686)
+++ trunk/coregrind/m_syswrap/syswrap-linux-variants.c 2011-04-11 16:17:51 UTC (rev 11687)
@@ -48,6 +48,7 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
+#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_debuginfo.h" // VG_(di_notify_*)
Modified: trunk/coregrind/m_syswrap/syswrap-linux.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-linux.c 2011-04-06 11:17:16 UTC (rev 11686)
+++ trunk/coregrind/m_syswrap/syswrap-linux.c 2011-04-11 16:17:51 UTC (rev 11687)
@@ -33,6 +33,7 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
#include "pub_core_vkiscnums.h"
+#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_debuginfo.h" // VG_(di_notify_*)
Modified: trunk/coregrind/m_syswrap/syswrap-main.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-main.c 2011-04-06 11:17:16 UTC (rev 11686)
+++ trunk/coregrind/m_syswrap/syswrap-main.c 2011-04-11 16:17:51 UTC (rev 11687)
@@ -34,6 +34,7 @@
#include "pub_core_aspacemgr.h"
#include "pub_core_vki.h"
#include "pub_core_vkiscnums.h"
+#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_libcbase.h"
#include "pub_core_libcassert.h"
@@ -2266,7 +2267,7 @@
sci->status.what = SsIdle;
vg_assert(tst->sched_jmpbuf_valid);
- __builtin_longjmp(tst->sched_jmpbuf, True);
+ VG_MINIMAL_LONGJMP(tst->sched_jmpbuf, True);
/* NOTREACHED */
vg_assert(0);
Modified: trunk/coregrind/m_syswrap/syswrap-ppc32-linux.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-ppc32-linux.c 2011-04-06 11:17:16 UTC (rev 11686)
+++ trunk/coregrind/m_syswrap/syswrap-ppc32-linux.c 2011-04-11 16:17:51 UTC (rev 11687)
@@ -33,6 +33,7 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
#include "pub_core_vkiscnums.h"
+#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_debuglog.h"
Modified: trunk/coregrind/m_syswrap/syswrap-ppc64-linux.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-ppc64-linux.c 2011-04-06 11:17:16 UTC (rev 11686)
+++ trunk/coregrind/m_syswrap/syswrap-ppc64-linux.c 2011-04-11 16:17:51 UTC (rev 11687)
@@ -33,6 +33,7 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
#include "pub_core_vkiscnums.h"
+#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_debuglog.h"
Modified: trunk/coregrind/m_syswrap/syswrap-s390x-linux.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-s390x-linux.c 2011-04-06 11:17:16 UTC (rev 11686)
+++ trunk/coregrind/m_syswrap/syswrap-s390x-linux.c 2011-04-11 16:17:51 UTC (rev 11687)
@@ -34,6 +34,7 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
#include "pub_core_vkiscnums.h"
+#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_debuglog.h"
Modified: trunk/coregrind/m_syswrap/syswrap-x86-linux.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-x86-linux.c 2011-04-06 11:17:16 UTC (rev 11686)
+++ trunk/coregrind/m_syswrap/syswrap-x86-linux.c 2011-04-11 16:17:51 UTC (rev 11687)
@@ -38,6 +38,7 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
#include "pub_core_vkiscnums.h"
+#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_debuglog.h"
Modified: trunk/coregrind/m_threadstate.c
===================================================================
--- trunk/coregrind/m_threadstate.c 2011-04-06 11:17:16 UTC (rev 11686)
+++ trunk/coregrind/m_threadstate.c 2011-04-11 16:17:51 UTC (rev 11687)
@@ -30,6 +30,7 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
+#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_libcassert.h"
Modified: trunk/coregrind/m_translate.c
===================================================================
--- trunk/coregrind/m_translate.c 2011-04-06 11:17:16 UTC (rev 11686)
+++ trunk/coregrind/m_translate.c 2011-04-11 16:17:51 UTC (rev 11687)
@@ -53,6 +53,7 @@
#include "pub_core_dispatch.h" // VG_(run_innerloop__dispatch_{un}profiled)
// VG_(run_a_noredir_translation__return_point)
+#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h" // VexGuestArchState
#include "pub_core_trampoline.h" // VG_(ppctoc_magic_redirect_return_stub)
Modified: trunk/coregrind/pub_core_basics.h
===================================================================
--- trunk/coregrind/pub_core_basics.h 2011-04-06 11:17:16 UTC (rev 11686)
+++ trunk/coregrind/pub_core_basics.h 2011-04-11 16:17:51 UTC (rev 11687)
@@ -64,10 +64,7 @@
# error Unknown arch
#endif
-// For jmp_buf
-#include <setjmp.h>
-
/* ---------------------------------------------------------------------
A struct to hold starting values for stack unwinding.
------------------------------------------------------------------ */
Added: trunk/coregrind/pub_core_libcsetjmp.h
===================================================================
--- trunk/coregrind/pub_core_libcsetjmp.h (rev 0)
+++ trunk/coregrind/pub_core_libcsetjmp.h 2011-04-11 16:17:51 UTC (rev 11687)
@@ -0,0 +1,49 @@
+
+/*--------------------------------------------------------------------*/
+/*--- A minimal setjmp/longjmp facility. pub_core_libcsetjmp.h ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ This file is part of Valgrind, a dynamic binary instrumentation
+ framework.
+
+ Copyright (C) 2010-2010 Mozilla Inc
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The GNU General Public License is contained in the file COPYING.
+*/
+
+/* Contributed by Julian Seward <js...@ac...> */
+
+#ifndef __PUB_CORE_LIBCSETJMP_H
+#define __PUB_CORE_LIBCSETJMP_H
+
+//--------------------------------------------------------------------
+// PURPOSE: Provides a minimal setjmp/longjmp facility, that saves/
+// restores integer registers, but not necessarily anything more.
+//--------------------------------------------------------------------
+
+// No core-only exports; everything in this module is visible to both
+// the core and tools.
+
+#include "pub_tool_libcsetjmp.h"
+
+#endif // __PUB_CORE_LIBCSETJMP_H
+
+/*--------------------------------------------------------------------*/
+/*--- end pub_core_libcsetjmp.h ---*/
+/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/pub_core_threadstate.h
===================================================================
--- trunk/coregrind/pub_core_threadstate.h 2011-04-06 11:17:16 UTC (rev 11686)
+++ trunk/coregrind/pub_core_threadstate.h 2011-04-11 16:17:51 UTC (rev 11687)
@@ -355,8 +355,8 @@
ThreadOSstate os_state;
/* Per-thread jmp_buf to resume scheduler after a signal */
- Bool sched_jmpbuf_valid;
- jmp_buf sched_jmpbuf;
+ Bool sched_jmpbuf_valid;
+ VG_MINIMAL_JMP_BUF sched_jmpbuf;
}
ThreadState;
Modified: trunk/include/Makefile.am
===================================================================
--- trunk/include/Makefile.am 2011-04-06 11:17:16 UTC (rev 11686)
+++ trunk/include/Makefile.am 2011-04-11 16:17:51 UTC (rev 11687)
@@ -18,6 +18,7 @@
pub_tool_libcfile.h \
pub_tool_libcprint.h \
pub_tool_libcproc.h \
+ pub_tool_libcsetjmp.h \
pub_tool_libcsignal.h \
pub_tool_machine.h \
pub_tool_mallocfree.h \
Added: trunk/include/pub_tool_libcsetjmp.h
===================================================================
--- trunk/include/pub_tool_libcsetjmp.h (rev 0)
+++ trunk/include/pub_tool_libcsetjmp.h 2011-04-11 16:17:51 UTC (rev 11687)
@@ -0,0 +1,76 @@
+
+/*--------------------------------------------------------------------*/
+/*--- A minimal setjmp/longjmp facility. pub_tool_libcsetjmp.h ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ This file is part of Valgrind, a dynamic binary instrumentation
+ framework.
+
+ Copyright (C) 2010-2010 Mozilla Inc
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The GNU General Public License is contained in the file COPYING.
+*/
+
+/* Contributed by Julian Seward <js...@ac...> */
+
+#ifndef __PUB_TOOL_LIBCSETJMP_H
+#define __PUB_TOOL_LIBCSETJMP_H
+
+//--------------------------------------------------------------------
+// PURPOSE: Provides a minimal setjmp/longjmp facility, that saves/
+// restores integer registers, but not necessarily anything more.
+//--------------------------------------------------------------------
+
+
+/* This provides an extremely minimal setjmp/longjmp facility, in
+ which only the host's integer registers are saved/restored. Or at
+ least, that is the minimal guaranteed functionality.
+
+ Until Apr 2011 we used __builtin_setjmp and __builtin_longjmp, but
+ it appears that that is not always correctly implemented. See
+ https://bugs.kde.org/show_bug.cgi?id=259977. So this module wraps
+ those functions up and facilitates replacing them with our own
+ implementations where necessary.
+*/
+
+/* --- !!! --- EXTERNAL HEADERS start --- !!! --- */
+#include <setjmp.h>
+/* --- !!! --- EXTERNAL HEADERS end --- !!! --- */
+
+
+/* Don't use jmp_buf, __builtin_setjmp or __builtin_longjmp directly.
+ They don't always work reliably. Instead use these macros, which
+ provide the opportunity to supply alternative implementations as
+ necessary.
+
+ Note that the abstraction is done with macros (ick) rather than
+ functions and typedefs, since wrapping __builtin_setjmp up in a
+ second function (eg, VG_(minimal_setjmp)) doesn't seem to work for
+ whatever reason -- returns via a VG_(minimal_longjmp) go wrong.
+*/
+#define VG_MINIMAL_JMP_BUF jmp_buf
+#define VG_MINIMAL_SETJMP(_env) __builtin_setjmp((_env))
+#define VG_MINIMAL_LONGJMP(_env) __builtin_longjmp((_env),1)
+
+
+#endif // __PUB_TOOL_LIBCSETJMP_H
+
+/*--------------------------------------------------------------------*/
+/*--- end pub_tool_libcsetjmp.h ---*/
+/*--------------------------------------------------------------------*/
Modified: trunk/memcheck/mc_leakcheck.c
===================================================================
--- trunk/memcheck/mc_leakcheck.c 2011-04-06 11:17:16 UTC (rev 11686)
+++ trunk/memcheck/mc_leakcheck.c 2011-04-11 16:17:51 UTC (rev 11687)
@@ -43,12 +43,11 @@
#include "pub_tool_options.h"
#include "pub_tool_oset.h"
#include "pub_tool_signals.h"
+#include "pub_tool_libcsetjmp.h" // setjmp facilities
#include "pub_tool_tooliface.h" // Needed for mc_include.h
#include "mc_include.h"
-#include <setjmp.h> // For jmp_buf
-
/*------------------------------------------------------------*/
/*--- An overview of leak checking. ---*/
/*------------------------------------------------------------*/
@@ -636,7 +635,7 @@
}
-static jmp_buf memscan_jmpbuf;
+static VG_MINIMAL_JMP_BUF memscan_jmpbuf;
static
void scan_all_valid_memory_catcher ( Int sigNo, Addr addr )
@@ -644,7 +643,7 @@
if (0)
VG_(printf)("OUCH! sig=%d addr=%#lx\n", sigNo, addr);
if (sigNo == VKI_SIGSEGV || sigNo == VKI_SIGBUS)
- __builtin_longjmp(memscan_jmpbuf, 1);
+ VG_MINIMAL_LONGJMP(memscan_jmpbuf);
}
// Scan a block of memory between [start, start+len). This range may
@@ -686,7 +685,7 @@
}
}
- if (__builtin_setjmp(memscan_jmpbuf) == 0) {
+ if (VG_MINIMAL_SETJMP(memscan_jmpbuf) == 0) {
if ( MC_(is_valid_aligned_word)(ptr) ) {
lc_scanned_szB += sizeof(Addr);
addr = *(Addr *)ptr;
|