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
(21) |
2
(18) |
3
(19) |
4
(17) |
|
5
(6) |
6
(5) |
7
(9) |
8
(21) |
9
(16) |
10
(21) |
11
(22) |
|
12
(19) |
13
(19) |
14
(8) |
15
(16) |
16
(17) |
17
(16) |
18
(33) |
|
19
(33) |
20
(34) |
21
(32) |
22
(26) |
23
(23) |
24
(16) |
25
(21) |
|
26
(19) |
27
(7) |
28
(29) |
29
(27) |
30
(55) |
|
|
|
From: <sv...@va...> - 2005-06-21 23:45:02
|
Author: njn
Date: 2005-06-22 00:44:58 +0100 (Wed, 22 Jun 2005)
New Revision: 3995
Log:
Remove VG_(getcwd_alloc)(), which can be done otherwise pretty easily.
This halves m_libcfile's dependence on m_mallocfree.
Modified:
trunk/cachegrind/cg_main.c
trunk/coregrind/m_libcfile.c
trunk/include/pub_tool_libcfile.h
trunk/massif/ms_main.c
Modified: trunk/cachegrind/cg_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/cachegrind/cg_main.c 2005-06-21 23:09:45 UTC (rev 3994)
+++ trunk/cachegrind/cg_main.c 2005-06-21 23:44:58 UTC (rev 3995)
@@ -1146,10 +1146,10 @@
VG_(register_profile_event)(VgpCacheResults, "cache-results");
}
=20
+static Char base_dir[VKI_PATH_MAX];
+
static void cg_pre_clo_init(void)
{
- Char* base_dir =3D NULL;
-
VG_(details_name) ("Cachegrind");
VG_(details_version) (NULL);
VG_(details_description) ("an I1/D1/L2 cache profiler");
@@ -1168,13 +1168,12 @@
cg_print_debug_usage);
=20
/* Get working directory */
- tl_assert( VG_(getcwd_alloc)(&base_dir) );
+ tl_assert( VG_(getcwd)(base_dir, VKI_PATH_MAX) );
=20
/* Block is big enough for dir name + cachegrind.out.<pid> */
cachegrind_out_file =3D VG_(malloc)((VG_(strlen)(base_dir) + 32)*size=
of(Char));
VG_(sprintf)(cachegrind_out_file, "%s/cachegrind.out.%d",
base_dir, VG_(getpid)());
- VG_(free)(base_dir);
=20
instr_info_table =3D VG_(HT_construct)();
}
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-06-21 23:09:45 UTC (rev 3994)
+++ trunk/coregrind/m_libcfile.c 2005-06-21 23:44:58 UTC (rev 3995)
@@ -174,33 +174,14 @@
=20
/* Nb: we do not allow the Linux extension which malloc()s memory for th=
e
buffer if buf=3D=3DNULL, because we don't want Linux calling malloc()=
*/
-Char* VG_(getcwd) ( Char* buf, SizeT size )
+Bool VG_(getcwd) ( Char* buf, SizeT size )
{
SysRes res;
vg_assert(buf !=3D NULL);
res =3D VG_(do_syscall2)(__NR_getcwd, (UWord)buf, size);
- return res.isError ? ((Char*)NULL) : (Char*)res.val;
+ return res.isError ? False : True;
}
=20
-/* Alternative version that does allocate the memory. Easier to use. */
-Bool VG_(getcwd_alloc) ( Char** out )
-{
- SizeT size =3D 4;
-
- *out =3D NULL;
- while (True) {
- *out =3D VG_(malloc)(size);
- if (NULL =3D=3D VG_(getcwd)(*out, size)) {
- VG_(free)(*out);
- if (size > 65535)
- return False;
- size *=3D 2;
- } else {
- return True;
- }
- }
-}
-
Int VG_(readlink) (Char* path, Char* buf, UInt bufsiz)
{
SysRes res;
Modified: trunk/include/pub_tool_libcfile.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/pub_tool_libcfile.h 2005-06-21 23:09:45 UTC (rev 3994)
+++ trunk/include/pub_tool_libcfile.h 2005-06-21 23:44:58 UTC (rev 3995)
@@ -48,7 +48,8 @@
extern Int VG_(rename) ( Char* old_name, Char* new_name );
extern Int VG_(unlink) ( Char* file_name );
=20
-extern Char* VG_(getcwd) ( Char* buf, SizeT size );
+// Returns False on failure (eg. if the buffer isn't big enough).
+extern Bool VG_(getcwd) ( Char* buf, SizeT size );
=20
/* Easier to use than VG_(getcwd)() -- does the buffer fiddling itself.
String put into 'cwd' is VG_(malloc)'d, and should be VG_(free)'d.
Modified: trunk/massif/ms_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/massif/ms_main.c 2005-06-21 23:09:45 UTC (rev 3994)
+++ trunk/massif/ms_main.c 2005-06-21 23:44:58 UTC (rev 3995)
@@ -265,7 +265,7 @@
static UInt n_heap_blocks =3D 0;
=20
// Current directory at startup.
-static Char* base_dir;
+static Char base_dir[VKI_PATH_MAX];
=20
#define MAX_ALLOC_FNS 32 // includes the builtin ones
=20
@@ -1835,7 +1835,7 @@
// Dummy node at top of the context structure.
alloc_xpt =3D new_XPt(0, NULL, /*is_bottom*/False);
=20
- tl_assert( VG_(getcwd_alloc)(&base_dir) );
+ tl_assert( VG_(getcwd)(base_dir, VKI_PATH_MAX) );
}
=20
VG_DETERMINE_INTERFACE_VERSION(ms_pre_clo_init, 0)
|
|
From: <sv...@va...> - 2005-06-21 23:09:47
|
Author: njn
Date: 2005-06-22 00:09:45 +0100 (Wed, 22 Jun 2005)
New Revision: 3994
Log:
Make search_all_symtabs() work in the same way as search_all_loctabs()
and search_all_scopetabs(), ie. search through SegInfos instead of Segmen=
ts.
This reduces m_debuginfo's dependency on m_aspacemgr.
Modified:
trunk/coregrind/m_debuginfo/symtab.c
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-06-21 23:03:36 UTC (rev 399=
3)
+++ trunk/coregrind/m_debuginfo/symtab.c 2005-06-21 23:09:45 UTC (rev 399=
4)
@@ -1796,32 +1796,25 @@
/* Search all symtabs that we know about to locate ptr. If found, set
*psi to the relevant SegInfo, and *symno to the symtab entry number
within that. If not found, *psi is set to NULL. */
-
static void search_all_symtabs ( Addr ptr, /*OUT*/SegInfo** psi,=20
/*OUT*/Int* symno,
Bool match_anywhere_in_fun )
{
Int sno;
SegInfo* si;
- Segment *s;
=20
VGP_PUSHCC(VgpSearchSyms);
=20
- s =3D VG_(find_segment)(ptr);
-
- if (s =3D=3D NULL || s->seginfo =3D=3D NULL)
- goto not_found;
- =20
- si =3D s->seginfo;
-
- sno =3D search_one_symtab ( si, ptr, match_anywhere_in_fun );
- if (sno =3D=3D -1) goto not_found;
- =20
- *symno =3D sno;
- *psi =3D si;
- VGP_POPCC(VgpSearchSyms);
- return;
-
+ for (si =3D segInfo_list; si !=3D NULL; si =3D si->next) {
+ if (si->start <=3D ptr && ptr < si->start+si->size) {
+ sno =3D search_one_symtab ( si, ptr, match_anywhere_in_fun );
+ if (sno =3D=3D -1) goto not_found;
+ *symno =3D sno;
+ *psi =3D si;
+ VGP_POPCC(VgpSearchSyms);
+ return;
+ }
+ }
not_found:
*psi =3D NULL;
VGP_POPCC(VgpSearchSyms);
|
|
From: <sv...@va...> - 2005-06-21 23:04:05
|
Author: njn
Date: 2005-06-22 00:03:36 +0100 (Wed, 22 Jun 2005)
New Revision: 3993
Log:
Added VG_() prefixes to functions exported from m_ume to avoid=20
namespace pollution.
Also broadened a couple of _dl_* suppressions so that vgtest_ume
passes on my machine.
Modified:
trunk/coregrind/m_main.c
trunk/coregrind/m_ume.c
trunk/coregrind/pub_core_ume.h
trunk/coregrind/stage1.c
trunk/memcheck/tests/Makefile.am
trunk/memcheck/tests/vgtest_ume.c
trunk/memcheck/tests/vgtest_ume.stderr.exp
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-06-21 22:47:54 UTC (rev 3992)
+++ trunk/coregrind/m_main.c 2005-06-21 23:03:36 UTC (rev 3993)
@@ -176,7 +176,7 @@
/* Look for our AUXV table */
static int scan_auxv(void* init_sp)
{
- struct ume_auxv *auxv =3D find_auxv((UWord*)init_sp);
+ struct ume_auxv *auxv =3D VG_(find_auxv)((UWord*)init_sp);
int padfile =3D -1, found =3D 0;
=20
for (; auxv->a_type !=3D AT_NULL; auxv++)
@@ -215,7 +215,7 @@
#if defined(VGP_ppc32_linux)
case AT_SYSINFO_EHDR:
VG_(vdso_base) =3D auxv->u.a_val;
- foreach_map(find_vdso, NULL);
+ VG_(foreach_map)(find_vdso, NULL);
break;
#endif
}
@@ -764,7 +764,7 @@
Addr cl_esp; /* client stack base (initial esp) */
=20
/* use our own auxv as a prototype */
- orig_auxv =3D find_auxv(init_sp);
+ orig_auxv =3D VG_(find_auxv)(init_sp);
=20
/* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D compu=
te sizes =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */
=20
@@ -1211,7 +1211,7 @@
} else {
Int ret;
VG_(clexecfd) =3D VG_(open)(exec, VKI_O_RDONLY, VKI_S_IRUSR);
- ret =3D do_exec(exec, info);
+ ret =3D VG_(do_exec)(exec, info);
if (ret !=3D 0) {
fprintf(stderr, "valgrind: do_exec(%s) failed: %s\n",
exec, strerror(ret));
@@ -1280,7 +1280,7 @@
extra.killpad_padstat =3D &padstat;
extra.killpad_start =3D start;
extra.killpad_end =3D end;
- foreach_map(killpad, &extra);
+ VG_(foreach_map)(killpad, &extra);
}
=20
static void as_closepadfile(int padfile)
Modified: trunk/coregrind/m_ume.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_ume.c 2005-06-21 22:47:54 UTC (rev 3992)
+++ trunk/coregrind/m_ume.c 2005-06-21 23:03:36 UTC (rev 3993)
@@ -76,10 +76,10 @@
=20
// 'extra' allows the caller to pass in extra args to 'fn', like free
// variables to a closure.
-void foreach_map(int (*fn)(char *start, char *end,
- const char *perm, off_t offset,
- int maj, int min, int ino, void* extra),
- void* extra)
+void VG_(foreach_map)(int (*fn)(char *start, char *end,
+ const char *perm, off_t offset,
+ int maj, int min, int ino, void* extra),
+ void* extra)
{
static char buf[10240];
char *bufptr =3D buf;
@@ -129,13 +129,13 @@
/*------------------------------------------------------------*/
=20
// __attribute__((noreturn))
-// void jump_and_switch_stacks ( Addr stack, Addr dst );
+// void VG_(jump_and_switch_stacks) ( Addr stack, Addr dst );
#if defined(VGA_x86)
// 4(%esp) =3D=3D stack
// 8(%esp) =3D=3D dst
asm(
-".global jump_and_switch_stacks\n"
-"jump_and_switch_stacks:\n"
+".global vgPlain_jump_and_switch_stacks\n"
+"vgPlain_jump_and_switch_stacks:\n"
" movl %esp, %esi\n" // remember old stack pointer
" movl 4(%esi), %esp\n" // set stack
" pushl 8(%esi)\n" // dst to stack
@@ -153,8 +153,8 @@
// %rdi =3D=3D stack
// %rsi =3D=3D dst
asm(
-".global jump_and_switch_stacks\n"
-"jump_and_switch_stacks:\n"
+".global vgPlain_jump_and_switch_stacks\n"
+"vgPlain_jump_and_switch_stacks:\n"
" movq %rdi, %rsp\n" // set stack
" pushq %rsi\n" // dst to stack
" movq $0, %rax\n" // zero all GP regs
@@ -188,8 +188,8 @@
// %r3 =3D=3D stack
// %r4 =3D=3D dst
asm(
-".global jump_and_switch_stacks\n"
-"jump_and_switch_stacks:\n"
+".global vgPlain_jump_and_switch_stacks\n"
+"vgPlain_jump_and_switch_stacks:\n"
" mtctr %r4\n\t" // dst to %ctr
" mr %r1,%r3\n\t" // stack to %sp
" li 0,0\n\t" // zero all GP regs
@@ -237,7 +237,7 @@
/*--- Finding auxv on the stack ---*/
/*------------------------------------------------------------*/
=20
-struct ume_auxv *find_auxv(UWord* sp)
+struct ume_auxv *VG_(find_auxv)(UWord* sp)
{
sp++; // skip argc (Nb: is word-sized, not int-sized!)
=20
@@ -734,7 +734,7 @@
=20
// See ume.h for an indication of which entries of 'info' are inputs, wh=
ich
// are outputs, and which are both.
-int do_exec(const char *exe, struct exeinfo *info)
+int VG_(do_exec)(const char *exe, struct exeinfo *info)
{
info->interp_name =3D NULL;
info->interp_args =3D NULL;
Modified: trunk/coregrind/pub_core_ume.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_ume.h 2005-06-21 22:47:54 UTC (rev 3992)
+++ trunk/coregrind/pub_core_ume.h 2005-06-21 23:03:36 UTC (rev 3993)
@@ -45,10 +45,10 @@
=20
/* This is only here so it can be shared between stage1 and stage2 */
extern
-void foreach_map(int (*fn)(char *start, char *end,
- const char *perm, off_t offset,
- int maj, int min, int ino, void* extra),
- void* extra);
+void VG_(foreach_map)(int (*fn)(char *start, char *end,
+ const char *perm, off_t offset,
+ int maj, int min, int ino, void* extra),
+ void* extra);
=20
/* Jump to 'dst', but first set the stack pointer to 'stack'. Also,
clear all the integer registers before entering 'dst'. It's
@@ -62,7 +62,7 @@
*/
extern
__attribute__((noreturn))
-void jump_and_switch_stacks ( Addr stack, Addr dst );
+void VG_(jump_and_switch_stacks) ( Addr stack, Addr dst );
=20
=20
/*------------------------------------------------------------*/
@@ -95,7 +95,7 @@
// checks execute permissions, sets up interpreter if program is a scrip=
t,=20
// reads headers, maps file into memory, and returns important info abou=
t
// the program.
-extern int do_exec(const char *exe, struct exeinfo *info);
+extern int VG_(do_exec)(const char *exe, struct exeinfo *info);
=20
/*------------------------------------------------------------*/
/*--- Finding and dealing with auxv ---*/
@@ -110,7 +110,7 @@
} u;
};
=20
-extern struct ume_auxv *find_auxv(UWord* orig_esp);
+extern struct ume_auxv *VG_(find_auxv)(UWord* orig_esp);
=20
/* Our private auxv entries */
#define AT_UME_PADFD 0xff01 /* padding file fd */
Modified: trunk/coregrind/stage1.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/stage1.c 2005-06-21 22:47:54 UTC (rev 3992)
+++ trunk/coregrind/stage1.c 2005-06-21 23:03:36 UTC (rev 3993)
@@ -85,7 +85,7 @@
assert(&delta >=3D stack && &delta < &stack[sizeof(stack)/sizeof(*sta=
ck)]);
=20
/* find the beginning of the AUXV table */
- auxv =3D find_auxv(v_init_esp);
+ auxv =3D VG_(find_auxv)(v_init_esp);
=20
/* Work out how we should move things to make space for the new
auxv entry. It seems that ld.so wants a 16-byte aligned stack on
@@ -236,7 +236,7 @@
extra.fillgap_end =3D end;
extra.fillgap_padfile =3D padfile;
=20
- foreach_map(fillgap, &extra);
+ VG_(foreach_map)(fillgap, &extra);
=09
if (extra.fillgap_start < extra.fillgap_end) {
void* res =3D mmap(extra.fillgap_start,=20
@@ -283,7 +283,7 @@
=20
snprintf(buf, sizeof(buf), "%s/%s", valgrind_lib, stage2);
=20
- err =3D do_exec(buf, &info);
+ err =3D VG_(do_exec)(buf, &info);
=20
if (err !=3D 0) {
fprintf(stderr, "valgrind: failed to load %s: %s\n",
@@ -301,11 +301,11 @@
if (0) {
printf("---------- launch stage 2 ----------\n");
printf("eip=3D%p esp=3D%p\n", (void *)info.init_eip, esp);
- foreach_map(prmap, /*dummy*/NULL);
+ VG_(foreach_map)(prmap, /*dummy*/NULL);
}
=20
VG_(debugLog)(1, "stage1", "main2(): starting stage2\n");
- jump_and_switch_stacks(
+ VG_(jump_and_switch_stacks)(
(Addr) esp, /* stack */
(Addr) info.init_eip /* where to */
);
@@ -358,7 +358,7 @@
=20
/* move onto another stack so we can play with the main one */
VG_(debugLog)(1, "stage1", "main(): running main2() on new stack\n");
- jump_and_switch_stacks(
+ VG_(jump_and_switch_stacks)(
(Addr) stack + sizeof(stack), /* stack */
(Addr) main2 /* where to */
);
Modified: trunk/memcheck/tests/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/memcheck/tests/Makefile.am 2005-06-21 22:47:54 UTC (rev 3992)
+++ trunk/memcheck/tests/Makefile.am 2005-06-21 23:03:36 UTC (rev 3993)
@@ -202,5 +202,5 @@
=20
vgtest_ume_CFLAGS =3D -DVGA_$(VG_ARCH) -DVGO_$(VG_OS)
vgtest_ume_SOURCES =3D vgtest_ume.c
-vgtest_ume_LDADD =3D ../../coregrind/ume.o
+vgtest_ume_LDADD =3D ../../coregrind/m_ume.o
=20
Modified: trunk/memcheck/tests/vgtest_ume.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/tests/vgtest_ume.c 2005-06-21 22:47:54 UTC (rev 3992)
+++ trunk/memcheck/tests/vgtest_ume.c 2005-06-21 23:03:36 UTC (rev 3993)
@@ -6,14 +6,14 @@
#include <assert.h>
#include <elf.h>
#include "../../include/pub_tool_basics.h"
-#include "../../coregrind/ume.h"
+#include "../../coregrind/pub_core_ume.h"
=20
#define STKSZ (64*1024)
=20
static void* init_sp;
=20
//-------------------------------------------------------------------
-// Test foreach_map()
+// Test VG_(foreach_map)()
//-------------------------------------------------------------------
=20
static int x[8];
@@ -36,12 +36,12 @@
=20
static void test__foreach_map(void)
{
- fprintf(stderr, "Calling foreach_map()\n");
- foreach_map(f, /*dummy*/NULL);
+ fprintf(stderr, "Calling VG_(foreach_map)()\n");
+ VG_(foreach_map)(f, /*dummy*/NULL);
}
=20
//-------------------------------------------------------------------
-// Test find_auxv()
+// Test VG_(find_auxv)()
//-------------------------------------------------------------------
=20
static void test__find_auxv(void)
@@ -50,8 +50,8 @@
=20
assert(init_sp !=3D NULL);
=20
- fprintf(stderr, "Calling find_auxv()\n");
- auxv =3D find_auxv((UWord*)init_sp);
+ fprintf(stderr, "Calling VG_(find_auxv)()\n");
+ auxv =3D VG_(find_auxv)((UWord*)init_sp);
=20
// Check the auxv value looks sane
assert((void*)auxv > (void*)init_sp);
@@ -72,7 +72,7 @@
}
=20
//-------------------------------------------------------------------
-// Test do_exec()
+// Test VG_(do_exec)()
//-------------------------------------------------------------------
=20
static void push_auxv(unsigned char **espp, int type, void *val)
@@ -103,8 +103,8 @@
info.exe_end =3D 0x50ffffff;
info.map_base =3D 0x51000000;
=20
- fprintf(stderr, "Calling do_exec(\"hello\")\n");
- err =3D do_exec("hello", &info);
+ fprintf(stderr, "Calling VG_(do_exec)(\"hello\")\n");
+ err =3D VG_(do_exec)("hello", &info);
assert(0 =3D=3D err);
=20
// printf("info.exe_base=3D%p exe_end=3D%p\n",=20
@@ -134,7 +134,7 @@
=20
// fprintf(stderr, "ume_go: %p %p\n", (void*)info.init_eip, (void*)esp=
);
=20
- jump_and_switch_stacks((Addr)esp, info.init_eip);
+ VG_(jump_and_switch_stacks)((Addr)esp, info.init_eip);
=20
assert(0); // UNREACHABLE
}
Modified: trunk/memcheck/tests/vgtest_ume.stderr.exp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/tests/vgtest_ume.stderr.exp 2005-06-21 22:47:54 UTC (r=
ev 3992)
+++ trunk/memcheck/tests/vgtest_ume.stderr.exp 2005-06-21 23:03:36 UTC (r=
ev 3993)
@@ -1,4 +1,4 @@
-Calling foreach_map()
-Calling find_auxv()
-Calling do_exec("hello")
+Calling VG_(foreach_map)()
+Calling VG_(find_auxv)()
+Calling VG_(do_exec)("hello")
Hello, world!
|
|
From: <sv...@va...> - 2005-06-21 22:47:56
|
Author: njn
Date: 2005-06-21 23:47:54 +0100 (Tue, 21 Jun 2005)
New Revision: 3992
Log:
Rename ume.c/ume.h as m_ume.c/pub_core_ume.h to be consistent with=20
all the other modules.
Added:
trunk/coregrind/m_ume.c
trunk/coregrind/pub_core_ume.h
Removed:
trunk/coregrind/ume.c
trunk/coregrind/ume.h
Modified:
trunk/coregrind/Makefile.am
trunk/coregrind/m_main.c
trunk/coregrind/stage1.c
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-06-21 22:27:19 UTC (rev 3991)
+++ trunk/coregrind/Makefile.am 2005-06-21 22:47:54 UTC (rev 3992)
@@ -72,7 +72,7 @@
pub_core_translate.h \
pub_core_transtab.h \
pub_core_transtab_asm.h \
- ume.h \
+ pub_core_ume.h \
vki_unistd.h \
vki_unistd-amd64-linux.h\
vki_unistd-arm-linux.h \
@@ -87,10 +87,9 @@
CLEANFILES =3D stage2.lds
=09
valgrind_SOURCES =3D \
- ume.c \
- \
stage1.c \
- m_debuglog.c
+ m_debuglog.c \
+ m_ume.c
valgrind_DEPENDENCIES =3D
valgrind_LDFLAGS=3D-static -g
valgrind_LDADD=3D
@@ -126,8 +125,7 @@
m_trampoline.S \
m_translate.c \
m_transtab.c \
- \
- ume.c
+ m_ume.c
=20
## Nb: libscheduler.a must precede libdispatch.a in this list.
stage2_extra=3D \
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-06-21 22:27:19 UTC (rev 3991)
+++ trunk/coregrind/m_main.c 2005-06-21 22:47:54 UTC (rev 3992)
@@ -56,7 +56,7 @@
#include "pub_core_tooliface.h"
#include "pub_core_trampoline.h"
#include "pub_core_transtab.h"
-#include "ume.h"
+#include "pub_core_ume.h"
=20
#include <dirent.h>
#include <dlfcn.h>
Copied: trunk/coregrind/m_ume.c (from rev 3989, trunk/coregrind/ume.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/ume.c 2005-06-21 13:26:17 UTC (rev 3989)
+++ trunk/coregrind/m_ume.c 2005-06-21 22:47:54 UTC (rev 3992)
@@ -0,0 +1,747 @@
+
+/*--------------------------------------------------------------------*/
+/*--- User-mode execve(), and other stuff shared between stage1 ---*/
+/*--- and stage2. m_ume.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.
+*/
+
+
+#define _GNU_SOURCE
+#define _FILE_OFFSET_BITS 64
+
+// It seems that on SuSE 9.1 (x86) something in <fcntl.h> messes up stuf=
f
+// acquired indirectly from vki-x86-linux.h. Therefore our headers must=
be
+// included ahead of the glibc ones. This fix is a kludge; the right
+// solution is to entirely remove the glibc dependency.
+#include "pub_core_basics.h"
+#include "pub_core_libcbase.h"
+#include "pub_core_machine.h"
+#include "pub_core_ume.h"
+
+#include <sys/mman.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <assert.h>
+
+#if VG_WORDSIZE =3D=3D 8
+#define ESZ(x) Elf64_##x
+#elif VG_WORDSIZE =3D=3D 4
+#define ESZ(x) Elf32_##x
+#else
+#error VG_WORDSIZE needs to =3D=3D4 or =3D=3D8
+#endif
+
+struct elfinfo
+{
+ ESZ(Ehdr) e;
+ ESZ(Phdr) *p;
+ int fd;
+};
+
+static void check_mmap(void* res, void* base, int len)
+{
+ if ((void*)-1 =3D=3D res) {
+ fprintf(stderr, "valgrind: mmap(%p, %d) failed in UME.\n", base, l=
en);
+ exit(1);
+ }
+}
+
+// 'extra' allows the caller to pass in extra args to 'fn', like free
+// variables to a closure.
+void foreach_map(int (*fn)(char *start, char *end,
+ const char *perm, off_t offset,
+ int maj, int min, int ino, void* extra),
+ void* extra)
+{
+ static char buf[10240];
+ char *bufptr =3D buf;
+ int ret, fd;
+
+ fd =3D open("/proc/self/maps", O_RDONLY);
+
+ if (fd =3D=3D -1) {
+ perror("open /proc/self/maps");
+ return;
+ }
+
+ ret =3D read(fd, buf, sizeof(buf));
+
+ if (ret =3D=3D -1) {
+ perror("read /proc/self/maps");
+ close(fd);
+ return;
+ }
+ close(fd);
+
+ if (ret =3D=3D sizeof(buf)) {
+ fprintf(stderr, "buf too small\n");
+ return;
+ }
+
+ while(bufptr && bufptr < buf+ret) {
+ char perm[5];
+ ULong offset;
+ int maj, min;
+ int ino;
+ void *segstart, *segend;
+
+ sscanf(bufptr, "%p-%p %s %llx %x:%x %d",
+ &segstart, &segend, perm, &offset, &maj, &min, &ino);
+ bufptr =3D strchr(bufptr, '\n');
+ if (bufptr !=3D NULL)
+ bufptr++; /* skip \n */
+
+ if (!(*fn)(segstart, segend, perm, offset, maj, min, ino, extra))
+ break;
+ }
+}
+
+/*------------------------------------------------------------*/
+/*--- Stack switching ---*/
+/*------------------------------------------------------------*/
+
+// __attribute__((noreturn))
+// void jump_and_switch_stacks ( Addr stack, Addr dst );
+#if defined(VGA_x86)
+// 4(%esp) =3D=3D stack
+// 8(%esp) =3D=3D dst
+asm(
+".global jump_and_switch_stacks\n"
+"jump_and_switch_stacks:\n"
+" movl %esp, %esi\n" // remember old stack pointer
+" movl 4(%esi), %esp\n" // set stack
+" pushl 8(%esi)\n" // dst to stack
+" movl $0, %eax\n" // zero all GP regs
+" movl $0, %ebx\n"
+" movl $0, %ecx\n"
+" movl $0, %edx\n"
+" movl $0, %esi\n"
+" movl $0, %edi\n"
+" movl $0, %ebp\n"
+" ret\n" // jump to dst
+" ud2\n" // should never get here
+);
+#elif defined(VGA_amd64)
+// %rdi =3D=3D stack
+// %rsi =3D=3D dst
+asm(
+".global jump_and_switch_stacks\n"
+"jump_and_switch_stacks:\n"
+" movq %rdi, %rsp\n" // set stack
+" pushq %rsi\n" // dst to stack
+" movq $0, %rax\n" // zero all GP regs
+" movq $0, %rbx\n"
+" movq $0, %rcx\n"
+" movq $0, %rdx\n"
+" movq $0, %rsi\n"
+" movq $0, %rdi\n"
+" movq $0, %rbp\n"
+" movq $0, %r8\n"\
+" movq $0, %r9\n"\
+" movq $0, %r10\n"
+" movq $0, %r11\n"
+" movq $0, %r12\n"
+" movq $0, %r13\n"
+" movq $0, %r14\n"
+" movq $0, %r15\n"
+" ret\n" // jump to dst
+" ud2\n" // should never get here
+);
+
+#elif defined(VGA_ppc32)
+/* Jump to 'dst', but first set the stack pointer to 'stack'. Also,
+ clear all the integer registers before entering 'dst'. It's
+ important that the stack pointer is set to exactly 'stack' and not
+ (eg) stack - apparently_harmless_looking_small_offset. Basically
+ because the code at 'dst' might be wanting to scan the area above
+ 'stack' (viz, the auxv array), and putting spurious words on the
+ stack confuses it.
+*/
+// %r3 =3D=3D stack
+// %r4 =3D=3D dst
+asm(
+".global jump_and_switch_stacks\n"
+"jump_and_switch_stacks:\n"
+" mtctr %r4\n\t" // dst to %ctr
+" mr %r1,%r3\n\t" // stack to %sp
+" li 0,0\n\t" // zero all GP regs
+" li 3,0\n\t"
+" li 4,0\n\t"
+" li 5,0\n\t"
+" li 6,0\n\t"
+" li 7,0\n\t"
+" li 8,0\n\t"
+" li 9,0\n\t"
+" li 10,0\n\t"
+" li 11,0\n\t"
+" li 12,0\n\t"
+" li 13,0\n\t" // CAB: This right? r13 =3D small data area p=
tr
+" li 14,0\n\t"
+" li 15,0\n\t"
+" li 16,0\n\t"
+" li 17,0\n\t"
+" li 18,0\n\t"
+" li 19,0\n\t"
+" li 20,0\n\t"
+" li 21,0\n\t"
+" li 22,0\n\t"
+" li 23,0\n\t"
+" li 24,0\n\t"
+" li 25,0\n\t"
+" li 26,0\n\t"
+" li 27,0\n\t"
+" li 28,0\n\t"
+" li 29,0\n\t"
+" li 30,0\n\t"
+" li 31,0\n\t"
+" mtxer 0\n\t"
+" mtcr 0\n\t"
+" mtlr %r0\n\t"
+" bctr\n\t" // jump to dst
+" trap\n" // should never get here
+);
+
+#else
+# error Unknown architecture
+#endif
+
+/*------------------------------------------------------------*/
+/*--- Finding auxv on the stack ---*/
+/*------------------------------------------------------------*/
+
+struct ume_auxv *find_auxv(UWord* sp)
+{
+ sp++; // skip argc (Nb: is word-sized, not int-sized!)
+
+ while (*sp !=3D 0) // skip argv
+ sp++;
+ sp++;
+
+ while (*sp !=3D 0) // skip env
+ sp++;
+ sp++;
+ =20
+#if defined(VGA_ppc32)
+# if defined AT_IGNOREPPC
+ while (*sp =3D=3D AT_IGNOREPPC) // skip AT_IGNOREPPC entries
+ sp +=3D 2;
+# endif
+#endif
+
+ return (struct ume_auxv *)sp;
+}
+
+/*------------------------------------------------------------*/
+/*--- Loading ELF files ---*/
+/*------------------------------------------------------------*/
+
+static=20
+struct elfinfo *readelf(int fd, const char *filename)
+{
+ struct elfinfo *e =3D malloc(sizeof(*e));
+ int phsz;
+
+ assert(e);
+ e->fd =3D fd;
+
+ if (pread(fd, &e->e, sizeof(e->e), 0) !=3D sizeof(e->e)) {
+ fprintf(stderr, "valgrind: %s: can't read ELF header: %s\n",=20
+ filename, strerror(errno));
+ return NULL;
+ }
+
+ if (memcmp(&e->e.e_ident[0], ELFMAG, SELFMAG) !=3D 0) {
+ fprintf(stderr, "valgrind: %s: bad ELF magic number\n", filename);
+ return NULL;
+ }
+ if (e->e.e_ident[EI_CLASS] !=3D VGA_ELF_CLASS) {
+ fprintf(stderr,=20
+ "valgrind: wrong ELF executable class "
+ "(eg. 32-bit instead of 64-bit)\n");
+ return NULL;
+ }
+ if (e->e.e_ident[EI_DATA] !=3D VGA_ELF_ENDIANNESS) {
+ fprintf(stderr, "valgrind: executable has wrong endian-ness\n");
+ return NULL;
+ }
+ if (!(e->e.e_type =3D=3D ET_EXEC || e->e.e_type =3D=3D ET_DYN)) {
+ fprintf(stderr, "valgrind: this is not an executable\n");
+ return NULL;
+ }
+
+ if (e->e.e_machine !=3D VGA_ELF_MACHINE) {
+ fprintf(stderr, "valgrind: executable is not for "
+ "this architecture\n");
+ return NULL;
+ }
+
+ if (e->e.e_phentsize !=3D sizeof(ESZ(Phdr))) {
+ fprintf(stderr, "valgrind: sizeof ELF Phdr wrong\n");
+ return NULL;
+ }
+
+ phsz =3D sizeof(ESZ(Phdr)) * e->e.e_phnum;
+ e->p =3D malloc(phsz);
+ assert(e->p);
+
+ if (pread(fd, e->p, phsz, e->e.e_phoff) !=3D phsz) {
+ fprintf(stderr, "valgrind: can't read phdr: %s\n", strerror(errno)=
);
+ return NULL;
+ }
+
+ return e;
+}
+
+/* Map an ELF file. Returns the brk address. */
+static
+ESZ(Addr) mapelf(struct elfinfo *e, ESZ(Addr) base)
+{
+ int i;
+ void* res;
+ ESZ(Addr) elfbrk =3D 0;
+
+ for(i =3D 0; i < e->e.e_phnum; i++) {
+ ESZ(Phdr) *ph =3D &e->p[i];
+ ESZ(Addr) addr, brkaddr;
+ ESZ(Word) memsz;
+
+ if (ph->p_type !=3D PT_LOAD)
+ continue;
+
+ addr =3D ph->p_vaddr+base;
+ memsz =3D ph->p_memsz;
+ brkaddr =3D addr+memsz;
+
+ if (brkaddr > elfbrk)
+ elfbrk =3D brkaddr;
+ }
+
+ for(i =3D 0; i < e->e.e_phnum; i++) {
+ ESZ(Phdr) *ph =3D &e->p[i];
+ ESZ(Addr) addr, bss, brkaddr;
+ ESZ(Off) off;
+ ESZ(Word) filesz;
+ ESZ(Word) memsz;
+ unsigned prot =3D 0;
+
+ if (ph->p_type !=3D PT_LOAD)
+ continue;
+
+ if (ph->p_flags & PF_X) prot |=3D PROT_EXEC;
+ if (ph->p_flags & PF_W) prot |=3D PROT_WRITE;
+ if (ph->p_flags & PF_R) prot |=3D PROT_READ;
+
+ addr =3D ph->p_vaddr+base;
+ off =3D ph->p_offset;
+ filesz =3D ph->p_filesz;
+ bss =3D addr+filesz;
+ memsz =3D ph->p_memsz;
+ brkaddr =3D addr+memsz;
+
+ // Tom says: In the following, do what the Linux kernel does and o=
nly
+ // map the pages that are required instead of rounding everything =
to
+ // the specified alignment (ph->p_align). (AMD64 doesn't work if =
you
+ // use ph->p_align -- part of stage2's memory gets trashed somehow=
.)
+ //
+ // The condition handles the case of a zero-length segment.
+ if (VG_PGROUNDUP(bss)-VG_PGROUNDDN(addr) > 0) {
+ res =3D mmap((char *)VG_PGROUNDDN(addr),
+ VG_PGROUNDUP(bss)-VG_PGROUNDDN(addr),
+ prot, MAP_FIXED|MAP_PRIVATE, e->fd, VG_PGROUNDDN(off=
));
+ check_mmap(res, (char*)VG_PGROUNDDN(addr),
+ VG_PGROUNDUP(bss)-VG_PGROUNDDN(addr));
+ }
+
+ // if memsz > filesz, fill the remainder with zeroed pages
+ if (memsz > filesz) {
+ UInt bytes;
+
+ bytes =3D VG_PGROUNDUP(brkaddr)-VG_PGROUNDUP(bss);
+ if (bytes > 0) {
+ res =3D mmap((char *)VG_PGROUNDUP(bss), bytes,
+ prot, MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE, -1, 0);
+ check_mmap(res, (char*)VG_PGROUNDUP(bss), bytes);
+ }
+
+ bytes =3D bss & (VKI_PAGE_SIZE - 1);
+
+ // The 'prot' condition allows for a read-only bss
+ if ((prot & PROT_WRITE) && (bytes > 0)) {
+ bytes =3D VKI_PAGE_SIZE - bytes;
+ memset((char *)bss, 0, bytes);
+ }
+ }
+ }
+
+ return elfbrk;
+}
+
+// Forward declaration.
+static int do_exec_inner(const char *exe, struct exeinfo *info);
+
+static int match_ELF(const char *hdr, int len)
+{
+ ESZ(Ehdr) *e =3D (ESZ(Ehdr) *)hdr;
+ return (len > sizeof(*e)) && memcmp(&e->e_ident[0], ELFMAG, SELFMAG) =
=3D=3D 0;
+}
+
+static int load_ELF(char *hdr, int len, int fd, const char *name,
+ struct exeinfo *info)
+{
+ struct elfinfo *e;
+ struct elfinfo *interp =3D NULL;
+ ESZ(Addr) minaddr =3D ~0; /* lowest mapped address */
+ ESZ(Addr) maxaddr =3D 0; /* highest mapped address */
+ ESZ(Addr) interp_addr =3D 0; /* interpreter (ld.so) address */
+ ESZ(Word) interp_size =3D 0; /* interpreter size */
+ ESZ(Word) interp_align =3D VKI_PAGE_SIZE;
+ int i;
+ void *entry;
+ ESZ(Addr) ebase =3D 0;
+
+#ifdef HAVE_PIE
+ ebase =3D info->exe_base;
+#endif
+
+ e =3D readelf(fd, name);
+
+ if (e =3D=3D NULL)
+ return ENOEXEC;
+
+ info->phnum =3D e->e.e_phnum;
+ info->entry =3D e->e.e_entry + ebase;
+ info->phdr =3D 0;
+
+ for(i =3D 0; i < e->e.e_phnum; i++) {
+ ESZ(Phdr) *ph =3D &e->p[i];
+
+ switch(ph->p_type) {
+ case PT_PHDR:
+ info->phdr =3D ph->p_vaddr + ebase;
+ break;
+
+ case PT_LOAD:
+ if (ph->p_vaddr < minaddr)
+ minaddr =3D ph->p_vaddr;
+ if (ph->p_vaddr+ph->p_memsz > maxaddr)
+ maxaddr =3D ph->p_vaddr+ph->p_memsz;
+ break;
+ =09
+ case PT_INTERP: {
+ char *buf =3D malloc(ph->p_filesz+1);
+ int j;
+ int intfd;
+ int baseaddr_set;
+
+ assert(buf);
+ pread(fd, buf, ph->p_filesz, ph->p_offset);
+ buf[ph->p_filesz] =3D '\0';
+
+ intfd =3D open(buf, O_RDONLY);
+ if (intfd =3D=3D -1) {
+ perror("open interp");
+ exit(1);
+ }
+
+ interp =3D readelf(intfd, buf);
+ if (interp =3D=3D NULL) {
+ fprintf(stderr, "Can't read interpreter\n");
+ return 1;
+ }
+ free(buf);
+
+ baseaddr_set =3D 0;
+ for(j =3D 0; j < interp->e.e_phnum; j++) {
+ ESZ(Phdr) *iph =3D &interp->p[j];
+ ESZ(Addr) end;
+
+ if (iph->p_type !=3D PT_LOAD)
+ continue;
+ =20
+ if (!baseaddr_set) {
+ interp_addr =3D iph->p_vaddr;
+ interp_align =3D iph->p_align;
+ baseaddr_set =3D 1;
+ }
+
+ /* assumes that all segments in the interp are close */
+ end =3D (iph->p_vaddr - interp_addr) + iph->p_memsz;
+
+ if (end > interp_size)
+ interp_size =3D end;
+ }
+ break;
+
+ default:
+ // do nothing
+ break;
+ }
+ }
+ }
+
+ if (info->phdr =3D=3D 0)
+ info->phdr =3D minaddr + e->e.e_phoff;
+
+ if (info->exe_base !=3D info->exe_end) {
+ if (minaddr >=3D maxaddr ||
+ (minaddr + ebase < info->exe_base ||
+ maxaddr + ebase > info->exe_end)) {
+ fprintf(stderr, "Executable range %p-%p is outside the\n"
+ "acceptable range %p-%p\n",
+ (void *)minaddr + ebase, (void *)maxaddr + ebase,
+ (void *)info->exe_base, (void *)info->exe_end);
+ return ENOMEM;
+ }
+ }
+
+ info->brkbase =3D mapelf(e, ebase); /* map the executable */
+
+ if (info->brkbase =3D=3D 0)
+ return ENOMEM;
+
+ if (interp !=3D NULL) {
+ /* reserve a chunk of address space for interpreter */
+ void* res;
+ char* base =3D (char *)info->exe_base;
+ char* baseoff;
+ int flags =3D MAP_PRIVATE|MAP_ANONYMOUS;
+
+ if (info->map_base !=3D 0) {
+ base =3D (char *)VG_ROUNDUP(info->map_base, interp_align);
+ flags |=3D MAP_FIXED;
+ }
+
+ res =3D mmap(base, interp_size, PROT_NONE, flags, -1, 0);
+ check_mmap(res, base, interp_size);
+ base =3D res;
+
+ baseoff =3D base - interp_addr;
+
+ mapelf(interp, (ESZ(Addr))baseoff);
+
+ close(interp->fd);
+
+ entry =3D baseoff + interp->e.e_entry;
+ info->interp_base =3D (ESZ(Addr))base;
+
+ free(interp->p);
+ free(interp);
+ } else
+ entry =3D (void *)e->e.e_entry;
+
+ info->exe_base =3D minaddr + ebase;
+ info->exe_end =3D maxaddr + ebase;
+
+ info->init_eip =3D (Addr)entry;
+
+ free(e->p);
+ free(e);
+
+ return 0;
+}
+
+
+static int match_script(const char *hdr, Int len)
+{
+ return (len > 2) && memcmp(hdr, "#!", 2) =3D=3D 0;
+}
+
+static int load_script(char *hdr, int len, int fd, const char *name,
+ struct exeinfo *info)
+{
+ char *interp;
+ char *const end =3D hdr+len;
+ char *cp;
+ char *arg =3D NULL;
+ int eol;
+
+ interp =3D hdr + 2;
+ while(interp < end && (*interp =3D=3D ' ' || *interp =3D=3D '\t'))
+ interp++;
+
+ if (*interp !=3D '/')
+ return ENOEXEC; /* absolute path only for interpreter */
+
+ /* skip over interpreter name */
+ for(cp =3D interp; cp < end && *cp !=3D ' ' && *cp !=3D '\t' && *cp !=
=3D '\n'; cp++)
+ ;
+
+ eol =3D (*cp =3D=3D '\n');
+
+ *cp++ =3D '\0';
+
+ if (!eol && cp < end) {
+ /* skip space before arg */
+ while (cp < end && (*cp =3D=3D '\t' || *cp =3D=3D ' '))
+ cp++;
+
+ /* arg is from here to eol */
+ arg =3D cp;
+ while (cp < end && *cp !=3D '\n')
+ cp++;
+ *cp =3D '\0';
+ }
+ =20
+ info->interp_name =3D strdup(interp);
+ assert(NULL !=3D info->interp_name);
+ if (arg !=3D NULL && *arg !=3D '\0') {
+ info->interp_args =3D strdup(arg);
+ assert(NULL !=3D info->interp_args);
+ }
+
+ if (info->argv && info->argv[0] !=3D NULL)
+ info->argv[0] =3D (char *)name;
+
+ if (0)
+ printf("#! script: interp_name=3D\"%s\" interp_args=3D\"%s\"\n",
+ info->interp_name, info->interp_args);
+
+ return do_exec_inner(interp, info);
+}
+
+/*=20
+ Emulate the normal Unix permissions checking algorithm.
+
+ If owner matches, then use the owner permissions, else
+ if group matches, then use the group permissions, else
+ use other permissions.
+
+ Note that we can't deal with SUID/SGID, so we refuse to run them
+ (otherwise the executable may misbehave if it doesn't have the
+ permissions it thinks it does).
+*/
+static int check_perms(int fd)
+{
+ struct stat st;
+
+ if (fstat(fd, &st) =3D=3D -1)=20
+ return errno;
+
+ if (st.st_mode & (S_ISUID | S_ISGID)) {
+ //fprintf(stderr, "Can't execute suid/sgid executable %s\n", exe);
+ return EACCES;
+ }
+
+ if (geteuid() =3D=3D st.st_uid) {
+ if (!(st.st_mode & S_IXUSR))
+ return EACCES;
+ } else {
+ int grpmatch =3D 0;
+
+ if (getegid() =3D=3D st.st_gid)
+ grpmatch =3D 1;
+ else {
+ gid_t groups[32];
+ int ngrp =3D getgroups(32, groups);
+ int i;
+
+ for(i =3D 0; i < ngrp; i++)
+ if (groups[i] =3D=3D st.st_gid) {
+ grpmatch =3D 1;
+ break;
+ }
+ }
+
+ if (grpmatch) {
+ if (!(st.st_mode & S_IXGRP))
+ return EACCES;
+ } else if (!(st.st_mode & S_IXOTH))
+ return EACCES;
+ }
+
+ return 0;
+}
+
+static int do_exec_inner(const char *exe, struct exeinfo *info)
+{
+ int fd;
+ int err;
+ char buf[VKI_PAGE_SIZE];
+ int bufsz;
+ int i;
+ int ret;
+ static const struct {
+ int (*match)(const char *hdr, int len);
+ int (*load) ( char *hdr, int len, int fd2, const char *name,
+ struct exeinfo *);
+ } formats[] =3D {
+ { match_ELF, load_ELF },
+ { match_script, load_script },
+ };
+
+ fd =3D open(exe, O_RDONLY);
+ if (fd =3D=3D -1) {
+ if (0)
+ fprintf(stderr, "Can't open executable %s: %s\n",
+ exe, strerror(errno));
+ return errno;
+ }
+
+ err =3D check_perms(fd);
+ if (err !=3D 0) {
+ close(fd);
+ return err;
+ }
+
+ bufsz =3D pread(fd, buf, sizeof(buf), 0);
+ if (bufsz < 0) {
+ fprintf(stderr, "Can't read executable header: %s\n",
+ strerror(errno));
+ close(fd);
+ return errno;
+ }
+
+ ret =3D ENOEXEC;
+ for(i =3D 0; i < sizeof(formats)/sizeof(*formats); i++) {
+ if ((formats[i].match)(buf, bufsz)) {
+ ret =3D (formats[i].load)(buf, bufsz, fd, exe, info);
+ break;
+ }
+ }
+
+ close(fd);
+
+ return ret;
+}
+
+// See ume.h for an indication of which entries of 'info' are inputs, wh=
ich
+// are outputs, and which are both.
+int do_exec(const char *exe, struct exeinfo *info)
+{
+ info->interp_name =3D NULL;
+ info->interp_args =3D NULL;
+
+ return do_exec_inner(exe, info);
+}
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
Copied: trunk/coregrind/pub_core_ume.h (from rev 3989, trunk/coregrind/um=
e.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/ume.h 2005-06-21 13:26:17 UTC (rev 3989)
+++ trunk/coregrind/pub_core_ume.h 2005-06-21 22:47:54 UTC (rev 3992)
@@ -0,0 +1,123 @@
+
+/*--------------------------------------------------------------------*/
+/*--- User-mode execve. pub_core_ume.h ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ 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.
+*/
+
+#ifndef __PUB_CORE_UME_H
+#define __PUB_CORE_UME_H
+
+//--------------------------------------------------------------------
+// PURPOSE: This module implements user-mode execve, ie. program loading
+// and exec'ing. It is shared between stage1 and stage2.
+//--------------------------------------------------------------------
+
+#include <elf.h>
+#include <sys/types.h>
+
+/*------------------------------------------------------------*/
+/*--- General stuff ---*/
+/*------------------------------------------------------------*/
+
+/* This is only here so it can be shared between stage1 and stage2 */
+extern
+void foreach_map(int (*fn)(char *start, char *end,
+ const char *perm, off_t offset,
+ int maj, int min, int ino, void* extra),
+ void* extra);
+
+/* Jump to 'dst', but first set the stack pointer to 'stack'. Also,
+ clear all the integer registers before entering 'dst'. It's
+ important that the stack pointer is set to exactly 'stack' and not
+ (eg) stack - apparently_harmless_looking_small_offset. Basically
+ because the code at 'dst' might be wanting to scan the area above
+ 'stack' (viz, the auxv array), and putting spurious words on the
+ stack confuses it.
+
+ This is only exported so that vgtest_ume.c can use it.
+*/
+extern
+__attribute__((noreturn))
+void jump_and_switch_stacks ( Addr stack, Addr dst );
+
+
+/*------------------------------------------------------------*/
+/*--- Loading ELF files ---*/
+/*------------------------------------------------------------*/
+
+// Info needed to load and run a program. IN/INOUT/OUT refers to the
+// inputs/outputs of do_exec().
+struct exeinfo
+{
+ Addr map_base; // IN: if non-zero, base address of mappings
+ char** argv; // IN: the original argv
+
+ Addr exe_base; // INOUT: lowest (allowed) address of exe
+ Addr exe_end; // INOUT: highest (allowed) address
+
+ Addr phdr; // OUT: address phdr was mapped at
+ int phnum; // OUT: number of phdrs
+ Addr interp_base; // OUT: where interpreter (ld.so) was mapped
+ Addr entry; // OUT: entrypoint in main executable
+ Addr init_eip; // OUT: initial eip
+ Addr brkbase; // OUT: base address of brk segment
+
+ // These are the extra args added by #! scripts
+ char* interp_name; // OUT: the interpreter name
+ char* interp_args; // OUT: the args for the interpreter
+};
+
+// Does everything short of actually running 'exe': finds the file,
+// checks execute permissions, sets up interpreter if program is a scrip=
t,=20
+// reads headers, maps file into memory, and returns important info abou=
t
+// the program.
+extern int do_exec(const char *exe, struct exeinfo *info);
+
+/*------------------------------------------------------------*/
+/*--- Finding and dealing with auxv ---*/
+/*------------------------------------------------------------*/
+
+struct ume_auxv
+{
+ Word a_type;
+ union {
+ void *a_ptr;
+ Word a_val;
+ } u;
+};
+
+extern struct ume_auxv *find_auxv(UWord* orig_esp);
+
+/* Our private auxv entries */
+#define AT_UME_PADFD 0xff01 /* padding file fd */
+#define AT_UME_EXECFD 0xff02 /* stage1 executable fd */
+
+#endif /* __PUB_CORE_UME_H */
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/stage1.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/stage1.c 2005-06-21 22:27:19 UTC (rev 3991)
+++ trunk/coregrind/stage1.c 2005-06-21 22:47:54 UTC (rev 3992)
@@ -44,9 +44,9 @@
#include "memcheck/memcheck.h"
#include "pub_core_basics.h"
#include "pub_core_debuglog.h"
-#include "pub_core_libcbase.h"
-#include "pub_core_libcproc.h"
-#include "ume.h"
+#include "pub_core_libcbase.h" // For VG_PGROUNDUP, VG_PGROUNDDN
+#include "pub_core_libcproc.h" // For VALGRINDLIB
+#include "pub_core_ume.h"
=20
=20
static int stack[SIGSTKSZ*4];
Deleted: trunk/coregrind/ume.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/ume.c 2005-06-21 22:27:19 UTC (rev 3991)
+++ trunk/coregrind/ume.c 2005-06-21 22:47:54 UTC (rev 3992)
@@ -1,747 +0,0 @@
-
-/*--------------------------------------------------------------------*/
-/*--- User-mode execve(), and other stuff shared between stage1 ---*/
-/*--- and stage2. ume.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.
-*/
-
-
-#define _GNU_SOURCE
-#define _FILE_OFFSET_BITS 64
-
-// It seems that on SuSE 9.1 (x86) something in <fcntl.h> messes up stuf=
f
-// acquired indirectly from vki-x86-linux.h. Therefore our headers must=
be
-// included ahead of the glibc ones. This fix is a kludge; the right
-// solution is to entirely remove the glibc dependency.
-#include "pub_core_basics.h"
-#include "pub_core_libcbase.h"
-#include "pub_core_machine.h"
-#include "ume.h"
-
-#include <sys/mman.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <assert.h>
-
-#if VG_WORDSIZE =3D=3D 8
-#define ESZ(x) Elf64_##x
-#elif VG_WORDSIZE =3D=3D 4
-#define ESZ(x) Elf32_##x
-#else
-#error VG_WORDSIZE needs to =3D=3D4 or =3D=3D8
-#endif
-
-struct elfinfo
-{
- ESZ(Ehdr) e;
- ESZ(Phdr) *p;
- int fd;
-};
-
-static void check_mmap(void* res, void* base, int len)
-{
- if ((void*)-1 =3D=3D res) {
- fprintf(stderr, "valgrind: mmap(%p, %d) failed in UME.\n", base, l=
en);
- exit(1);
- }
-}
-
-// 'extra' allows the caller to pass in extra args to 'fn', like free
-// variables to a closure.
-void foreach_map(int (*fn)(char *start, char *end,
- const char *perm, off_t offset,
- int maj, int min, int ino, void* extra),
- void* extra)
-{
- static char buf[10240];
- char *bufptr =3D buf;
- int ret, fd;
-
- fd =3D open("/proc/self/maps", O_RDONLY);
-
- if (fd =3D=3D -1) {
- perror("open /proc/self/maps");
- return;
- }
-
- ret =3D read(fd, buf, sizeof(buf));
-
- if (ret =3D=3D -1) {
- perror("read /proc/self/maps");
- close(fd);
- return;
- }
- close(fd);
-
- if (ret =3D=3D sizeof(buf)) {
- fprintf(stderr, "buf too small\n");
- return;
- }
-
- while(bufptr && bufptr < buf+ret) {
- char perm[5];
- ULong offset;
- int maj, min;
- int ino;
- void *segstart, *segend;
-
- sscanf(bufptr, "%p-%p %s %llx %x:%x %d",
- &segstart, &segend, perm, &offset, &maj, &min, &ino);
- bufptr =3D strchr(bufptr, '\n');
- if (bufptr !=3D NULL)
- bufptr++; /* skip \n */
-
- if (!(*fn)(segstart, segend, perm, offset, maj, min, ino, extra))
- break;
- }
-}
-
-/*------------------------------------------------------------*/
-/*--- Stack switching ---*/
-/*------------------------------------------------------------*/
-
-// __attribute__((noreturn))
-// void jump_and_switch_stacks ( Addr stack, Addr dst );
-#if defined(VGA_x86)
-// 4(%esp) =3D=3D stack
-// 8(%esp) =3D=3D dst
-asm(
-".global jump_and_switch_stacks\n"
-"jump_and_switch_stacks:\n"
-" movl %esp, %esi\n" // remember old stack pointer
-" movl 4(%esi), %esp\n" // set stack
-" pushl 8(%esi)\n" // dst to stack
-" movl $0, %eax\n" // zero all GP regs
-" movl $0, %ebx\n"
-" movl $0, %ecx\n"
-" movl $0, %edx\n"
-" movl $0, %esi\n"
-" movl $0, %edi\n"
-" movl $0, %ebp\n"
-" ret\n" // jump to dst
-" ud2\n" // should never get here
-);
-#elif defined(VGA_amd64)
-// %rdi =3D=3D stack
-// %rsi =3D=3D dst
-asm(
-".global jump_and_switch_stacks\n"
-"jump_and_switch_stacks:\n"
-" movq %rdi, %rsp\n" // set stack
-" pushq %rsi\n" // dst to stack
-" movq $0, %rax\n" // zero all GP regs
-" movq $0, %rbx\n"
-" movq $0, %rcx\n"
-" movq $0, %rdx\n"
-" movq $0, %rsi\n"
-" movq $0, %rdi\n"
-" movq $0, %rbp\n"
-" movq $0, %r8\n"\
-" movq $0, %r9\n"\
-" movq $0, %r10\n"
-" movq $0, %r11\n"
-" movq $0, %r12\n"
-" movq $0, %r13\n"
-" movq $0, %r14\n"
-" movq $0, %r15\n"
-" ret\n" // jump to dst
-" ud2\n" // should never get here
-);
-
-#elif defined(VGA_ppc32)
-/* Jump to 'dst', but first set the stack pointer to 'stack'. Also,
- clear all the integer registers before entering 'dst'. It's
- important that the stack pointer is set to exactly 'stack' and not
- (eg) stack - apparently_harmless_looking_small_offset. Basically
- because the code at 'dst' might be wanting to scan the area above
- 'stack' (viz, the auxv array), and putting spurious words on the
- stack confuses it.
-*/
-// %r3 =3D=3D stack
-// %r4 =3D=3D dst
-asm(
-".global jump_and_switch_stacks\n"
-"jump_and_switch_stacks:\n"
-" mtctr %r4\n\t" // dst to %ctr
-" mr %r1,%r3\n\t" // stack to %sp
-" li 0,0\n\t" // zero all GP regs
-" li 3,0\n\t"
-" li 4,0\n\t"
-" li 5,0\n\t"
-" li 6,0\n\t"
-" li 7,0\n\t"
-" li 8,0\n\t"
-" li 9,0\n\t"
-" li 10,0\n\t"
-" li 11,0\n\t"
-" li 12,0\n\t"
-" li 13,0\n\t" // CAB: This right? r13 =3D small data area p=
tr
-" li 14,0\n\t"
-" li 15,0\n\t"
-" li 16,0\n\t"
-" li 17,0\n\t"
-" li 18,0\n\t"
-" li 19,0\n\t"
-" li 20,0\n\t"
-" li 21,0\n\t"
-" li 22,0\n\t"
-" li 23,0\n\t"
-" li 24,0\n\t"
-" li 25,0\n\t"
-" li 26,0\n\t"
-" li 27,0\n\t"
-" li 28,0\n\t"
-" li 29,0\n\t"
-" li 30,0\n\t"
-" li 31,0\n\t"
-" mtxer 0\n\t"
-" mtcr 0\n\t"
-" mtlr %r0\n\t"
-" bctr\n\t" // jump to dst
-" trap\n" // should never get here
-);
-
-#else
-# error Unknown architecture
-#endif
-
-/*------------------------------------------------------------*/
-/*--- Finding auxv on the stack ---*/
-/*------------------------------------------------------------*/
-
-struct ume_auxv *find_auxv(UWord* sp)
-{
- sp++; // skip argc (Nb: is word-sized, not int-sized!)
-
- while (*sp !=3D 0) // skip argv
- sp++;
- sp++;
-
- while (*sp !=3D 0) // skip env
- sp++;
- sp++;
- =20
-#if defined(VGA_ppc32)
-# if defined AT_IGNOREPPC
- while (*sp =3D=3D AT_IGNOREPPC) // skip AT_IGNOREPPC entries
- sp +=3D 2;
-# endif
-#endif
-
- return (struct ume_auxv *)sp;
-}
-
-/*------------------------------------------------------------*/
-/*--- Loading ELF files ---*/
-/*------------------------------------------------------------*/
-
-static=20
-struct elfinfo *readelf(int fd, const char *filename)
-{
- struct elfinfo *e =3D malloc(sizeof(*e));
- int phsz;
-
- assert(e);
- e->fd =3D fd;
-
- if (pread(fd, &e->e, sizeof(e->e), 0) !=3D sizeof(e->e)) {
- fprintf(stderr, "valgrind: %s: can't read ELF header: %s\n",=20
- filename, strerror(errno));
- return NULL;
- }
-
- if (memcmp(&e->e.e_ident[0], ELFMAG, SELFMAG) !=3D 0) {
- fprintf(stderr, "valgrind: %s: bad ELF magic number\n", filename);
- return NULL;
- }
- if (e->e.e_ident[EI_CLASS] !=3D VGA_ELF_CLASS) {
- fprintf(stderr,=20
- "valgrind: wrong ELF executable class "
- "(eg. 32-bit instead of 64-bit)\n");
- return NULL;
- }
- if (e->e.e_ident[EI_DATA] !=3D VGA_ELF_ENDIANNESS) {
- fprintf(stderr, "valgrind: executable has wrong endian-ness\n");
- return NULL;
- }
- if (!(e->e.e_type =3D=3D ET_EXEC || e->e.e_type =3D=3D ET_DYN)) {
- fprintf(stderr, "valgrind: this is not an executable\n");
- return NULL;
- }
-
- if (e->e.e_machine !=3D VGA_ELF_MACHINE) {
- fprintf(stderr, "valgrind: executable is not for "
- "this architecture\n");
- return NULL;
- }
-
- if (e->e.e_phentsize !=3D sizeof(ESZ(Phdr))) {
- fprintf(stderr, "valgrind: sizeof ELF Phdr wrong\n");
- return NULL;
- }
-
- phsz =3D sizeof(ESZ(Phdr)) * e->e.e_phnum;
- e->p =3D malloc(phsz);
- assert(e->p);
-
- if (pread(fd, e->p, phsz, e->e.e_phoff) !=3D phsz) {
- fprintf(stderr, "valgrind: can't read phdr: %s\n", strerror(errno)=
);
- return NULL;
- }
-
- return e;
-}
-
-/* Map an ELF file. Returns the brk address. */
-static
-ESZ(Addr) mapelf(struct elfinfo *e, ESZ(Addr) base)
-{
- int i;
- void* res;
- ESZ(Addr) elfbrk =3D 0;
-
- for(i =3D 0; i < e->e.e_phnum; i++) {
- ESZ(Phdr) *ph =3D &e->p[i];
- ESZ(Addr) addr, brkaddr;
- ESZ(Word) memsz;
-
- if (ph->p_type !=3D PT_LOAD)
- continue;
-
- addr =3D ph->p_vaddr+base;
- memsz =3D ph->p_memsz;
- brkaddr =3D addr+memsz;
-
- if (brkaddr > elfbrk)
- elfbrk =3D brkaddr;
- }
-
- for(i =3D 0; i < e->e.e_phnum; i++) {
- ESZ(Phdr) *ph =3D &e->p[i];
- ESZ(Addr) addr, bss, brkaddr;
- ESZ(Off) off;
- ESZ(Word) filesz;
- ESZ(Word) memsz;
- unsigned prot =3D 0;
-
- if (ph->p_type !=3D PT_LOAD)
- continue;
-
- if (ph->p_flags & PF_X) prot |=3D PROT_EXEC;
- if (ph->p_flags & PF_W) prot |=3D PROT_WRITE;
- if (ph->p_flags & PF_R) prot |=3D PROT_READ;
-
- addr =3D ph->p_vaddr+base;
- off =3D ph->p_offset;
- filesz =3D ph->p_filesz;
- bss =3D addr+filesz;
- memsz =3D ph->p_memsz;
- brkaddr =3D addr+memsz;
-
- // Tom says: In the following, do what the Linux kernel does and o=
nly
- // map the pages that are required instead of rounding everything =
to
- // the specified alignment (ph->p_align). (AMD64 doesn't work if =
you
- // use ph->p_align -- part of stage2's memory gets trashed somehow=
.)
- //
- // The condition handles the case of a zero-length segment.
- if (VG_PGROUNDUP(bss)-VG_PGROUNDDN(addr) > 0) {
- res =3D mmap((char *)VG_PGROUNDDN(addr),
- VG_PGROUNDUP(bss)-VG_PGROUNDDN(addr),
- prot, MAP_FIXED|MAP_PRIVATE, e->fd, VG_PGROUNDDN(off=
));
- check_mmap(res, (char*)VG_PGROUNDDN(addr),
- VG_PGROUNDUP(bss)-VG_PGROUNDDN(addr));
- }
-
- // if memsz > filesz, fill the remainder with zeroed pages
- if (memsz > filesz) {
- UInt bytes;
-
- bytes =3D VG_PGROUNDUP(brkaddr)-VG_PGROUNDUP(bss);
- if (bytes > 0) {
- res =3D mmap((char *)VG_PGROUNDUP(bss), bytes,
- prot, MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE, -1, 0);
- check_mmap(res, (char*)VG_PGROUNDUP(bss), bytes);
- }
-
- bytes =3D bss & (VKI_PAGE_SIZE - 1);
-
- // The 'prot' condition allows for a read-only bss
- if ((prot & PROT_WRITE) && (bytes > 0)) {
- bytes =3D VKI_PAGE_SIZE - bytes;
- memset((char *)bss, 0, bytes);
- }
- }
- }
-
- return elfbrk;
-}
-
-// Forward declaration.
-static int do_exec_inner(const char *exe, struct exeinfo *info);
-
-static int match_ELF(const char *hdr, int len)
-{
- ESZ(Ehdr) *e =3D (ESZ(Ehdr) *)hdr;
- return (len > sizeof(*e)) && memcmp(&e->e_ident[0], ELFMAG, SELFMAG) =
=3D=3D 0;
-}
-
-static int load_ELF(char *hdr, int len, int fd, const char *name,
- struct exeinfo *info)
-{
- struct elfinfo *e;
- struct elfinfo *interp =3D NULL;
- ESZ(Addr) minaddr =3D ~0; /* lowest mapped address */
- ESZ(Addr) maxaddr =3D 0; /* highest mapped address */
- ESZ(Addr) interp_addr =3D 0; /* interpreter (ld.so) address */
- ESZ(Word) interp_size =3D 0; /* interpreter size */
- ESZ(Word) interp_align =3D VKI_PAGE_SIZE;
- int i;
- void *entry;
- ESZ(Addr) ebase =3D 0;
-
-#ifdef HAVE_PIE
- ebase =3D info->exe_base;
-#endif
-
- e =3D readelf(fd, name);
-
- if (e =3D=3D NULL)
- return ENOEXEC;
-
- info->phnum =3D e->e.e_phnum;
- info->entry =3D e->e.e_entry + ebase;
- info->phdr =3D 0;
-
- for(i =3D 0; i < e->e.e_phnum; i++) {
- ESZ(Phdr) *ph =3D &e->p[i];
-
- switch(ph->p_type) {
- case PT_PHDR:
- info->phdr =3D ph->p_vaddr + ebase;
- break;
-
- case PT_LOAD:
- if (ph->p_vaddr < minaddr)
- minaddr =3D ph->p_vaddr;
- if (ph->p_vaddr+ph->p_memsz > maxaddr)
- maxaddr =3D ph->p_vaddr+ph->p_memsz;
- break;
- =09
- case PT_INTERP: {
- char *buf =3D malloc(ph->p_filesz+1);
- int j;
- int intfd;
- int baseaddr_set;
-
- assert(buf);
- pread(fd, buf, ph->p_filesz, ph->p_offset);
- buf[ph->p_filesz] =3D '\0';
-
- intfd =3D open(buf, O_RDONLY);
- if (intfd =3D=3D -1) {
- perror("open interp");
- exit(1);
- }
-
- interp =3D readelf(intfd, buf);
- if (interp =3D=3D NULL) {
- fprintf(stderr, "Can't read interpreter\n");
- return 1;
- }
- free(buf);
-
- baseaddr_set =3D 0;
- for(j =3D 0; j < interp->e.e_phnum; j++) {
- ESZ(Phdr) *iph =3D &interp->p[j];
- ESZ(Addr) end;
-
- if (iph->p_type !=3D PT_LOAD)
- continue;
- =20
- if (!baseaddr_set) {
- interp_addr =3D iph->p_vaddr;
- interp_align =3D iph->p_align;
- baseaddr_set =3D 1;
- }
-
- /* assumes that all segments in the interp are close */
- end =3D (iph->p_vaddr - interp_addr) + iph->p_memsz;
-
- if (end > interp_size)
- interp_size =3D end;
- }
- break;
-
- default:
- // do nothing
- break;
- }
- }
- }
-
- if (info->phdr =3D=3D 0)
- info->phdr =3D minaddr + e->e.e_phoff;
-
- if (info->exe_base !=3D info->exe_end) {
- if (minaddr >=3D maxaddr ||
- (minaddr + ebase < info->exe_base ||
- maxaddr + ebase > info->exe_end)) {
- fprintf(stderr, "Executable range %p-%p is outside the\n"
- "acceptable range %p-%p\n",
- (void *)minaddr + ebase, (void *)maxaddr + ebase,
- (void *)info->exe_base, (void *)info->exe_end);
- return ENOMEM;
- }
- }
-
- info->brkbase =3D mapelf(e, ebase); /* map the executable */
-
- if (info->brkbase =3D=3D 0)
- return ENOMEM;
-
- if (interp !=3D NULL) {
- /* reserve a chunk of address space for interpreter */
- void* res;
- char* base =3D (char *)info->exe_base;
- char* baseoff;
- int flags =3D MAP_PRIVATE|MAP_ANONYMOUS;
-
- if (info->map_base !=3D 0) {
- base =3D (char *)VG_ROUNDUP(info->map_base, interp_align);
- flags |=3D MAP_FIXED;
- }
-
- res =3D mmap(base, interp_size, PROT_NONE, flags, -1, 0);
- check_mmap(res, base, interp_size);
- base =3D res;
-
- baseoff =3D base - interp_addr;
-
- mapelf(interp, (ESZ(Addr))baseoff);
-
- close(interp->fd);
-
- entry =3D baseoff + interp->e.e_entry;
- info->interp_base =3D (ESZ(Addr))base;
-
- free(interp->p);
- free(interp);
- } else
- entry =3D (void *)e->e.e_entry;
-
- info->exe_base =3D minaddr + ebase;
- info->exe_end =3D maxaddr + ebase;
-
- info->init_eip =3D (Addr)entry;
-
- free(e->p);
- free(e);
-
- return 0;
-}
-
-
-static int match_script(const char *hdr, Int len)
-{
- return (len > 2) && memcmp(hdr, "#!", 2) =3D=3D 0;
-}
-
-static int load_script(char *hdr, int len, int fd, const char *name,
- struct exeinfo *info)
-{
- char *interp;
- char *const end =3D hdr+len;
- char *cp;
- char *arg =3D NULL;
- int eol;
-
- interp =3D hdr + 2;
- while(interp < end && (*interp =3D=3D ' ' || *interp =3D=3D '\t'))
- interp++;
-
- if (*interp !=3D '/')
- return ENOEXEC; /* absolute path only for interpreter */
-
- /* skip over interpreter name */
- for(cp =3D interp; cp < end && *cp !=3D ' ' && *cp !=3D '\t' && *cp !=
=3D '\n'; cp++)
- ;
-
- eol =3D (*cp =3D=3D '\n');
-
- *cp++ =3D '\0';
-
- if (!eol && cp < end) {
- /* skip space before arg */
- while (cp < end && (*cp =3D=3D '\t' || *cp =3D=3D ' '))
- cp++;
-
- /* arg is from here to eol */
- arg =3D cp;
- while (cp < end && *cp !=3D '\n')
- cp++;
- *cp =3D '\0';
- }
- =20
- info->interp_name =3D strdup(interp);
- assert(NULL !=3D info->interp_name);
- if (arg !=3D NULL && *arg !=3D '\0') {
- info->interp_args =3D strdup(arg);
- assert(NULL !=3D info->interp_args);
- }
-
- if (info->argv && info->argv[0] !=3D NULL)
- info->argv[0] =3D (char *)name;
-
- if (0)
- printf("#! script: interp_name=3D\"%s\" interp_args=3D\"%s\"\n",
- info->interp_name, info->interp_args);
-
- return do_exec_inner(interp, info);
-}
-
-/*=20
- Emulate the normal Unix permissions checking algorithm.
-
- If owner matches, then use the owner permissions, else
- if group matches, then use the group permissions, else
- use other permissions.
-
- Note that we can't deal with SUID/SGID, so we refuse to run them
- (otherwise the executable may misbehave if it doesn't have the
- permissions it thinks it does).
-*/
-static int check_perms(int fd)
-{
- struct stat st;
-
- if (fstat(fd, &st) =3D=3D -1)=20
- return errno;
-
- if (st.st_mode & (S_ISUID | S_ISGID)) {
- //fprintf(stderr, "Can't execute suid/sgid executable %s\n", exe);
- return EACCES;
- }
-
- if (geteuid() =3D=3D st.st_uid) {
- if (!(st.st_mode & S_IXUSR))
- return EACCES;
- } else {
- int grpmatch =3D 0;
-
- if (getegid() =3D=3D st.st_gid)
- grpmatch =3D 1;
- else {
- gid_t groups[32];
- int ngrp =3D getgroups(32, groups);
- int i;
-
- for(i =3D 0; i < ngrp; i++)
- if (groups[i] =3D=3D st.st_gid) {
- grpmatch =3D 1;
- break;
- }
- }
-
- if (grpmatch) {
- if (!(st.st_mode & S_IXGRP))
- return EACCES;
- } else if (!(st.st_mode & S_IXOTH))
- return EACCES;
- }
-
- return 0;
-}
-
-static int do_exec_inner(const char *exe, struct exeinfo *info)
-{
- int fd;
- int err;
- char buf[VKI_PAGE_SIZE];
- int bufsz;
- int i;
- int ret;
- static const struct {
- int (*match)(const char *hdr, int len);
- int (*load) ( char *hdr, int len, int fd2, const char *name,
- struct exeinfo *);
- } formats[] =3D {
- { match_ELF, load_ELF },
- { match_script, load_script },
- };
-
- fd =3D open(exe, O_RDONLY);
- if (fd =3D=3D -1) {
- if (0)
- fprintf(stderr, "Can't open executable %s: %s\n",
- exe, strerror(errno));
- return errno;
- }
-
- err =3D check_perms(fd);
- if (err !=3D 0) {
- close(fd);
- return err;
- }
-
- bufsz =3D pread(fd, buf, sizeof(buf), 0);
- if (bufsz < 0) {
- fprintf(stderr, "Can't read executable header: %s\n",
- strerror(errno));
- close(fd);
- return errno;
- }
-
- ret =3D ENOEXEC;
- for(i =3D 0; i < sizeof(formats)/sizeof(*formats); i++) {
- if ((formats[i].match)(buf, bufsz)) {
- ret =3D (formats[i].load)(buf, bufsz, fd, exe, info);
- break;
- }
- }
-
- close(fd);
-
- return ret;
-}
-
-// See ume.h for an indication of which entries of 'info' are inputs, wh=
ich
-// are outputs, and which are both.
-int do_exec(const char *exe, struct exeinfo *info)
-{
- info->interp_name =3D NULL;
- info->interp_args =3D NULL;
-
- return do_exec_inner(exe, info);
-}
-
-/*--------------------------------------------------------------------*/
-/*--- end ume.c ---*/
-/*--------------------------------------------------------------------*/
Deleted: trunk/coregrind/ume.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/ume.h 2005-06-21 22:27:19 UTC (rev 3991)
+++ trunk/coregrind/ume.h 2005-06-21 22:47:54 UTC (rev 3992)
@@ -1,118 +0,0 @@
-
-/*--------------------------------------------------------------------*/
-/*--- A header file used by both stage1 and stage2. ---*/
-/*--- ume.h ---*/
-/*--------------------------------------------------------------------*/
-
-/*
- 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.
-*/
-
-#ifndef _COREGRIND_UME_H
-#define _COREGRIND_UME_H
-
-#include <elf.h>
-#include <sys/types.h>
-
-/*------------------------------------------------------------*/
-/*--- General stuff ---*/
-/*------------------------------------------------------------*/
-
-extern
-void foreach_map(int (*fn)(char *start, char *end,
- const char *perm, off_t offset,
- int maj, int min, int ino, void* extra),
- void* extra);
-
-/* Jump to 'dst', but first set the stack pointer to 'stack'. Also,
- clear all the integer registers before entering 'dst'. It's
- important that the stack pointer is set to exactly 'stack' and not
- (eg) stack - apparently_harmless_looking_small_offset. Basically
- because the code at 'dst' might be wanting to scan the area above
- 'stack' (viz, the auxv array), and putting spurious words on the
- stack confuses it.
-
- This is only exported so that vgtest_ume.c can use it.
-*/
-extern
-__attribute__((noreturn))
-void jump_and_switch_stacks ( Addr stack, Addr dst );
-
-
-/*------------------------------------------------------------*/
-/*--- Loading ELF files ---*/
-/*------------------------------------------------------------*/
-
-// Info needed to load and run a program. IN/INOUT/OUT refers to the
-// inputs/outputs of do_exec().
-struct exeinfo
-{
- Addr map_base; // IN: if non-zero, base address of mappings
- char** argv; // IN: the original argv
-
- Addr exe_base; // INOUT: lowest (allowed) address of exe
- Addr exe_end; // INOUT: highest (allowed) address
-
- Addr phdr; // OUT: address phdr was mapped at
- int phnum; // OUT: number of phdrs
- Addr interp_base; // OUT: where interpreter (ld.so) was mapped
- Addr entry; // OUT: entrypoint in main executable
- Addr init_eip; // OUT: initial eip
- Addr brkbase; // OUT: base address of brk segment
-
- // These are the extra args added by #! scripts
- char* interp_name; // OUT: the interpreter name
- char* interp_args; // OUT: the args for the interpreter
-};
-
-// Does everything short of actually running 'exe': finds the file,
-// checks execute permissions, sets up interpreter if program is a scrip=
t,=20
-// reads headers, maps file into memory, and returns important info abou=
t
-// the program.
-extern int do_exec(const char *exe, struct exeinfo *info);
-
-/*------------------------------------------------------------*/
-/*--- Finding and dealing with auxv ---*/
-/*------------------------------------------------------------*/
-
-struct ume_auxv
-{
- Word a_type;
- union {
- void *a_ptr;
- Word a_val;
- } u;
-};
-
-extern struct ume_auxv *find_auxv(UWord* orig_esp);
-
-/* Our private auxv entries */
-#define AT_UME_PADFD 0xff01 /* padding file fd */
-#define AT_UME_EXECFD 0xff02 /* stage1 executable fd */
-
-#endif /* _COREGRIND_UME_H */
-
-/*--------------------------------------------------------------------*/
-/*--- end ume.h ---*/
-/*--------------------------------------------------------------------*/
|
|
From: <sv...@va...> - 2005-06-21 22:27:22
|
Author: njn
Date: 2005-06-21 23:27:19 +0100 (Tue, 21 Jun 2005)
New Revision: 3991
Log:
Move VG_(resume_scheduler) to m_signals, and make it local. Reduces
m_signals' dependence on m_scheduler.
Modified:
trunk/coregrind/m_scheduler/scheduler.c
trunk/coregrind/m_signals.c
trunk/coregrind/pub_core_scheduler.h
Modified: trunk/coregrind/m_scheduler/scheduler.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_scheduler/scheduler.c 2005-06-21 22:23:59 UTC (rev =
3990)
+++ trunk/coregrind/m_scheduler/scheduler.c 2005-06-21 22:27:19 UTC (rev =
3991)
@@ -299,20 +299,6 @@
}
=20
=20
-void VG_(resume_scheduler)(ThreadId tid)
-{
- ThreadState *tst =3D VG_(get_ThreadState)(tid);
-
- vg_assert(tst->os_state.lwpid =3D=3D VG_(gettid)());
-
- if (tst->sched_jmpbuf_valid) {
- /* Can't continue; must longjmp back to the scheduler and thus
- enter the sighandler immediately. */
- =20
- longjmp(tst->sched_jmpbuf, True);
- }
-}
-
/* Set the standard set of blocked signals, used wheneever we're not
running a client syscall. */
static void block_signals(ThreadId tid)
Modified: trunk/coregrind/m_signals.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_signals.c 2005-06-21 22:23:59 UTC (rev 3990)
+++ trunk/coregrind/m_signals.c 2005-06-21 22:27:19 UTC (rev 3991)
@@ -1500,6 +1500,19 @@
/* Thread state is ready to go - just add Runnable */
}
=20
+static void resume_scheduler(ThreadId tid)
+{
+ ThreadState *tst =3D VG_(get_ThreadState)(tid);
+
+ vg_assert(tst->os_state.lwpid =3D=3D VG_(gettid)());
+
+ if (tst->sched_jmpbuf_valid) {
+ /* Can't continue; must longjmp back to the scheduler and thus
+ enter the sighandler immediately. */
+ longjmp(tst->sched_jmpbuf, True);
+ }
+}
+
static void synth_fault_common(ThreadId tid, Addr addr, Int si_code)
{
vki_siginfo_t info;
@@ -1547,7 +1560,7 @@
info.si_code =3D 1; /* jrs: no idea what this should be */
info._sifields._sigfault._addr =3D (void*)addr;
=20
- VG_(resume_scheduler)(tid);
+ resume_scheduler(tid);
deliver_signal(tid, &info);
}
=20
@@ -1671,7 +1684,7 @@
=20
/* longjmp back to the thread's main loop to start executing the
handler. */
- VG_(resume_scheduler)(tid);
+ resume_scheduler(tid);
=20
VG_(core_panic)("async_signalhandler: got unexpected signal while out=
side of scheduler");
}
@@ -1805,7 +1818,7 @@
/* It's a fatal signal, so we force the default handler. */
VG_(set_default_handler)(sigNo);
deliver_signal(tid, info);
- VG_(resume_scheduler)(tid);
+ resume_scheduler(tid);
VG_(exit)(99); /* If we can't resume, then just exit */
}
=20
@@ -1911,7 +1924,7 @@
/* Can't continue; must longjmp back to the scheduler and thus
enter the sighandler immediately. */
deliver_signal(tid, info);
- VG_(resume_scheduler)(tid);
+ resume_scheduler(tid);
}
=20
/* Check to see if someone is interested in faults. */
@@ -1970,7 +1983,7 @@
VG_(set_running)(tid);
VG_(post_syscall)(tid);
=20
- VG_(resume_scheduler)(tid);
+ resume_scheduler(tid);
=20
VG_(core_panic)("sigvgkill_handler couldn't return to the scheduler\n=
");
}
Modified: trunk/coregrind/pub_core_scheduler.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_scheduler.h 2005-06-21 22:23:59 UTC (rev 399=
0)
+++ trunk/coregrind/pub_core_scheduler.h 2005-06-21 22:27:19 UTC (rev 399=
1)
@@ -80,9 +80,6 @@
/* Stats ... */
extern void VG_(print_scheduler_stats) ( void );
=20
-// Longjmp back to the scheduler and thus enter the sighandler immediate=
ly.
-extern void VG_(resume_scheduler) ( ThreadId tid );
-
/* If true, a fault is Valgrind-internal (ie, a bug) */
extern Bool VG_(my_fault);
=20
|
|
From: <sv...@va...> - 2005-06-21 22:24:03
|
Author: njn
Date: 2005-06-21 23:23:59 +0100 (Tue, 21 Jun 2005)
New Revision: 3990
Log:
Move VKI_SIGVGKILL and VKI_SIGVGRTUSERMAX out of vki-linux.h since they'r=
e
not really from the kernel and they're defined in terms of VG_(max_signal=
),
which is in m_signals. Renamed them with the VG_ prefix too, since they'=
re
now not part of the kernel interface.
Modified:
trunk/coregrind/m_libcfile.c
trunk/coregrind/m_scheduler/scheduler.c
trunk/coregrind/m_signals.c
trunk/coregrind/m_syswrap/syswrap-generic.c
trunk/coregrind/m_syswrap/syswrap-main.c
trunk/coregrind/pub_core_signals.h
trunk/include/vki-linux.h
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-06-21 13:26:17 UTC (rev 3989)
+++ trunk/coregrind/m_libcfile.c 2005-06-21 22:23:59 UTC (rev 3990)
@@ -32,7 +32,7 @@
#include "pub_core_libcbase.h"
#include "pub_core_libcassert.h"
#include "pub_core_libcfile.h"
-#include "pub_core_libcprint.h"
+#include "pub_core_libcprint.h" // For VG_(sprintf)()
#include "pub_core_mallocfree.h"
#include "pub_core_syscall.h"
#include "vki_unistd.h"
Modified: trunk/coregrind/m_scheduler/scheduler.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_scheduler/scheduler.c 2005-06-21 13:26:17 UTC (rev =
3989)
+++ trunk/coregrind/m_scheduler/scheduler.c 2005-06-21 22:23:59 UTC (rev =
3990)
@@ -268,7 +268,7 @@
if (VG_(clo_trace_signals))
VG_(message)(Vg_DebugMsg, "kill_thread zaps tid %d lwp %d",
tid, VG_(threads)[tid].os_state.lwpid);
- VG_(tkill)(VG_(threads)[tid].os_state.lwpid, VKI_SIGVGKILL);
+ VG_(tkill)(VG_(threads)[tid].os_state.lwpid, VG_SIGVGKILL);
}
}
=20
Modified: trunk/coregrind/m_signals.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_signals.c 2005-06-21 13:26:17 UTC (rev 3989)
+++ trunk/coregrind/m_signals.c 2005-06-21 22:23:59 UTC (rev 3990)
@@ -333,7 +333,7 @@
default:
// VKI_SIGVG* are runtime variables, so we can't make them =
=20
// cases in the switch, so we handle them in the 'default' case=
.
- if (sig =3D=3D VKI_SIGVGKILL)
+ if (sig =3D=3D VG_SIGVGKILL)
skss_handler =3D sigvgkill_handler;
else {
if (scss_handler =3D=3D VKI_SIG_IGN)
@@ -577,7 +577,7 @@
if (signo < 1 || signo > VG_(max_signal)) goto bad_signo;
=20
/* don't let them use our signals */
- if ( (signo > VKI_SIGVGRTUSERMAX)
+ if ( (signo > VG_SIGVGRTUSERMAX)
&& new_act
&& !(new_act->ksa_handler =3D=3D VKI_SIG_DFL=20
|| new_act->ksa_handler =3D=3D VKI_SIG_IGN) )
@@ -1436,7 +1436,7 @@
VG_(message)(Vg_DebugMsg,"delivering signal %d (%s):%d to thread %=
d",=20
sigNo, signame(sigNo), info->si_code, tid );
=20
- if (sigNo =3D=3D VKI_SIGVGKILL) {
+ if (sigNo =3D=3D VG_SIGVGKILL) {
/* If this is a SIGVGKILL, we're expecting it to interrupt any
blocked syscall. It doesn't matter whether the VCPU state is
set to restart or not, because we don't expect it will
@@ -1963,7 +1963,7 @@
if (VG_(clo_trace_signals))
VG_(message)(Vg_DebugMsg, "sigvgkill for lwp %d tid %d", VG_(getti=
d)(), tid);
=20
- vg_assert(signo =3D=3D VKI_SIGVGKILL);
+ vg_assert(signo =3D=3D VG_SIGVGKILL);
vg_assert(si->si_signo =3D=3D signo);
vg_assert(VG_(threads)[tid].status =3D=3D VgTs_WaitSys);
=20
@@ -2114,9 +2114,9 @@
VG_(message)(Vg_DebugMsg, "Max kernel-supported signal is %d", VG_=
(max_signal));
=20
/* Our private internal signals are treated as ignored */
- scss.scss_per_sig[VKI_SIGVGKILL].scss_handler =3D VKI_SIG_IGN;
- scss.scss_per_sig[VKI_SIGVGKILL].scss_flags =3D VKI_SA_SIGINFO;
- VG_(sigfillset)(&scss.scss_per_sig[VKI_SIGVGKILL].scss_mask);
+ scss.scss_per_sig[VG_SIGVGKILL].scss_handler =3D VKI_SIG_IGN;
+ scss.scss_per_sig[VG_SIGVGKILL].scss_flags =3D VKI_SA_SIGINFO;
+ VG_(sigfillset)(&scss.scss_per_sig[VG_SIGVGKILL].scss_mask);
=20
/* Copy the process' signal mask into the root thread. */
vg_assert(VG_(threads)[1].status =3D=3D VgTs_Init);
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-06-21 13:26:17 UTC (=
rev 3989)
+++ trunk/coregrind/m_syswrap/syswrap-generic.c 2005-06-21 22:23:59 UTC (=
rev 3990)
@@ -96,7 +96,7 @@
Bool VG_(client_signal_OK)(Int sigNo)
{
/* signal 0 is OK for kill */
- Bool ret =3D sigNo >=3D 0 && sigNo <=3D VKI_SIGVGRTUSERMAX;
+ Bool ret =3D sigNo >=3D 0 && sigNo <=3D VG_SIGVGRTUSERMAX;
=20
//VG_(printf)("client_signal_OK(%d) -> %d\n", sigNo, ret);
=20
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-06-21 13:26:17 UTC (rev=
3989)
+++ trunk/coregrind/m_syswrap/syswrap-main.c 2005-06-21 22:23:59 UTC (rev=
3990)
@@ -41,7 +41,7 @@
#include "pub_core_stacktrace.h" // For VG_(get_and_pp_StackTrace)()
#include "pub_core_tooliface.h"
#include "pub_core_options.h"
-#include "pub_core_signals.h" // For VG_(max_signal), VG_(poll_sig=
nals)
+#include "pub_core_signals.h" // For VG_SIGVGKILL, VG_(poll_signal=
s)
#include "pub_core_syscall.h"
#include "pub_core_syswrap.h"
=20
@@ -506,7 +506,7 @@
{
VG_(sigdelset)(mask, VKI_SIGKILL);
VG_(sigdelset)(mask, VKI_SIGSTOP);
- VG_(sigdelset)(mask, VKI_SIGVGKILL); /* never block */
+ VG_(sigdelset)(mask, VG_SIGVGKILL); /* never block */
}
=20
typedef
Modified: trunk/coregrind/pub_core_signals.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_signals.h 2005-06-21 13:26:17 UTC (rev 3989)
+++ trunk/coregrind/pub_core_signals.h 2005-06-21 22:23:59 UTC (rev 3990)
@@ -40,6 +40,10 @@
/* Highest signal the kernel will let us use */
extern Int VG_(max_signal);
=20
+/* Use high signals because native pthreads wants to use low */
+#define VG_SIGVGKILL (VG_(max_signal)-0)
+#define VG_SIGVGRTUSERMAX (VG_(max_signal)-1)
+
extern void VG_(sigstartup_actions) ( void );
=20
/* Poll a thread's set of pending signals, and update the Thread's
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-06-21 13:26:17 UTC (rev 3989)
+++ trunk/include/vki-linux.h 2005-06-21 22:23:59 UTC (rev 3990)
@@ -350,14 +350,6 @@
};
=20
//----------------------------------------------------------------------
-// From nowhere: constants internal to Valgrind
-//----------------------------------------------------------------------
-
-/* Use high signals because native pthreads wants to use low */
-#define VKI_SIGVGKILL (VG_(max_signal)-0) // [[internal: kill]]
-#define VKI_SIGVGRTUSERMAX (VG_(max_signal)-1) // [[internal: last user=
-usable RT signal]]
-
-//----------------------------------------------------------------------
// From linux-2.6.8.1/include/asm-generic/siginfo.h
//----------------------------------------------------------------------
=20
|
|
From: Julian S. <js...@ac...> - 2005-06-21 21:56:55
|
> Redirect the correct address to the vtime vsyscall instead of > redirecting the vgettimofday address to two different places. Duh. Just call me Fikk. Sigh. (etc) J |
|
From: <sv...@va...> - 2005-06-21 19:03:10
|
Author: sewardj
Date: 2005-06-21 13:52:38 +0100 (Tue, 21 Jun 2005)
New Revision: 3988
Log:
Fix bug causing TINVALs to throw away huge numbers of translations
unnecessarily.
Modified:
trunk/coregrind/m_scheduler/scheduler.c
Modified: trunk/coregrind/m_scheduler/scheduler.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_scheduler/scheduler.c 2005-06-21 10:11:36 UTC (rev =
3987)
+++ trunk/coregrind/m_scheduler/scheduler.c 2005-06-21 12:52:38 UTC (rev =
3988)
@@ -762,13 +762,12 @@
break;
=20
case VEX_TRC_JMP_TINVAL:
-#if defined(VGA_ppc32)
VG_(discard_translations)(
(Addr64)VG_(threads)[tid].arch.vex.guest_TISTART,
- VG_(threads)[tid].arch.vex.guest_TISTART );
+ VG_(threads)[tid].arch.vex.guest_TILEN
+ );
if (0)
VG_(printf)("dump translations done.\n");
-#endif
break;
=20
default:=20
|
|
From: <sv...@va...> - 2005-06-21 18:57:09
|
Author: tom
Date: 2005-06-21 14:26:17 +0100 (Tue, 21 Jun 2005)
New Revision: 3989
Log:
Redirect the correct address to the vtime vsyscall instead of
redirecting the vgettimofday address to two different places.
Modified:
trunk/coregrind/m_redir.c
Modified: trunk/coregrind/m_redir.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_redir.c 2005-06-21 12:52:38 UTC (rev 3988)
+++ trunk/coregrind/m_redir.c 2005-06-21 13:26:17 UTC (rev 3989)
@@ -392,7 +392,7 @@
);
=20
add_redirect_addr_to_addr(=20
- 0xFFFFFFFFFF600000ULL,
+ 0xFFFFFFFFFF600400ULL,
(Addr)&VG_(amd64_linux_REDIR_FOR_vtime)=20
);
=20
|
|
From: <sv...@va...> - 2005-06-21 18:41:40
|
Author: sewardj
Date: 2005-06-21 14:51:18 +0100 (Tue, 21 Jun 2005)
New Revision: 1216
Log:
amd64 back end: handle 8Uto32.
Modified:
trunk/priv/host-amd64/isel.c
Modified: trunk/priv/host-amd64/isel.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/priv/host-amd64/isel.c 2005-06-20 16:28:32 UTC (rev 1215)
+++ trunk/priv/host-amd64/isel.c 2005-06-21 13:51:18 UTC (rev 1216)
@@ -1328,7 +1328,7 @@
return rLo; /* and abandon rHi */
}
case Iop_8Uto16:
-// case Iop_8Uto32:
+ case Iop_8Uto32:
case Iop_8Uto64:
case Iop_16Uto64:
case Iop_16Uto32: {
|
|
From: <sv...@va...> - 2005-06-21 10:11:38
|
Author: sewardj
Date: 2005-06-21 11:11:36 +0100 (Tue, 21 Jun 2005)
New Revision: 3987
Log:
ppc32-linux build fix.
Modified:
trunk/tests/cputest.c
Modified: trunk/tests/cputest.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/tests/cputest.c 2005-06-21 10:07:25 UTC (rev 3986)
+++ trunk/tests/cputest.c 2005-06-21 10:11:36 UTC (rev 3987)
@@ -42,7 +42,7 @@
}
#endif // __arm__
=20
-#ifdef __ppc__
+#ifdef __powerpc__
static Bool go(char* cpu)
{
if ( strcmp( cpu, "ppc" ) =3D=3D 0 )
@@ -50,7 +50,7 @@
else=20
return False;
}
-#endif // __ppc__
+#endif // __powerpc__
=20
#ifdef __x86__
static void cpuid ( unsigned int n,
|
|
From: <sv...@va...> - 2005-06-21 10:07:30
|
Author: sewardj
Date: 2005-06-21 11:07:25 +0100 (Tue, 21 Jun 2005)
New Revision: 3986
Log:
Get ppc32 stage2 linked in the right place, so stage2 can actually start.
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-06-21 09:56:56 UTC (rev 3985)
+++ trunk/configure.in 2005-06-21 10:07:25 UTC (rev 3986)
@@ -139,7 +139,7 @@
powerpc*)
AC_MSG_RESULT([ok (${host_cpu})])
VG_ARCH=3D"ppc32"
- KICKSTART_BASE=3D"0x10000000"
+ KICKSTART_BASE=3D"0x70000000"
ARCH_CORE_AM_CFLAGS=3D""
ARCH_TOOL_AM_CFLAGS=3D"-fpic"
ARCH_CORE_AM_CCASFLAGS=3D"-Wa,-maltivec"
|
|
From: Julian S. <js...@ac...> - 2005-06-21 10:05:23
|
Works on Red Hat 7.3 at least, where it was failing before. J > >> Does the RH73 default script have any other hex numbers in it > >> before the 0x08048000? How about we just modify the first line that > >> has a hex number in it? > > > > Sounds ok to me. I tried to this but my sed-fu is too weak; I kept > > changing every hex value in the file which is no good. > > I just committed something a little more robust -- it searches for a hex > number followed by "+ SIZEOF_HEADERS", hopefully it will get both cases > right. Confirmation of whether this fixed the broken platforms would be > appreciated! Thanks. > > N > > > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click > _______________________________________________ > Valgrind-developers mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-developers |
|
From: <sv...@va...> - 2005-06-21 09:57:02
|
Author: sewardj
Date: 2005-06-21 10:56:56 +0100 (Tue, 21 Jun 2005)
New Revision: 3985
Log:
Un-break the build on ppc32-linux. This whole multiplatform
development deal is much more fragile than single-platform ..
Modified:
trunk/coregrind/m_trampoline.S
Modified: trunk/coregrind/m_trampoline.S
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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_trampoline.S 2005-06-21 04:26:24 UTC (rev 3984)
+++ trunk/coregrind/m_trampoline.S 2005-06-21 09:56:56 UTC (rev 3985)
@@ -37,6 +37,7 @@
This code runs on the simulated CPU.
*/
=20
+/*---------------- x86-linux ----------------*/
#if defined(VGP_x86_linux)
=20
.global VG_(trampoline_stuff_start)
@@ -68,10 +69,10 @@
VG_(trampoline_stuff_end):
=20
=09
+/*---------------- amd64-linux ----------------*/
#else
#if defined(VGP_amd64_linux)
=20
-
.global VG_(trampoline_stuff_start)
VG_(trampoline_stuff_start):
=20
@@ -99,18 +100,19 @@
VG_(trampoline_stuff_end):
=20
=20
+/*---------------- ppc32-linux ----------------*/
#else
#if defined(VGP_ppc32_linux)
=20
-=09
-// CAB: TODO
-// Not yet used, just keeping the compiler quiet
-sigreturn_start:
-rt_sigreturn_start:
-syscall_start:
-gettimeofday_start:
-time_start:
+.global VG_(trampoline_stuff_start)
+VG_(trampoline_stuff_start):
=20
+.global VG_(trampoline_stuff_end)
+VG_(trampoline_stuff_end):
+
+
+
+/*---------------- unknown ----------------*/
#else
# error Unknown platform
=20
|
|
From: <sv...@va...> - 2005-06-21 04:26:27
|
Author: njn
Date: 2005-06-21 05:26:24 +0100 (Tue, 21 Jun 2005)
New Revision: 3984
Log:
wibble
Modified:
trunk/coregrind/m_libcassert.c
Modified: trunk/coregrind/m_libcassert.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_libcassert.c 2005-06-21 04:01:51 UTC (rev 3983)
+++ trunk/coregrind/m_libcassert.c 2005-06-21 04:26:24 UTC (rev 3984)
@@ -136,7 +136,6 @@
{
va_list vargs;
Char buf[256];
- Char* bufptr =3D buf;
Char* component;
Char* bugs_to;
=20
@@ -146,7 +145,7 @@
entered =3D True;
=20
va_start(vargs, format);
- VG_(vsprintf) ( bufptr, format, vargs );
+ VG_(vsprintf) ( buf, format, vargs );
va_end(vargs);
=20
if (isCore) {
|
|
From: <sv...@va...> - 2005-06-21 04:01:54
|
Author: njn
Date: 2005-06-21 05:01:51 +0100 (Tue, 21 Jun 2005)
New Revision: 3983
Log:
Moved VG_(first_matching_thread_stack), removing m_threadstate's dependen=
cy
on m_machine.
Modified:
trunk/coregrind/m_machine.c
trunk/coregrind/m_threadstate.c
trunk/include/pub_tool_machine.h
trunk/include/pub_tool_threadstate.h
trunk/massif/ms_main.c
Modified: trunk/coregrind/m_machine.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_machine.c 2005-06-21 03:52:49 UTC (rev 3982)
+++ trunk/coregrind/m_machine.c 2005-06-21 04:01:51 UTC (rev 3983)
@@ -178,8 +178,24 @@
}
}
=20
+// Try and identify a thread whose stack satisfies the predicate p, or
+// return VG_INVALID_THREADID if none do.
+ThreadId VG_(first_matching_thread_stack)
+ ( Bool (*p) ( Addr stack_min, Addr stack_max, void* d ),
+ void* d )
+{
+ ThreadId tid;
=20
+ for (tid =3D 1; tid < VG_N_THREADS; tid++) {
+ if (VG_(threads)[tid].status =3D=3D VgTs_Empty) continue;
=20
+ if ( p ( VG_(get_SP)(tid),
+ VG_(threads)[tid].client_stack_highest_word, d ) )
+ return tid;
+ }
+ return VG_INVALID_THREADID;
+}
+
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_threadstate.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_threadstate.c 2005-06-21 03:52:49 UTC (rev 3982)
+++ trunk/coregrind/m_threadstate.c 2005-06-21 04:01:51 UTC (rev 3983)
@@ -31,7 +31,6 @@
#include "pub_core_basics.h"
#include "pub_core_threadstate.h"
#include "pub_core_libcassert.h"
-#include "pub_core_machine.h" // For VG_(get_SP)
=20
/*------------------------------------------------------------*/
/*--- Data structures. ---*/
@@ -123,26 +122,6 @@
return VG_INVALID_THREADID;
}
=20
-/* For constructing error messages only: try and identify a thread
- whose stack satisfies the predicate p, or return VG_INVALID_THREADID
- if none do.
-*/
-ThreadId VG_(first_matching_thread_stack)
- ( Bool (*p) ( Addr stack_min, Addr stack_max, void* d ),
- void* d )
-{
- ThreadId tid;
-
- for (tid =3D 1; tid < VG_N_THREADS; tid++) {
- if (VG_(threads)[tid].status =3D=3D VgTs_Empty) continue;
-
- if ( p ( VG_(get_SP)(tid),
- VG_(threads)[tid].client_stack_highest_word, d ) )
- return tid;
- }
- return VG_INVALID_THREADID;
-}
-=20
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/include/pub_tool_machine.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/pub_tool_machine.h 2005-06-21 03:52:49 UTC (rev 3982)
+++ trunk/include/pub_tool_machine.h 2005-06-21 04:01:51 UTC (rev 3983)
@@ -74,6 +74,12 @@
// doing leak checking.
extern void VG_(apply_to_GP_regs)(void (*f)(UWord val));
=20
+// Searches through all thread stacks to see if any match. Returns
+// VG_INVALID_THREADID if none match.
+extern ThreadId VG_(first_matching_thread_stack)
+ ( Bool (*p) ( Addr stack_min, Addr stack_max, vo=
id* d ),
+ void* d );
+
#endif // __PUB_TOOL_MACHINE_H
=20
/*--------------------------------------------------------------------*/
Modified: trunk/include/pub_tool_threadstate.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/pub_tool_threadstate.h 2005-06-21 03:52:49 UTC (rev 398=
2)
+++ trunk/include/pub_tool_threadstate.h 2005-06-21 04:01:51 UTC (rev 398=
3)
@@ -46,12 +46,6 @@
/* Get the TID of the thread which currently has the CPU. */
extern ThreadId VG_(get_running_tid) ( void );
=20
-/* Searches through all thread's stacks to see if any match. Returns
- VG_INVALID_THREADID if none match. */
-extern ThreadId VG_(first_matching_thread_stack)
- ( Bool (*p) ( Addr stack_min, Addr stack_max, vo=
id* d ),
- void* d );
-
#endif // __PUB_TOOL_THREADSTATE_H
=20
/*--------------------------------------------------------------------*/
Modified: trunk/massif/ms_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/massif/ms_main.c 2005-06-21 03:52:49 UTC (rev 3982)
+++ trunk/massif/ms_main.c 2005-06-21 04:01:51 UTC (rev 3983)
@@ -43,12 +43,12 @@
#include "pub_tool_libcmman.h"
#include "pub_tool_libcprint.h"
#include "pub_tool_libcproc.h"
+#include "pub_tool_machine.h"
#include "pub_tool_mallocfree.h"
#include "pub_tool_options.h"
#include "pub_tool_profile.h"
#include "pub_tool_replacemalloc.h"
#include "pub_tool_stacktrace.h"
-#include "pub_tool_threadstate.h"
#include "pub_tool_tooliface.h"
=20
#include "valgrind.h" // For {MALLOC,FREE}LIKE_BLOCK
|
|
From: <sv...@va...> - 2005-06-21 03:52:52
|
Author: njn
Date: 2005-06-21 04:52:49 +0100 (Tue, 21 Jun 2005)
New Revision: 3982
Log:
Slight reduce m_syswrap's dependence on m_signals by moving=20
VG_(client_signal_OK)().
Modified:
trunk/coregrind/m_signals.c
trunk/coregrind/m_syswrap/priv_syswrap-generic.h
trunk/coregrind/m_syswrap/syswrap-generic.c
trunk/coregrind/m_syswrap/syswrap-linux.c
trunk/coregrind/pub_core_signals.h
Modified: trunk/coregrind/m_signals.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_signals.c 2005-06-21 03:36:01 UTC (rev 3981)
+++ trunk/coregrind/m_signals.c 2005-06-21 03:52:49 UTC (rev 3982)
@@ -770,16 +770,6 @@
restore_all_host_signals(saved_mask);
}
=20
-Bool VG_(client_signal_OK)(Int sigNo)
-{
- /* signal 0 is OK for kill */
- Bool ret =3D sigNo >=3D 0 && sigNo <=3D VKI_SIGVGRTUSERMAX;
-
- //VG_(printf)("client_signal_OK(%d) -> %d\n", sigNo, ret);
-
- return ret;
-}
-
/* ---------------------------------------------------------------------
The signal simulation proper. A simplified version of what the=20
Linux kernel does.
Modified: trunk/coregrind/m_syswrap/priv_syswrap-generic.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/m_syswrap/priv_syswrap-generic.h 2005-06-21 03:36:01 =
UTC (rev 3981)
+++ trunk/coregrind/m_syswrap/priv_syswrap-generic.h 2005-06-21 03:52:49 =
UTC (rev 3982)
@@ -40,6 +40,9 @@
Bool VG_(valid_client_addr)(Addr start, SizeT size, ThreadId tid,
const Char *syscallname);
=20
+// Returns True if the signal is OK for the client to use.
+extern Bool VG_(client_signal_OK)(Int sigNo);
+
// Return true if we're allowed to use or create this fd.
extern
Bool VG_(fd_allowed)(Int fd, const Char *syscallname, ThreadId tid, Bool=
soft);
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-06-21 03:36:01 UTC (=
rev 3981)
+++ trunk/coregrind/m_syswrap/syswrap-generic.c 2005-06-21 03:52:49 UTC (=
rev 3982)
@@ -42,13 +42,13 @@
#include "pub_core_libcsignal.h"
#include "pub_core_main.h"
#include "pub_core_mallocfree.h"
-#include "pub_core_stacktrace.h" // For VG_(get_and_pp_StackTrace)()
-#include "pub_core_tooliface.h"
#include "pub_core_options.h"
#include "pub_core_scheduler.h"
#include "pub_core_signals.h"
+#include "pub_core_stacktrace.h" // For VG_(get_and_pp_StackTrace)()
#include "pub_core_syscall.h"
#include "pub_core_syswrap.h"
+#include "pub_core_tooliface.h"
=20
#include "priv_types_n_macros.h"
#include "priv_syswrap-generic.h"
@@ -93,6 +93,16 @@
return ret;
}
=20
+Bool VG_(client_signal_OK)(Int sigNo)
+{
+ /* signal 0 is OK for kill */
+ Bool ret =3D sigNo >=3D 0 && sigNo <=3D VKI_SIGVGRTUSERMAX;
+
+ //VG_(printf)("client_signal_OK(%d) -> %d\n", sigNo, ret);
+
+ return ret;
+}
+
/* ---------------------------------------------------------------------
Doing mmap, mremap
------------------------------------------------------------------ */
Modified: trunk/coregrind/m_syswrap/syswrap-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-linux.c 2005-06-21 03:36:01 UTC (re=
v 3981)
+++ trunk/coregrind/m_syswrap/syswrap-linux.c 2005-06-21 03:52:49 UTC (re=
v 3982)
@@ -42,7 +42,6 @@
#include "pub_core_tooliface.h"
#include "pub_core_options.h"
#include "pub_core_scheduler.h"
-#include "pub_core_signals.h" // For VG_(client_signal_OK)()
#include "pub_core_syscall.h"
=20
#include "priv_types_n_macros.h"
Modified: trunk/coregrind/pub_core_signals.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_signals.h 2005-06-21 03:36:01 UTC (rev 3981)
+++ trunk/coregrind/pub_core_signals.h 2005-06-21 03:52:49 UTC (rev 3982)
@@ -72,9 +72,6 @@
/* Extend the stack to cover addr, if possible */
extern Bool VG_(extend_stack)(Addr addr, UInt maxsize);
=20
-/* Returns True if the signal is OK for the client to use */
-extern Bool VG_(client_signal_OK)(Int sigNo);
-
/* Forces the client's signal handler to SIG_DFL - generally just
before using that signal to kill the process. */
extern void VG_(set_default_handler)(Int sig);
|
|
From: <sv...@va...> - 2005-06-21 03:36:03
|
Author: njn
Date: 2005-06-21 04:36:01 +0100 (Tue, 21 Jun 2005)
New Revision: 3981
Log:
Remove redundancy.
Modified:
trunk/coregrind/m_redir.c
Modified: trunk/coregrind/m_redir.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_redir.c 2005-06-21 03:30:51 UTC (rev 3980)
+++ trunk/coregrind/m_redir.c 2005-06-21 03:36:01 UTC (rev 3981)
@@ -216,19 +216,15 @@
if (si->seg->flags & SF_VALGRIND)
return False;
=20
- resolved =3D VG_(is_resolved)(redir);
-
+ resolved =3D from_resolved(redir);
vg_assert(!resolved);
+ vg_assert(redir->from_sym !=3D NULL);
=20
- if (!from_resolved(redir)) {
- vg_assert(redir->from_sym !=3D NULL);
-
- if (match_lib(redir->from_lib, si)) {
- redir->from_addr =3D VG_(reverse_search_one_symtab)(si, redir->from_sy=
m);
- if (VG_(clo_trace_redir) && redir->from_addr !=3D 0)
- VG_(printf)(" bind FROM: %p =3D %s:%s\n",=20
- redir->from_addr,redir->from_lib, redir->from_sy=
m );
- }
+ if (match_lib(redir->from_lib, si)) {
+ redir->from_addr =3D VG_(reverse_search_one_symtab)(si, redir->fro=
m_sym);
+ if (VG_(clo_trace_redir) && redir->from_addr !=3D 0)
+ VG_(printf)(" bind FROM: %p =3D %s:%s\n",=20
+ redir->from_addr,redir->from_lib, redir->from_sym )=
;
}
=20
resolved =3D from_resolved(redir);
|
|
From: Nicholas N. <nj...@cs...> - 2005-06-21 03:32:27
|
On Mon, 20 Jun 2005, Nicholas Nethercote wrote: >>> . = 0x08048000 + SIZEOF_HEADERS; >> >> Does the RH73 default script have any other hex numbers in it >> before the 0x08048000? How about we just modify the first line that >> has a hex number in it? > > Sounds ok to me. I tried to this but my sed-fu is too weak; I kept changing > every hex value in the file which is no good. I just committed something a little more robust -- it searches for a hex number followed by "+ SIZEOF_HEADERS", hopefully it will get both cases right. Confirmation of whether this fixed the broken platforms would be appreciated! Thanks. N |
|
From: <sv...@va...> - 2005-06-21 03:30:52
|
Author: njn Date: 2005-06-21 04:30:51 +0100 (Tue, 21 Jun 2005) New Revision: 3980 Log: Attempt to fix the stage2.lds borkage. 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-06-21 03:20:17 UTC (rev 3979) +++ trunk/coregrind/Makefile.am 2005-06-21 03:30:51 UTC (rev 3980) @@ -183,13 +183,23 @@ -Wl,-z,initfirst =20 # Extract ld's default linker script and hack it to our needs. -# This relies on finding "executable_start" and replacing the address on -# that line with kickstart_base. +# First we cut everything above and below the "=3D=3D=3D=3D=3D..." lines= at the top +# and bottom. +# Then we have to replace the load address with "kickstart_base". +# The line to replace in has one of the following two forms: +# +# . =3D 0x08048000 + SIZEOF_HEADERS; +# +# or +# PROVIDE (__executable_start =3D 0x08048000); . =3D 0x08048000 + SIZE= OF_HEADERS; +# +# So we search for the line with a hex value "+ SIZEOF_HEADERS", and rep= lace +# all the hex values in that line with "kickstart_base". stage2.lds: Makefile $(CC) -Wl,--verbose -nostdlib 2>&1 | sed \ -e '1,/^=3D=3D=3D=3D=3D\+$$/d' \ -e '/^=3D=3D=3D=3D=3D\+$$/d' \ - -e '/executable_start/s/0x[0-9A-Fa-f]\+/kickstart_base/g' > $@ \ + -e '/\. =3D 0x[0-9A-Fa-f]\+ + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/kicksta= rt_base/g' > $@ \ || rm -f $@ =20 MANUAL_DEPS =3D $(noinst_HEADERS) $(include_HEADERS) |
|
From: <sv...@va...> - 2005-06-21 03:20:54
|
Author: njn
Date: 2005-06-21 04:20:17 +0100 (Tue, 21 Jun 2005)
New Revision: 3979
Log:
Malloc replacement worked very much like a 'need', but wasn't one.
I've changed it so it now is, which makes it consistent with the
other 'needs'. Because of this, I was also able to invert the dependence
between m_mallocfree and m_tooliface, which is related to setting
the redzone size for client heap blocks. As a result, m_tooliface
now doesn't depend on anything except pub_core_basics.h, hooray!
=20
Modified:
trunk/addrcheck/ac_main.c
trunk/coregrind/m_mallocfree.c
trunk/coregrind/m_scheduler/scheduler.c
trunk/coregrind/m_tooliface.c
trunk/coregrind/pub_core_tooliface.h
trunk/helgrind/hg_main.c
trunk/include/pub_tool_tooliface.h
trunk/massif/ms_main.c
trunk/memcheck/mc_main.c
Modified: trunk/addrcheck/ac_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/addrcheck/ac_main.c 2005-06-21 01:54:38 UTC (rev 3978)
+++ trunk/addrcheck/ac_main.c 2005-06-21 03:20:17 UTC (rev 3979)
@@ -1344,7 +1344,7 @@
ac_expensive_sanity_check);
VG_(needs_shadow_memory) ();
=20
- VG_(malloc_funcs) (MAC_(malloc),
+ VG_(needs_malloc_replacement) (MAC_(malloc),
MAC_(__builtin_new),
MAC_(__builtin_vec_new),
MAC_(memalign),
Modified: trunk/coregrind/m_mallocfree.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_mallocfree.c 2005-06-21 01:54:38 UTC (rev 3978)
+++ trunk/coregrind/m_mallocfree.c 2005-06-21 03:20:17 UTC (rev 3979)
@@ -37,6 +37,7 @@
#include "pub_core_mallocfree.h"
#include "pub_core_options.h"
#include "pub_core_profile.h"
+#include "pub_core_tooliface.h"
#include "valgrind.h"
=20
//zz#include "memcheck/memcheck.h"
@@ -386,31 +387,6 @@
}
}
=20
-static Bool init_done =3D False;
-static SizeT client_malloc_redzone_szB =3D 8; // default: be paranoid
-
-// Nb: this must be called before the client arena is initialised, ie.
-// before any memory is allocated.
-void VG_(set_client_malloc_redzone_szB)(SizeT rz_szB)
-{
- if (init_done) {
- VG_(printf)(
- "\nTool error:\n"
- "%s cannot be called after the first allocation.\n",
- __PRETTY_FUNCTION__);
- VG_(exit)(1);
- }
- // This limit is no special figure, just something not too big
- if (rz_szB > 128) {
- VG_(printf)(
- "\nTool error:\n"
- " %s passed a too-big value (%llu)",=20
- __PRETTY_FUNCTION__, (ULong)rz_szB);
- VG_(exit)(1);
- }
- client_malloc_redzone_szB =3D rz_szB;
-}
-
/* This library is self-initialising, as it makes this more self-contain=
ed,
less coupled with the outside world. Hence VG_(arena_malloc)() and
VG_(arena_free)() below always call ensure_mm_init() to ensure things=
are
@@ -418,10 +394,29 @@
static
void ensure_mm_init ( void )
{
+ static Bool init_done =3D False;
+ static SizeT client_redzone_szB =3D 8; // default: be paranoid
+
if (init_done) {
+ // This assertion ensures that a tool cannot try to change the cli=
ent
+ // redzone size with VG_(needs_malloc_replacement)() after this mo=
dule
+ // has done its first allocation.
+ if (VG_(needs).malloc_replacement)
+ vg_assert(client_redzone_szB =3D=3D VG_(tdict).tool_client_redz=
one_szB);
return;
}
=20
+ if (VG_(needs).malloc_replacement) {
+ client_redzone_szB =3D VG_(tdict).tool_client_redzone_szB;
+ // 128 is no special figure, just something not too big
+ if (client_redzone_szB > 128) {
+ VG_(printf)( "\nTool error:\n"
+ " specified redzone size is too big (%llu)\n",=20
+ (ULong)client_redzone_szB);
+ VG_(exit)(1);
+ }
+ }
+
/* Use checked red zones (of various sizes) for our internal stuff,
and an unchecked zone of arbitrary size for the client. Of
course the client's red zone can be checked by the tool, eg.=20
@@ -437,7 +432,7 @@
arena_init ( VG_AR_CORE, "core", 4, CORE_ARENA_MIN_SZB );
arena_init ( VG_AR_TOOL, "tool", 4, 1048576 );
arena_init ( VG_AR_SYMTAB, "symtab", 4, 1048576 );
- arena_init ( VG_AR_CLIENT, "client", client_malloc_redzone_szB, 10=
48576 );
+ arena_init ( VG_AR_CLIENT, "client", client_redzone_szB, 1048576 )=
;
arena_init ( VG_AR_DEMANGLE, "demangle", 12/*paranoid*/, 65536 );
arena_init ( VG_AR_EXECTXT, "exectxt", 4, 65536 );
arena_init ( VG_AR_ERRORS, "errors", 4, 65536 );
Modified: trunk/coregrind/m_scheduler/scheduler.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_scheduler/scheduler.c 2005-06-21 01:54:38 UTC (rev =
3978)
+++ trunk/coregrind/m_scheduler/scheduler.c 2005-06-21 03:20:17 UTC (rev =
3979)
@@ -980,15 +980,15 @@
case VG_USERREQ__GET_MALLOCFUNCS: {
struct vg_mallocfunc_info *info =3D (struct vg_mallocfunc_info *)arg[1=
];
=20
- info->tl_malloc =3D VG_(tdict).malloc_malloc;
- info->tl_calloc =3D VG_(tdict).malloc_calloc;
- info->tl_realloc =3D VG_(tdict).malloc_realloc;
- info->tl_memalign =3D VG_(tdict).malloc_memalign;
- info->tl___builtin_new =3D VG_(tdict).malloc___builtin_new;
- info->tl___builtin_vec_new =3D VG_(tdict).malloc___builtin_vec_new;
- info->tl_free =3D VG_(tdict).malloc_free;
- info->tl___builtin_delete =3D VG_(tdict).malloc___builtin_delete;
- info->tl___builtin_vec_delete =3D VG_(tdict).malloc___builtin_vec_dele=
te;
+ info->tl_malloc =3D VG_(tdict).tool_malloc;
+ info->tl_calloc =3D VG_(tdict).tool_calloc;
+ info->tl_realloc =3D VG_(tdict).tool_realloc;
+ info->tl_memalign =3D VG_(tdict).tool_memalign;
+ info->tl___builtin_new =3D VG_(tdict).tool___builtin_new;
+ info->tl___builtin_vec_new =3D VG_(tdict).tool___builtin_vec_new;
+ info->tl_free =3D VG_(tdict).tool_free;
+ info->tl___builtin_delete =3D VG_(tdict).tool___builtin_delete;
+ info->tl___builtin_vec_delete =3D VG_(tdict).tool___builtin_vec_delete=
;
=20
info->arena_payload_szB =3D VG_(arena_payload_szB);
info->clo_trace_malloc =3D VG_(clo_trace_malloc);
Modified: trunk/coregrind/m_tooliface.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_tooliface.c 2005-06-21 01:54:38 UTC (rev 3978)
+++ trunk/coregrind/m_tooliface.c 2005-06-21 03:20:17 UTC (rev 3979)
@@ -30,7 +30,6 @@
*/
=20
#include "pub_core_basics.h"
-#include "pub_core_mallocfree.h" // For VG_(set_client_malloc_redzone=
_szB)()
#include "pub_core_tooliface.h"
=20
// The core/tool dictionary of functions (initially zeroed, as we want i=
t)
@@ -87,14 +86,13 @@
.tool_errors =3D False,
.libc_freeres =3D False,
.basic_block_discards =3D False,
- .no_longer_used_1 =3D False,
.command_line_options =3D False,
.client_requests =3D False,
- .no_longer_used_0 =3D False,
.syscall_wrapper =3D False,
.sanity_checks =3D False,
.data_syms =3D False,
.shadow_memory =3D False,
+ .malloc_replacement =3D False,
};
=20
/* static */
@@ -233,11 +231,7 @@
VG_(tdict).tool_expensive_sanity_check =3D expen;
}
=20
-
-/*--------------------------------------------------------------------*/
-/* Replacing malloc() */
-
-extern void VG_(malloc_funcs)(
+void VG_(needs_malloc_replacement)(
void* (*malloc) ( ThreadId, SizeT ),
void* (*__builtin_new) ( ThreadId, SizeT ),
void* (*__builtin_vec_new) ( ThreadId, SizeT ),
@@ -250,17 +244,17 @@
SizeT client_malloc_redzone_szB
)
{
- VG_(tdict).malloc_malloc =3D malloc;
- VG_(tdict).malloc___builtin_new =3D __builtin_new;
- VG_(tdict).malloc___builtin_vec_new =3D __builtin_vec_new;
- VG_(tdict).malloc_memalign =3D memalign;
- VG_(tdict).malloc_calloc =3D calloc;
- VG_(tdict).malloc_free =3D free;
- VG_(tdict).malloc___builtin_delete =3D __builtin_delete;
- VG_(tdict).malloc___builtin_vec_delete =3D __builtin_vec_delete;
- VG_(tdict).malloc_realloc =3D realloc;
-
- VG_(set_client_malloc_redzone_szB)( client_malloc_redzone_szB );
+ VG_(needs).malloc_replacement =3D True;
+ VG_(tdict).tool_malloc =3D malloc;
+ VG_(tdict).tool___builtin_new =3D __builtin_new;
+ VG_(tdict).tool___builtin_vec_new =3D __builtin_vec_new;
+ VG_(tdict).tool_memalign =3D memalign;
+ VG_(tdict).tool_calloc =3D calloc;
+ VG_(tdict).tool_free =3D free;
+ VG_(tdict).tool___builtin_delete =3D __builtin_delete;
+ VG_(tdict).tool___builtin_vec_delete =3D __builtin_vec_delete;
+ VG_(tdict).tool_realloc =3D realloc;
+ VG_(tdict).tool_client_redzone_szB =3D client_malloc_redzone_szB;
}
=20
=20
Modified: trunk/coregrind/pub_core_tooliface.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_tooliface.h 2005-06-21 01:54:38 UTC (rev 397=
8)
+++ trunk/coregrind/pub_core_tooliface.h 2005-06-21 03:20:17 UTC (rev 397=
9)
@@ -84,14 +84,13 @@
Bool core_errors;
Bool tool_errors;
Bool basic_block_discards;
- Bool no_longer_used_1; // for backwards compatibility
Bool command_line_options;
Bool client_requests;
- Bool no_longer_used_0; // for backwards compatibility
Bool syscall_wrapper;
Bool sanity_checks;
Bool data_syms;
Bool shadow_memory;
+ Bool malloc_replacement;
}=20
VgNeeds;
=20
@@ -141,6 +140,18 @@
Bool (*tool_cheap_sanity_check)(void);
Bool (*tool_expensive_sanity_check)(void);
=20
+ // VG_(needs).malloc_replacement
+ void* (*tool_malloc) (ThreadId, SizeT);
+ void* (*tool___builtin_new) (ThreadId, SizeT);
+ void* (*tool___builtin_vec_new) (ThreadId, SizeT);
+ void* (*tool_memalign) (ThreadId, SizeT, SizeT);
+ void* (*tool_calloc) (ThreadId, SizeT, SizeT);
+ void (*tool_free) (ThreadId, void*);
+ void (*tool___builtin_delete) (ThreadId, void*);
+ void (*tool___builtin_vec_delete)(ThreadId, void*);
+ void* (*tool_realloc) (ThreadId, void*, SizeT);
+ SizeT tool_client_redzone_szB;
+
// -- Event tracking functions ------------------------------------
void (*track_new_mem_startup) (Addr, SizeT, Bool, Bool, Bool);
void (*track_new_mem_stack_signal)(Addr, SizeT);
@@ -192,17 +203,6 @@
=20
void (*track_init_shadow_page)(Addr);
=20
- // -- malloc/free replacements -----------------------------------
- void* (*malloc_malloc) (ThreadId, SizeT);
- void* (*malloc___builtin_new) (ThreadId, SizeT);
- void* (*malloc___builtin_vec_new) (ThreadId, SizeT);
- void* (*malloc_memalign) (ThreadId, SizeT, SizeT);
- void* (*malloc_calloc) (ThreadId, SizeT, SizeT);
- void (*malloc_free) (ThreadId, void*);
- void (*malloc___builtin_delete) (ThreadId, void*);
- void (*malloc___builtin_vec_delete)(ThreadId, void*);
- void* (*malloc_realloc) (ThreadId, void*, SizeT);
-
} VgToolInterface;
=20
extern VgToolInterface VG_(tdict);
Modified: trunk/helgrind/hg_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/helgrind/hg_main.c 2005-06-21 01:54:38 UTC (rev 3978)
+++ trunk/helgrind/hg_main.c 2005-06-21 03:20:17 UTC (rev 3979)
@@ -3392,7 +3392,7 @@
hg_print_debug_usage);
VG_(needs_shadow_memory) ();
=20
- VG_(malloc_funcs) (hg_malloc,
+ VG_(needs_malloc_replacement) (hg_malloc,
hg___builtin_new,
hg___builtin_vec_new,
hg_memalign,
Modified: trunk/include/pub_tool_tooliface.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/pub_tool_tooliface.h 2005-06-21 01:54:38 UTC (rev 3978)
+++ trunk/include/pub_tool_tooliface.h 2005-06-21 03:20:17 UTC (rev 3979)
@@ -253,11 +253,9 @@
/* Does the tool need shadow memory allocated? */
extern void VG_(needs_shadow_memory)( void );
=20
-/* ------------------------------------------------------------------ */
-/* Malloc replacement */
-
+/* Does the tool replace malloc() and friends with its own versions? */
// The 'p' prefix avoids GCC complaints about overshadowing global names=
.
-extern void VG_(malloc_funcs)(
+extern void VG_(needs_malloc_replacement)(
void* (*pmalloc) ( ThreadId tid, SizeT n ),
void* (*p__builtin_new) ( ThreadId tid, SizeT n ),
void* (*p__builtin_vec_new) ( ThreadId tid, SizeT n ),
Modified: trunk/massif/ms_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/massif/ms_main.c 2005-06-21 01:54:38 UTC (rev 3978)
+++ trunk/massif/ms_main.c 2005-06-21 03:20:17 UTC (rev 3979)
@@ -1802,9 +1802,7 @@
ms_print_usage,
ms_print_debug_usage);
VG_(needs_client_requests) (ms_handle_client_request);
-
- // Malloc replacement
- VG_(malloc_funcs) (ms_malloc,
+ VG_(needs_malloc_replacement) (ms_malloc,
ms___builtin_new,
ms___builtin_vec_new,
ms_memalign,
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-06-21 01:54:38 UTC (rev 3978)
+++ trunk/memcheck/mc_main.c 2005-06-21 03:20:17 UTC (rev 3979)
@@ -2554,7 +2554,7 @@
mc_expensive_sanity_check);
VG_(needs_shadow_memory) ();
=20
- VG_(malloc_funcs) (MAC_(malloc),
+ VG_(needs_malloc_replacement) (MAC_(malloc),
MAC_(__builtin_new),
MAC_(__builtin_vec_new),
MAC_(memalign),
|
|
From: <js...@ac...> - 2005-06-21 02:39:54
|
Nightly build on phoenix ( SuSE 9.1 ) started at 2005-06-21 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 == 175 tests, 4 stderr failures, 1 stdout failure ================= memcheck/tests/error_counts (stdout) memcheck/tests/leak-0 (stderr) memcheck/tests/leak-tree (stderr) none/tests/faultstatus (stderr) none/tests/x86/int (stderr) |
|
From: Tom H. <to...@co...> - 2005-06-21 02:35:59
|
Nightly build on dunsmere ( athlon, Fedora Core 3 ) started at 2005-06-21 03:30:03 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 == 178 tests, 8 stderr failures, 2 stdout failures ================= memcheck/tests/error_counts (stdout) memcheck/tests/leak-0 (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/x86/scalar_supp (stderr) memcheck/tests/xml1 (stderr) none/tests/faultstatus (stderr) none/tests/selfrun (stdout) none/tests/selfrun (stderr) none/tests/x86/int (stderr) |
|
From: Tom H. <th...@cy...> - 2005-06-21 02:27:48
|
Nightly build on audi ( i686, Red Hat 9 ) started at 2005-06-21 03:25:02 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 == 177 tests, 176 stderr failures, 70 stdout failures ================= memcheck/tests/addressable (stdout) memcheck/tests/addressable (stderr) memcheck/tests/badaddrvalue (stdout) memcheck/tests/badaddrvalue (stderr) memcheck/tests/badfree-2trace (stderr) memcheck/tests/badfree (stderr) memcheck/tests/badjump (stderr) memcheck/tests/badjump2 (stderr) memcheck/tests/badloop (stderr) memcheck/tests/badpoll (stderr) memcheck/tests/badrw (stderr) memcheck/tests/brk (stderr) memcheck/tests/brk2 (stderr) memcheck/tests/buflen_check (stderr) memcheck/tests/clientperm (stdout) memcheck/tests/clientperm (stderr) memcheck/tests/custom_alloc (stderr) memcheck/tests/describe-block (stderr) memcheck/tests/doublefree (stderr) memcheck/tests/error_counts (stdout) memcheck/tests/error_counts (stderr) memcheck/tests/errs1 (stderr) memcheck/tests/execve (stderr) memcheck/tests/execve2 (stderr) memcheck/tests/exitprog (stderr) memcheck/tests/fprw (stderr) memcheck/tests/fwrite (stdout) memcheck/tests/fwrite (stderr) memcheck/tests/inits (stderr) memcheck/tests/inline (stdout) memcheck/tests/inline (stderr) memcheck/tests/leak-0 (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-regroot (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/leakotron (stdout) memcheck/tests/malloc1 (stderr) memcheck/tests/malloc2 (stderr) memcheck/tests/malloc3 (stdout) memcheck/tests/malloc3 (stderr) memcheck/tests/manuel1 (stdout) memcheck/tests/manuel1 (stderr) memcheck/tests/manuel2 (stdout) memcheck/tests/manuel2 (stderr) memcheck/tests/manuel3 (stderr) memcheck/tests/match-overrun (stderr) memcheck/tests/memalign2 (stderr) memcheck/tests/memalign_test (stderr) memcheck/tests/memcmptest (stdout) memcheck/tests/memcmptest (stderr) memcheck/tests/mempool (stderr) memcheck/tests/mismatches (stderr) memcheck/tests/mmaptest (stderr) memcheck/tests/nanoleak (stderr) memcheck/tests/nanoleak_supp (stderr) memcheck/tests/new_nothrow (stderr) memcheck/tests/new_override (stdout) memcheck/tests/new_override (stderr) memcheck/tests/null_socket (stderr) memcheck/tests/overlap (stdout) memcheck/tests/overlap (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/post-syscall (stdout) memcheck/tests/post-syscall (stderr) memcheck/tests/realloc1 (stderr) memcheck/tests/realloc2 (stderr) memcheck/tests/realloc3 (stderr) memcheck/tests/sigaltstack (stderr) memcheck/tests/signal2 (stdout) memcheck/tests/signal2 (stderr) memcheck/tests/sigprocmask (stderr) memcheck/tests/str_tester (stderr) memcheck/tests/strchr (stderr) memcheck/tests/supp1 (stderr) memcheck/tests/supp2 (stderr) memcheck/tests/suppfree (stderr) memcheck/tests/toobig-allocs (stderr) memcheck/tests/trivialleak (stderr) memcheck/tests/vgtest_ume (stderr) memcheck/tests/weirdioctl (stdout) memcheck/tests/weirdioctl (stderr) memcheck/tests/writev (stderr) memcheck/tests/x86/fpeflags (stderr) memcheck/tests/x86/pushfpopf (stdout) memcheck/tests/x86/pushfpopf (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/x86/scalar_exit_group (stderr) memcheck/tests/x86/scalar_fork (stderr) memcheck/tests/x86/scalar_supp (stderr) memcheck/tests/x86/scalar_vfork (stderr) memcheck/tests/x86/tronical (stderr) memcheck/tests/xml1 (stdout) memcheck/tests/xml1 (stderr) memcheck/tests/zeropage (stdout) memcheck/tests/zeropage (stderr) cachegrind/tests/chdir (stderr) cachegrind/tests/dlclose (stdout) cachegrind/tests/dlclose (stderr) cachegrind/tests/x86/fpu-28-108 (stderr) corecheck/tests/as_mmap (stderr) corecheck/tests/as_shm (stdout) corecheck/tests/as_shm (stderr) corecheck/tests/erringfds (stdout) corecheck/tests/erringfds (stderr) corecheck/tests/fdleak_cmsg (stderr) corecheck/tests/fdleak_creat (stderr) corecheck/tests/fdleak_dup (stderr) corecheck/tests/fdleak_dup2 (stderr) corecheck/tests/fdleak_fcntl (stderr) corecheck/tests/fdleak_ipv4 (stdout) corecheck/tests/fdleak_ipv4 (stderr) corecheck/tests/fdleak_open (stderr) corecheck/tests/fdleak_pipe (stderr) corecheck/tests/fdleak_socketpair (stderr) corecheck/tests/pth_atfork1 (stdout) corecheck/tests/pth_atfork1 (stderr) corecheck/tests/pth_cancel1 (stdout) corecheck/tests/pth_cancel1 (stderr) corecheck/tests/pth_cancel2 (stderr) corecheck/tests/pth_cvsimple (stdout) corecheck/tests/pth_cvsimple (stderr) corecheck/tests/pth_empty (stderr) corecheck/tests/pth_exit (stderr) corecheck/tests/pth_exit2 (stderr) corecheck/tests/pth_mutexspeed (stdout) corecheck/tests/pth_mutexspeed (stderr) corecheck/tests/pth_once (stdout) corecheck/tests/pth_once (stderr) corecheck/tests/pth_rwlock (stderr) corecheck/tests/res_search (stdout) corecheck/tests/res_search (stderr) corecheck/tests/sigkill (stderr) corecheck/tests/stack_changes (stdout) corecheck/tests/stack_changes (stderr) corecheck/tests/threadederrno (stdout) corecheck/tests/threadederrno (stderr) corecheck/tests/vgprintf (stdout) corecheck/tests/vgprintf (stderr) massif/tests/toobig-allocs (stderr) massif/tests/true_html (stderr) massif/tests/true_text (stderr) lackey/tests/true (stderr) none/tests/args (stdout) none/tests/args (stderr) none/tests/async-sigs (stdout) none/tests/async-sigs (stderr) none/tests/bitfield1 (stderr) none/tests/blockfault (stderr) none/tests/closeall (stderr) none/tests/cmdline1 (stdout) none/tests/cmdline1 (stderr) none/tests/cmdline2 (stdout) none/tests/cmdline2 (stderr) none/tests/cmdline3 (stderr) none/tests/cmdline4 (stderr) none/tests/cmdline5 (stderr) none/tests/cmdline6 (stderr) none/tests/coolo_sigaction (stdout) none/tests/coolo_sigaction (stderr) none/tests/coolo_strlen (stderr) none/tests/discard (stdout) none/tests/discard (stderr) none/tests/exec-sigmask (stderr) none/tests/execve (stderr) none/tests/faultstatus (stderr) none/tests/fcntl_setown (stderr) none/tests/floored (stdout) none/tests/floored (stderr) none/tests/fork (stdout) none/tests/fork (stderr) none/tests/fucomip (stderr) none/tests/gxx304 (stderr) none/tests/manythreads (stdout) none/tests/manythreads (stderr) none/tests/map_unaligned (stderr) none/tests/map_unmap (stdout) none/tests/map_unmap (stderr) none/tests/mq (stderr) none/tests/mremap (stderr) none/tests/munmap_exe (stderr) none/tests/pending (stdout) none/tests/pending (stderr) none/tests/pth_blockedsig (stdout) none/tests/pth_blockedsig (stderr) none/tests/pth_stackalign (stdout) none/tests/pth_stackalign (stderr) none/tests/rcrl (stdout) none/tests/rcrl (stderr) none/tests/readline1 (stdout) none/tests/readline1 (stderr) none/tests/resolv (stdout) none/tests/resolv (stderr) none/tests/rlimit_nofile (stderr) none/tests/sem (stderr) none/tests/semlimit (stderr) none/tests/sha1_test (stderr) none/tests/shortpush (stderr) none/tests/shorts (stderr) none/tests/sigstackgrowth (stdout) none/tests/sigstackgrowth (stderr) none/tests/smc1 (stdout) none/tests/smc1 (stderr) none/tests/stackgrowth (stdout) none/tests/stackgrowth (stderr) none/tests/syscall-restart1 (stderr) none/tests/syscall-restart2 (stderr) none/tests/system (stderr) none/tests/thread-exits (stdout) none/tests/thread-exits (stderr) none/tests/threaded-fork (stdout) none/tests/threaded-fork (stderr) none/tests/tls (stdout) none/tests/tls (stderr) none/tests/x86/badseg (stdout) none/tests/x86/badseg (stderr) none/tests/x86/bt_everything (stdout) none/tests/x86/bt_everything (stderr) none/tests/x86/bt_literal (stdout) none/tests/x86/bt_literal (stderr) none/tests/x86/cpuid (stdout) none/tests/x86/cpuid (stderr) none/tests/x86/fpu_lazy_eflags (stdout) none/tests/x86/fpu_lazy_eflags (stderr) none/tests/x86/getseg (stdout) none/tests/x86/getseg (stderr) none/tests/x86/insn_basic (stdout) none/tests/x86/insn_basic (stderr) none/tests/x86/insn_cmov (stdout) none/tests/x86/insn_cmov (stderr) none/tests/x86/insn_fpu (stdout) none/tests/x86/insn_fpu (stderr) none/tests/x86/insn_mmx (stdout) none/tests/x86/insn_mmx (stderr) none/tests/x86/insn_mmxext (stdout) none/tests/x86/insn_mmxext (stderr) none/tests/x86/insn_sse (stdout) none/tests/x86/insn_sse (stderr) none/tests/x86/int (stderr) none/tests/x86/pushpopseg (stdout) none/tests/x86/pushpopseg (stderr) none/tests/x86/seg_override (stdout) none/tests/x86/seg_override (stderr) none/tests/x86/sigcontext (stdout) none/tests/x86/sigcontext (stderr) none/tests/yield (stdout) none/tests/yield (stderr) |
|
From: Tom H. <th...@cy...> - 2005-06-21 02:17:46
|
Nightly build on alvis ( i686, Red Hat 7.3 ) started at 2005-06-21 03:15:03 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 == 176 tests, 175 stderr failures, 69 stdout failures ================= memcheck/tests/addressable (stdout) memcheck/tests/addressable (stderr) memcheck/tests/badaddrvalue (stdout) memcheck/tests/badaddrvalue (stderr) memcheck/tests/badfree-2trace (stderr) memcheck/tests/badfree (stderr) memcheck/tests/badjump (stderr) memcheck/tests/badjump2 (stderr) memcheck/tests/badloop (stderr) memcheck/tests/badpoll (stderr) memcheck/tests/badrw (stderr) memcheck/tests/brk (stderr) memcheck/tests/brk2 (stderr) memcheck/tests/buflen_check (stderr) memcheck/tests/clientperm (stdout) memcheck/tests/clientperm (stderr) memcheck/tests/custom_alloc (stderr) memcheck/tests/describe-block (stderr) memcheck/tests/doublefree (stderr) memcheck/tests/error_counts (stdout) memcheck/tests/error_counts (stderr) memcheck/tests/errs1 (stderr) memcheck/tests/execve (stderr) memcheck/tests/execve2 (stderr) memcheck/tests/exitprog (stderr) memcheck/tests/fprw (stderr) memcheck/tests/fwrite (stdout) memcheck/tests/fwrite (stderr) memcheck/tests/inits (stderr) memcheck/tests/inline (stdout) memcheck/tests/inline (stderr) memcheck/tests/leak-0 (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-regroot (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/leakotron (stdout) memcheck/tests/malloc1 (stderr) memcheck/tests/malloc2 (stderr) memcheck/tests/malloc3 (stdout) memcheck/tests/malloc3 (stderr) memcheck/tests/manuel1 (stdout) memcheck/tests/manuel1 (stderr) memcheck/tests/manuel2 (stdout) memcheck/tests/manuel2 (stderr) memcheck/tests/manuel3 (stderr) memcheck/tests/match-overrun (stderr) memcheck/tests/memalign2 (stderr) memcheck/tests/memalign_test (stderr) memcheck/tests/memcmptest (stdout) memcheck/tests/memcmptest (stderr) memcheck/tests/mempool (stderr) memcheck/tests/mismatches (stderr) memcheck/tests/mmaptest (stderr) memcheck/tests/nanoleak (stderr) memcheck/tests/nanoleak_supp (stderr) memcheck/tests/new_nothrow (stderr) memcheck/tests/new_override (stdout) memcheck/tests/new_override (stderr) memcheck/tests/null_socket (stderr) memcheck/tests/overlap (stdout) memcheck/tests/overlap (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/post-syscall (stdout) memcheck/tests/post-syscall (stderr) memcheck/tests/realloc1 (stderr) memcheck/tests/realloc2 (stderr) memcheck/tests/realloc3 (stderr) memcheck/tests/sigaltstack (stderr) memcheck/tests/signal2 (stdout) memcheck/tests/signal2 (stderr) memcheck/tests/sigprocmask (stderr) memcheck/tests/str_tester (stderr) memcheck/tests/strchr (stderr) memcheck/tests/supp1 (stderr) memcheck/tests/supp2 (stderr) memcheck/tests/suppfree (stderr) memcheck/tests/toobig-allocs (stderr) memcheck/tests/trivialleak (stderr) memcheck/tests/vgtest_ume (stderr) memcheck/tests/weirdioctl (stdout) memcheck/tests/weirdioctl (stderr) memcheck/tests/writev (stderr) memcheck/tests/x86/fpeflags (stderr) memcheck/tests/x86/pushfpopf (stdout) memcheck/tests/x86/pushfpopf (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/x86/scalar_exit_group (stderr) memcheck/tests/x86/scalar_fork (stderr) memcheck/tests/x86/scalar_supp (stderr) memcheck/tests/x86/scalar_vfork (stderr) memcheck/tests/x86/tronical (stderr) memcheck/tests/xml1 (stdout) memcheck/tests/xml1 (stderr) memcheck/tests/zeropage (stdout) memcheck/tests/zeropage (stderr) cachegrind/tests/chdir (stderr) cachegrind/tests/dlclose (stdout) cachegrind/tests/dlclose (stderr) cachegrind/tests/x86/fpu-28-108 (stderr) corecheck/tests/as_mmap (stderr) corecheck/tests/as_shm (stdout) corecheck/tests/as_shm (stderr) corecheck/tests/erringfds (stdout) corecheck/tests/erringfds (stderr) corecheck/tests/fdleak_cmsg (stderr) corecheck/tests/fdleak_creat (stderr) corecheck/tests/fdleak_dup (stderr) corecheck/tests/fdleak_dup2 (stderr) corecheck/tests/fdleak_fcntl (stderr) corecheck/tests/fdleak_ipv4 (stdout) corecheck/tests/fdleak_ipv4 (stderr) corecheck/tests/fdleak_open (stderr) corecheck/tests/fdleak_pipe (stderr) corecheck/tests/fdleak_socketpair (stderr) corecheck/tests/pth_atfork1 (stdout) corecheck/tests/pth_atfork1 (stderr) corecheck/tests/pth_cancel1 (stdout) corecheck/tests/pth_cancel1 (stderr) corecheck/tests/pth_cancel2 (stderr) corecheck/tests/pth_cvsimple (stdout) corecheck/tests/pth_cvsimple (stderr) corecheck/tests/pth_empty (stderr) corecheck/tests/pth_exit (stderr) corecheck/tests/pth_exit2 (stderr) corecheck/tests/pth_mutexspeed (stdout) corecheck/tests/pth_mutexspeed (stderr) corecheck/tests/pth_once (stdout) corecheck/tests/pth_once (stderr) corecheck/tests/pth_rwlock (stderr) corecheck/tests/res_search (stdout) corecheck/tests/res_search (stderr) corecheck/tests/sigkill (stderr) corecheck/tests/stack_changes (stdout) corecheck/tests/stack_changes (stderr) corecheck/tests/threadederrno (stdout) corecheck/tests/threadederrno (stderr) corecheck/tests/vgprintf (stdout) corecheck/tests/vgprintf (stderr) massif/tests/toobig-allocs (stderr) massif/tests/true_html (stderr) massif/tests/true_text (stderr) lackey/tests/true (stderr) none/tests/args (stdout) none/tests/args (stderr) none/tests/async-sigs (stdout) none/tests/async-sigs (stderr) none/tests/bitfield1 (stderr) none/tests/blockfault (stderr) none/tests/closeall (stderr) none/tests/cmdline1 (stdout) none/tests/cmdline1 (stderr) none/tests/cmdline2 (stdout) none/tests/cmdline2 (stderr) none/tests/cmdline3 (stderr) none/tests/cmdline4 (stderr) none/tests/cmdline5 (stderr) none/tests/cmdline6 (stderr) none/tests/coolo_sigaction (stdout) none/tests/coolo_sigaction (stderr) none/tests/coolo_strlen (stderr) none/tests/discard (stdout) none/tests/discard (stderr) none/tests/exec-sigmask (stderr) none/tests/execve (stderr) none/tests/faultstatus (stderr) none/tests/fcntl_setown (stderr) none/tests/floored (stdout) none/tests/floored (stderr) none/tests/fork (stdout) none/tests/fork (stderr) none/tests/fucomip (stderr) none/tests/gxx304 (stderr) none/tests/manythreads (stdout) none/tests/manythreads (stderr) none/tests/map_unaligned (stderr) none/tests/map_unmap (stdout) none/tests/map_unmap (stderr) none/tests/mq (stderr) none/tests/mremap (stderr) none/tests/munmap_exe (stderr) none/tests/pending (stdout) none/tests/pending (stderr) none/tests/pth_blockedsig (stdout) none/tests/pth_blockedsig (stderr) none/tests/pth_stackalign (stdout) none/tests/pth_stackalign (stderr) none/tests/rcrl (stdout) none/tests/rcrl (stderr) none/tests/readline1 (stdout) none/tests/readline1 (stderr) none/tests/resolv (stdout) none/tests/resolv (stderr) none/tests/rlimit_nofile (stderr) none/tests/sem (stderr) none/tests/semlimit (stderr) none/tests/sha1_test (stderr) none/tests/shortpush (stderr) none/tests/shorts (stderr) none/tests/sigstackgrowth (stdout) none/tests/sigstackgrowth (stderr) none/tests/smc1 (stdout) none/tests/smc1 (stderr) none/tests/stackgrowth (stdout) none/tests/stackgrowth (stderr) none/tests/syscall-restart1 (stderr) none/tests/syscall-restart2 (stderr) none/tests/system (stderr) none/tests/thread-exits (stdout) none/tests/thread-exits (stderr) none/tests/threaded-fork (stdout) none/tests/threaded-fork (stderr) none/tests/x86/badseg (stdout) none/tests/x86/badseg (stderr) none/tests/x86/bt_everything (stdout) none/tests/x86/bt_everything (stderr) none/tests/x86/bt_literal (stdout) none/tests/x86/bt_literal (stderr) none/tests/x86/cpuid (stdout) none/tests/x86/cpuid (stderr) none/tests/x86/fpu_lazy_eflags (stdout) none/tests/x86/fpu_lazy_eflags (stderr) none/tests/x86/getseg (stdout) none/tests/x86/getseg (stderr) none/tests/x86/insn_basic (stdout) none/tests/x86/insn_basic (stderr) none/tests/x86/insn_cmov (stdout) none/tests/x86/insn_cmov (stderr) none/tests/x86/insn_fpu (stdout) none/tests/x86/insn_fpu (stderr) none/tests/x86/insn_mmx (stdout) none/tests/x86/insn_mmx (stderr) none/tests/x86/insn_mmxext (stdout) none/tests/x86/insn_mmxext (stderr) none/tests/x86/insn_sse (stdout) none/tests/x86/insn_sse (stderr) none/tests/x86/int (stderr) none/tests/x86/pushpopseg (stdout) none/tests/x86/pushpopseg (stderr) none/tests/x86/seg_override (stdout) none/tests/x86/seg_override (stderr) none/tests/x86/sigcontext (stdout) none/tests/x86/sigcontext (stderr) none/tests/yield (stdout) none/tests/yield (stderr) |