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-13 18:01:09
|
Author: sewardj
Date: 2005-06-13 18:39:06 +0100 (Mon, 13 Jun 2005)
New Revision: 3909
Log:
Updates to the rest of the debuginfo module to track directory names.
The only interesting part is a change of signature of
VG_(get_filename_linenum) so that callers can optionally request
directory info too.
Modified:
trunk/cachegrind/cg_main.c
trunk/coregrind/m_debuginfo/priv_symtab.h
trunk/coregrind/m_debuginfo/stabs.c
trunk/coregrind/m_debuginfo/symtab.c
trunk/coregrind/m_debuginfo/symtypes.c
trunk/helgrind/hg_main.c
trunk/include/pub_tool_debuginfo.h
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-13 17:33:27 UTC (rev 3908)
+++ trunk/cachegrind/cg_main.c 2005-06-13 17:39:06 UTC (rev 3909)
@@ -165,8 +165,12 @@
static void get_debug_info(Addr instr_addr, Char file[FILE_LEN],
Char fn[FN_LEN], Int* line)
{
- Bool found_file_line =3D VG_(get_filename_linenum)(instr_addr, file,
- FILE_LEN, line);
+ Bool found_file_line =3D VG_(get_filename_linenum)(
+ instr_addr,=20
+ file, FILE_LEN,
+ NULL, 0, NULL,
+ line
+ );
Bool found_fn =3D VG_(get_fnname)(instr_addr, fn, FN_LEN);
=20
if (!found_file_line) {
Modified: trunk/coregrind/m_debuginfo/priv_symtab.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_debuginfo/priv_symtab.h 2005-06-13 17:33:27 UTC (re=
v 3908)
+++ trunk/coregrind/m_debuginfo/priv_symtab.h 2005-06-13 17:39:06 UTC (re=
v 3909)
@@ -69,7 +69,9 @@
UShort size:LOC_SIZE_BITS; /* byte size; we catch overflows of =
this */
UInt lineno:LINENO_BITS; /* source line number, or zero */
/* Word 3 */
- Char* filename; /* source filename */
+ Char* filename; /* source filename */
+ /* Word 4 */
+ Char* dirname; /* source directory name */
}
RiLoc;
=20
@@ -231,7 +233,10 @@
=20
Char *VG_(addStr) ( SegInfo* si, Char* str, Int len );
void VG_(addScopeInfo) ( SegInfo* si, Addr this, Addr next, Scope *scope=
);
-void VG_(addLineInfo) ( SegInfo* si, Char* filename, Addr this, Addr nex=
t, Int lineno, Int entry);
+void VG_(addLineInfo) ( SegInfo* si,=20
+ Char* filename,=20
+ Char* dirname, /* NULL is allowable */
+ Addr this, Addr next, Int lineno, Int entry);
void VG_(addCfiSI) ( SegInfo* si, CfiSI* cfisi );
=20
/* Non-fatal -- use vg_panic if terminal. */
Modified: trunk/coregrind/m_debuginfo/stabs.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/stabs.c 2005-06-13 17:33:27 UTC (rev 3908=
)
+++ trunk/coregrind/m_debuginfo/stabs.c 2005-06-13 17:39:06 UTC (rev 3909=
)
@@ -1414,7 +1414,7 @@
=20
if (line.addr !=3D 0) {
/* finish off previous line */
- VG_(addLineInfo)(si, file.name, line.addr,
+ VG_(addLineInfo)(si, file.name, NULL, line.addr,
addr, line.no + line.ovf * LINENO_OVERFLOW, i);
}
=20
@@ -1446,7 +1446,7 @@
=20
if (line.addr !=3D 0) {
/* there was a previous */
- VG_(addLineInfo)(si, file.name, line.addr,
+ VG_(addLineInfo)(si, file.name, NULL, line.addr,
addr, line.no + line.ovf * LINENO_OVERFLOW, i);
}
=20
@@ -1555,7 +1555,7 @@
}
=20
if (line.addr) {
- VG_(addLineInfo)(si, file.name, line.addr,
+ VG_(addLineInfo)(si, file.name, NULL, line.addr,
addr, line.no + line.ovf * LINENO_OVERFLOW, i);
line.addr =3D 0;
}
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-13 17:33:27 UTC (rev 390=
8)
+++ trunk/coregrind/m_debuginfo/symtab.c 2005-06-13 17:39:06 UTC (rev 390=
9)
@@ -248,11 +248,12 @@
=20
void VG_(addLineInfo) ( SegInfo* si,
Char* filename,
+ Char* dirname, /* NULL =3D=3D directory is unknown */
Addr this,
Addr next,
Int lineno,
Int entry /* only needed for debug printing */
- )
+ )
{
static const Bool debug =3D False;
RiLoc loc;
@@ -262,7 +263,9 @@
if (this =3D=3D next) return;
=20
if (debug)
- VG_(printf)(" src %s line %d %p-%p\n", filename, lineno, this, ne=
xt);
+ VG_(printf)( " src %s %s line %d %p-%p\n",
+ dirname ? dirname : (Char*)"(unknown)",
+ filename, lineno, this, next );
=20
/* Maximum sanity checking. Some versions of GNU as do a shabby
* job with stabs entries; if anything looks suspicious, revert to
@@ -314,6 +317,7 @@
loc.size =3D (UShort)size;
loc.lineno =3D lineno;
loc.filename =3D filename;
+ loc.dirname =3D dirname;
=20
if (0) VG_(message)(Vg_DebugMsg,=20
"addLoc: addr %p, size %d, line %d, file %s",
@@ -2242,21 +2246,43 @@
return True;
}
=20
-/* Map a code address to a (filename, line number) pair. =20
- Returns True if successful.
+/* Map a code address to a filename/line number/dir name info.
+ See prototype for detailed description of behaviour.
*/
-Bool VG_(get_filename_linenum)( Addr a,=20
- Char* filename, Int n_filename,=20
- UInt* lineno )
+Bool VG_(get_filename_linenum) ( Addr a,=20
+ /*OUT*/Char* filename, Int n_filename,
+ /*OUT*/Char* dirname, Int n_dirname,
+ /*OUT*/Bool* dirname_available,
+ /*OUT*/UInt* lineno )
{
SegInfo* si;
Int locno;
+
+ vg_assert( (dirname =3D=3D NULL && dirname_available =3D=3D NULL)
+ ||
+ (dirname !=3D NULL && dirname_available !=3D NULL) );
+
search_all_loctabs ( a, &si, &locno );
if (si =3D=3D NULL)=20
return False;
VG_(strncpy_safely)(filename, si->loctab[locno].filename, n_filename)=
;
*lineno =3D si->loctab[locno].lineno;
=20
+ if (dirname) {
+ /* caller wants directory info too .. */
+ vg_assert(n_dirname > 0);
+ if (si->loctab[locno].dirname) {
+ /* .. and we have some */
+ *dirname_available =3D True;
+ VG_(strncpy_safely)(dirname, si->loctab[locno].dirname,
+ n_dirname);
+ } else {
+ /* .. but we don't have any */
+ *dirname_available =3D False;
+ *dirname =3D 0;
+ }
+ }
+
return True;
}
=20
@@ -2267,7 +2293,7 @@
static Addr regaddr_from_tst(Int regno, ThreadArchState *arch)
{
#if defined(VGA_x86)
-/* This is the Intel register encoding -- integer regs. */
+ /* This is the Intel register encoding -- integer regs. */
# define R_STACK_PTR 4
# define R_FRAME_PTR 5
switch (regno) {
@@ -2282,7 +2308,7 @@
default: return 0;
}
#elif defined(VGA_amd64)
-/* This is the Intel register encoding -- integer regs. */
+ /* This is the AMD64 register encoding -- integer regs. */
# define R_STACK_PTR 7
# define R_FRAME_PTR 6
switch (regno) {
@@ -2358,7 +2384,8 @@
Char file[100];
Int line;
=20
- if (!VG_(get_filename_linenum)(sr->addr, file, sizeof(file), &line=
))
+ if (!VG_(get_filename_linenum)(sr->addr, file, sizeof(file),=20
+ NULL, 0, NULL, &lin=
e))
file[0] =3D 0;
=20
VG_(printf)("found scope range %p: eip=3D%p (%s:%d) size=3D%d scop=
e=3D%p\n",
@@ -2366,7 +2393,9 @@
}
=20
distance =3D 0;
- for(scope =3D si->scopetab[scopeidx].scope; scope !=3D NULL; scope =3D=
scope->outer, distance++) {
+ for (scope =3D si->scopetab[scopeidx].scope;=20
+ scope !=3D NULL;=20
+ scope =3D scope->outer, distance++) {
UInt i;
=20
for(i =3D 0; i < scope->nsyms; i++) {
@@ -2435,6 +2464,10 @@
=20
return list;
}
+
+# undef R_STACK_PTR
+# undef R_FRAME_PTR
+
#endif /* TEST */
=20
/* Print into buf info on code address, function name and filename */
@@ -2477,11 +2510,16 @@
static UChar buf_fn[BUF_LEN];
static UChar buf_obj[BUF_LEN];
static UChar buf_srcloc[BUF_LEN];
+ static UChar buf_dirname[BUF_LEN];
+ Bool know_dirinfo =3D False;
Bool know_fnname =3D VG_(get_fnname) (eip, buf_fn, BUF_LEN);
Bool know_objname =3D VG_(get_objname)(eip, buf_obj, BUF_LEN);
- Bool know_srcloc =3D VG_(get_filename_linenum)(eip, buf_srcloc,
- BUF_LEN, &lineno);
-
+ Bool know_srcloc =3D VG_(get_filename_linenum)(
+ eip,=20
+ buf_srcloc, BUF_LEN,=20
+ buf_dirname, BUF_LEN, &know_dirinfo,
+ &lineno=20
+ );
if (VG_(clo_xml)) {
=20
Bool human_readable =3D True;
@@ -2506,6 +2544,12 @@
APPEND("</fn>");
}
if (know_srcloc) {
+ if (know_dirinfo) {
+ APPEND(maybe_newline);
+ APPEND("<dir>");
+ APPEND(buf_dirname);
+ APPEND("</dir>");
+ }
APPEND(maybe_newline);
APPEND("<file>");
APPEND_ESC(buf_srcloc);
@@ -2552,6 +2596,7 @@
=20
# undef APPEND
# undef APPEND_ESC
+# undef BUF_LEN
}
=20
/* Returns True if OK. If not OK, *{ip,sp,fp}P are not changed. */
Modified: trunk/coregrind/m_debuginfo/symtypes.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/symtypes.c 2005-06-13 17:33:27 UTC (rev 3=
908)
+++ trunk/coregrind/m_debuginfo/symtypes.c 2005-06-13 17:39:06 UTC (rev 3=
909)
@@ -737,7 +737,8 @@
if (debug) {
Char file[100];
Int line;
- if (!VG_(get_filename_linenum)(eip, file, sizeof(file), &line))
+ if (!VG_(get_filename_linenum)(eip, file, sizeof(file),=20
+ NULL, 0, NULL, &line))
file[0] =3D 0;
VG_(printf)("describing address %p for tid=3D%d @ %s:%d\n", addr, =
tid, file, line);
}
@@ -1047,7 +1048,8 @@
if (addr !=3D found->valuep)
bprintf(describe_addr_addbuf, 0, "+%d", addr - found->valuep);
=20
- if (VG_(get_filename_linenum)(eip, file, sizeof(file), &line))
+ if (VG_(get_filename_linenum)(eip, file, sizeof(file),=20
+ NULL, 0, NULL, &line))
bprintf(describe_addr_addbuf, 0, " at %s:%d", file, line, addr);
}
}
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-13 17:33:27 UTC (rev 3908)
+++ trunk/helgrind/hg_main.c 2005-06-13 17:39:06 UTC (rev 3909)
@@ -2730,7 +2730,8 @@
pp_state(extra->lasttouched.state),
unpackTLS(extra->lasttouched.tls)->tid);
=20
- if (VG_(get_filename_linenum)(ip, file, sizeof(file), &line)) {
+ if (VG_(get_filename_linenum)(ip, file, sizeof(file),=20
+ NULL, 0, NULL, &line)) {
VG_(message)(Vg_UserMsg, " at %p: %y (%s:%u)",
ip, ip, file, line);
} else if (VG_(get_objname)(ip, file, sizeof(file))) {
Modified: trunk/include/pub_tool_debuginfo.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/include/pub_tool_debuginfo.h 2005-06-13 17:33:27 UTC (rev 3908)
+++ trunk/include/pub_tool_debuginfo.h 2005-06-13 17:39:06 UTC (rev 3909)
@@ -47,11 +47,23 @@
extern Bool VG_(get_fnname_w_offset)
( Addr a, Char* fnname, Int n_fnname )=
;
=20
-/* This one is more efficient if getting both filename and line number,
- because the two lookups are done together. */
+/* This one is the most general. It gives filename, line number and
+ optionally directory name. filename and linenum may not be NULL.
+ dirname may be NULL, meaning that the caller does not want
+ directory name info, in which case dirname_available must also be
+ NULL. If dirname is non-null, directory info is written to it, if
+ it is available; if not available, '\0' is written to the first
+ byte. In either case *dirname_available is set to indicate whether
+ or not directory information was available.
+
+ Returned value indicates whether any filename/line info could be
+ found. */
extern Bool VG_(get_filename_linenum)
- ( Addr a, Char* filename, Int n_filename,
- UInt* linenum );
+ ( Addr a,=20
+ /*OUT*/Char* filename, Int n_filename,
+ /*OUT*/Char* dirname, Int n_dirname,
+ /*OUT*/Bool* dirname_available,
+ /*OUT*/UInt* linenum );
=20
/* Succeeds only if we find from debug info that 'a' is the address of t=
he
first instruction in a function -- as opposed to VG_(get_fnname) whic=
h
|
|
From: <sv...@va...> - 2005-06-13 17:33:30
|
Author: sewardj
Date: 2005-06-13 18:33:27 +0100 (Mon, 13 Jun 2005)
New Revision: 3908
Log:
Partially merge in a (heavily modified) patch from Eric Estievenart
which adds support for reading directory names from DWARF2 debug info.
Also rework the representation of file and directory tables in the
DWARF2 reader. This removes a longstanding but only-just-discovered
curiousity that the previous code expanded the filename table one
entry at a time, so that reading file names from a DWARF2 object was
quadratic in the number of file names. It's now N log N.
Modified:
trunk/coregrind/m_debuginfo/dwarf.c
Modified: trunk/coregrind/m_debuginfo/dwarf.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/dwarf.c 2005-06-13 16:50:29 UTC (rev 3907=
)
+++ trunk/coregrind/m_debuginfo/dwarf.c 2005-06-13 17:33:27 UTC (rev 3908=
)
@@ -36,6 +36,81 @@
#include "pub_core_options.h"
#include "priv_symtab.h"
=20
+
+/*------------------------------------------------------------*/
+/*--- Expanding arrays of words, for holding file name and ---*/
+/*--- directory name arrays. ---*/
+/*------------------------------------------------------------*/
+
+typedef
+ struct {
+ Word* tab;
+ UInt tab_size;
+ UInt tab_used;
+ }
+ WordArray;
+
+static void init_WordArray ( WordArray* wa )
+{
+ wa->tab =3D NULL;
+ wa->tab_size =3D 0;
+ wa->tab_used =3D 0;
+}
+
+static void free_WordArray ( WordArray* wa )
+{
+ if (wa->tab) {
+ vg_assert(wa->tab_size > 0);
+ VG_(arena_free)(VG_AR_SYMTAB, wa->tab);
+ }
+ init_WordArray(wa);
+}
+
+static void addto_WordArray ( WordArray* wa, Word w )
+{
+ UInt new_size, i;
+ Word* new_tab;
+
+ if (0) VG_(printf)("<<ADD %p (new sz =3D %d) >>\n",=20
+ (HChar*)w, wa->tab_used+1);
+
+ if (wa->tab_used < wa->tab_size) {
+ /* fine */
+ } else {
+ /* expand array */
+ if (0) VG_(printf)("EXPAND ARRAY from %d\n", wa->tab_size);
+ vg_assert(wa->tab_used =3D=3D wa->tab_size);
+ vg_assert( (wa->tab_size =3D=3D 0 && wa->tab =3D=3D NULL)
+ || (wa->tab_size !=3D 0 && wa->tab !=3D NULL) );
+ new_size =3D wa->tab_size =3D=3D 0 ? 8 : 2 * wa->tab_size;
+ new_tab =3D VG_(arena_malloc)(VG_AR_SYMTAB,=20
+ new_size * sizeof(Word));
+ vg_assert(new_tab !=3D NULL);
+ for (i =3D 0; i < wa->tab_used; i++)
+ new_tab[i] =3D wa->tab[i];
+ wa->tab_size =3D new_size;
+ if (wa->tab)
+ VG_(arena_free)(VG_AR_SYMTAB, wa->tab);
+ wa->tab =3D new_tab;
+ }
+
+ vg_assert(wa->tab_used < wa->tab_size);
+ vg_assert(wa->tab_size > 0);
+ wa->tab[wa->tab_used] =3D w;
+ wa->tab_used++;
+}
+
+static Word index_WordArray ( WordArray* wa, Int i )
+{
+ vg_assert(i >=3D 0 && i < wa->tab_used);
+ return wa->tab[i];
+}
+
+
+/*------------------------------------------------------------*/
+/*--- Read DWARF2 format line number info. ---*/
+/*------------------------------------------------------------*/
+
/* Structure found in the .debug_line section. */
typedef struct
{
@@ -105,9 +180,6 @@
Int is_stmt;
Int basic_block;
Int end_sequence;
- /* This variable hold the number of the last entry seen
- in the File Table. */
- UInt last_file_entry;
} SMR;
=20
=20
@@ -157,13 +229,27 @@
state_machine_regs.is_stmt =3D is_stmt;
state_machine_regs.basic_block =3D 0;
state_machine_regs.end_sequence =3D 0;
- state_machine_regs.last_file_entry =3D 0;
}
=20
+/* Look up a directory name, or return NULL if unknown. */
+static
+Char* lookupDir ( Int filename_index,
+ WordArray* fnidx2dir,
+ WordArray* dirnames )
+{
+ Word diridx =3D index_WordArray( fnidx2dir, filename_index );
+ Word dirname =3D index_WordArray( dirnames, (Int)diridx );
+ return (Char*)dirname;
+}
+
+
/* Handled an extend line op. Returns true if this is the end
of sequence. */
static=20
-int process_extended_line_op( SegInfo *si, Char*** fnames,=20
+int process_extended_line_op( SegInfo *si,=20
+ WordArray* filenames,=20
+ WordArray* dirnames,=20
+ WordArray* fnidx2dir,=20
UChar* data, Int is_stmt)
{
UChar op_code;
@@ -197,10 +283,15 @@
*/
if (state_machine_regs.is_stmt) {
if (state_machine_regs.last_address)
- VG_(addLineInfo) (si, (*fnames)[state_machine_regs.last_file],=20
- si->offset + state_machine_regs.last_address,=20
- si->offset + state_machine_regs.address,=20
- state_machine_regs.last_line, 0);
+ VG_(addLineInfo) (
+ si,=20
+ (Char*)index_WordArray(filenames, state_machine_regs.last=
_file),=20
+ lookupDir( state_machine_regs.last_file,
+ fnidx2dir, dirnames ),
+ si->offset + state_machine_regs.last_address,=20
+ si->offset + state_machine_regs.address,=20
+ state_machine_regs.last_line, 0
+ );
}
reset_state_machine (is_stmt);
break;
@@ -212,15 +303,8 @@
break;
=20
case DW_LNE_define_file:
- ++ state_machine_regs.last_file_entry;
name =3D data;
- if (*fnames =3D=3D NULL)
- *fnames =3D VG_(arena_malloc)(VG_AR_SYMTAB, sizeof (Char *) * 2)=
;
- else
- *fnames =3D VG_(arena_realloc)(
- VG_AR_SYMTAB, *fnames,
- sizeof(Char *) * (state_machine_regs.last_file_entr=
y + 1));
- (*fnames)[state_machine_regs.last_file_entry] =3D VG_(addStr) (si,=
name, -1);
+ addto_WordArray( filenames, (Word)VG_(addStr)(si,name,-1) );
data +=3D VG_(strlen) ((char *) data) + 1;
read_leb128 (data, & bytes_read, 0);
data +=3D bytes_read;
@@ -239,37 +323,78 @@
=20
void VG_(read_debuginfo_dwarf2) ( SegInfo* si, UChar* dwarf2, Int dwarf2=
_sz )
{
- DWARF2_External_LineInfo * external;
- DWARF2_Internal_LineInfo info;
- UChar * standard_opcodes;
- UChar * data =3D dwarf2;
- UChar * end =3D dwarf2 + dwarf2_sz;
- UChar * end_of_sequence;
- Char ** fnames =3D NULL;
+ DWARF2_External_LineInfo* external;
+ DWARF2_Internal_LineInfo info;
+ UChar* standard_opcodes;
+ UChar* data =3D dwarf2;
+ UChar* end =3D dwarf2 + dwarf2_sz;
+ UChar* end_of_sequence;
+ WordArray filenames;
+ WordArray dirnames;
+ WordArray fnidx2dir;
=20
+ /* filenames is an array of file names harvested from the DWARF2 info.=
=20
+ Entry [0] is NULL and is never referred to by the state machine.
+
+ Similarly, dirnames is an array of directory names. Entry [0] is
+ also NULL and denotes "we don't know what the path is", since
+ that is different from "the path is the empty string". Unlike
+ the file name table, the state machine does refer to entry [0],
+ which basically means "." ("the current directory of the
+ compilation", whatever that means, according to the DWARF3 spec.)
+
+ fnidx2dir is an array of indexes into the dirnames table.
+ (confused yet?) filenames[] and fnidx2dir[] are indexed together.
+ That is, for some index i in the filename table, then
+
+ the filename is filenames[i]
+ the diretory is dirnames[ fnidx2dir[i] ] */
+
/* Fails due to gcc padding ...
vg_assert(sizeof(DWARF2_External_LineInfo)
=3D=3D sizeof(DWARF2_Internal_LineInfo));
*/
=20
- while (data < end)
- {
+ init_WordArray(&filenames);
+ init_WordArray(&dirnames);
+ init_WordArray(&fnidx2dir);
+
+ while (data < end) {
+
+ /* Dump the file/dirname tables and start over. */
+ free_WordArray(&filenames);
+ free_WordArray(&dirnames);
+ free_WordArray(&fnidx2dir);
+
+ init_WordArray(&filenames);
+ init_WordArray(&dirnames);
+ init_WordArray(&fnidx2dir);
+
+ /* DWARF2 starts numbering filename entries at 1, so we need to
+ add a dummy zeroth entry to the table. The zeroth dirnames
+ entry denotes 'current directory of compilation' so we might
+ as well make the fnidx2dir zeroth entry denote that.=20
+ */
+ addto_WordArray( &filenames, (Word)NULL );
+ addto_WordArray( &dirnames, (Word)VG_(addStr)(si,".",-1) );
+ addto_WordArray( &fnidx2dir, (Word)0 ); /* "." */
+
external =3D (DWARF2_External_LineInfo *) data;
=20
/* Check the length of the block. */
info.li_length =3D * ((UInt *)(external->li_length));
=20
- if (info.li_length =3D=3D 0xffffffff)
+ if (info.li_length =3D=3D 0xffffffff)=20
{
VG_(symerr)("64-bit DWARF line info is not supported yet.");
- break;
+ goto out;
}
=20
if (info.li_length + sizeof (external->li_length) > dwarf2_sz)
{
VG_(symerr)("DWARF line info appears to be corrupt "
"- the section is too small");
- return;
+ goto out;
}
=20
/* Check its version number. */
@@ -278,7 +403,7 @@
{
VG_(symerr)("Only DWARF version 2 line info "
"is currently supported.");
- return;
+ goto out;
}
=20
info.li_prologue_length =3D * ((UInt *) (external->li_prologue_len=
gth));
@@ -313,7 +438,7 @@
info.li_opcode_base =3D * ((UChar *)(external->li_opcode_base)=
);=20
=20
if (0) VG_(printf)("dwarf2: line base: %d, range %d, opc base: %d\=
n",
- info.li_line_base, info.li_line_range, info.li_opcode_base);
+ info.li_line_base, info.li_line_range, info.li_opcode_=
base);
=20
/* Sign extend the line base field. */
info.li_line_base <<=3D 24;
@@ -330,64 +455,39 @@
/* Read the contents of the Directory table. */
data =3D standard_opcodes + info.li_opcode_base - 1;
=20
- if (* data =3D=3D 0)=20
- {
- }
- else
- {
- /* We ignore the directory table, since gcc gives the entire
- path as part of the filename */
- while (* data !=3D 0)
- {
- data +=3D VG_(strlen) ((char *) data) + 1;
- }
- }
-
- /* Skip the NUL at the end of the table. */
+ while (* data !=3D 0) {
+ addto_WordArray( &dirnames, (Word)VG_(addStr)(si,data,-1) );
+ data +=3D VG_(strlen) ((char *) data) + 1;
+ }
if (*data !=3D 0) {
VG_(symerr)("can't find NUL at end of DWARF2 directory table");
- return;
+ goto out;
}
data ++;
=20
- /* Read the contents of the File Name table. */
- if (* data =3D=3D 0)
- {
- }
- else
- {
- while (* data !=3D 0)
- {
- UChar * name;
- Int bytes_read;
+ /* Read the contents of the File Name table. This produces a
+ bunch of file names, and for each, an index to the
+ corresponding direcory name entry. */
+ while (* data !=3D 0) {
+ UChar* name;
+ Int bytes_read, diridx;
+ name =3D data;
+ data +=3D VG_(strlen) ((Char *) data) + 1;
=20
- ++ state_machine_regs.last_file_entry;
- name =3D data;
- /* Since we don't have realloc (0, ....) =3D=3D malloc (...=
)
- semantics, we need to malloc the first time. */
+ diridx =3D read_leb128 (data, & bytes_read, 0);
+ data +=3D bytes_read;
+ read_leb128 (data, & bytes_read, 0);
+ data +=3D bytes_read;
+ read_leb128 (data, & bytes_read, 0);
+ data +=3D bytes_read;
=20
- if (fnames =3D=3D NULL)
- fnames =3D VG_(arena_malloc)(VG_AR_SYMTAB, sizeof (Char *=
) * 2);
- else
- fnames =3D VG_(arena_realloc)(VG_AR_SYMTAB, fnames,
- sizeof(Char *)=20
- * (state_machine_regs.last_file_entry + 1)=
);
- data +=3D VG_(strlen) ((Char *) data) + 1;
- fnames[state_machine_regs.last_file_entry] =3D VG_(addStr) =
(si,name, -1);
-
- read_leb128 (data, & bytes_read, 0);
- data +=3D bytes_read;
- read_leb128 (data, & bytes_read, 0);
- data +=3D bytes_read;
- read_leb128 (data, & bytes_read, 0);
- data +=3D bytes_read;
- }
- }
-
- /* Skip the NUL at the end of the table. */
+ addto_WordArray( &filenames, (Word)VG_(addStr)(si,name,-1) );
+ addto_WordArray( &fnidx2dir, (Word)diridx );
+ if (0) VG_(printf)("file %s diridx %d\n", name, diridx );
+ }
if (*data !=3D 0) {
VG_(symerr)("can't find NUL at end of DWARF2 file name table");
- return;
+ goto out;
}
data ++;
=20
@@ -401,7 +501,7 @@
=20
op_code =3D * data ++;
=20
- if (0) VG_(printf)("dwarf2: OPC: %d\n", op_code);
+ if (0) VG_(printf)("dwarf2: OPC: %d\n", op_code);
=20
if (op_code >=3D info.li_opcode_base)
{
@@ -420,10 +520,17 @@
if (state_machine_regs.is_stmt) {
/* only add a statement if there was a previous boundary */
if (state_machine_regs.last_address)=20
- VG_(addLineInfo) (si, fnames[state_machine_regs.last_file],=20
- si->offset + state_machine_regs.last_address,=20
- si->offset + state_machine_regs.address,=20
- state_machine_regs.last_line, 0);
+ VG_(addLineInfo)(
+ si,=20
+ (Char*)index_WordArray( &filenames,
+ state_machine_regs.last_=
file ),
+ lookupDir( state_machine_regs.last_file,
+ &fnidx2dir, &dirnames ),
+ si->offset + state_machine_regs.last_address,=20
+ si->offset + state_machine_regs.address,=20
+ state_machine_regs.last_line,=20
+ 0
+ );
state_machine_regs.last_address =3D state_machine_regs.address;
state_machine_regs.last_file =3D state_machine_regs.file;
state_machine_regs.last_line =3D state_machine_regs.line;
@@ -433,8 +540,8 @@
{
case DW_LNS_extended_op:
data +=3D process_extended_line_op (
- si, &fnames, data,=20
- info.li_default_is_stmt);
+ si, &filenames, &dirnames, &fnidx2dir,
+ data, info.li_default_is_stmt);
break;
=20
case DW_LNS_copy:
@@ -443,10 +550,17 @@
if (state_machine_regs.is_stmt) {
/* only add a statement if there was a previous boundary */
if (state_machine_regs.last_address)=20
- VG_(addLineInfo) (si, fnames[state_machine_regs.last_file],=20
- si->offset + state_machine_regs.last_address,=20
- si->offset + state_machine_regs.address,
- state_machine_regs.last_line, 0);
+ VG_(addLineInfo)(
+ si,=20
+ (Char*)index_WordArray( &filenames,
+ state_machine_regs.last_=
file ),
+ lookupDir( state_machine_regs.last_file,
+ &fnidx2dir, &dirnames ),
+ si->offset + state_machine_regs.last_address,=20
+ si->offset + state_machine_regs.address,
+ state_machine_regs.last_line,=20
+ 0
+ );
state_machine_regs.last_address =3D state_machine_regs.address;
state_machine_regs.last_file =3D state_machine_regs.file;
state_machine_regs.last_line =3D state_machine_regs.line;
@@ -527,10 +641,14 @@
}
break;
}
- }
- VG_(arena_free)(VG_AR_SYMTAB, fnames);
- fnames =3D NULL;
- }
+ } /* while (data < end_of_sequence) */
+
+ } /* while (data < end) */
+
+ out:
+ free_WordArray(&filenames);
+ free_WordArray(&dirnames);
+ free_WordArray(&fnidx2dir);
}
=20
=20
@@ -813,7 +931,7 @@
if (delta > 0 && prev_line > 0) {
if (0) VG_(printf) (" %d %d-%d\n",
prev_line, prev_delta, delta-1);
- VG_(addLineInfo) ( si, curr_filenm,=20
+ VG_(addLineInfo) ( si, curr_filenm, NULL,
base + prev_delta, base + delta,
prev_line, 0 );
}
|
|
From: Ashley P. <as...@qu...> - 2005-06-13 17:31:31
|
On Sat, 2005-05-28 at 13:17 -0700, Jeremy Fitzhardinge wrote:
> Ashley Pittman wrote:
>
> >It's somewhat complicated...
> >
> >
> Er, yep.
>
> >the parent thread calls elan3_detach (an ioctl) and the device driver
> >sets some state and wakes up the kernel thread sitting in the lwp ioctl.
> >This thread then returns done and the lwp exits. Other than that the
> >lwp only returns to user-space to take signals.
> >
> >
> So what makes it return done? What triggers that event?
Either the elan3_detach ioctl or the close of the fd at program exit
causes a bit to be set and the extra thread then wakes up, notices the
bit, returns to user-space where the thread exits. The code in question
looks like this:
if (--ctxt->LwpCount != 0) /* Still other LWPs running */
{
spin_unlock_irqrestore (&dev->IntrLock, flags);
return;
}
kcondvar_wakeupall (&ctxt->LwpWait, &dev->IntrLock); /* Wakeup anyone waiting on LwpCount */
I'm not really a kernel programmer though, I can go over it again or
forward this onto someone with a better understanding of this if you
need better understanding of this.
I'd be surprised if many programs actually call elan3_detach() though,
there are no hooks from MPI_Finilize through so it probably never gets
called.
> >That's the theory anyway, it's complicated by the fact that we have
> >kernel patches (not just modules) to provide "ptrack" functionality,
> >basically the job starts in a container and when the job finishes all
> >processes (and sys-v stuff) created in that container also get
> >destroyed.
> >
> >
> Is this some extra kernel state which Valgrind needs to understand to do
> a correct emulation?
Possibly but hopefully not.
> How are these containers created? In this case,
> would the program running under valgrind create a new container which is
> expected to mop up all the threads when the main thread exits? How is a
> "job" defined?
These containers are created by the rms kernel modules (the kernel
module is open-source, RMS the application is not. There is open-source
software which uses the kernel module) Typically to run a "job" over
say four cpus you would type "prun -n4 mping" which would start four
programs each of which would be expected to call elan_init(). Each
program in this job would have a "vp" or virtual process number from 0
to N-1 (In MPI terms this is called "rank"). Each of these four
processes is kept inside it's own container and the rms kernel module
keeps track of any child processes and/or sys-v objects made and ensures
that they are all torn down properly at program exit.
There is another way of running programs outside of this mechanism
though, it's kind of messy and we don't recommend using it for anything
other than fine-grained bug-hunting but it does work so I suspect the
above may be a red herring.
> In the 2.6 NPTL thread model, exit_group() terminates all threads in the
> thread group atomically, so there's no waiting around for things to
> terminate (or dependence on termination order). Is this running in a
> 2.4 thread model, or a 2.6 one? It sounds like the container machinery
> has an atomic group termination property similar to exit_group().
It does sound similar, it works across child programs though, not just
thread groups. Probably not relevant to this bug however.
Going back to the original questions, the thread should be implicitly be
woken and then die when the parent thread terminates, hence the deadlock
if the parent thread isn't exiting. How does V work WTR any other
blocking syscall being in progress at program exit?
Ashley,
|
|
From: <sv...@va...> - 2005-06-13 16:50:31
|
Author: sewardj Date: 2005-06-13 17:50:29 +0100 (Mon, 13 Jun 2005) New Revision: 3907 Log: Updated date :-) Modified: trunk/docs/xml/vg-entities.xml Modified: trunk/docs/xml/vg-entities.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/docs/xml/vg-entities.xml 2005-06-13 16:48:32 UTC (rev 3906) +++ trunk/docs/xml/vg-entities.xml 2005-06-13 16:50:29 UTC (rev 3907) @@ -7,6 +7,6 @@ =20 <!-- valgrind release + version stuff --> <!ENTITY rel-type "Development release"> -<!ENTITY rel-version "2.1.2"> -<!ENTITY rel-date "July 18 2004"> +<!ENTITY rel-version "3.0.0"> +<!ENTITY rel-date "June 01 2005"> =20 |
|
From: <sv...@va...> - 2005-06-13 16:48:35
|
Author: sewardj
Date: 2005-06-13 17:48:32 +0100 (Mon, 13 Jun 2005)
New Revision: 3906
Log:
Emit XML preamble in a more parseable way.
Modified:
trunk/coregrind/m_main.c
Modified: trunk/coregrind/m_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_main.c 2005-06-13 16:44:33 UTC (rev 3905)
+++ trunk/coregrind/m_main.c 2005-06-13 16:48:32 UTC (rev 3906)
@@ -1905,7 +1905,6 @@
results of a run which encompasses multiple processes. */
=20
if (VG_(clo_xml)) {
- VG_(message)(Vg_UserMsg, "");
VG_(message)(Vg_UserMsg, "<?xml version=3D\"1.0\"?>");
VG_(message)(Vg_UserMsg, "");
VG_(message)(Vg_UserMsg, "<valgrindoutput>");
@@ -1914,10 +1913,14 @@
VG_(message)(Vg_UserMsg, "");
}
=20
- HChar* xpre =3D VG_(clo_xml) ? "<preamble>" : "";
- HChar* xpost =3D VG_(clo_xml) ? "</preamble>" : "";
+ HChar* xpre =3D VG_(clo_xml) ? " <line>" : "";
+ HChar* xpost =3D VG_(clo_xml) ? "</line>" : "";
=20
if (VG_(clo_verbosity > 0)) {
+
+ if (VG_(clo_xml))
+ VG_(message)(Vg_UserMsg, "<preamble>");
+
/* Tool details */
VG_(message)(Vg_UserMsg, "%s%s%s%s, %s.%s",
xpre,
@@ -1943,6 +1946,9 @@
VG_(message)(Vg_UserMsg,=20
"%sCopyright (C) 2000-2005, and GNU GPL'd, by Julian Seward et =
al.%s",
xpre, xpost );
+
+ if (VG_(clo_xml))
+ VG_(message)(Vg_UserMsg, "</preamble>");
}
=20
if (VG_(clo_verbosity) > 0 && log_to !=3D VgLogTo_Fd) {
|
|
From: <sv...@va...> - 2005-06-13 16:44:35
|
Author: sewardj
Date: 2005-06-13 17:44:33 +0100 (Mon, 13 Jun 2005)
New Revision: 3905
Log:
Update with recent (minor) changes.
Modified:
trunk/README_XML_OUTPUT.txt
Modified: trunk/README_XML_OUTPUT.txt
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/README_XML_OUTPUT.txt 2005-06-13 08:46:57 UTC (rev 3904)
+++ trunk/README_XML_OUTPUT.txt 2005-06-13 16:44:33 UTC (rev 3905)
@@ -24,7 +24,9 @@
* Put as much information as possible into the XML and let the GUIs
decide what to show the user (a.k.a provide mechanism, not policy).
=20
+* Make XML which is actually parseable by standard XML tools.
=20
+
How to use
~~~~~~~~~~
=20
@@ -76,11 +78,23 @@
TEXT is arbitrary text.
HEX64 is a 64-bit hexadecimal number, with leading "0x".
=20
+Text strings are escaped so as to remove the <, > and & characters
+which would otherwise mess up parsing. They are replaced respectively
+with the standard encodings "<", ">" and "&" respectively.
+Note this is not (yet) done throughout, only for function names in
+<frame>..</frame> tags-pairs.
=20
+
TOPLEVEL
--------
-All output is contained within the tag-pair <valgrindoutput>.
=20
+The first line output is always this:
+
+ <?xml version=3D"1.0"?>
+
+All remaining output is contained within the tag-pair
+<valgrindoutput>.
+
Inside that, the first entity is an indication of the protocol
version. This is provided so that existing parsers can identify XML
created by future versions of Valgrind merely by observing that the
@@ -107,7 +121,9 @@
components. The text in them can be anything; it is not intended
for interpretation by the GUI:
=20
- <preamble>Misc version/copyright text</preamble>
+ <preamble>
+ <line>Misc version/copyright text</line> (zero or more of)
+ </preamble>
=20
* The PID of this process and of its parent:
=20
@@ -284,6 +300,7 @@
<ip>HEX64</ip>
optionally <obj>TEXT</obj>
optionally <fn>TEXT</fn>
+ optionally <dir>TEXT</dir>
optionally <file>TEXT</file>
optionally <line>INT</line>
</frame>
@@ -297,6 +314,10 @@
=20
* fn: gives the name of the function containing the code address
=20
+* dir: gives the source directory associated with the name specified
+ by <file>. Note the current implementation often does not
+ put anything useful in this field.
+
* file: gives the name of the source file containing the code address
=20
* line: gives the line number in the source file
@@ -335,3 +356,4 @@
=20
The <name> is as specified in the suppression name fields in .supp
files.
+
|
|
From: <sv...@va...> - 2005-06-13 16:30:38
|
Author: sewardj
Date: 2005-06-13 17:30:18 +0100 (Mon, 13 Jun 2005)
New Revision: 1208
Log:
Make iropt not complain about missing folding rules at the default
verbosity setting (zero).
Modified:
trunk/priv/ir/iropt.c
Modified: trunk/priv/ir/iropt.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/ir/iropt.c 2005-06-13 12:33:36 UTC (rev 1207)
+++ trunk/priv/ir/iropt.c 2005-06-13 16:30:18 UTC (rev 1208)
@@ -1417,9 +1417,11 @@
ppIRExpr(e);
vpanic("fold_Expr: no rule for the above");
# else
- vex_printf("vex iropt: fold_Expr: no rule for: ");
- ppIRExpr(e);
- vex_printf("\n");
+ if (vex_control.iropt_verbosity > 0) {
+ vex_printf("vex iropt: fold_Expr: no rule for: ");
+ ppIRExpr(e);
+ vex_printf("\n");
+ }
return e2;
# endif
}
|
|
From: <sv...@va...> - 2005-06-13 12:33:45
|
Author: sewardj
Date: 2005-06-13 13:33:36 +0100 (Mon, 13 Jun 2005)
New Revision: 1207
Log:
The guest-state effect declaration for x86 'fldenv' has been wrong for
a long time -- it says fldenv writes the FP regs, which isn't true.
Modified:
trunk/priv/guest-x86/toIR.c
Modified: trunk/priv/guest-x86/toIR.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/guest-x86/toIR.c 2005-06-13 12:17:27 UTC (rev 1206)
+++ trunk/priv/guest-x86/toIR.c 2005-06-13 12:33:36 UTC (rev 1207)
@@ -3749,28 +3749,24 @@
d->mSize =3D 28;
=20
/* declare we're writing guest state */
- d->nFxState =3D 5;
+ d->nFxState =3D 4;
=20
d->fxState[0].fx =3D Ifx_Write;
d->fxState[0].offset =3D OFFB_FTOP;
d->fxState[0].size =3D sizeof(UInt);
=20
d->fxState[1].fx =3D Ifx_Write;
- d->fxState[1].offset =3D OFFB_FPREGS;
- d->fxState[1].size =3D 8 * sizeof(ULong);
+ d->fxState[1].offset =3D OFFB_FPTAGS;
+ d->fxState[1].size =3D 8 * sizeof(UChar);
=20
d->fxState[2].fx =3D Ifx_Write;
- d->fxState[2].offset =3D OFFB_FPTAGS;
- d->fxState[2].size =3D 8 * sizeof(UChar);
+ d->fxState[2].offset =3D OFFB_FPROUND;
+ d->fxState[2].size =3D sizeof(UInt);
=20
d->fxState[3].fx =3D Ifx_Write;
- d->fxState[3].offset =3D OFFB_FPROUND;
+ d->fxState[3].offset =3D OFFB_FC3210;
d->fxState[3].size =3D sizeof(UInt);
=20
- d->fxState[4].fx =3D Ifx_Write;
- d->fxState[4].offset =3D OFFB_FC3210;
- d->fxState[4].size =3D sizeof(UInt);
-
stmt( IRStmt_Dirty(d) );
=20
/* ew contains any emulation warning we may need to
|
|
From: <sv...@va...> - 2005-06-13 12:17:35
|
Author: sewardj
Date: 2005-06-13 13:17:27 +0100 (Mon, 13 Jun 2005)
New Revision: 1206
Log:
Implement fldenv/fstenv on amd64.
Modified:
trunk/priv/guest-amd64/gdefs.h
trunk/priv/guest-amd64/ghelpers.c
trunk/priv/guest-amd64/toIR.c
trunk/priv/guest-generic/g_generic_x87.h
trunk/priv/guest-x86/ghelpers.c
trunk/priv/guest-x86/toIR.c
Modified: trunk/priv/guest-amd64/gdefs.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/priv/guest-amd64/gdefs.h 2005-06-10 11:04:52 UTC (rev 1205)
+++ trunk/priv/guest-amd64/gdefs.h 2005-06-13 12:17:27 UTC (rev 1206)
@@ -105,6 +105,10 @@
=20
extern ULong amd64g_create_mxcsr ( ULong sseround );
=20
+extern VexEmWarn amd64g_dirtyhelper_FLDENV ( VexGuestAMD64State*, HWord =
);
+
+extern void amd64g_dirtyhelper_FSTENV ( VexGuestAMD64State*, HWord );
+
/* Translate a guest virtual_addr into a guest linear address by
consulting the supplied LDT/GDT structures. Their representation
must be as specified in pub/libvex_guest_amd64.h. To indicate a
Modified: trunk/priv/guest-amd64/ghelpers.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/guest-amd64/ghelpers.c 2005-06-10 11:04:52 UTC (rev 1205)
+++ trunk/priv/guest-amd64/ghelpers.c 2005-06-13 12:17:27 UTC (rev 1206)
@@ -1308,6 +1308,98 @@
}
=20
=20
+/* This is used to implement 'fldenv'. =20
+ Reads 28 bytes at x87_state[0 .. 27]. */
+/* CALLED FROM GENERATED CODE */
+/* DIRTY HELPER */
+VexEmWarn amd64g_dirtyhelper_FLDENV ( /*OUT*/VexGuestAMD64State* vex_sta=
te,
+ /*IN*/HWord x87_state)
+{
+ Int stno, preg;
+ UInt tag;
+ UChar* vexTags =3D (UChar*)(&vex_state->guest_FPTAG[0]);
+ Fpu_State* x87 =3D (Fpu_State*)x87_state;
+ UInt ftop =3D (x87->env[FP_ENV_STAT] >> 11) & 7;
+ UInt tagw =3D x87->env[FP_ENV_TAG];
+ UInt fpucw =3D x87->env[FP_ENV_CTRL];
+ ULong c3210 =3D x87->env[FP_ENV_STAT] & 0x4700;
+ VexEmWarn ew;
+ ULong fpround;
+ ULong pair;
+
+ /* Copy tags */
+ for (stno =3D 0; stno < 8; stno++) {
+ preg =3D (stno + ftop) & 7;
+ tag =3D (tagw >> (2*preg)) & 3;
+ if (tag =3D=3D 3) {
+ /* register is empty */
+ vexTags[preg] =3D 0;
+ } else {
+ /* register is non-empty */
+ vexTags[preg] =3D 1;
+ }
+ }
+
+ /* stack pointer */
+ vex_state->guest_FTOP =3D ftop;
+
+ /* status word */
+ vex_state->guest_FC3210 =3D c3210;
+
+ /* handle the control word, setting FPROUND and detecting any
+ emulation warnings. */
+ pair =3D amd64g_check_fldcw ( (ULong)fpucw );
+ fpround =3D pair & 0xFFFFFFFFULL;
+ ew =3D (VexEmWarn)(pair >> 32);
+ =20
+ vex_state->guest_FPROUND =3D fpround & 3;
+
+ /* emulation warnings --> caller */
+ return ew;
+}
+
+
+/* CALLED FROM GENERATED CODE */
+/* DIRTY HELPER */
+/* Create an x87 FPU env from the guest state, as close as we can
+ approximate it. Writes 28 bytes at x87_state[0..27]. */
+void amd64g_dirtyhelper_FSTENV ( /*IN*/VexGuestAMD64State* vex_state,
+ /*OUT*/HWord x87_state )
+{
+ Int i, stno, preg;
+ UInt tagw;
+ UChar* vexTags =3D (UChar*)(&vex_state->guest_FPTAG[0]);
+ Fpu_State* x87 =3D (Fpu_State*)x87_state;
+ UInt ftop =3D vex_state->guest_FTOP;
+ ULong c3210 =3D vex_state->guest_FC3210;
+
+ for (i =3D 0; i < 14; i++)
+ x87->env[i] =3D 0;
+
+ x87->env[1] =3D x87->env[3] =3D x87->env[5] =3D x87->env[13] =3D 0xFF=
FF;
+ x87->env[FP_ENV_STAT]=20
+ =3D toUShort(((ftop & 7) << 11) | (c3210 & 0x4700));
+ x87->env[FP_ENV_CTRL]=20
+ =3D toUShort(amd64g_create_fpucw( vex_state->guest_FPROUND ));
+
+ /* Compute the x87 tag word. */
+ tagw =3D 0;
+ for (stno =3D 0; stno < 8; stno++) {
+ preg =3D (stno + ftop) & 7;
+ if (vexTags[preg] =3D=3D 0) {
+ /* register is empty */
+ tagw |=3D (3 << (2*preg));
+ } else {
+ /* register is full. */
+ tagw |=3D (0 << (2*preg));
+ }
+ }
+ x87->env[FP_ENV_TAG] =3D toUShort(tagw);
+
+ /* We don't dump the x87 registers, tho. */
+}
+
+
/*---------------------------------------------------------------*/
/*--- Misc integer helpers, including rotates and CPUID. ---*/
/*---------------------------------------------------------------*/
Modified: trunk/priv/guest-amd64/toIR.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/guest-amd64/toIR.c 2005-06-10 11:04:52 UTC (rev 1205)
+++ trunk/priv/guest-amd64/toIR.c 2005-06-13 12:17:27 UTC (rev 1206)
@@ -4596,65 +4596,63 @@
fp_pop();
break;
=20
-//.. case 4: { /* FLDENV m108 */
-//.. /* Uses dirty helper:=20
-//.. VexEmWarn x86g_do_FLDENV ( VexGuestX86State*, =
Addr32 ) */
-//.. IRTemp ew =3D newTemp(Ity_I32);
-//.. IRDirty* d =3D unsafeIRDirty_0_N (=20
-//.. 0/*regparms*/,=20
-//.. "x86g_dirtyhelper_FLDENV",=20
-//.. &x86g_dirtyhelper_FLDENV,
-//.. mkIRExprVec_1( mkexpr(addr) )
-//.. );
-//.. d->needsBBP =3D True;
-//.. d->tmp =3D ew;
-//.. /* declare we're reading memory */
-//.. d->mFx =3D Ifx_Read;
-//.. d->mAddr =3D mkexpr(addr);
-//.. d->mSize =3D 28;
-//..=20
-//.. /* declare we're writing guest state */
-//.. d->nFxState =3D 5;
-//..=20
-//.. d->fxState[0].fx =3D Ifx_Write;
-//.. d->fxState[0].offset =3D OFFB_FTOP;
-//.. d->fxState[0].size =3D sizeof(UInt);
-//..=20
-//.. d->fxState[1].fx =3D Ifx_Write;
-//.. d->fxState[1].offset =3D OFFB_FPREGS;
-//.. d->fxState[1].size =3D 8 * sizeof(ULong);
-//..=20
-//.. d->fxState[2].fx =3D Ifx_Write;
-//.. d->fxState[2].offset =3D OFFB_FPTAGS;
-//.. d->fxState[2].size =3D 8 * sizeof(UChar);
-//..=20
-//.. d->fxState[3].fx =3D Ifx_Write;
-//.. d->fxState[3].offset =3D OFFB_FPROUND;
-//.. d->fxState[3].size =3D sizeof(UInt);
-//..=20
-//.. d->fxState[4].fx =3D Ifx_Write;
-//.. d->fxState[4].offset =3D OFFB_FC3210;
-//.. d->fxState[4].size =3D sizeof(UInt);
-//..=20
-//.. stmt( IRStmt_Dirty(d) );
-//..=20
-//.. /* ew contains any emulation warning we may need to
-//.. issue. If needed, side-exit to the next insn,
-//.. reporting the warning, so that Valgrind's dispatc=
her
-//.. sees the warning. */
-//.. put_emwarn( mkexpr(ew) );
-//.. stmt(=20
-//.. IRStmt_Exit(
-//.. binop(Iop_CmpNE32, mkexpr(ew), mkU32(0)),
-//.. Ijk_EmWarn,
-//.. IRConst_U32( ((Addr32)guest_eip_bbstart)+delta=
)
-//.. )
-//.. );
-//..=20
-//.. DIP("fldenv %s\n", dis_buf);
-//.. break;
-//.. }
+ case 4: { /* FLDENV m28 */
+ /* Uses dirty helper:=20
+ VexEmWarn amd64g_do_FLDENV ( VexGuestX86State*, HWo=
rd ) */
+ IRTemp ew =3D newTemp(Ity_I32);
+ IRTemp w64 =3D newTemp(Ity_I64);
+ IRDirty* d =3D unsafeIRDirty_0_N (=20
+ 0/*regparms*/,=20
+ "amd64g_dirtyhelper_FLDENV",=20
+ &amd64g_dirtyhelper_FLDENV,
+ mkIRExprVec_1( mkexpr(addr) )
+ );
+ d->needsBBP =3D True;
+ d->tmp =3D w64;
+ /* declare we're reading memory */
+ d->mFx =3D Ifx_Read;
+ d->mAddr =3D mkexpr(addr);
+ d->mSize =3D 28;
=20
+ /* declare we're writing guest state */
+ d->nFxState =3D 4;
+
+ d->fxState[0].fx =3D Ifx_Write;
+ d->fxState[0].offset =3D OFFB_FTOP;
+ d->fxState[0].size =3D sizeof(UInt);
+
+ d->fxState[1].fx =3D Ifx_Write;
+ d->fxState[1].offset =3D OFFB_FPTAGS;
+ d->fxState[1].size =3D 8 * sizeof(UChar);
+
+ d->fxState[2].fx =3D Ifx_Write;
+ d->fxState[2].offset =3D OFFB_FPROUND;
+ d->fxState[2].size =3D sizeof(ULong);
+
+ d->fxState[3].fx =3D Ifx_Write;
+ d->fxState[3].offset =3D OFFB_FC3210;
+ d->fxState[3].size =3D sizeof(ULong);
+
+ stmt( IRStmt_Dirty(d) );
+
+ /* ew contains any emulation warning we may need to
+ issue. If needed, side-exit to the next insn,
+ reporting the warning, so that Valgrind's dispatcher
+ sees the warning. */
+ assign(ew, unop(Iop_64to32,mkexpr(w64)) );
+ put_emwarn( mkexpr(ew) );
+ stmt(=20
+ IRStmt_Exit(
+ binop(Iop_CmpNE32, mkexpr(ew), mkU32(0)),
+ Ijk_EmWarn,
+ IRConst_U64( guest_rip_bbstart+delta )
+ )
+ );
+
+ DIP("fldenv %s\n", dis_buf);
+ break;
+ }
+
case 5: {/* FLDCW */
/* The only thing we observe in the control word is the
rounding mode. Therefore, pass the 16-bit value
@@ -4695,51 +4693,51 @@
break;
}
=20
-//.. case 6: { /* FNSTENV m28 */
-//.. /* Uses dirty helper:=20
-//.. void x86g_do_FSTENV ( VexGuestX86State*, UInt =
) */
-//.. IRDirty* d =3D unsafeIRDirty_0_N (=20
-//.. 0/*regparms*/,=20
-//.. "x86g_dirtyhelper_FSTENV",=20
-//.. &x86g_dirtyhelper_FSTENV,
-//.. mkIRExprVec_1( mkexpr(addr) )
-//.. );
-//.. d->needsBBP =3D True;
-//.. /* declare we're writing memory */
-//.. d->mFx =3D Ifx_Write;
-//.. d->mAddr =3D mkexpr(addr);
-//.. d->mSize =3D 28;
-//..=20
-//.. /* declare we're reading guest state */
-//.. d->nFxState =3D 4;
-//..=20
-//.. d->fxState[0].fx =3D Ifx_Read;
-//.. d->fxState[0].offset =3D OFFB_FTOP;
-//.. d->fxState[0].size =3D sizeof(UInt);
-//..=20
-//.. d->fxState[1].fx =3D Ifx_Read;
-//.. d->fxState[1].offset =3D OFFB_FPTAGS;
-//.. d->fxState[1].size =3D 8 * sizeof(UChar);
-//..=20
-//.. d->fxState[2].fx =3D Ifx_Read;
-//.. d->fxState[2].offset =3D OFFB_FPROUND;
-//.. d->fxState[2].size =3D sizeof(UInt);
-//..=20
-//.. d->fxState[3].fx =3D Ifx_Read;
-//.. d->fxState[3].offset =3D OFFB_FC3210;
-//.. d->fxState[3].size =3D sizeof(UInt);
-//..=20
-//.. stmt( IRStmt_Dirty(d) );
-//..=20
-//.. DIP("fnstenv %s\n", dis_buf);
-//.. break;
-//.. }
+ case 6: { /* FNSTENV m28 */
+ /* Uses dirty helper:=20
+ void amd64g_do_FSTENV ( VexGuestAMD64State*, HWord =
) */
+ IRDirty* d =3D unsafeIRDirty_0_N (=20
+ 0/*regparms*/,=20
+ "amd64g_dirtyhelper_FSTENV",=20
+ &amd64g_dirtyhelper_FSTENV,
+ mkIRExprVec_1( mkexpr(addr) )
+ );
+ d->needsBBP =3D True;
+ /* declare we're writing memory */
+ d->mFx =3D Ifx_Write;
+ d->mAddr =3D mkexpr(addr);
+ d->mSize =3D 28;
=20
+ /* declare we're reading guest state */
+ d->nFxState =3D 4;
+
+ d->fxState[0].fx =3D Ifx_Read;
+ d->fxState[0].offset =3D OFFB_FTOP;
+ d->fxState[0].size =3D sizeof(UInt);
+
+ d->fxState[1].fx =3D Ifx_Read;
+ d->fxState[1].offset =3D OFFB_FPTAGS;
+ d->fxState[1].size =3D 8 * sizeof(UChar);
+
+ d->fxState[2].fx =3D Ifx_Read;
+ d->fxState[2].offset =3D OFFB_FPROUND;
+ d->fxState[2].size =3D sizeof(ULong);
+
+ d->fxState[3].fx =3D Ifx_Read;
+ d->fxState[3].offset =3D OFFB_FC3210;
+ d->fxState[3].size =3D sizeof(ULong);
+
+ stmt( IRStmt_Dirty(d) );
+
+ DIP("fnstenv %s\n", dis_buf);
+ break;
+ }
+
case 7: /* FNSTCW */
/* Fake up a native x87 FPU control word. The only
thing it depends on is FPROUND[1:0], so call a clean
helper to cook it up. */
- /* ULong x86h_create_fpucw ( ULong fpround ) */
+ /* ULong amd64g_create_fpucw ( ULong fpround ) */
DIP("fnstcw %s\n", dis_buf);
storeLE(
mkexpr(addr),=20
Modified: trunk/priv/guest-generic/g_generic_x87.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/priv/guest-generic/g_generic_x87.h 2005-06-10 11:04:52 UTC (rev=
1205)
+++ trunk/priv/guest-generic/g_generic_x87.h 2005-06-13 12:17:27 UTC (rev=
1206)
@@ -75,6 +75,26 @@
void convert_f80le_to_f64le ( /*IN*/UChar* f80, /*OUT*/UChar* f64 );
=20
=20
+/* Layout of the real x87 state. */
+typedef
+ struct {
+ UShort env[14];
+ UChar reg[80];
+ }
+ Fpu_State;
+
+/* Offsets, in 16-bit ints, into the FPU environment (env) area. */
+#define FP_ENV_CTRL 0
+#define FP_ENV_STAT 2
+#define FP_ENV_TAG 4
+#define FP_ENV_IP 6 /* and 7 */
+#define FP_ENV_CS 8
+#define FP_ENV_OPOFF 10 /* and 11 */
+#define FP_ENV_OPSEL 12
+#define FP_REG(ii) (10*(7-(ii)))
+
+
+
#endif /* ndef __G_GENERIC_X87_H */
=20
/*---------------------------------------------------------------*/
Modified: trunk/priv/guest-x86/ghelpers.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/guest-x86/ghelpers.c 2005-06-10 11:04:52 UTC (rev 1205)
+++ trunk/priv/guest-x86/ghelpers.c 2005-06-13 12:17:27 UTC (rev 1206)
@@ -1234,25 +1234,10 @@
/*----------------------------------------------*/
=20
/* Layout of the real x87 state. */
+/* 13 June 05: Fpu_State and auxiliary constants was moved to
+ g_generic_x87.h */
=20
-typedef
- struct {
- UShort env[14];
- UChar reg[80];
- }
- Fpu_State;
=20
-/* Offsets, in 16-bit ints, into the FPU environment (env) area. */
-#define FP_ENV_CTRL 0
-#define FP_ENV_STAT 2
-#define FP_ENV_TAG 4
-#define FP_ENV_IP 6 /* and 7 */
-#define FP_ENV_CS 8
-#define FP_ENV_OPOFF 10 /* and 11 */
-#define FP_ENV_OPSEL 12
-#define FP_REG(ii) (10*(7-(ii)))
-
-
/* CLEAN HELPER */
/* fpucw[15:0] contains a x87 native format FPU control word.
Extract from it the required FPROUND value and any resulting
Modified: trunk/priv/guest-x86/toIR.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/guest-x86/toIR.c 2005-06-10 11:04:52 UTC (rev 1205)
+++ trunk/priv/guest-x86/toIR.c 2005-06-13 12:17:27 UTC (rev 1206)
@@ -3733,7 +3733,7 @@
=20
case 4: { /* FLDENV m28 */
/* Uses dirty helper:=20
- VexEmWarn x86g_do_FLDENV ( VexGuestX86State*, Addr3=
2 ) */
+ VexEmWarn x86g_do_FLDENV ( VexGuestX86State*, HWord=
) */
IRTemp ew =3D newTemp(Ity_I32);
IRDirty* d =3D unsafeIRDirty_0_N (=20
0/*regparms*/,=20
@@ -3832,7 +3832,7 @@
=20
case 6: { /* FNSTENV m28 */
/* Uses dirty helper:=20
- void x86g_do_FSTENV ( VexGuestX86State*, UInt ) */
+ void x86g_do_FSTENV ( VexGuestX86State*, HWord ) */
IRDirty* d =3D unsafeIRDirty_0_N (=20
0/*regparms*/,=20
"x86g_dirtyhelper_FSTENV",=20
|
|
From: <js...@ac...> - 2005-06-13 09:02:06
|
Nightly build on phoenix ( SuSE 9.1 ) started at 2005-06-13 09:50: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 == 174 tests, 3 stderr failures, 0 stdout failures ================= memcheck/tests/xml1 (stderr) none/tests/faultstatus (stderr) none/tests/x86/int (stderr) |
|
From: <sv...@va...> - 2005-06-13 08:47:02
|
Author: tom Date: 2005-06-13 09:46:57 +0100 (Mon, 13 Jun 2005) New Revision: 3904 Log: Comment fix - the ARCH_SET_xxx constants are in the x86_64 prctl.h as wel= l. Modified: trunk/include/vki-amd64-linux.h Modified: trunk/include/vki-amd64-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-amd64-linux.h 2005-06-13 04:21:38 UTC (rev 3903) +++ trunk/include/vki-amd64-linux.h 2005-06-13 08:46:57 UTC (rev 3904) @@ -483,8 +483,10 @@ #define VKI_GDT_ENTRY_TLS_MIN 11 #define VKI_GDT_ENTRY_TLS_MAX 13 =20 -// These are actually from linux-???/include/asm-i386/prctl.h. -// But they appear to be needed on amd64. +//---------------------------------------------------------------------- +// From linux-2.6.11.9/include/asm-x86_64/prctl.h +//---------------------------------------------------------------------- + #define VKI_ARCH_SET_GS 0x1001 #define VKI_ARCH_SET_FS 0x1002 #define VKI_ARCH_GET_FS 0x1003 |
Author: njn
Date: 2005-06-13 05:21:38 +0100 (Mon, 13 Jun 2005)
New Revision: 3903
Log:
Created m_machine, for various machine-related things.
Added:
trunk/coregrind/m_machine.c
trunk/coregrind/pub_core_machine.h
trunk/include/pub_tool_machine.h
Modified:
trunk/cachegrind/cg_main.c
trunk/coregrind/Makefile.am
trunk/coregrind/core.h
trunk/coregrind/m_debuginfo/symtab.c
trunk/coregrind/m_debuginfo/symtypes.c
trunk/coregrind/m_main.c
trunk/coregrind/m_scheduler/scheduler.c
trunk/coregrind/m_sigframe/sigframe-amd64-linux.c
trunk/coregrind/m_sigframe/sigframe-x86-linux.c
trunk/coregrind/m_signals.c
trunk/coregrind/m_stacktrace.c
trunk/coregrind/ume.c
trunk/helgrind/hg_main.c
trunk/include/Makefile.am
trunk/include/basic_types.h
trunk/include/tool.h
trunk/memcheck/mac_shared.c
trunk/memcheck/mc_main.c
trunk/memcheck/tests/Makefile.am
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-12 20:51:09 UTC (rev 3902)
+++ trunk/cachegrind/cg_main.c 2005-06-13 04:21:38 UTC (rev 3903)
@@ -37,6 +37,7 @@
#include "pub_tool_libcfile.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"
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-12 20:51:09 UTC (rev 3902)
+++ trunk/coregrind/Makefile.am 2005-06-13 04:21:38 UTC (rev 3903)
@@ -53,6 +53,7 @@
pub_core_libcprint.h \
pub_core_libcproc.h \
pub_core_libcsignal.h \
+ pub_core_machine.h \
pub_core_main.h \
pub_core_mallocfree.h \
pub_core_options.h \
@@ -103,6 +104,7 @@
m_libcprint.c \
m_libcproc.c \
m_libcsignal.c \
+ m_machine.c \
m_main.c \
m_mallocfree.c \
m_options.c \
Modified: trunk/coregrind/core.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/core.h 2005-06-12 20:51:09 UTC (rev 3902)
+++ trunk/coregrind/core.h 2005-06-13 04:21:38 UTC (rev 3903)
@@ -35,48 +35,16 @@
#include "tool.h" // tool stuff
=20
#include "libvex.h"
+
+// XXX: this is needed because pub_core_scheduler needs VexGuestXXXState=
...
#if defined(VGA_x86)
# include "libvex_guest_x86.h"
-# define VGA_ELF_ENDIANNESS ELFDATA2LSB
-# define VGA_ELF_MACHINE EM_386
-# define VGA_ELF_CLASS ELFCLASS32
-# define VGA_INSTR_PTR guest_EIP
-# define VGA_STACK_PTR guest_ESP
-# define VGA_FRAME_PTR guest_EBP
-# define VGA_CLREQ_ARGS guest_EAX
-# define VGA_CLREQ_RET guest_EDX
#elif defined(VGA_amd64)
# include "libvex_guest_amd64.h"
-# define VGA_ELF_ENDIANNESS ELFDATA2LSB
-# define VGA_ELF_MACHINE EM_X86_64
-# define VGA_ELF_CLASS ELFCLASS64
-# define VGA_INSTR_PTR guest_RIP
-# define VGA_STACK_PTR guest_RSP
-# define VGA_FRAME_PTR guest_RBP
-# define VGA_CLREQ_ARGS guest_RAX
-# define VGA_CLREQ_RET guest_RDX
-#elif defined(VGA_arm)
-#define VGA_ELF_ENDIANNESS ELFDATA2LSB
-#define VGA_ELF_MACHINE EM_ARM
-#define VGA_ELF_CLASS ELFCLASS32
- // XXX: Not sure, but I think:
- // r11 =3D frame pointer
- // r12 =3D "implicit parameter" (neither caller-save, nor callee-sa=
ve)
- // r13 =3D stack pointer
- // r14 =3D link register
- // r15 =3D program counter
-# define VGA_INSTR_PTR guest_R15
-# define VGA_STACK_PTR guest_R13
-# define VGA_FRAME_PTR guest_R11
-# define VGA_CLREQ_ARGS guest_R0
-# define VGA_CLREQ_RET guest_R0
#else
# error Unknown arch
#endif
=20
-
-
-
#include <setjmp.h> // for jmp_buf
=20
#include "pub_core_scheduler.h" // for types 'ThreadArchState'
@@ -140,17 +108,6 @@
extern Bool VGA_(getArchAndSubArch)( /*OUT*/VexArch*,=20
/*OUT*/VexSubArch* );
=20
-// Accessors for the ThreadArchState
-#define INSTR_PTR(regs) ((regs).vex.VGA_INSTR_PTR)
-#define STACK_PTR(regs) ((regs).vex.VGA_STACK_PTR)
-#define FRAME_PTR(regs) ((regs).vex.VGA_FRAME_PTR)
-#define CLREQ_ARGS(regs) ((regs).vex.VGA_CLREQ_ARGS)
-#define CLREQ_RET(regs) ((regs).vex.VGA_CLREQ_RET)
-// Offsets for the Vex state
-#define O_STACK_PTR (offsetof(VexGuestArchState, VGA_STACK_PTR))
-#define O_CLREQ_RET (offsetof(VexGuestArchState, VGA_CLREQ_RET))
-
-
// Setting up the initial thread (1) state
extern void=20
VGA_(init_thread1state) ( Addr client_eip,=20
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-12 20:51:09 UTC (rev 390=
2)
+++ trunk/coregrind/m_debuginfo/symtab.c 2005-06-13 04:21:38 UTC (rev 390=
3)
@@ -37,6 +37,7 @@
#include "pub_core_libcfile.h"
#include "pub_core_libcmman.h"
#include "pub_core_libcprint.h"
+#include "pub_core_machine.h"
#include "pub_core_mallocfree.h"
#include "pub_core_options.h"
#include "pub_core_profile.h"
Modified: trunk/coregrind/m_debuginfo/symtypes.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/symtypes.c 2005-06-12 20:51:09 UTC (rev 3=
902)
+++ trunk/coregrind/m_debuginfo/symtypes.c 2005-06-13 04:21:38 UTC (rev 3=
903)
@@ -36,6 +36,7 @@
#include "pub_core_libcmman.h"
#include "pub_core_libcprint.h"
#include "pub_core_libcsignal.h"
+#include "pub_core_machine.h"
#include "pub_core_mallocfree.h"
#include "pub_core_tooliface.h"
#include "priv_symtypes.h"
Added: 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-12 20:51:09 UTC (rev 3902)
+++ trunk/coregrind/m_machine.c 2005-06-13 04:21:38 UTC (rev 3903)
@@ -0,0 +1,99 @@
+
+/*--------------------------------------------------------------------*/
+/*--- Machine-related stuff. m_machine.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.
+*/
+
+#include "core.h"
+#include "pub_core_libcassert.h"
+#include "pub_core_libcbase.h"
+#include "pub_core_machine.h"
+
+#define INSTR_PTR(regs) ((regs).vex.VGA_INSTR_PTR)
+#define STACK_PTR(regs) ((regs).vex.VGA_STACK_PTR)
+#define FRAME_PTR(regs) ((regs).vex.VGA_FRAME_PTR)
+
+Addr VG_(get_SP) ( ThreadId tid )
+{
+ return STACK_PTR( VG_(threads)[tid].arch );
+}
+
+Addr VG_(get_IP) ( ThreadId tid )
+{
+ return INSTR_PTR( VG_(threads)[tid].arch );
+}
+
+Addr VG_(get_FP) ( ThreadId tid )
+{
+ return FRAME_PTR( VG_(threads)[tid].arch );
+}
+
+void VG_(set_SP) ( ThreadId tid, Addr sp )
+{
+ STACK_PTR( VG_(threads)[tid].arch ) =3D sp;
+}
+
+void VG_(set_IP) ( ThreadId tid, Addr ip )
+{
+ INSTR_PTR( VG_(threads)[tid].arch ) =3D ip;
+}
+
+
+void VG_(get_shadow_regs_area) ( ThreadId tid, OffT offset, SizeT size,
+ UChar* area )
+{
+ ThreadState* tst;
+
+ vg_assert(VG_(is_valid_tid)(tid));
+ tst =3D & VG_(threads)[tid];
+
+ // Bounds check
+ vg_assert(0 <=3D offset && offset < sizeof(VexGuestArchState));
+ vg_assert(offset + size <=3D sizeof(VexGuestArchState));
+
+ VG_(memcpy)( area, (void*)(((Addr)&(tst->arch.vex_shadow)) + offset),=
size);
+}
+
+void VG_(set_shadow_regs_area) ( ThreadId tid, OffT offset, SizeT size,
+ const UChar* area )
+{
+ ThreadState* tst;
+
+ vg_assert(VG_(is_valid_tid)(tid));
+ tst =3D & VG_(threads)[tid];
+
+ // Bounds check
+ vg_assert(0 <=3D offset && offset < sizeof(VexGuestArchState));
+ vg_assert(offset + size <=3D sizeof(VexGuestArchState));
+
+ VG_(memcpy)( (void*)(((Addr)(&tst->arch.vex_shadow)) + offset), area,=
size);
+}
+
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
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-12 20:51:09 UTC (rev 3902)
+++ trunk/coregrind/m_main.c 2005-06-13 04:21:38 UTC (rev 3903)
@@ -43,6 +43,7 @@
#include "pub_core_libcprint.h"
#include "pub_core_libcproc.h"
#include "pub_core_libcsignal.h"
+#include "pub_core_machine.h"
#include "pub_core_main.h"
#include "pub_core_mallocfree.h"
#include "pub_core_options.h"
@@ -256,18 +257,6 @@
}
=20
=20
-/* Get the simulated stack pointer */
-Addr VG_(get_SP) ( ThreadId tid )
-{
- return STACK_PTR( VG_(threads)[tid].arch );
-}
-
-Addr VG_(get_IP) ( ThreadId tid )
-{
- return INSTR_PTR( VG_(threads)[tid].arch );
-}
-
-
/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
/*=3D=3D=3D Check we were launched by stage 1 =
=3D=3D=3D*/
/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
@@ -2828,7 +2817,7 @@
"Caught __NR_exit; running __libc_freeres()");
=20
/* point thread context to point to libc_freeres_wrapper */
- INSTR_PTR(VG_(threads)[tid].arch) =3D __libc_freeres_wrapper;
+ VG_(set_IP)(tid, __libc_freeres_wrapper);
// XXX should we use a special stack?
=20
/* Block all blockable signals by copying the real block state into
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-12 20:51:09 UTC (rev =
3902)
+++ trunk/coregrind/m_scheduler/scheduler.c 2005-06-13 04:21:38 UTC (rev =
3903)
@@ -68,6 +68,7 @@
#include "pub_core_libcprint.h"
#include "pub_core_libcproc.h"
#include "pub_core_libcsignal.h"
+#include "pub_core_machine.h"
#include "pub_core_main.h"
#include "pub_core_mallocfree.h"
#include "pub_core_options.h"
@@ -156,7 +157,7 @@
for (tid =3D 1; tid < VG_N_THREADS; tid++) {
if (VG_(threads)[tid].status =3D=3D VgTs_Empty) continue;
=20
- if ( p ( STACK_PTR(VG_(threads)[tid].arch),
+ if ( p ( VG_(get_SP)(tid),
VG_(threads)[tid].client_stack_highest_word, d ) )
return tid;
}
@@ -683,12 +684,11 @@
static void handle_tt_miss ( ThreadId tid )
{
Bool found;
- Addr ip =3D INSTR_PTR(VG_(threads)[tid].arch);
+ Addr ip =3D VG_(get_IP)(tid);
=20
/* Trivial event. Miss in the fast-cache. Do a full
lookup for it. */
- found =3D VG_(search_transtab)( NULL,
- ip, True/*upd_fast_cache*/ );
+ found =3D VG_(search_transtab)( NULL, ip, True/*upd_fast_cache*/ );
if (!found) {
/* Not found; we need to request a translation. */
if (VG_(translate)( tid, ip, /*debug*/False, 0/*not verbose*/ )) {
@@ -877,7 +877,7 @@
}
=20
case VEX_TRC_JMP_NODECODE:
- VG_(synth_sigill)(tid, INSTR_PTR(VG_(threads)[tid].arch));
+ VG_(synth_sigill)(tid, VG_(get_IP)(tid));
break;
=20
default:=20
@@ -934,6 +934,23 @@
Specifying shadow register values
------------------------------------------------------------------ */
=20
+#if defined(VGA_x86)
+# define VGA_CLREQ_ARGS guest_EAX
+# define VGA_CLREQ_RET guest_EDX
+#elif defined(VGA_amd64)
+# define VGA_CLREQ_ARGS guest_RAX
+# define VGA_CLREQ_RET guest_RDX
+#elif defined(VGA_arm)
+# define VGA_CLREQ_ARGS guest_R0
+# define VGA_CLREQ_RET guest_R0
+#else
+# error Unknown arch
+#endif
+
+#define CLREQ_ARGS(regs) ((regs).vex.VGA_CLREQ_ARGS)
+#define CLREQ_RET(regs) ((regs).vex.VGA_CLREQ_RET)
+#define O_CLREQ_RET (offsetof(VexGuestArchState, VGA_CLREQ_RET))
+
// These macros write a value to a client's thread register, and tell th=
e
// tool that it's happened (if necessary).
=20
@@ -949,36 +966,6 @@
zztid, O_CLREQ_RET, sizeof(UWord), f); \
} while (0)
=20
-void VG_(set_shadow_regs_area) ( ThreadId tid, OffT offset, SizeT size,
- const UChar* area )
-{
- ThreadState* tst;
-
- vg_assert(VG_(is_valid_tid)(tid));
- tst =3D & VG_(threads)[tid];
-
- // Bounds check
- vg_assert(0 <=3D offset && offset < sizeof(VexGuestArchState));
- vg_assert(offset + size <=3D sizeof(VexGuestArchState));
-
- VG_(memcpy)( (void*)(((Addr)(&tst->arch.vex_shadow)) + offset), area,=
size);
-}
-
-void VG_(get_shadow_regs_area) ( ThreadId tid, OffT offset, SizeT size,
- UChar* area )
-{
- ThreadState* tst;
-
- vg_assert(VG_(is_valid_tid)(tid));
- tst =3D & VG_(threads)[tid];
-
- // Bounds check
- vg_assert(0 <=3D offset && offset < sizeof(VexGuestArchState));
- vg_assert(offset + size <=3D sizeof(VexGuestArchState));
-
- VG_(memcpy)( area, (void*)(((Addr)&(tst->arch.vex_shadow)) + offset),=
size);
-}
-
/* ---------------------------------------------------------------------
Handle client requests.
------------------------------------------------------------------ */
Modified: trunk/coregrind/m_sigframe/sigframe-amd64-linux.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_sigframe/sigframe-amd64-linux.c 2005-06-12 20:51:09=
UTC (rev 3902)
+++ trunk/coregrind/m_sigframe/sigframe-amd64-linux.c 2005-06-13 04:21:38=
UTC (rev 3903)
@@ -34,6 +34,7 @@
#include "pub_core_libcbase.h"
#include "pub_core_libcassert.h"
#include "pub_core_libcprint.h"
+#include "pub_core_machine.h"
#include "pub_core_options.h"
#include "pub_core_sigframe.h"
#include "pub_core_signals.h"
@@ -496,7 +497,7 @@
=20
/* Set the thread so it will next run the handler. */
/* tst->m_rsp =3D rsp; also notify the tool we've updated RSP */
- STACK_PTR(VG_(threads)[tid].arch) =3D rsp;
+ VG_(set_SP)(tid, rsp);
VG_TRACK( post_reg_write, Vg_CoreSignal, tid, O_STACK_PTR, sizeof(Add=
r));
=20
//VG_(printf)("handler =3D %p\n", handler);
Modified: trunk/coregrind/m_sigframe/sigframe-x86-linux.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_sigframe/sigframe-x86-linux.c 2005-06-12 20:51:09 U=
TC (rev 3902)
+++ trunk/coregrind/m_sigframe/sigframe-x86-linux.c 2005-06-13 04:21:38 U=
TC (rev 3903)
@@ -34,6 +34,7 @@
#include "pub_core_libcbase.h"
#include "pub_core_libcassert.h"
#include "pub_core_libcprint.h"
+#include "pub_core_machine.h"
#include "pub_core_options.h"
#include "pub_core_sigframe.h"
#include "pub_core_signals.h"
@@ -573,7 +574,7 @@
=20
/* Set the thread so it will next run the handler. */
/* tst->m_esp =3D esp; also notify the tool we've updated ESP */
- STACK_PTR(VG_(threads)[tid].arch) =3D esp;
+ VG_(set_SP)(tid, esp);
VG_TRACK( post_reg_write, Vg_CoreSignal, tid, O_STACK_PTR, sizeof(Add=
r));
=20
//VG_(printf)("handler =3D %p\n", handler);
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-12 20:51:09 UTC (rev 3902)
+++ trunk/coregrind/m_signals.c 2005-06-13 04:21:38 UTC (rev 3903)
@@ -89,6 +89,7 @@
#include "pub_core_libcprint.h"
#include "pub_core_libcproc.h"
#include "pub_core_libcsignal.h"
+#include "pub_core_machine.h"
#include "pub_core_main.h"
#include "pub_core_mallocfree.h"
#include "pub_core_options.h"
@@ -475,7 +476,7 @@
Addr m_SP;
=20
vg_assert(VG_(is_valid_tid)(tid));
- m_SP =3D STACK_PTR(VG_(threads)[tid].arch);
+ m_SP =3D VG_(get_SP)(tid);
=20
if (VG_(clo_trace_signals))
VG_(message)(Vg_DebugExtraMsg,=20
@@ -490,7 +491,7 @@
}
=20
if (ss !=3D NULL) {
- if (on_sig_stack(tid, STACK_PTR(VG_(threads)[tid].arch))) {
+ if (on_sig_stack(tid, VG_(get_SP)(tid))) {
return VG_(mk_SysRes_Error)( VKI_EPERM );
}
if (ss->ss_flags !=3D VKI_SS_DISABLE=20
@@ -763,7 +764,7 @@
&& /* there is a defined and enabled alt stack, which we're not
already using. Logic from get_sigframe in
arch/i386/kernel/signal.c. */
- sas_ss_flags(tid, STACK_PTR(tst->arch)) =3D=3D 0
+ sas_ss_flags(tid, VG_(get_SP)(tid)) =3D=3D 0
) {
esp_top_of_frame=20
=3D (Addr)(tst->altstack.ss_sp) + tst->altstack.ss_size;
@@ -779,7 +780,7 @@
VG_TRACK( pre_deliver_signal, tid, sigNo, /*alt_stack*/True );
=20
} else {
- esp_top_of_frame =3D STACK_PTR(tst->arch) - VGA_STACK_REDZONE_SZB;
+ esp_top_of_frame =3D VG_(get_SP)(tid) - VGA_STACK_REDZONE_SZB;
=20
/* Signal delivery to tools */
VG_TRACK( pre_deliver_signal, tid, sigNo, /*alt_stack*/False );
@@ -1792,8 +1793,7 @@
=20
if (VG_(clo_trace_signals)) {
VG_(message)(Vg_DebugMsg, "signal %d arrived ... si_code=3D%d, EIP=
=3D%p, eip=3D%p",
- sigNo, info->si_code,=20
- INSTR_PTR(VG_(threads)[tid].arch),=20
+ sigNo, info->si_code, VG_(get_IP)(tid),=20
VGP_UCONTEXT_INSTR_PTR(uc) );
}
vg_assert(sigNo >=3D 1 && sigNo <=3D VG_(max_signal));
@@ -1803,7 +1803,7 @@
*/
if (info->si_signo =3D=3D VKI_SIGSEGV) {
Addr fault =3D (Addr)info->_sifields._sigfault._addr;
- Addr esp =3D STACK_PTR(VG_(threads)[tid].arch);
+ Addr esp =3D VG_(get_SP)(tid);
Segment* seg;
=20
seg =3D VG_(find_segment)(fault);
Modified: trunk/coregrind/m_stacktrace.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_stacktrace.c 2005-06-12 20:51:09 UTC (rev 3902)
+++ trunk/coregrind/m_stacktrace.c 2005-06-13 04:21:38 UTC (rev 3903)
@@ -33,6 +33,7 @@
#include "pub_core_libcbase.h"
#include "pub_core_libcassert.h"
#include "pub_core_libcprint.h"
+#include "pub_core_machine.h"
#include "pub_core_options.h"
#include "pub_core_profile.h"
#include "pub_core_stacktrace.h"
@@ -162,11 +163,10 @@
UInt VG_(get_StackTrace) ( ThreadId tid, StackTrace ips, UInt n_ips )
{
/* thread in thread table */
- ThreadState* tst =3D & VG_(threads)[ tid ];
- Addr ip =3D INSTR_PTR(tst->arch);
- Addr fp =3D FRAME_PTR(tst->arch);
- Addr sp =3D STACK_PTR(tst->arch);
- Addr stack_highest_word =3D tst->client_stack_highest_word;
+ Addr ip =3D VG_(get_IP)(tid);
+ Addr fp =3D VG_(get_FP)(tid);
+ Addr sp =3D VG_(get_SP)(tid);
+ Addr stack_highest_word =3D VG_(threads)[tid].client_stack_highest_wo=
rd;
=20
#if defined(VGP_x86_linux)
/* Nasty little hack to deal with sysinfo syscalls - if libc is
Added: trunk/coregrind/pub_core_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/coregrind/pub_core_machine.h 2005-06-12 20:51:09 UTC (rev 3902)
+++ trunk/coregrind/pub_core_machine.h 2005-06-13 04:21:38 UTC (rev 3903)
@@ -0,0 +1,87 @@
+
+/*--------------------------------------------------------------------*/
+/*--- Machine-related things. pub_core_machine.h ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ This file is part of Valgrind, a dynamic binary instrumentation
+ framework.
+
+ Copyright (C) 2000-2005 Julian Seward
+ js...@ac...
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The GNU General Public License is contained in the file COPYING.
+*/
+
+#ifndef __PUB_CORE_MACHINE_H
+#define __PUB_CORE_MACHINE_H
+
+//--------------------------------------------------------------------
+// PURPOSE: This module contains code related to the particular
+// architecture, things like accessing guest state, endianness, word siz=
e,
+// etc.
+//--------------------------------------------------------------------
+
+#include "pub_tool_machine.h"
+
+#if defined(VGA_x86)
+# define VGA_ELF_ENDIANNESS ELFDATA2LSB
+# define VGA_ELF_MACHINE EM_386
+# define VGA_ELF_CLASS ELFCLASS32
+#elif defined(VGA_amd64)
+# define VGA_ELF_ENDIANNESS ELFDATA2LSB
+# define VGA_ELF_MACHINE EM_X86_64
+# define VGA_ELF_CLASS ELFCLASS64
+#elif defined(VGA_arm)
+# define VGA_ELF_ENDIANNESS ELFDATA2LSB
+# define VGA_ELF_MACHINE EM_ARM
+# define VGA_ELF_CLASS ELFCLASS32
+#else
+# error Unknown arch
+#endif
+
+#if defined(VGA_x86)
+# define VGA_INSTR_PTR guest_EIP
+# define VGA_STACK_PTR guest_ESP
+# define VGA_FRAME_PTR guest_EBP
+#elif defined(VGA_amd64)
+# define VGA_INSTR_PTR guest_RIP
+# define VGA_STACK_PTR guest_RSP
+# define VGA_FRAME_PTR guest_RBP
+#elif defined(VGA_arm)
+ // XXX: Not sure, but I think:
+ // r11 =3D frame pointer
+ // r12 =3D "implicit parameter" (neither caller-save, nor callee-sa=
ve)
+ // r13 =3D stack pointer
+ // r14 =3D link register
+ // r15 =3D program counter
+# define VGA_INSTR_PTR guest_R15
+# define VGA_STACK_PTR guest_R13
+# define VGA_FRAME_PTR guest_R11
+#else
+# error Unknown arch
+#endif
+
+// Offsets for the Vex state
+#define O_STACK_PTR (offsetof(VexGuestArchState, VGA_STACK_PTR))
+
+#endif // __PUB_CORE_MACHINE_H
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
Modified: 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-12 20:51:09 UTC (rev 3902)
+++ trunk/coregrind/ume.c 2005-06-13 04:21:38 UTC (rev 3903)
@@ -46,6 +46,7 @@
=20
#include "ume.h"
#include "pub_core_libcbase.h"
+#include "pub_core_machine.h"
=20
#if ELFSZ =3D=3D 64
#define ESZ(x) Elf64_##x
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-12 20:51:09 UTC (rev 3902)
+++ trunk/helgrind/hg_main.c 2005-06-13 04:21:38 UTC (rev 3903)
@@ -37,6 +37,7 @@
#include "pub_tool_libcassert.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"
Modified: trunk/include/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/include/Makefile.am 2005-06-12 20:51:09 UTC (rev 3902)
+++ trunk/include/Makefile.am 2005-06-13 04:21:38 UTC (rev 3903)
@@ -16,6 +16,7 @@
pub_tool_libcprint.h \
pub_tool_libcproc.h \
pub_tool_libcsignal.h \
+ pub_tool_machine.h \
pub_tool_mallocfree.h \
pub_tool_options.h \
pub_tool_profile.h \
Modified: trunk/include/basic_types.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/basic_types.h 2005-06-12 20:51:09 UTC (rev 3902)
+++ trunk/include/basic_types.h 2005-06-13 04:21:38 UTC (rev 3903)
@@ -65,6 +65,14 @@
# define NULL ((void*)0)
#endif
=20
+#if defined(VGA_x86)
+# define VGA_REGPARM(n) __attribute__((regparm(n)))
+#elif defined(VGA_amd64) || defined(VGA_arm)
+# define VGA_REGPARM(n) /* */
+#else
+# error Unknown arch
+#endif
+
/* ---------------------------------------------------------------------
non-builtin types
------------------------------------------------------------------ */
Added: 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-12 20:51:09 UTC (rev 3902)
+++ trunk/include/pub_tool_machine.h 2005-06-13 04:21:38 UTC (rev 3903)
@@ -0,0 +1,71 @@
+
+/*--------------------------------------------------------------------*/
+/*--- Machine-related stuff. pub_tool_machine.h ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ This file is part of Valgrind, a dynamic binary instrumentation
+ framework.
+
+ Copyright (C) 2000-2005 Julian Seward
+ js...@ac...
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The GNU General Public License is contained in the file COPYING.
+*/
+
+#ifndef __PUB_TOOL_MACHINE
+#define __PUB_TOOL_MACHINE
+
+/* VGA_STACK_REDZONE_SZB: how many bytes below the stack pointer are val=
idly
+ * addressible? */
+#if defined(VGA_x86)
+# define VGA_MIN_INSTR_SZB 1
+# define VGA_MAX_INSTR_SZB 16
+# define VGA_STACK_REDZONE_SZB 0
+#elif defined(VGA_amd64)
+# define VGA_MIN_INSTR_SZB 1
+# define VGA_MAX_INSTR_SZB 16
+# define VGA_STACK_REDZONE_SZB 128
+#elif defined(VGA_arm)
+# define VGA_MIN_INSTR_SZB 4
+# define VGA_MAX_INSTR_SZB 4=20
+# define VGA_STACK_REDZONE_SZB 0
+#else
+# error Unknown arch
+#endif
+
+// Guest state accessors
+extern Addr VG_(get_SP) ( ThreadId tid );
+extern Addr VG_(get_IP) ( ThreadId tid );
+extern Addr VG_(get_FP) ( ThreadId tid );
+
+extern void VG_(set_SP) ( ThreadId tid, Addr sp );
+extern void VG_(set_IP) ( ThreadId tid, Addr ip );
+
+// For get/set, 'area' is where the asked-for shadow state will be copie=
d
+// into/from.
+extern void VG_(get_shadow_regs_area) ( ThreadId tid, OffT guest_state_o=
ffset,
+ SizeT size, UChar* area );
+extern void VG_(set_shadow_regs_area) ( ThreadId tid, OffT guest_state_o=
ffset,
+ SizeT size, const UChar* area );
+
+#endif // __PUB_TOOL_MACHINE
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
Modified: trunk/include/tool.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/tool.h 2005-06-12 20:51:09 UTC (rev 3902)
+++ trunk/include/tool.h 2005-06-13 04:21:38 UTC (rev 3903)
@@ -68,11 +68,6 @@
( Bool (*p) ( Addr stack_min, Addr stack_max, vo=
id* d ),
void* d );
=20
-/* Get parts of the client's state. */
-extern Addr VG_(get_SP) ( ThreadId tid );
-extern Addr VG_(get_IP) ( ThreadId tid );
-
-
/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
/*=3D=3D=3D Valgrind's version of libc =
=3D=3D=3D*/
/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
@@ -94,42 +89,6 @@
UInt *eax_ret, UInt *ebx_ret,
UInt *ecx_ret, UInt *edx_ret );
=20
-/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
-/*=3D=3D=3D Functions for shadow registers =
=3D=3D=3D*/
-/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
-
-// For get/set, 'area' is where the asked-for shadow state will be copie=
d
-// into/from.
-extern void VG_(get_shadow_regs_area) ( ThreadId tid, OffT guest_state_o=
ffset,
- SizeT size, UChar* area );
-extern void VG_(set_shadow_regs_area) ( ThreadId tid, OffT guest_state_o=
ffset,
- SizeT size, const UChar* area );
-
-/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
-/*=3D=3D=3D Arch-specific stuff =
=3D=3D=3D*/
-/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
-
-/* VGA_STACK_REDZONE_SZB: how many bytes below the stack pointer are val=
idly
- * addressible? */
-#if defined(VGA_x86)
-# define VGA_REGPARM(n) __attribute__((regparm(n)))
-# define VGA_MIN_INSTR_SZB 1
-# define VGA_MAX_INSTR_SZB 16
-# define VGA_STACK_REDZONE_SZB 0
-#elif defined(VGA_amd64)
-# define VGA_REGPARM(n) /* */
-# define VGA_MIN_INSTR_SZB 1
-# define VGA_MAX_INSTR_SZB 16
-# define VGA_STACK_REDZONE_SZB 128
-#elif defined(VGA_arm)
-# define VGA_REGPARM(n) /* */
-# define VGA_MIN_INSTR_SZB 4
-# define VGA_MAX_INSTR_SZB 4=20
-# define VGA_STACK_REDZONE_SZB 0
-#else
-# error Unknown platform
-#endif
-
#endif /* __TOOL_H */
=20
=20
Modified: trunk/memcheck/mac_shared.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/mac_shared.c 2005-06-12 20:51:09 UTC (rev 3902)
+++ trunk/memcheck/mac_shared.c 2005-06-13 04:21:38 UTC (rev 3903)
@@ -34,6 +34,7 @@
#include "pub_tool_libcassert.h"
#include "pub_tool_libcbase.h"
#include "pub_tool_libcprint.h"
+#include "pub_tool_machine.h"
#include "memcheck.h" /* for VG_USERREQ__* */
=20
/*------------------------------------------------------------*/
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-12 20:51:09 UTC (rev 3902)
+++ trunk/memcheck/mc_main.c 2005-06-13 04:21:38 UTC (rev 3903)
@@ -42,6 +42,7 @@
#include "pub_tool_libcbase.h"
#include "pub_tool_libcassert.h"
#include "pub_tool_libcprint.h"
+#include "pub_tool_machine.h"
=20
=20
#define EXPECTED_TAKEN(cond) __builtin_expect((cond),1)
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-12 20:51:09 UTC (rev 3902)
+++ trunk/memcheck/tests/Makefile.am 2005-06-13 04:21:38 UTC (rev 3903)
@@ -197,6 +197,7 @@
hello_DEPENDENCIES =3D ../../coregrind/${VG_ARCH}/stage2.lds
endif
=20
+vgtest_ume_CFLAGS =3D -DVGA_$(VG_ARCH)
vgtest_ume_SOURCES =3D vgtest_ume.c
vgtest_ume_LDADD =3D ../../coregrind/ume.o \
../../coregrind/jmp_with_stack.o
|
|
From: Tom H. <th...@cy...> - 2005-06-13 03:07:45
|
Nightly build on audi ( i686, Red Hat 9 ) started at 2005-06-13 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 == 176 tests, 8 stderr failures, 2 stdout failures ================= memcheck/tests/sigaltstack (stderr) memcheck/tests/xml1 (stderr) corecheck/tests/fdleak_cmsg (stderr) corecheck/tests/pth_cancel1 (stdout) corecheck/tests/pth_cancel1 (stderr) corecheck/tests/pth_cancel2 (stderr) none/tests/faultstatus (stderr) none/tests/pth_blockedsig (stderr) none/tests/x86/int (stderr) none/tests/yield (stdout) |
|
From: <js...@ac...> - 2005-06-13 02:50:06
|
Nightly build on phoenix ( SuSE 9.1 ) started at 2005-06-13 03:50:00 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow Nightly build on phoenix ( SuSE 9.1 ) started at 2005-06-13 03:50:00 BST |
|
From: Tom H. <to...@co...> - 2005-06-13 02:35:52
|
Nightly build on dunsmere ( athlon, Fedora Core 3 ) started at 2005-06-13 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 == 177 tests, 6 stderr failures, 1 stdout failure ================= 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-13 02:20:41
|
Nightly build on alvis ( i686, Red Hat 7.3 ) started at 2005-06-13 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 == 175 tests, 13 stderr failures, 0 stdout failures ================= memcheck/tests/addressable (stderr) memcheck/tests/describe-block (stderr) memcheck/tests/leak-0 (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-regroot (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/match-overrun (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/vgtest_ume (stderr) memcheck/tests/xml1 (stderr) corecheck/tests/fdleak_cmsg (stderr) none/tests/faultstatus (stderr) none/tests/x86/int (stderr) |
|
From: Tom H. <th...@cy...> - 2005-06-13 02:19:50
|
Nightly build on dellow ( x86_64, Fedora Core 3 ) started at 2005-06-13 03:10:04 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 == 156 tests, 10 stderr failures, 3 stdout failures ================= memcheck/tests/brk (stderr) memcheck/tests/sigaltstack (stderr) memcheck/tests/sigprocmask (stderr) memcheck/tests/toobig-allocs (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/xml1 (stderr) corecheck/tests/stack_changes (stdout) corecheck/tests/stack_changes (stderr) massif/tests/toobig-allocs (stderr) none/tests/faultstatus (stderr) none/tests/selfrun (stdout) none/tests/selfrun (stderr) none/tests/yield (stdout) |
|
From: Tom H. <th...@cy...> - 2005-06-13 02:05:31
|
Nightly build on gill ( x86_64, Fedora Core 2 ) started at 2005-06-13 03:00: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 == 156 tests, 11 stderr failures, 2 stdout failures ================= memcheck/tests/brk (stderr) memcheck/tests/sigaltstack (stderr) memcheck/tests/sigprocmask (stderr) memcheck/tests/toobig-allocs (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/xml1 (stderr) corecheck/tests/fdleak_fcntl (stderr) corecheck/tests/stack_changes (stdout) corecheck/tests/stack_changes (stderr) massif/tests/toobig-allocs (stderr) none/tests/faultstatus (stderr) none/tests/selfrun (stdout) none/tests/selfrun (stderr) |