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
(12) |
2
(11) |
3
(8) |
|
4
(9) |
5
(10) |
6
(18) |
7
(8) |
8
(12) |
9
(23) |
10
(14) |
|
11
(15) |
12
(31) |
13
(45) |
14
(28) |
15
(20) |
16
(16) |
17
(9) |
|
18
(18) |
19
(26) |
20
(49) |
21
(14) |
22
(18) |
23
(24) |
24
(28) |
|
25
(39) |
26
(17) |
27
(27) |
28
(27) |
29
(14) |
30
(44) |
|
|
From: <sv...@va...> - 2005-09-28 20:05:37
|
Author: sewardj
Date: 2005-09-28 21:05:31 +0100 (Wed, 28 Sep 2005)
New Revision: 4814
Log:
Fix subtle bug in ML_(generic_POST_sys_shmdt) caused by new aspacem.
Modified:
trunk/coregrind/m_syswrap/syswrap-generic.c
Modified: trunk/coregrind/m_syswrap/syswrap-generic.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_syswrap/syswrap-generic.c 2005-09-28 20:00:30 UTC (=
rev 4813)
+++ trunk/coregrind/m_syswrap/syswrap-generic.c 2005-09-28 20:05:31 UTC (=
rev 4814)
@@ -1627,14 +1627,15 @@
{
NSegment* s =3D VG_(am_find_nsegment)(arg0);
=20
- if (s !=3D NULL /* && (s->flags & SF_SHM) */
- /* && Implied by defn of am_find_nsegment:
- VG_(seg_contains)(s, arg0, 1) */) {
- Bool d =3D VG_(am_notify_munmap)(s->start, s->end+1 - s->start);
- VG_TRACK( die_mem_munmap, s->start, s->end+1 - s->start );
+ if (s !=3D NULL) {
+ Addr s_start =3D s->start;
+ SizeT s_len =3D s->end+1 - s->start;
+ Bool d =3D VG_(am_notify_munmap)(s_start, s_len);
+ s =3D NULL; /* s is now invalid */
+ VG_TRACK( die_mem_munmap, s_start, s_len );
if (d)
- VG_(discard_translations)( (Addr64)(s->start),
- (ULong)(s->end+1 - s->start),
+ VG_(discard_translations)( (Addr64)s_start,
+ (ULong)s_len,
"ML_(generic_POST_sys_shmdt)" );
}
}
|
|
From: <sv...@va...> - 2005-09-28 20:00:35
|
Author: sewardj
Date: 2005-09-28 21:00:30 +0100 (Wed, 28 Sep 2005)
New Revision: 4813
Log:
%u -> %lu
Modified:
trunk/memcheck/mc_main.c
Modified: trunk/memcheck/mc_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/memcheck/mc_main.c 2005-09-28 19:59:19 UTC (rev 4812)
+++ trunk/memcheck/mc_main.c 2005-09-28 20:00:30 UTC (rev 4813)
@@ -575,7 +575,7 @@
if (len > 100 * 1000 * 1000) {
VG_(message)(Vg_UserMsg,=20
"Warning: set address range perms: "
- "large range %u, a %d, v %d",
+ "large range %lu, a %d, v %d",
len, example_a_bit, example_v_bit );
}
}
|
|
From: <sv...@va...> - 2005-09-28 19:59:27
|
Author: sewardj
Date: 2005-09-28 20:59:19 +0100 (Wed, 28 Sep 2005)
New Revision: 4812
Log:
Fix command-line printing.
Modified:
trunk/coregrind/m_main.c
Modified: trunk/coregrind/m_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_main.c 2005-09-28 19:58:58 UTC (rev 4811)
+++ trunk/coregrind/m_main.c 2005-09-28 19:59:19 UTC (rev 4812)
@@ -1518,6 +1518,8 @@
VG_(message)(Vg_UserMsg,=20
"My PID =3D %d, parent PID =3D %d. Prog and args are:",
VG_(getpid)(), VG_(getppid)() );
+ if (VG_(args_the_exename))
+ VG_(message)(Vg_UserMsg, " %s", VG_(args_the_exename));
for (i =3D 0; i < VG_(args_for_client).used; i++)=20
VG_(message)(Vg_UserMsg, " %s", VG_(args_for_client).strs[i])=
;
if (VG_(clo_log_file_qualifier)) {
|
|
From: <sv...@va...> - 2005-09-28 19:59:06
|
Author: sewardj
Date: 2005-09-28 20:58:58 +0100 (Wed, 28 Sep 2005)
New Revision: 4811
Log:
Make --log-socket=3D work on amd64-linux.
Modified:
trunk/coregrind/m_libcfile.c
Modified: trunk/coregrind/m_libcfile.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_libcfile.c 2005-09-28 14:49:40 UTC (rev 4810)
+++ trunk/coregrind/m_libcfile.c 2005-09-28 19:58:58 UTC (rev 4811)
@@ -394,9 +394,9 @@
return res.isError ? -1 : res.val;
=20
#elif defined(VGP_amd64_linux)
- // AMD64/Linux doesn't define __NR_socketcall... see comment above
- // VG_(sigpending)() for more details.
- I_die_here;
+ SysRes res;
+ res =3D VG_(do_syscall3)(__NR_socket, domain, type, protocol );
+ return res.isError ? -1 : res.val;
=20
#elif defined(VGP_ppc32_linux)
//CAB: TODO
@@ -421,9 +421,9 @@
return res.isError ? -1 : res.val;
=20
#elif defined(VGP_amd64_linux)
- // AMD64/Linux doesn't define __NR_socketcall... see comment above
- // VG_(sigpending)() for more details.
- I_die_here;
+ SysRes res;
+ res =3D VG_(do_syscall3)(__NR_connect, sockfd, (UWord)serv_addr, addr=
len);
+ return res.isError ? -1 : res.val;
=20
#elif defined(VGP_ppc32_linux)
//CAB: TODO
@@ -453,9 +453,9 @@
return res.isError ? -1 : res.val;
=20
#elif defined(VGP_amd64_linux)
- // AMD64/Linux doesn't define __NR_socketcall... see comment above
- // VG_(sigpending)() for more details.
- I_die_here;
+ SysRes res;
+ res =3D VG_(do_syscall6)(__NR_sendto, sd, (UWord)msg, count, flags, 0=
,0);
+ return res.isError ? -1 : res.val;
=20
#elif defined(VGP_ppc32_linux)
//CAB: TODO
|
|
From: <sv...@va...> - 2005-09-28 14:49:49
|
Author: njn
Date: 2005-09-28 15:49:40 +0100 (Wed, 28 Sep 2005)
New Revision: 4810
Log:
Make primes.c a bazillion times faster.
Modified:
trunk/auxprogs/primes.c
Modified: trunk/auxprogs/primes.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/auxprogs/primes.c 2005-09-28 11:51:17 UTC (rev 4809)
+++ trunk/auxprogs/primes.c 2005-09-28 14:49:40 UTC (rev 4810)
@@ -1,10 +1,12 @@
=20
#include <stdio.h>
+#include <math.h>
=20
int isprime ( int n )
{
int m;
- for (m =3D 2; m < n; m++)
+ int sqrt_n =3D sqrt(n);
+ for (m =3D 2; m <=3D sqrt_n+1; m++) // +1 in case of obscure roundin=
g error
if ((n % m) =3D=3D 0) return 0;
return 1;
}
|
|
From: Nicholas N. <nj...@cs...> - 2005-09-28 14:44:14
|
On Wed, 28 Sep 2005, Julian Seward wrote: > Attached is the coregrind/ module graph following r4806. It's > big and ugly, but not as big and ugly as it was before :-) > > Now (for the first time!) m_main is at the top of the graph, > rather than in the middle of a huge cycle, and m_aspacemgr is > nearly at the bottom, as intended. The trivia-obsessed may be > amused to observe that the harmless-sounding m_libcassert > (purveyor of vg_assert) is now right in the middle of a giant > tangle of modules, due to our insistence on printing fully- > annotated stack backtraces at assertion failures. [This is a > conscious design choice, so no harm there, but it's interesting > to see.] That could be fixed by having an init() function for m_libcassert and passing in pointers to pp_sched_status and VG_(get_StackTrace2) and VG_(pp_StackTrace). Nick |
|
From: <sv...@va...> - 2005-09-28 11:51:20
|
Author: sewardj Date: 2005-09-28 12:51:17 +0100 (Wed, 28 Sep 2005) New Revision: 4809 Log: Restore correct version number following the aspacem merge. Modified: trunk/configure.in Modified: trunk/configure.in =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/configure.in 2005-09-28 11:50:20 UTC (rev 4808) +++ trunk/configure.in 2005-09-28 11:51:17 UTC (rev 4809) @@ -1,5 +1,5 @@ # Process this file with autoconf to produce a configure script. -AC_INIT(Valgrind, 3.1.ASPACEM, val...@li...) +AC_INIT(Valgrind, 3.1.SVN, val...@li...) AC_CONFIG_SRCDIR(coregrind/m_main.c) AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE |
|
From: <sv...@va...> - 2005-09-28 11:50:26
|
Author: sewardj
Date: 2005-09-28 12:50:20 +0100 (Wed, 28 Sep 2005)
New Revision: 4808
Log:
Increase some sizes to deal better with the new multigigabyte world:
- on 64-bit platforms, double the size of the supported address
space to 32G.
- Increase the size of the ExeContext table 6 times. Some very
large apps have been observed to have been doing a lot of=20
searching in the old 4999 entry table. This table may be
OSetified in the fullness of time.
Modified:
trunk/coregrind/m_aspacemgr/aspacemgr.c
trunk/coregrind/m_execontext.c
trunk/coregrind/m_transtab.c
trunk/memcheck/mc_main.c
Modified: trunk/coregrind/m_aspacemgr/aspacemgr.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_aspacemgr/aspacemgr.c 2005-09-28 11:25:10 UTC (rev =
4807)
+++ trunk/coregrind/m_aspacemgr/aspacemgr.c 2005-09-28 11:50:20 UTC (rev =
4808)
@@ -1465,13 +1465,13 @@
accordingly. */
=20
VG_(debugLog)(2, "aspacem",=20
- " sp_at_startup =3D 0x%llx (supplied)\n",=20
+ " sp_at_startup =3D 0x%010llx (supplied)\n",=20
(ULong)sp_at_startup );
=20
aspacem_minAddr =3D (Addr) 0x04000000; // 64M
=20
# if VG_WORDSIZE =3D=3D 8
- aspacem_maxAddr =3D (Addr)0x400000000 - 1; // 16G
+ aspacem_maxAddr =3D (Addr)0x800000000 - 1; // 32G
# else
aspacem_maxAddr =3D VG_PGROUNDDN( sp_at_startup ) - 1;
# endif
Modified: trunk/coregrind/m_execontext.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_execontext.c 2005-09-28 11:25:10 UTC (rev 4807)
+++ trunk/coregrind/m_execontext.c 2005-09-28 11:50:20 UTC (rev 4808)
@@ -55,7 +55,7 @@
=20
/* Number of lists in which we keep track of ExeContexts. Should be
prime. */
-#define N_EC_LISTS 4999 /* a prime number */
+#define N_EC_LISTS 30011 /*4999*/ /* a prime number */
=20
/* The idea is only to ever store any one context once, so as to save
space and make exact comparisons faster. */
Modified: trunk/coregrind/m_transtab.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_transtab.c 2005-09-28 11:25:10 UTC (rev 4807)
+++ trunk/coregrind/m_transtab.c 2005-09-28 11:50:20 UTC (rev 4808)
@@ -57,12 +57,12 @@
/* Number of TC entries in each sector. This needs to be a prime
number to work properly, and it is strongly recommended not to
change this. */
-#define N_TTES_PER_SECTOR /*30011*/ 40009
+#define N_TTES_PER_SECTOR /*30011*/ /*40009*/ 80021
=20
/* Because each sector contains a hash table of TTEntries, we need to
specify the maximum allowable loading, after which the sector is
deemed full. */
-#define SECTOR_TT_LIMIT_PERCENT 60
+#define SECTOR_TT_LIMIT_PERCENT 66
=20
/* The sector is deemed full when this many entries are in it. */
#define N_TTES_PER_SECTOR_USABLE \
Modified: trunk/memcheck/mc_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/memcheck/mc_main.c 2005-09-28 11:25:10 UTC (rev 4807)
+++ trunk/memcheck/mc_main.c 2005-09-28 11:50:20 UTC (rev 4808)
@@ -134,9 +134,9 @@
=20
#else
=20
-/* Just handle the first 16G fast and the rest via auxiliary
+/* Just handle the first 32G fast and the rest via auxiliary
primaries. */
-# define N_PRIMARY_BITS 18
+# define N_PRIMARY_BITS 19
=20
#endif
=20
|
|
From: <sv...@va...> - 2005-09-28 11:25:15
|
Author: sewardj
Date: 2005-09-28 12:25:10 +0100 (Wed, 28 Sep 2005)
New Revision: 4807
Log:
Handy program for finding prime numbers (small ones!)
Added:
trunk/auxprogs/primes.c
Modified:
trunk/auxprogs/Makefile.am
Modified: trunk/auxprogs/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/auxprogs/Makefile.am 2005-09-28 10:47:38 UTC (rev 4806)
+++ trunk/auxprogs/Makefile.am 2005-09-28 11:25:10 UTC (rev 4807)
@@ -3,7 +3,7 @@
=20
bin_PROGRAMS =3D valgrind-listener
=20
-noinst_SCRIPTS =3D gen-mdg DotToScc.hs \
+noinst_SCRIPTS =3D gen-mdg DotToScc.hs primes.c \
gsl16test gsl16-badfree.patch gsl16-wavelet.patch
=20
EXTRA_DIST =3D $(noinst_SCRIPTS)
Added: trunk/auxprogs/primes.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/auxprogs/primes.c 2005-09-28 10:47:38 UTC (rev 4806)
+++ trunk/auxprogs/primes.c 2005-09-28 11:25:10 UTC (rev 4807)
@@ -0,0 +1,18 @@
+
+#include <stdio.h>
+
+int isprime ( int n )
+{
+ int m;
+ for (m =3D 2; m < n; m++)
+ if ((n % m) =3D=3D 0) return 0;
+ return 1;
+}
+
+int main ( int argc, char** argv )
+{
+ int i;
+ for (i =3D 79000; i < 81000; i++)
+ if (isprime(i)) { printf ( "%d ", i ); fflush(stdout); }
+ return 0;
+}
|
|
From: Julian S. <js...@ac...> - 2005-09-28 11:09:01
|
Attached is the coregrind/ module graph following r4806. It's big and ugly, but not as big and ugly as it was before :-) Now (for the first time!) m_main is at the top of the graph, rather than in the middle of a huge cycle, and m_aspacemgr is nearly at the bottom, as intended. The trivia-obsessed may be amused to observe that the harmless-sounding m_libcassert (purveyor of vg_assert) is now right in the middle of a giant tangle of modules, due to our insistence on printing fully- annotated stack backtraces at assertion failures. [This is a conscious design choice, so no harm there, but it's interesting to see.] J |
|
From: <sv...@va...> - 2005-09-28 10:47:44
|
Author: sewardj
Date: 2005-09-28 11:47:38 +0100 (Wed, 28 Sep 2005)
New Revision: 4806
Log:
Get rid of pub_core_main.h, so that m_main is not imported by anyone,
and so is not part of a module cycle. This requires a moderately
grotty hack of passing a continuation-function pointer in a global
variable.
Removed:
trunk/coregrind/pub_core_main.h
Modified:
trunk/coregrind/Makefile.am
trunk/coregrind/m_main.c
trunk/coregrind/m_syswrap/syswrap-amd64-linux.c
trunk/coregrind/m_syswrap/syswrap-generic.c
trunk/coregrind/m_syswrap/syswrap-main.c
trunk/coregrind/m_syswrap/syswrap-ppc32-linux.c
trunk/coregrind/m_syswrap/syswrap-x86-linux.c
trunk/coregrind/pub_core_syswrap.h
Modified: trunk/coregrind/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/Makefile.am 2005-09-28 09:37:16 UTC (rev 4805)
+++ trunk/coregrind/Makefile.am 2005-09-28 10:47:38 UTC (rev 4806)
@@ -48,7 +48,6 @@
pub_core_libcproc.h \
pub_core_libcsignal.h \
pub_core_machine.h \
- pub_core_main.h \
pub_core_mallocfree.h \
pub_core_options.h \
pub_core_oset.h \
Modified: trunk/coregrind/m_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_main.c 2005-09-28 09:37:16 UTC (rev 4805)
+++ trunk/coregrind/m_main.c 2005-09-28 10:47:38 UTC (rev 4806)
@@ -44,7 +44,6 @@
#include "pub_core_libcsignal.h"
#include "pub_core_syscall.h" // VG_(strerror)
#include "pub_core_machine.h"
-#include "pub_core_main.h"
#include "pub_core_mallocfree.h"
#include "pub_core_options.h"
#include "pub_core_profile.h"
@@ -1823,8 +1822,18 @@
=20
static Addr sp_at_startup =3D 0;
=20
+/* --- Forwards decls to do with shutdown --- */
=20
+static void final_tidyup(ThreadId tid);=20
=20
+/* Do everything which needs doing when the last thread exits */
+static=20
+void shutdown_actions_NORETURN( ThreadId tid,=20
+ VgSchedReturnCode tids_schedretcode );
+
+/* --- end of Forwards decls to do with shutdown --- */
+
+
/* TODO: GIVE THIS A PROPER HOME
TODO: MERGE THIS WITH DUPLICATE IN mac_leakcheck.c
Extract from aspacem a vector of the current segment start
@@ -1860,8 +1869,6 @@
=20
=20
=20
-
-
Int main(Int argc, HChar **argv, HChar **envp)
{
HChar* toolname =3D "memcheck"; // default to Memcheck
@@ -2480,68 +2487,34 @@
}
=20
VG_(debugLog)(1, "main", "Running thread 1\n");
+
/* As a result of the following call, the last thread standing
- eventually winds up running VG_(shutdown_actions_NORETURN) just
- below. */
+ eventually winds up running shutdown_actions_NORETURN
+ just below. Unfortunately, simply exporting said function
+ causes m_main to be part of a module cycle, which is pretty
+ nonsensical. So instead of doing that, the address of said
+ function is stored in a global variable 'owned' by m_syswrap,
+ and it uses that function pointer to get back here when it needs
+ to. */
+
+ /* Set continuation address. */
+ VG_(address_of_m_main_shutdown_actions_NORETURN)
+ =3D & shutdown_actions_NORETURN;
+
+ /* Run the first thread, eventually ending up at the continuation
+ address. */
VG_(main_thread_wrapper_NORETURN)(1);
=20
/*NOTREACHED*/
vg_assert(0);
}
=20
+/* Do everything which needs doing when the last thread exits. */
=20
-/* Final clean-up before terminating the process. =20
- Clean up the client by calling __libc_freeres() (if requested)=20
- This is Linux-specific?
-*/
-static void final_tidyup(ThreadId tid)
+static=20
+void shutdown_actions_NORETURN( ThreadId tid,=20
+ VgSchedReturnCode tids_schedretcode )
{
- Addr __libc_freeres_wrapper;
-
- vg_assert(VG_(is_running_thread)(tid));
- =20
- if ( !VG_(needs).libc_freeres ||
- !VG_(clo_run_libc_freeres) ||
- 0 =3D=3D (__libc_freeres_wrapper =3D VG_(get_libc_freeres_wrappe=
r)()) )
- return; /* can't/won't do it */
-
- if (VG_(clo_verbosity) > 2 ||
- VG_(clo_trace_syscalls) ||
- VG_(clo_trace_sched))
- VG_(message)(Vg_DebugMsg,=20
- "Caught __NR_exit; running __libc_freeres()");
- =20
- /* point thread context to point to libc_freeres_wrapper */
- VG_(set_IP)(tid, __libc_freeres_wrapper);
- // XXX should we use a special stack?
-
- /* Block all blockable signals by copying the real block state into
- the thread's block state*/
- VG_(sigprocmask)(VKI_SIG_BLOCK, NULL, &VG_(threads)[tid].sig_mask);
- VG_(threads)[tid].tmp_sig_mask =3D VG_(threads)[tid].sig_mask;
-
- /* and restore handlers to default */
- VG_(set_default_handler)(VKI_SIGSEGV);
- VG_(set_default_handler)(VKI_SIGBUS);
- VG_(set_default_handler)(VKI_SIGILL);
- VG_(set_default_handler)(VKI_SIGFPE);
-
- // We were exiting, so assert that...
- vg_assert(VG_(is_exiting)(tid));
- // ...but now we're not again
- VG_(threads)[tid].exitreason =3D VgSrc_None;
-
- // run until client thread exits - ideally with LIBC_FREERES_DONE,
- // but exit/exitgroup/signal will do
- VG_(scheduler)(tid);
-
- vg_assert(VG_(is_exiting)(tid));
-}
-
-/* Do everything which needs doing when the last thread exits */
-void VG_(shutdown_actions_NORETURN) ( ThreadId tid,=20
- VgSchedReturnCode tids_schedretcod=
e )
-{
VG_(debugLog)(1, "main", "entering VG_(shutdown_actions_NORETURN)\n")=
;
=20
vg_assert( VG_(count_living_threads)() =3D=3D 1 );
@@ -2646,7 +2619,57 @@
}
}
=20
+/* -------------------- */
=20
+/* Final clean-up before terminating the process. =20
+ Clean up the client by calling __libc_freeres() (if requested)=20
+ This is Linux-specific?
+*/
+static void final_tidyup(ThreadId tid)
+{
+ Addr __libc_freeres_wrapper;
+
+ vg_assert(VG_(is_running_thread)(tid));
+ =20
+ if ( !VG_(needs).libc_freeres ||
+ !VG_(clo_run_libc_freeres) ||
+ 0 =3D=3D (__libc_freeres_wrapper =3D VG_(get_libc_freeres_wrappe=
r)()) )
+ return; /* can't/won't do it */
+
+ if (VG_(clo_verbosity) > 2 ||
+ VG_(clo_trace_syscalls) ||
+ VG_(clo_trace_sched))
+ VG_(message)(Vg_DebugMsg,=20
+ "Caught __NR_exit; running __libc_freeres()");
+ =20
+ /* point thread context to point to libc_freeres_wrapper */
+ VG_(set_IP)(tid, __libc_freeres_wrapper);
+ // XXX should we use a special stack?
+
+ /* Block all blockable signals by copying the real block state into
+ the thread's block state*/
+ VG_(sigprocmask)(VKI_SIG_BLOCK, NULL, &VG_(threads)[tid].sig_mask);
+ VG_(threads)[tid].tmp_sig_mask =3D VG_(threads)[tid].sig_mask;
+
+ /* and restore handlers to default */
+ VG_(set_default_handler)(VKI_SIGSEGV);
+ VG_(set_default_handler)(VKI_SIGBUS);
+ VG_(set_default_handler)(VKI_SIGILL);
+ VG_(set_default_handler)(VKI_SIGFPE);
+
+ // We were exiting, so assert that...
+ vg_assert(VG_(is_exiting)(tid));
+ // ...but now we're not again
+ VG_(threads)[tid].exitreason =3D VgSrc_None;
+
+ // run until client thread exits - ideally with LIBC_FREERES_DONE,
+ // but exit/exitgroup/signal will do
+ VG_(scheduler)(tid);
+
+ vg_assert(VG_(is_exiting)(tid));
+}
+
+
/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
/*=3D=3D=3D Getting to main() alive =
=3D=3D=3D*/
/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
Modified: trunk/coregrind/m_syswrap/syswrap-amd64-linux.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_syswrap/syswrap-amd64-linux.c 2005-09-28 09:37:16 U=
TC (rev 4805)
+++ trunk/coregrind/m_syswrap/syswrap-amd64-linux.c 2005-09-28 10:47:38 U=
TC (rev 4806)
@@ -38,7 +38,6 @@
#include "pub_core_libcprint.h"
#include "pub_core_libcproc.h"
#include "pub_core_libcsignal.h"
-#include "pub_core_main.h"
#include "pub_core_scheduler.h"
#include "pub_core_sigframe.h"
#include "pub_core_signals.h"
@@ -133,8 +132,9 @@
(ULong)tidW);
=20
/* We are the last one standing. Keep hold of the lock and
- carry on to show final tool results, then exit the entire syste=
m. */
- VG_(shutdown_actions_NORETURN)(tid, src);
+ carry on to show final tool results, then exit the entire syste=
m.=20
+ Use the continuation pointer set at startup in m_main. */
+ ( * VG_(address_of_m_main_shutdown_actions_NORETURN) ) (tid, src);
=20
} else {
=20
Modified: trunk/coregrind/m_syswrap/syswrap-generic.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_syswrap/syswrap-generic.c 2005-09-28 09:37:16 UTC (=
rev 4805)
+++ trunk/coregrind/m_syswrap/syswrap-generic.c 2005-09-28 10:47:38 UTC (=
rev 4806)
@@ -42,7 +42,6 @@
#include "pub_core_libcprint.h"
#include "pub_core_libcproc.h"
#include "pub_core_libcsignal.h"
-#include "pub_core_main.h"
#include "pub_core_mallocfree.h"
#include "pub_core_options.h"
#include "pub_core_scheduler.h"
Modified: trunk/coregrind/m_syswrap/syswrap-main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_syswrap/syswrap-main.c 2005-09-28 09:37:16 UTC (rev=
4805)
+++ trunk/coregrind/m_syswrap/syswrap-main.c 2005-09-28 10:47:38 UTC (rev=
4806)
@@ -1153,6 +1153,20 @@
}
=20
=20
+/* ---------------------------------------------------------------------
+ A place to store the where-to-call-when-really-done pointer
+ ------------------------------------------------------------------ */
+
+// When the final thread is done, where shall I call to shutdown the
+// system cleanly? Is set once at startup (in m_main) and never
+// changes after that. Is basically a pointer to the exit
+// continuation. This is all just a nasty hack to avoid calling
+// directly from m_syswrap to m_main at exit, since that would cause
+// m_main to become part of a module cycle, which is silly.
+void (* VG_(address_of_m_main_shutdown_actions_NORETURN) )
+ (ThreadId,VgSchedReturnCode)
+ =3D NULL;
+
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_syswrap/syswrap-ppc32-linux.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_syswrap/syswrap-ppc32-linux.c 2005-09-28 09:37:16 U=
TC (rev 4805)
+++ trunk/coregrind/m_syswrap/syswrap-ppc32-linux.c 2005-09-28 10:47:38 U=
TC (rev 4806)
@@ -37,7 +37,6 @@
#include "pub_core_libcprint.h"
#include "pub_core_libcproc.h"
#include "pub_core_libcsignal.h"
-#include "pub_core_main.h" // For VG_(shutdown_actions_NORETURN=
)()
#include "pub_core_options.h"
#include "pub_core_scheduler.h"
#include "pub_core_sigframe.h" // For VG_(sigframe_destroy)()
@@ -158,8 +157,9 @@
(ULong)tidW);
=20
/* We are the last one standing. Keep hold of the lock and
- carry on to show final tool results, then exit the entire syste=
m. */
- VG_(shutdown_actions_NORETURN)(tid, src);
+ carry on to show final tool results, then exit the entire syste=
m.=20
+ Use the continuation pointer set at startup in m_main. */
+ ( * VG_(address_of_m_main_shutdown_actions_NORETURN) ) (tid, src);
=20
} else {
VG_(debugLog)(1, "syswrap-ppc32-linux",=20
Modified: trunk/coregrind/m_syswrap/syswrap-x86-linux.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_syswrap/syswrap-x86-linux.c 2005-09-28 09:37:16 UTC=
(rev 4805)
+++ trunk/coregrind/m_syswrap/syswrap-x86-linux.c 2005-09-28 10:47:38 UTC=
(rev 4806)
@@ -43,7 +43,6 @@
#include "pub_core_libcprint.h"
#include "pub_core_libcproc.h"
#include "pub_core_libcsignal.h"
-#include "pub_core_main.h" // For VG_(shutdown_actions_NORETURN=
)()
#include "pub_core_mallocfree.h"
#include "pub_core_options.h"
#include "pub_core_scheduler.h"
@@ -140,8 +139,9 @@
(ULong)tidW);
=20
/* We are the last one standing. Keep hold of the lock and
- carry on to show final tool results, then exit the entire syste=
m. */
- VG_(shutdown_actions_NORETURN)(tid, src);
+ carry on to show final tool results, then exit the entire syste=
m.=20
+ Use the continuation pointer set at startup in m_main. */
+ ( * VG_(address_of_m_main_shutdown_actions_NORETURN) ) (tid, src);
=20
} else {
=20
Deleted: trunk/coregrind/pub_core_main.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/pub_core_main.h 2005-09-28 09:37:16 UTC (rev 4805)
+++ trunk/coregrind/pub_core_main.h 2005-09-28 10:47:38 UTC (rev 4806)
@@ -1,52 +0,0 @@
-
-/*--------------------------------------------------------------------*/
-/*--- The main module. pub_core_main.h ---*/
-/*--------------------------------------------------------------------*/
-
-/*
- This file is part of Valgrind, a dynamic binary instrumentation
- framework.
-
- Copyright (C) 2000-2005 Julian Seward
- js...@ac...
-
- 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.
-*/
-
-#ifndef __PUB_CORE_MAIN_H
-#define __PUB_CORE_MAIN_H
-
-//--------------------------------------------------------------------
-// PURPOSE: This module is the main module, ie. the one holding main().
-// It arguably shouldn't export anything to other modules, since it depe=
nds
-// on almost every other module! But currently it exports quite a few
-// things.
-//--------------------------------------------------------------------
-
-// Do everything which needs doing before the process finally ends,
-// like printing reports, etc
-extern void VG_(shutdown_actions_NORETURN) (
- ThreadId tid,=20
- VgSchedReturnCode tids_schedretcode=20
- );
-
-#endif // __PUB_CORE_MAIN_H
-
-/*--------------------------------------------------------------------*/
-/*--- end ---*/
-/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/pub_core_syswrap.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/pub_core_syswrap.h 2005-09-28 09:37:16 UTC (rev 4805)
+++ trunk/coregrind/pub_core_syswrap.h 2005-09-28 10:47:38 UTC (rev 4806)
@@ -66,6 +66,15 @@
extern void VG_(init_preopened_fds) ( void );
extern void VG_(show_open_fds) ( void );
=20
+// When the final thread is done, where shall I call to shutdown the
+// system cleanly? Is set once at startup (in m_main) and never
+// changes after that. Is basically a pointer to the exit
+// continuation. This is all just a nasty hack to avoid calling
+// directly from m_syswrap to m_main at exit, since that would cause
+// m_main to become part of a module cycle, which is silly.
+extern void (* VG_(address_of_m_main_shutdown_actions_NORETURN) )
+ (ThreadId,VgSchedReturnCode);
+
#endif // __PUB_CORE_SYSWRAP_H
=20
/*--------------------------------------------------------------------*/
|
|
From: <sv...@va...> - 2005-09-28 09:37:24
|
Author: sewardj
Date: 2005-09-28 10:37:16 +0100 (Wed, 28 Sep 2005)
New Revision: 4805
Log:
Privatise parse_procselfmaps() and move it into aspacemgr.c in order
to benefit from the module-cycle-breaking functions in aspacemgr.c.
Modified:
trunk/coregrind/m_aspacemgr/aspacemgr.c
trunk/coregrind/m_aspacemgr/read_procselfmaps.c
trunk/coregrind/pub_core_aspacemgr.h
Modified: trunk/coregrind/m_aspacemgr/aspacemgr.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_aspacemgr/aspacemgr.c 2005-09-28 01:53:07 UTC (rev =
4804)
+++ trunk/coregrind/m_aspacemgr/aspacemgr.c 2005-09-28 09:37:16 UTC (rev =
4805)
@@ -124,11 +124,18 @@
=20
/* ------ end of STATE for the address-space manager ------ */
=20
-// Forwards decls
-static void aspacem_exit ( Int );
+/* ------ Forwards decls ------ */
+static void aspacem_exit ( Int );
static Int find_nsegment_idx ( Addr a );
=20
+static void parse_procselfmaps (
+ void (*record_mapping)( Addr addr, SizeT len, UInt prot,
+ UInt dev, UInt ino, ULong offset,=20
+ const UChar* filename ),
+ void (*record_gap)( Addr addr, SizeT len )
+ );
=20
+
/*-----------------------------------------------------------------*/
/*--- ---*/
/*--- Stuff to make aspacem almost completely independent of ---*/
@@ -308,7 +315,24 @@
aspacem_assert(2+2 =3D=3D 5);
}
=20
+static SysRes aspacem_open ( const Char* pathname, Int flags, Int mode )
+{ =20
+ SysRes res =3D VG_(do_syscall3)(__NR_open, (UWord)pathname, flags, mo=
de);
+ return res;
+}
=20
+static void aspacem_close ( Int fd )
+{
+ (void)VG_(do_syscall1)(__NR_close, fd);
+}
+
+static Int aspacem_read ( Int fd, void* buf, Int count)
+{
+ SysRes res =3D VG_(do_syscall3)(__NR_read, fd, (UWord)buf, count);
+ return res.isError ? -1 : res.val;
+}
+
+
//--------------------------------------------------------------
// Functions for extracting information about file descriptors.
=20
@@ -982,8 +1006,8 @@
sync_check_ok =3D True;
if (0)
VG_(debugLog)(0,"aspacem", "do_sync_check %s:%d\n", file,line);
- VG_(parse_procselfmaps)( sync_check_mapping_callback,
- sync_check_gap_callback );
+ parse_procselfmaps( sync_check_mapping_callback,
+ sync_check_gap_callback );
if (!sync_check_ok) {
VG_(debugLog)(0,"aspacem",=20
"sync check at %s:%d (%s): FAILED\n",
@@ -1503,7 +1527,7 @@
VG_(am_show_nsegments)(2, "Initial layout");
=20
VG_(debugLog)(2, "aspacem", "Reading /proc/self/maps\n");
- VG_(parse_procselfmaps) ( read_maps_callback, NULL );
+ parse_procselfmaps( read_maps_callback, NULL );
=20
VG_(am_show_nsegments)(2, "With contents of /proc/self/maps");
=20
@@ -2710,6 +2734,264 @@
}
=20
=20
+/*-----------------------------------------------------------------*/
+/*--- ---*/
+/*--- A simple parser for /proc/self/maps on Linux 2.4.X/2.6.X. ---*/
+/*--- Almost completely independent of the stuff above. The ---*/
+/*--- only function it 'exports' to the code above this comment ---*/
+/*--- is parse_procselfmaps. ---*/
+/*--- ---*/
+/*-----------------------------------------------------------------*/
+
+/* Size of a smallish table used to read /proc/self/map entries. */
+#define M_PROCMAP_BUF 100000
+
+/* static ... to keep it out of the stack frame. */
+static Char procmap_buf[M_PROCMAP_BUF];
+
+/* Records length of /proc/self/maps read into procmap_buf. */
+static Int buf_n_tot;
+
+/* Helper fns. */
+
+static Int hexdigit ( Char c )
+{
+ if (c >=3D '0' && c <=3D '9') return (Int)(c - '0');
+ if (c >=3D 'a' && c <=3D 'f') return 10 + (Int)(c - 'a');
+ if (c >=3D 'A' && c <=3D 'F') return 10 + (Int)(c - 'A');
+ return -1;
+}
+
+static Int decdigit ( Char c )
+{
+ if (c >=3D '0' && c <=3D '9') return (Int)(c - '0');
+ return -1;
+}
+
+static Int readchar ( const Char* buf, Char* ch )
+{
+ if (*buf =3D=3D 0) return 0;
+ *ch =3D *buf;
+ return 1;
+}
+
+static Int readhex ( const Char* buf, UWord* val )
+{
+ Int n =3D 0;
+ *val =3D 0;
+ while (hexdigit(*buf) >=3D 0) {
+ *val =3D (*val << 4) + hexdigit(*buf);
+ n++; buf++;
+ }
+ return n;
+}
+
+static Int readdec ( const Char* buf, UInt* val )
+{
+ Int n =3D 0;
+ *val =3D 0;
+ while (hexdigit(*buf) >=3D 0) {
+ *val =3D (*val * 10) + decdigit(*buf);
+ n++; buf++;
+ }
+ return n;
+}
+
+
+/* Get the contents of /proc/self/maps into a static buffer. If
+ there's a syntax error, it won't fit, or other failure, just
+ abort. */
+
+static void read_procselfmaps_into_buf ( void )
+{
+ Int n_chunk;
+ SysRes fd;
+ =20
+ /* Read the initial memory mapping from the /proc filesystem. */
+ fd =3D aspacem_open( "/proc/self/maps", VKI_O_RDONLY, 0 );
+ if (fd.isError)
+ aspacem_barf("can't open /proc/self/maps");
+
+ buf_n_tot =3D 0;
+ do {
+ n_chunk =3D aspacem_read( fd.val, &procmap_buf[buf_n_tot],
+ M_PROCMAP_BUF - buf_n_tot );
+ buf_n_tot +=3D n_chunk;
+ } while ( n_chunk > 0 && buf_n_tot < M_PROCMAP_BUF );
+
+ aspacem_close(fd.val);
+
+ if (buf_n_tot >=3D M_PROCMAP_BUF-5)
+ aspacem_barf_toolow("M_PROCMAP_BUF");
+ if (buf_n_tot =3D=3D 0)
+ aspacem_barf("I/O error on /proc/self/maps");
+
+ procmap_buf[buf_n_tot] =3D 0;
+}
+
+/* Parse /proc/self/maps. For each map entry, call
+ record_mapping, passing it, in this order:
+
+ start address in memory
+ length
+ page protections (using the VKI_PROT_* flags)
+ mapped file device and inode
+ offset in file, or zero if no file
+ filename, zero terminated, or NULL if no file
+
+ So the sig of the called fn might be
+
+ void (*record_mapping)( Addr start, SizeT size, UInt prot,
+ UInt dev, UInt info,
+ ULong foffset, UChar* filename )
+
+ Note that the supplied filename is transiently stored; record_mapping=
=20
+ should make a copy if it wants to keep it.
+
+ Nb: it is important that this function does not alter the contents of
+ procmap_buf!
+*/
+static void parse_procselfmaps (
+ void (*record_mapping)( Addr addr, SizeT len, UInt prot,
+ UInt dev, UInt ino, ULong offset,=20
+ const UChar* filename ),
+ void (*record_gap)( Addr addr, SizeT len )
+ )
+{
+ Int i, j, i_eol;
+ Addr start, endPlusOne, gapStart;
+ UChar* filename;
+ UChar rr, ww, xx, pp, ch, tmp;
+ UInt ino, prot;
+ UWord foffset, maj, min;
+
+ read_procselfmaps_into_buf();
+
+ aspacem_assert('\0' !=3D procmap_buf[0] && 0 !=3D buf_n_tot);
+
+ if (0)
+ VG_(debugLog)(0, "procselfmaps", "raw:\n%s\n", procmap_buf);
+
+ /* Ok, it's safely aboard. Parse the entries. */
+ i =3D 0;
+ gapStart =3D Addr_MIN;
+ while (True) {
+ if (i >=3D buf_n_tot) break;
+
+ /* Read (without fscanf :) the pattern %16x-%16x %c%c%c%c %16x %2x=
:%2x %d */
+ j =3D readhex(&procmap_buf[i], &start);
+ if (j > 0) i +=3D j; else goto syntaxerror;
+ j =3D readchar(&procmap_buf[i], &ch);
+ if (j =3D=3D 1 && ch =3D=3D '-') i +=3D j; else goto syntaxerror;
+ j =3D readhex(&procmap_buf[i], &endPlusOne);
+ if (j > 0) i +=3D j; else goto syntaxerror;
+
+ j =3D readchar(&procmap_buf[i], &ch);
+ if (j =3D=3D 1 && ch =3D=3D ' ') i +=3D j; else goto syntaxerror;
+
+ j =3D readchar(&procmap_buf[i], &rr);
+ if (j =3D=3D 1 && (rr =3D=3D 'r' || rr =3D=3D '-')) i +=3D j; else=
goto syntaxerror;
+ j =3D readchar(&procmap_buf[i], &ww);
+ if (j =3D=3D 1 && (ww =3D=3D 'w' || ww =3D=3D '-')) i +=3D j; else=
goto syntaxerror;
+ j =3D readchar(&procmap_buf[i], &xx);
+ if (j =3D=3D 1 && (xx =3D=3D 'x' || xx =3D=3D '-')) i +=3D j; else=
goto syntaxerror;
+ /* This field is the shared/private flag */
+ j =3D readchar(&procmap_buf[i], &pp);
+ if (j =3D=3D 1 && (pp =3D=3D 'p' || pp =3D=3D '-' || pp =3D=3D 's'=
))=20
+ i +=3D j; else goto syntax=
error;
+
+ j =3D readchar(&procmap_buf[i], &ch);
+ if (j =3D=3D 1 && ch =3D=3D ' ') i +=3D j; else goto syntaxerror;
+
+ j =3D readhex(&procmap_buf[i], &foffset);
+ if (j > 0) i +=3D j; else goto syntaxerror;
+
+ j =3D readchar(&procmap_buf[i], &ch);
+ if (j =3D=3D 1 && ch =3D=3D ' ') i +=3D j; else goto syntaxerror;
+
+ j =3D readhex(&procmap_buf[i], &maj);
+ if (j > 0) i +=3D j; else goto syntaxerror;
+ j =3D readchar(&procmap_buf[i], &ch);
+ if (j =3D=3D 1 && ch =3D=3D ':') i +=3D j; else goto syntaxerror;
+ j =3D readhex(&procmap_buf[i], &min);
+ if (j > 0) i +=3D j; else goto syntaxerror;
+
+ j =3D readchar(&procmap_buf[i], &ch);
+ if (j =3D=3D 1 && ch =3D=3D ' ') i +=3D j; else goto syntaxerror;
+
+ j =3D readdec(&procmap_buf[i], &ino);
+ if (j > 0) i +=3D j; else goto syntaxerror;
+=20
+ goto read_line_ok;
+
+ syntaxerror:
+ VG_(debugLog)(0, "Valgrind:",=20
+ "FATAL: syntax error reading /proc/self/maps\n");
+ { Int k, m;
+ HChar buf50[51];
+ m =3D 0;
+ buf50[m] =3D 0;
+ k =3D i - 50;
+ if (k < 0) k =3D 0;
+ for (; k <=3D i; k++) {
+ buf50[m] =3D procmap_buf[k];
+ buf50[m+1] =3D 0;
+ if (m < 50-1) m++;
+ }
+ VG_(debugLog)(0, "procselfmaps", "Last 50 chars: '%s'\n", buf50)=
;
+ }
+ aspacem_exit(1);
+
+ read_line_ok:
+
+ /* Try and find the name of the file mapped to this segment, if
+ it exists. Note that files can contains spaces. */
+
+ // Move i to the next non-space char, which should be either a '/'=
or
+ // a newline.
+ while (procmap_buf[i] =3D=3D ' ' && i < buf_n_tot-1) i++;
+ =20
+ // Move i_eol to the end of the line.
+ i_eol =3D i;
+ while (procmap_buf[i_eol] !=3D '\n' && i_eol < buf_n_tot-1) i_eol+=
+;
+
+ // If there's a filename...
+ if (i < i_eol-1 && procmap_buf[i] =3D=3D '/') {
+ /* Minor hack: put a '\0' at the filename end for the call to
+ 'record_mapping', then restore the old char with 'tmp'. */
+ filename =3D &procmap_buf[i];
+ tmp =3D filename[i_eol - i];
+ filename[i_eol - i] =3D '\0';
+ } else {
+ tmp =3D 0;
+ filename =3D NULL;
+ foffset =3D 0;
+ }
+
+ prot =3D 0;
+ if (rr =3D=3D 'r') prot |=3D VKI_PROT_READ;
+ if (ww =3D=3D 'w') prot |=3D VKI_PROT_WRITE;
+ if (xx =3D=3D 'x') prot |=3D VKI_PROT_EXEC;
+
+ if (record_gap && gapStart < start)
+ (*record_gap) ( gapStart, start-gapStart );
+
+ (*record_mapping) ( start, endPlusOne-start,=20
+ prot, maj * 256 + min, ino,
+ foffset, filename );
+
+ if ('\0' !=3D tmp) {
+ filename[i_eol - i] =3D tmp;
+ }
+
+ i =3D i_eol + 1;
+ gapStart =3D endPlusOne;
+ }
+
+ if (record_gap && gapStart < Addr_MAX)
+ (*record_gap) ( gapStart, Addr_MAX - gapStart + 1 );
+}
+
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_aspacemgr/read_procselfmaps.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_aspacemgr/read_procselfmaps.c 2005-09-28 01:53:07 U=
TC (rev 4804)
+++ trunk/coregrind/m_aspacemgr/read_procselfmaps.c 2005-09-28 09:37:16 U=
TC (rev 4805)
@@ -29,266 +29,9 @@
The GNU General Public License is contained in the file COPYING.
*/
=20
-#include "pub_core_basics.h"
-#include "pub_core_debuglog.h"
-#include "pub_core_aspacemgr.h"
-#include "pub_core_libcassert.h"
-#include "pub_core_libcfile.h"
+/* Contents of this file were folded into aspacemgr.c on 28 Sept
+ 05. */
=20
-/* Size of a smallish table used to read /proc/self/map entries. */
-#define M_PROCMAP_BUF 50000
-
-/* static ... to keep it out of the stack frame. */
-static Char procmap_buf[M_PROCMAP_BUF];
-
-/* Records length of /proc/self/maps read into procmap_buf. */
-static Int buf_n_tot;
-
-/* Minimum and maximum addresses */
-#define Addr_MIN ((Addr)0)
-#define Addr_MAX ((Addr)(-1ULL))
-
-/* Helper fns. */
-
-static Int hexdigit ( Char c )
-{
- if (c >=3D '0' && c <=3D '9') return (Int)(c - '0');
- if (c >=3D 'a' && c <=3D 'f') return 10 + (Int)(c - 'a');
- if (c >=3D 'A' && c <=3D 'F') return 10 + (Int)(c - 'A');
- return -1;
-}
-
-static Int decdigit ( Char c )
-{
- if (c >=3D '0' && c <=3D '9') return (Int)(c - '0');
- return -1;
-}
-
-static Int readchar ( const Char* buf, Char* ch )
-{
- if (*buf =3D=3D 0) return 0;
- *ch =3D *buf;
- return 1;
-}
-
-static Int readhex ( const Char* buf, UWord* val )
-{
- Int n =3D 0;
- *val =3D 0;
- while (hexdigit(*buf) >=3D 0) {
- *val =3D (*val << 4) + hexdigit(*buf);
- n++; buf++;
- }
- return n;
-}
-
-static Int readdec ( const Char* buf, UInt* val )
-{
- Int n =3D 0;
- *val =3D 0;
- while (hexdigit(*buf) >=3D 0) {
- *val =3D (*val * 10) + decdigit(*buf);
- n++; buf++;
- }
- return n;
-}
-
-
-/* Read /proc/self/maps, store the contents into a static buffer. If
- there's a syntax error or other failure, just abort. */
-
-static void read_procselfmaps ( void )
-{
- Int n_chunk;
- SysRes fd;
- =20
- /* Read the initial memory mapping from the /proc filesystem. */
- fd =3D VG_(open) ( "/proc/self/maps", VKI_O_RDONLY, 0 );
- if (fd.isError) {
- VG_(debugLog)(0, "Valgrind:", "FATAL: can't open /proc/self/maps\n=
");
- VG_(exit)(1);
- }
- buf_n_tot =3D 0;
- do {
- n_chunk =3D VG_(read) ( fd.val, &procmap_buf[buf_n_tot],
- M_PROCMAP_BUF - buf_n_tot );
- buf_n_tot +=3D n_chunk;
- } while ( n_chunk > 0 && buf_n_tot < M_PROCMAP_BUF );
- VG_(close)(fd.val);
- if (buf_n_tot >=3D M_PROCMAP_BUF-5) {
- VG_(debugLog)(0, "Valgrind:", "FATAL: M_PROCMAP_BUF is too small;\=
n");
- VG_(debugLog)(0, "Valgrind:", " increase it and recompile.\n=
");
- VG_(exit)(1);
- }
- if (buf_n_tot =3D=3D 0) {
- VG_(debugLog)(0, "Valgrind:", "FATAL: I/O error on /proc/self/maps=
\n");
- VG_(exit)(1);
- }
- procmap_buf[buf_n_tot] =3D 0;
-}
-
-/* Parse /proc/self/maps. For each map entry, call
- record_mapping, passing it, in this order:
-
- start address in memory
- length
- page protections (using the VKI_PROT_* flags)
- mapped file device and inode
- offset in file, or zero if no file
- filename, zero terminated, or NULL if no file
-
- So the sig of the called fn might be
-
- void (*record_mapping)( Addr start, SizeT size, UInt prot,
- UInt dev, UInt info,
- ULong foffset, UChar* filename )
-
- Note that the supplied filename is transiently stored; record_mapping=
=20
- should make a copy if it wants to keep it.
-
- Nb: it is important that this function does not alter the contents of
- procmap_buf!
-*/
-void VG_(parse_procselfmaps) (
- void (*record_mapping)( Addr addr, SizeT len, UInt prot,
- UInt dev, UInt ino, ULong foff, const UChar* filename ),
- void (*record_gap)( Addr addr, SizeT len )
- )
-{
- Int i, j, i_eol;
- Addr start, endPlusOne, gapStart;
- UChar* filename;
- UChar rr, ww, xx, pp, ch, tmp;
- UInt ino, prot;
- UWord foffset, maj, min;
-
- read_procselfmaps();
-
- tl_assert( '\0' !=3D procmap_buf[0] && 0 !=3D buf_n_tot);
-
- if (0)
- VG_(debugLog)(0, "procselfmaps", "raw:\n%s\n", procmap_buf);
-
- /* Ok, it's safely aboard. Parse the entries. */
- i =3D 0;
- gapStart =3D Addr_MIN;
- while (True) {
- if (i >=3D buf_n_tot) break;
-
- /* Read (without fscanf :) the pattern %16x-%16x %c%c%c%c %16x %2x=
:%2x %d */
- j =3D readhex(&procmap_buf[i], &start);
- if (j > 0) i +=3D j; else goto syntaxerror;
- j =3D readchar(&procmap_buf[i], &ch);
- if (j =3D=3D 1 && ch =3D=3D '-') i +=3D j; else goto syntaxerror;
- j =3D readhex(&procmap_buf[i], &endPlusOne);
- if (j > 0) i +=3D j; else goto syntaxerror;
-
- j =3D readchar(&procmap_buf[i], &ch);
- if (j =3D=3D 1 && ch =3D=3D ' ') i +=3D j; else goto syntaxerror;
-
- j =3D readchar(&procmap_buf[i], &rr);
- if (j =3D=3D 1 && (rr =3D=3D 'r' || rr =3D=3D '-')) i +=3D j; else=
goto syntaxerror;
- j =3D readchar(&procmap_buf[i], &ww);
- if (j =3D=3D 1 && (ww =3D=3D 'w' || ww =3D=3D '-')) i +=3D j; else=
goto syntaxerror;
- j =3D readchar(&procmap_buf[i], &xx);
- if (j =3D=3D 1 && (xx =3D=3D 'x' || xx =3D=3D '-')) i +=3D j; else=
goto syntaxerror;
- /* This field is the shared/private flag */
- j =3D readchar(&procmap_buf[i], &pp);
- if (j =3D=3D 1 && (pp =3D=3D 'p' || pp =3D=3D '-' || pp =3D=3D 's'=
))=20
- i +=3D j; else goto syntax=
error;
-
- j =3D readchar(&procmap_buf[i], &ch);
- if (j =3D=3D 1 && ch =3D=3D ' ') i +=3D j; else goto syntaxerror;
-
- j =3D readhex(&procmap_buf[i], &foffset);
- if (j > 0) i +=3D j; else goto syntaxerror;
-
- j =3D readchar(&procmap_buf[i], &ch);
- if (j =3D=3D 1 && ch =3D=3D ' ') i +=3D j; else goto syntaxerror;
-
- j =3D readhex(&procmap_buf[i], &maj);
- if (j > 0) i +=3D j; else goto syntaxerror;
- j =3D readchar(&procmap_buf[i], &ch);
- if (j =3D=3D 1 && ch =3D=3D ':') i +=3D j; else goto syntaxerror;
- j =3D readhex(&procmap_buf[i], &min);
- if (j > 0) i +=3D j; else goto syntaxerror;
-
- j =3D readchar(&procmap_buf[i], &ch);
- if (j =3D=3D 1 && ch =3D=3D ' ') i +=3D j; else goto syntaxerror;
-
- j =3D readdec(&procmap_buf[i], &ino);
- if (j > 0) i +=3D j; else goto syntaxerror;
-=20
- goto read_line_ok;
-
- syntaxerror:
- VG_(debugLog)(0, "Valgrind:",=20
- "FATAL: syntax error reading /proc/self/maps\n");
- { Int k, m;
- HChar buf50[51];
- m =3D 0;
- buf50[m] =3D 0;
- k =3D i - 50;
- if (k < 0) k =3D 0;
- for (; k <=3D i; k++) {
- buf50[m] =3D procmap_buf[k];
- buf50[m+1] =3D 0;
- if (m < 50-1) m++;
- }
- VG_(debugLog)(0, "procselfmaps", "Last 50 chars: '%s'\n", buf50)=
;
- }
- VG_(exit)(1);
-
- read_line_ok:
-
- /* Try and find the name of the file mapped to this segment, if
- it exists. Note that files can contains spaces. */
-
- // Move i to the next non-space char, which should be either a '/'=
or
- // a newline.
- while (procmap_buf[i] =3D=3D ' ' && i < buf_n_tot-1) i++;
- =20
- // Move i_eol to the end of the line.
- i_eol =3D i;
- while (procmap_buf[i_eol] !=3D '\n' && i_eol < buf_n_tot-1) i_eol+=
+;
-
- // If there's a filename...
- if (i < i_eol-1 && procmap_buf[i] =3D=3D '/') {
- /* Minor hack: put a '\0' at the filename end for the call to
- 'record_mapping', then restore the old char with 'tmp'. */
- filename =3D &procmap_buf[i];
- tmp =3D filename[i_eol - i];
- filename[i_eol - i] =3D '\0';
- } else {
- tmp =3D 0;
- filename =3D NULL;
- foffset =3D 0;
- }
-
- prot =3D 0;
- if (rr =3D=3D 'r') prot |=3D VKI_PROT_READ;
- if (ww =3D=3D 'w') prot |=3D VKI_PROT_WRITE;
- if (xx =3D=3D 'x') prot |=3D VKI_PROT_EXEC;
-
- if (record_gap && gapStart < start)
- (*record_gap) ( gapStart, start-gapStart );
-
- (*record_mapping) ( start, endPlusOne-start,=20
- prot, maj * 256 + min, ino,
- foffset, filename );
-
- if ('\0' !=3D tmp) {
- filename[i_eol - i] =3D tmp;
- }
-
- i =3D i_eol + 1;
- gapStart =3D endPlusOne;
- }
-
- if (record_gap && gapStart < Addr_MAX)
- (*record_gap) ( gapStart, Addr_MAX - gapStart + 1 );
-}
-
/*--------------------------------------------------------------------*/
/*--- end read_procselfmaps.c ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/pub_core_aspacemgr.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/pub_core_aspacemgr.h 2005-09-28 01:53:07 UTC (rev 480=
4)
+++ trunk/coregrind/pub_core_aspacemgr.h 2005-09-28 09:37:16 UTC (rev 480=
5)
@@ -41,14 +41,6 @@
=20
#include "pub_tool_aspacemgr.h"
=20
-/* Parses /proc/self/maps, calling `record_mapping' for each entry. */
-extern=20
-void VG_(parse_procselfmaps) (
- void (*record_mapping)( Addr addr, SizeT len, UInt prot,
- UInt dev, UInt ino, ULong foff,
- const UChar *filename ),
- void (*record_gap)( Addr addr, SizeT len ) );
-
//--------------------------------------------------------------
// Definition of address-space segments
=20
|
|
From: Christophe G. <chr...@gi...> - 2005-09-28 08:16:37
|
Hello,
In the "gcc accepts -msse" test of configure script, CFLAGS are saved
in safe_CFLAGS but are not restored after the test
Missing line is:
CFLAGS=$safe_CFLAGS
Regards,
CG
--
Christophe GIAUME
|
|
From: <js...@ac...> - 2005-09-28 03:00:35
|
Nightly build on phoenix ( SuSE 9.1 ) started at 2005-09-28 03:30:00 BST Checking out vex source tree ... done Building vex ... done Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 186 tests, 2 stderr failures, 0 stdout failures ================= none/tests/faultstatus (stderr) none/tests/x86/int (stderr) |
|
From: Nicholas N. <nj...@cs...> - 2005-09-28 02:58:43
|
On Tue, 27 Sep 2005, Julian Seward wrote: > I misphrased that. What I meant is that on line 2 of > coregrind/Makefile.am, svn merge produced > > include $(top_srcdir)/Makefile.core.am > > and I to change that to > > include $(top_srcdir)/Makefile.core-AM_CPPFLAGS.am > > in line with what the ASPACEM branch said. Also had to do that in > one other place which I can't remember now. Ah. I believe Makefile.core-AM_CPPFLAGS.am got renamed as Makefile.core.am in the trunk while ASPACEM was being worked on. I've fixed it up. Nick |
|
From: Tom H. <to...@co...> - 2005-09-28 02:41:01
|
Nightly build on dunsmere ( athlon, Fedora Core 4 ) started at 2005-09-28 03:30:07 BST Results differ from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 188 tests, 8 stderr failures, 1 stdout failure ================= memcheck/tests/leak-tree (stderr) memcheck/tests/leakotron (stdout) memcheck/tests/mempool (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/xml1 (stderr) none/tests/faultstatus (stderr) none/tests/x86/int (stderr) ================================================= == Results from 24 hours ago == ================================================= Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 188 tests, 5 stderr failures, 0 stdout failures ================= memcheck/tests/leak-tree (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/xml1 (stderr) none/tests/faultstatus (stderr) none/tests/x86/int (stderr) ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Wed Sep 28 03:35:41 2005 --- new.short Wed Sep 28 03:40:49 2005 *************** *** 8,12 **** ! == 188 tests, 5 stderr failures, 0 stdout failures ================= memcheck/tests/leak-tree (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/xml1 (stderr) --- 8,16 ---- ! == 188 tests, 8 stderr failures, 1 stdout failure ================= memcheck/tests/leak-tree (stderr) + memcheck/tests/leakotron (stdout) + memcheck/tests/mempool (stderr) + memcheck/tests/pointer-trace (stderr) memcheck/tests/weirdioctl (stderr) + memcheck/tests/x86/scalar (stderr) memcheck/tests/xml1 (stderr) |
|
From: Tom H. <th...@cy...> - 2005-09-28 02:27:58
|
Nightly build on alvis ( i686, Red Hat 7.3 ) started at 2005-09-28 03:15:04 BST Results differ from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 187 tests, 16 stderr failures, 1 stdout failure ================= memcheck/tests/addressable (stderr) memcheck/tests/describe-block (stderr) memcheck/tests/erringfds (stderr) memcheck/tests/leak-0 (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-regroot (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/match-overrun (stderr) memcheck/tests/mempool (stderr) memcheck/tests/nanoleak (stderr) memcheck/tests/partiallydefinedeq (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/sigkill (stderr) memcheck/tests/stack_changes (stderr) none/tests/faultstatus (stderr) none/tests/x86/int (stderr) none/tests/x86/yield (stdout) ================================================= == Results from 24 hours ago == ================================================= Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 187 tests, 14 stderr failures, 0 stdout failures ================= memcheck/tests/addressable (stderr) memcheck/tests/describe-block (stderr) memcheck/tests/erringfds (stderr) memcheck/tests/leak-0 (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-regroot (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/match-overrun (stderr) memcheck/tests/partiallydefinedeq (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/sigkill (stderr) memcheck/tests/stack_changes (stderr) none/tests/faultstatus (stderr) none/tests/x86/int (stderr) ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Wed Sep 28 03:21:34 2005 --- new.short Wed Sep 28 03:27:53 2005 *************** *** 8,10 **** ! == 187 tests, 14 stderr failures, 0 stdout failures ================= memcheck/tests/addressable (stderr) --- 8,10 ---- ! == 187 tests, 16 stderr failures, 1 stdout failure ================= memcheck/tests/addressable (stderr) *************** *** 17,18 **** --- 17,20 ---- memcheck/tests/match-overrun (stderr) + memcheck/tests/mempool (stderr) + memcheck/tests/nanoleak (stderr) memcheck/tests/partiallydefinedeq (stderr) *************** *** 23,24 **** --- 25,27 ---- none/tests/x86/int (stderr) + none/tests/x86/yield (stdout) |
|
From: Tom H. <th...@cy...> - 2005-09-28 02:24:59
|
Nightly build on ginetta ( i686, Red Hat 8.0 ) started at 2005-09-28 03:10:07 BST Results differ from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 187 tests, 4 stderr failures, 0 stdout failures ================= memcheck/tests/mempool (stderr) memcheck/tests/pointer-trace (stderr) none/tests/faultstatus (stderr) none/tests/x86/int (stderr) ================================================= == Results from 24 hours ago == ================================================= Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 187 tests, 2 stderr failures, 0 stdout failures ================= none/tests/faultstatus (stderr) none/tests/x86/int (stderr) ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Wed Sep 28 03:19:02 2005 --- new.short Wed Sep 28 03:24:51 2005 *************** *** 8,10 **** ! == 187 tests, 2 stderr failures, 0 stdout failures ================= none/tests/faultstatus (stderr) --- 8,12 ---- ! == 187 tests, 4 stderr failures, 0 stdout failures ================= ! memcheck/tests/mempool (stderr) ! memcheck/tests/pointer-trace (stderr) none/tests/faultstatus (stderr) |
|
From: Tom H. <th...@cy...> - 2005-09-28 02:20:49
|
Nightly build on dellow ( x86_64, Fedora Core 4 ) started at 2005-09-28 03:10:07 BST Results differ from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 165 tests, 7 stderr failures, 2 stdout failures ================= memcheck/tests/sigprocmask (stderr) memcheck/tests/strchr (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/xml1 (stderr) none/tests/as_mmap (stderr) none/tests/as_shm (stdout) none/tests/as_shm (stderr) none/tests/faultstatus (stderr) none/tests/mremap2 (stdout) ================================================= == Results from 24 hours ago == ================================================= Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 165 tests, 6 stderr failures, 0 stdout failures ================= memcheck/tests/sigprocmask (stderr) memcheck/tests/strchr (stderr) memcheck/tests/vgtest_ume (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/xml1 (stderr) none/tests/faultstatus (stderr) ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Wed Sep 28 03:16:51 2005 --- new.short Wed Sep 28 03:20:41 2005 *************** *** 8,16 **** ! == 165 tests, 6 stderr failures, 0 stdout failures ================= memcheck/tests/sigprocmask (stderr) memcheck/tests/strchr (stderr) - memcheck/tests/vgtest_ume (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/xml1 (stderr) none/tests/faultstatus (stderr) --- 8,19 ---- ! == 165 tests, 7 stderr failures, 2 stdout failures ================= memcheck/tests/sigprocmask (stderr) memcheck/tests/strchr (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/xml1 (stderr) + none/tests/as_mmap (stderr) + none/tests/as_shm (stdout) + none/tests/as_shm (stderr) none/tests/faultstatus (stderr) + none/tests/mremap2 (stdout) |
|
From: Tom H. <th...@cy...> - 2005-09-28 02:17:55
|
Nightly build on aston ( x86_64, Fedora Core 3 ) started at 2005-09-28 03:05:12 BST Results differ from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 165 tests, 7 stderr failures, 2 stdout failures ================= memcheck/tests/sigprocmask (stderr) memcheck/tests/strchr (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/xml1 (stderr) none/tests/as_mmap (stderr) none/tests/as_shm (stdout) none/tests/as_shm (stderr) none/tests/faultstatus (stderr) none/tests/mremap2 (stdout) ================================================= == Results from 24 hours ago == ================================================= Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 165 tests, 6 stderr failures, 0 stdout failures ================= memcheck/tests/sigprocmask (stderr) memcheck/tests/strchr (stderr) memcheck/tests/vgtest_ume (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/xml1 (stderr) none/tests/faultstatus (stderr) ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Wed Sep 28 03:12:49 2005 --- new.short Wed Sep 28 03:17:50 2005 *************** *** 8,16 **** ! == 165 tests, 6 stderr failures, 0 stdout failures ================= memcheck/tests/sigprocmask (stderr) memcheck/tests/strchr (stderr) - memcheck/tests/vgtest_ume (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/xml1 (stderr) none/tests/faultstatus (stderr) --- 8,19 ---- ! == 165 tests, 7 stderr failures, 2 stdout failures ================= memcheck/tests/sigprocmask (stderr) memcheck/tests/strchr (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/xml1 (stderr) + none/tests/as_mmap (stderr) + none/tests/as_shm (stdout) + none/tests/as_shm (stderr) none/tests/faultstatus (stderr) + none/tests/mremap2 (stdout) |
|
From: Tom H. <th...@cy...> - 2005-09-28 02:12:56
|
Nightly build on gill ( x86_64, Fedora Core 2 ) started at 2005-09-28 03:00:03 BST Results differ from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 165 tests, 8 stderr failures, 1 stdout failure ================= memcheck/tests/sigprocmask (stderr) memcheck/tests/strchr (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/xml1 (stderr) none/tests/as_mmap (stderr) none/tests/as_shm (stdout) none/tests/as_shm (stderr) none/tests/faultstatus (stderr) none/tests/fdleak_fcntl (stderr) ================================================= == Results from 24 hours ago == ================================================= Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 165 tests, 7 stderr failures, 0 stdout failures ================= memcheck/tests/sigprocmask (stderr) memcheck/tests/strchr (stderr) memcheck/tests/vgtest_ume (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/xml1 (stderr) none/tests/faultstatus (stderr) none/tests/fdleak_fcntl (stderr) ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Wed Sep 28 03:05:28 2005 --- new.short Wed Sep 28 03:12:46 2005 *************** *** 8,15 **** ! == 165 tests, 7 stderr failures, 0 stdout failures ================= memcheck/tests/sigprocmask (stderr) memcheck/tests/strchr (stderr) - memcheck/tests/vgtest_ume (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/xml1 (stderr) none/tests/faultstatus (stderr) --- 8,17 ---- ! == 165 tests, 8 stderr failures, 1 stdout failure ================= memcheck/tests/sigprocmask (stderr) memcheck/tests/strchr (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/xml1 (stderr) + none/tests/as_mmap (stderr) + none/tests/as_shm (stdout) + none/tests/as_shm (stderr) none/tests/faultstatus (stderr) |
|
From: <sv...@va...> - 2005-09-28 01:53:09
|
Author: sewardj
Date: 2005-09-28 02:53:07 +0100 (Wed, 28 Sep 2005)
New Revision: 4804
Log:
Rename m_launcher.c to launcher.c to make clear it's not part of the
normal module scheme -- it's a standalone program.
Added:
trunk/coregrind/launcher.c
Removed:
trunk/coregrind/m_launcher.c
Modified:
trunk/coregrind/Makefile.am
Modified: trunk/coregrind/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/Makefile.am 2005-09-28 01:46:31 UTC (rev 4803)
+++ trunk/coregrind/Makefile.am 2005-09-28 01:53:07 UTC (rev 4804)
@@ -92,7 +92,7 @@
CLEANFILES =3D=20
=20
valgrind_SOURCES =3D \
- m_launcher.c \
+ launcher.c \
m_debuglog.c
=20
libcoregrind_a_SOURCES =3D \
Copied: trunk/coregrind/launcher.c (from rev 4797, trunk/coregrind/m_laun=
cher.c)
Deleted: trunk/coregrind/m_launcher.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_launcher.c 2005-09-28 01:46:31 UTC (rev 4803)
+++ trunk/coregrind/m_launcher.c 2005-09-28 01:53:07 UTC (rev 4804)
@@ -1,145 +0,0 @@
-
-/*--------------------------------------------------------------------*/
-/*--- Launching valgrind m_launcher.c ---*/
-/*--------------------------------------------------------------------*/
-
-/*
- This file is part of Valgrind, a dynamic binary instrumentation
- framework.
-
- Copyright (C) 2000-2005 Julian Seward=20
- js...@ac...
-
- 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.
-*/
-
-/* Note: this is a "normal" program and not part of Valgrind proper,
- and so it doesn't have to conform to Valgrind's arcane rules on
- no-glibc-usage etc. */
-
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <assert.h>
-
-#include "pub_core_debuglog.h"
-#include "pub_core_libcproc.h" // For VALGRIND_LIB, VALGRIND_LAUNCHER
-
-
-
-#define PATH_MAX 4096 /* POSIX refers to this a lot but I dunno
- where it is defined */
-
-static void barf ( char* str )
-{
- fprintf(stderr, "valgrind: Cannot continue: %s\n", str );
- exit(1);
-}
-
-/* Where we expect to find all our aux files */
-static const char *valgrind_lib =3D VG_LIBDIR;
-
-int main(int argc, char** argv, char** envp)
-{
- int i, j, loglevel, r;
- const char *toolname =3D NULL;
- const char *cp;
- char *toolfile;
- char launcher_name[PATH_MAX+1];
- char* new_line;
- char** new_env;
-
- /* Start the debugging-log system ASAP. First find out how many=20
- "-d"s were specified. This is a pre-scan of the command line.
- At the same time, look for the tool name. */
- loglevel =3D 0;
- for (i =3D 1; i < argc; i++) {
- if (argv[i][0] !=3D '-')
- break;
- if (0 =3D=3D strcmp(argv[i], "--"))=20
- break;
- if (0 =3D=3D strcmp(argv[i], "-d"))=20
- loglevel++;
- if (0 =3D=3D strncmp(argv[i], "--tool=3D", 7))=20
- toolname =3D argv[i] + 7;
- }
-
- /* ... and start the debug logger. Now we can safely emit logging
- messages all through startup. */
- VG_(debugLog_startup)(loglevel, "Stage 1");
-
- /* Make sure we know which tool we're using */
- if (toolname) {
- VG_(debugLog)(1, "launcher", "tool '%s' requested\n", toolname);
- } else {
- VG_(debugLog)(1, "launcher",=20
- "no tool requested, defaulting to 'memcheck'\n");
- toolname =3D "memcheck";
- }
-
- /* Figure out the name of this executable (viz, the launcher), so
- we can tell stage2. stage2 will use the name for recursive
- invokations of valgrind on child processes. */
- memset(launcher_name, 0, PATH_MAX+1);
- r =3D readlink("/proc/self/exe", launcher_name, PATH_MAX);
- if (r =3D=3D -1)
- barf("readlink(\"/proc/self/exe\") failed.");
-
- /* tediously augment the env: VALGRIND_LAUNCHER=3Dlauncher_name */
- new_line =3D malloc(strlen(VALGRIND_LAUNCHER) + 1=20
- + strlen(launcher_name) + 1);
- if (new_line =3D=3D NULL)
- barf("malloc of new_line failed.");
- strcpy(new_line, VALGRIND_LAUNCHER);
- strcat(new_line, "=3D");
- strcat(new_line, launcher_name);
-
- for (j =3D 0; envp[j]; j++)
- ;
- new_env =3D malloc((j+2) * sizeof(char*));
- if (new_env =3D=3D NULL)
- barf("malloc of new_env failed.");
- for (i =3D 0; i < j; i++)
- new_env[i] =3D envp[i];
- new_env[i++] =3D new_line;
- new_env[i++] =3D NULL;
- assert(i =3D=3D j+2);
-
- /* Establish the correct VALGRIND_LIB. */
- cp =3D getenv(VALGRIND_LIB);
-
- if (cp !=3D NULL)
- valgrind_lib =3D cp;
-
- /* Build the stage2 invokation, and execve it. Bye! */
- toolfile =3D malloc(strlen(valgrind_lib) + strlen(toolname) + 2);
- if (toolfile =3D=3D NULL)
- barf("malloc of toolfile failed.");
- sprintf(toolfile, "%s/%s", valgrind_lib, toolname);
-
- VG_(debugLog)(1, "launcher", "launching %s\n", toolfile);
-
- execve(toolfile, argv, new_env);
-
- fprintf(stderr, "valgrind: failed to start tool '%s': %s\n",
- toolname, strerror(errno));
-
- exit(1);
-}
|
|
From: <sv...@va...> - 2005-09-28 01:46:33
|
Author: sewardj
Date: 2005-09-28 02:46:31 +0100 (Wed, 28 Sep 2005)
New Revision: 4803
Log:
VG_(am_extend_into_adjacent_reservation_client): Do not allow the
reservation segment to be shrunk below one page.
Modified:
trunk/coregrind/m_aspacemgr/aspacemgr.c
trunk/coregrind/pub_core_aspacemgr.h
Modified: trunk/coregrind/m_aspacemgr/aspacemgr.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_aspacemgr/aspacemgr.c 2005-09-28 01:36:01 UTC (rev =
4802)
+++ trunk/coregrind/m_aspacemgr/aspacemgr.c 2005-09-28 01:46:31 UTC (rev =
4803)
@@ -2383,8 +2383,10 @@
extended forwards in the address space, and the reservation must be
the next one along. If DELTA is negative, the segment is extended
backwards in the address space and the reservation must be the
- previous one. DELTA must be page aligned and must not exceed the
- size of the reservation segment. */
+ previous one. DELTA must be page aligned. abs(DELTA) must not
+ exceed the size of the reservation segment minus one page, that is,
+ the reservation segment after the operation must be at least one
+ page long. */
=20
Bool VG_(am_extend_into_adjacent_reservation_client) ( NSegment* seg,=20
SSizeT delta )
@@ -2418,7 +2420,8 @@
|| nsegments[segR].kind !=3D SkResvn
|| nsegments[segR].smode !=3D SmLower
|| nsegments[segR].start !=3D nsegments[segA].end + 1
- || delta > (nsegments[segR].end - nsegments[segR].start + 1))
+ || delta + VKI_PAGE_SIZE=20
+ > (nsegments[segR].end - nsegments[segR].start + 1))
return False;
=20
/* Extend the kernel's mapping. */
@@ -2452,7 +2455,8 @@
|| nsegments[segR].kind !=3D SkResvn
|| nsegments[segR].smode !=3D SmUpper
|| nsegments[segR].end + 1 !=3D nsegments[segA].start
- || delta > (nsegments[segR].end - nsegments[segR].start + 1))
+ || delta + VKI_PAGE_SIZE=20
+ > (nsegments[segR].end - nsegments[segR].start + 1))
return False;
=20
/* Extend the kernel's mapping. */
Modified: trunk/coregrind/pub_core_aspacemgr.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/pub_core_aspacemgr.h 2005-09-28 01:36:01 UTC (rev 480=
2)
+++ trunk/coregrind/pub_core_aspacemgr.h 2005-09-28 01:46:31 UTC (rev 480=
3)
@@ -262,8 +262,10 @@
extended forwards in the address space, and the reservation must be
the next one along. If DELTA is negative, the segment is extended
backwards in the address space and the reservation must be the
- previous one. DELTA must be page aligned and must not exceed the
- size of the reservation segment. */
+ previous one. DELTA must be page aligned. abs(DELTA) must not
+ exceed the size of the reservation segment minus one page, that is,
+ the reservation segment after the operation must be at least one
+ page long. */
extern Bool VG_(am_extend_into_adjacent_reservation_client)=20
( NSegment* seg, SSizeT delta );
=20
|
|
From: <sv...@va...> - 2005-09-28 01:36:04
|
Author: sewardj
Date: 2005-09-28 02:36:01 +0100 (Wed, 28 Sep 2005)
New Revision: 4802
Log:
Get rid of some macros used only by the old aspacemgr, and tidy up
m_main even more.
Modified:
trunk/coregrind/m_main.c
trunk/coregrind/pub_core_options.h
trunk/include/vki-linux.h
Modified: trunk/coregrind/m_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_main.c 2005-09-28 01:23:25 UTC (rev 4801)
+++ trunk/coregrind/m_main.c 2005-09-28 01:36:01 UTC (rev 4802)
@@ -61,35 +61,6 @@
#include "pub_core_ume.h"
=20
=20
-#ifndef AT_DCACHEBSIZE
-#define AT_DCACHEBSIZE 19
-#endif /* AT_DCACHEBSIZE */
-
-#ifndef AT_ICACHEBSIZE
-#define AT_ICACHEBSIZE 20
-#endif /* AT_ICACHEBSIZE */
-
-#ifndef AT_UCACHEBSIZE
-#define AT_UCACHEBSIZE 21
-#endif /* AT_UCACHEBSIZE */
-
-#ifndef AT_SYSINFO
-#define AT_SYSINFO 32
-#endif /* AT_SYSINFO */
-
-#ifndef AT_SYSINFO_EHDR
-#define AT_SYSINFO_EHDR 33
-#endif /* AT_SYSINFO_EHDR */
-
-#ifndef AT_SECURE
-#define AT_SECURE 23 /* secure mode boolean */
-#endif /* AT_SECURE */
-
-/* Number of file descriptors that Valgrind tries to reserve for
- it's own use - just a small constant. */
-#define N_RESERVED_FDS (10)
-
-
/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
/*=3D=3D=3D Counters, for profiling purposes only =
=3D=3D=3D*/
/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
@@ -114,7 +85,7 @@
=20
=20
/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
-/*=3D=3D=3D Environment and stack setup =
=3D=3D=3D*/
+/*=3D=3D=3D Setting up the client's environment =
=3D=3D=3D*/
/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
=20
/* Prepare the client's environment. This is basically a copy of our
@@ -236,6 +207,34 @@
}
=20
=20
+/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
+/*=3D=3D=3D Setting up the client's stack =
=3D=3D=3D*/
+/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
+
+#ifndef AT_DCACHEBSIZE
+#define AT_DCACHEBSIZE 19
+#endif /* AT_DCACHEBSIZE */
+
+#ifndef AT_ICACHEBSIZE
+#define AT_ICACHEBSIZE 20
+#endif /* AT_ICACHEBSIZE */
+
+#ifndef AT_UCACHEBSIZE
+#define AT_UCACHEBSIZE 21
+#endif /* AT_UCACHEBSIZE */
+
+#ifndef AT_SYSINFO
+#define AT_SYSINFO 32
+#endif /* AT_SYSINFO */
+
+#ifndef AT_SYSINFO_EHDR
+#define AT_SYSINFO_EHDR 33
+#endif /* AT_SYSINFO_EHDR */
+
+#ifndef AT_SECURE
+#define AT_SECURE 23 /* secure mode boolean */
+#endif /* AT_SECURE */
+
/* Add a string onto the string table, and return its address */
static char *copy_str(char **tab, const char *str)
{
@@ -254,7 +253,9 @@
return orig;
}
=20
-/*=20
+
+/* ----------------------------------------------------------------
+=20
This sets up the client's initial stack, containing the args,
environment and aux vector.
=20
@@ -292,8 +293,9 @@
=20
VG_(cache_line_size_ppc32) // ppc32 only -- cache line size
VG_(have_altivec_ppc32) // ppc32 only -- is Altivec supported?
-*/
=20
+ ---------------------------------------------------------------- */
+
static=20
Addr setup_client_stack( void* init_sp,
char** orig_envp,=20
@@ -1621,6 +1623,10 @@
/*=3D=3D=3D File descriptor setup =
=3D=3D=3D*/
/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
=20
+/* Number of file descriptors that Valgrind tries to reserve for
+ it's own use - just a small constant. */
+#define N_RESERVED_FDS (10)
+
static void setup_file_descriptors(void)
{
struct vki_rlimit rl;
Modified: trunk/coregrind/pub_core_options.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/pub_core_options.h 2005-09-28 01:23:25 UTC (rev 4801)
+++ trunk/coregrind/pub_core_options.h 2005-09-28 01:36:01 UTC (rev 4802)
@@ -158,7 +158,6 @@
enum {=20
Vg_SmcNone, // never generate self-checking translations
Vg_SmcStack, // generate s-c-t's for code found in stacks
- // (segments with SF_GROWDOWN, to be precise)
// (this is the default)
Vg_SmcAll // make all translations self-checking.
}=20
Modified: trunk/include/vki-linux.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/include/vki-linux.h 2005-09-28 01:23:25 UTC (rev 4801)
+++ trunk/include/vki-linux.h 2005-09-28 01:36:01 UTC (rev 4802)
@@ -33,8 +33,6 @@
=20
All code is copied verbatim from kernel source files, except that:
- VKI_/vki_ prefixes are added
- - a few extra constants are defined (eg. VKI_MAP_NOSYMS); these are
- marked 'internal'
- some extra explanatory comments are included; they are all within
"[[ ]]"
- for some types, we only care about the size; for a few of them (bi=
g
@@ -477,10 +475,6 @@
#define VKI_SEEK_CUR 1
#define VKI_SEEK_END 2
=20
-// [[Our own additional mmap flags]]
-#define VKI_MAP_NOSYMS 0x40000000 // internal: disable symbol load=
ing
-#define VKI_MAP_CLIENT 0x80000000 // internal: distinguish client =
mappings
-
//----------------------------------------------------------------------
// From linux-2.6.8.1/include/linux/net.h
//----------------------------------------------------------------------
|
|
From: <sv...@va...> - 2005-09-28 01:23:30
|
Author: sewardj
Date: 2005-09-28 02:23:25 +0100 (Wed, 28 Sep 2005)
New Revision: 4801
Log:
Clean up the m_debuginfo interface a bit.
Modified:
trunk/coregrind/m_debuginfo/symtab.c
trunk/coregrind/pub_core_debuginfo.h
Modified: trunk/coregrind/m_debuginfo/symtab.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_debuginfo/symtab.c 2005-09-28 01:14:32 UTC (rev 480=
0)
+++ trunk/coregrind/m_debuginfo/symtab.c 2005-09-28 01:23:25 UTC (rev 480=
1)
@@ -96,6 +96,14 @@
=20
=20
/*------------------------------------------------------------*/
+/*--- Forwards decls ---*/
+/*------------------------------------------------------------*/
+
+static Bool is_elf_object_file ( const void *buf );
+static void unload_symbols ( Addr start, SizeT length );
+
+
+/*------------------------------------------------------------*/
/*--- TOP LEVEL ---*/
/*------------------------------------------------------------*/
=20
@@ -127,11 +135,6 @@
return VG_(strstr)( filename, "/lib/valgrind/" ) !=3D NULL;
}
=20
-////////////
-
-// fwds
-static void unload_symbols ( Addr start, SizeT length );
-
static void nuke_syms_in_range ( Addr start, SizeT length )
{
/* Repeatedly scan the segInfo list, looking for segInfos in this
@@ -183,7 +186,7 @@
&& seg->hasR
&& seg->hasX
&& !seg->hasW
- && VG_(is_object_file)( (const void*)seg->start );
+ && is_elf_object_file( (const void*)seg->start );
=20
if (!ok) {
VG_(arena_free)(VG_AR_SYMTAB, filename);
@@ -1056,7 +1059,7 @@
/*--- Read info from a .so/exe file. ---*/
/*------------------------------------------------------------*/
=20
-Bool VG_(is_object_file)(const void *buf)
+static Bool is_elf_object_file(const void *buf)
{
{
ElfXX_Ehdr *ehdr =3D (ElfXX_Ehdr *)buf;
@@ -1437,7 +1440,7 @@
ehdr =3D (ElfXX_Ehdr*)oimage;
=20
if (ok)
- ok &=3D VG_(is_object_file)(ehdr);
+ ok &=3D is_elf_object_file(ehdr);
=20
if (!ok) {
ML_(symerr)("Invalid ELF header, or missing stringtab/sectiontab."=
);
@@ -1681,7 +1684,7 @@
if ((dimage =3D find_debug_file(si->filename, debuglink, crc, &=
n_dimage)) !=3D 0) {
ehdr =3D (ElfXX_Ehdr*)dimage;
=20
- if (n_dimage >=3D sizeof(ElfXX_Ehdr) && VG_(is_object_file)(=
ehdr))
+ if (n_dimage >=3D sizeof(ElfXX_Ehdr) && is_elf_object_file(e=
hdr))
{
shdr =3D (ElfXX_Shdr*)(dimage + ehdr->e_shoff);
sh_strtab =3D (UChar*)(dimage + shdr[ehdr->e_shstrndx].sh=
_offset);
@@ -1853,21 +1856,21 @@
VGP_POPCC(VgpReadSyms);
}
=20
-void VG_(seginfo_decref)(SegInfo *si, Addr start)
-{
- vg_assert(si);
- vg_assert(si->ref >=3D 1);
- if (--si->ref =3D=3D 0)
- unload_symbols(si->start, si->size);
-}
+//static void seginfo_decref(SegInfo *si, Addr start)
+//{
+// vg_assert(si);
+// vg_assert(si->ref >=3D 1);
+// if (--si->ref =3D=3D 0)
+// unload_symbols(si->start, si->size);
+//}
+//
+//static void seginfo_incref(SegInfo *si)
+//{
+// vg_assert(si);
+// vg_assert(si->ref > 0);
+// si->ref++;
+//}
=20
-void VG_(seginfo_incref)(SegInfo *si)
-{
- vg_assert(si);
- vg_assert(si->ref > 0);
- si->ref++;
-}
-
/*------------------------------------------------------------*/
/*--- Use of symbol table & location info to create ---*/
/*--- plausible-looking stack dumps. ---*/
Modified: trunk/coregrind/pub_core_debuginfo.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/pub_core_debuginfo.h 2005-09-28 01:14:32 UTC (rev 480=
0)
+++ trunk/coregrind/pub_core_debuginfo.h 2005-09-28 01:23:25 UTC (rev 480=
1)
@@ -45,11 +45,8 @@
extern void VG_(di_notify_munmap)( Addr a, SizeT len );
extern void VG_(di_notify_mprotect)( Addr a, SizeT len, UInt prot );
=20
-extern Bool VG_(is_object_file) ( const void *hdr );
extern SegInfo *VG_(read_seg_symbols) ( Addr addr, SizeT len,
OffT offset, const Char* filenam=
e);
-extern void VG_(seginfo_incref) ( SegInfo * );
-extern void VG_(seginfo_decref) ( SegInfo *, Addr a );
=20
extern Bool VG_(get_fnname_nodemangle)( Addr a, Char* fnname, Int n_fnna=
me );
=20
|