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
(13) |
2
(33) |
3
(25) |
4
(22) |
5
(22) |
6
(21) |
7
(19) |
|
8
(29) |
9
(34) |
10
(29) |
11
(37) |
12
(36) |
13
(28) |
14
(25) |
|
15
(28) |
16
(23) |
17
(36) |
18
(21) |
19
(12) |
20
(14) |
21
(10) |
|
22
(7) |
23
(15) |
24
(41) |
25
(15) |
26
(9) |
27
(7) |
28
(6) |
|
29
(16) |
30
(24) |
31
(22) |
|
|
|
|
|
From: <sv...@va...> - 2005-05-13 23:40:57
|
Author: njn
Date: 2005-05-14 00:40:55 +0100 (Sat, 14 May 2005)
New Revision: 3703
Added:
trunk/coregrind/m_transtab.c
trunk/coregrind/pub_core_transtab.h
Removed:
trunk/coregrind/vg_transtab.c
Modified:
trunk/coregrind/Makefile.am
trunk/coregrind/core.h
trunk/coregrind/m_aspacemgr/aspacemgr.c
trunk/coregrind/m_translate.c
trunk/coregrind/vg_main.c
trunk/coregrind/vg_redir.c
trunk/coregrind/vg_scheduler.c
Log:
Modularised vg_transtab.c as m_transtab.
Renamed add_to_trans_tab() as add_to_transtab() for consistency
with the other names.
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-05-13 23:32:43 UTC (rev 3702)
+++ trunk/coregrind/Makefile.am 2005-05-13 23:40:55 UTC (rev 3703)
@@ -53,6 +53,7 @@
pub_core_syscalls.h \
pub_core_tooliface.h \
pub_core_translate.h \
+ pub_core_transtab.h \
ume.h \
vg_symtab2.h \
vg_symtypes.h
@@ -80,6 +81,7 @@
m_stacktrace.c \
m_tooliface.c \
m_translate.c \
+ m_transtab.c \
ume.c \
\
vg_scheduler.c \
@@ -95,8 +97,7 @@
vg_redir.c \
vg_dwarf.c \
vg_stabs.c \
- vg_symtypes.c \
- vg_transtab.c
+ vg_symtypes.c
=20
## libplatform.a must be before libarch.a and libos.a, it seems.
stage2_extra=3D \
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-05-13 23:32:43 UTC (rev 3702)
+++ trunk/coregrind/core.h 2005-05-13 23:40:55 UTC (rev 3703)
@@ -759,38 +759,6 @@
=20
=20
/* ---------------------------------------------------------------------
- Exports of vg_transtab.c
- ------------------------------------------------------------------ */
-
-/* The fast-cache for tt-lookup, and for finding counters. */
-extern ULong* VG_(tt_fast) [VG_TT_FAST_SIZE];
-extern UInt* VG_(tt_fastN)[VG_TT_FAST_SIZE];
-
-
-extern void VG_(init_tt_tc) ( void );
-
-extern
-void VG_(add_to_trans_tab)( VexGuestExtents* vge,
- Addr64 entry,
- AddrH code,
- UInt code_len );
-
-extern Bool VG_(search_transtab) ( /*OUT*/AddrH* result,
- Addr64 guest_addr,=20
- Bool upd_cache );
-
-extern void VG_(discard_translations) ( Addr64 start, UInt range );
-
-extern void VG_(sanity_check_tt_tc) ( Char* caller );
-
-extern void VG_(print_tt_tc_stats) ( void );
-
-extern UInt VG_(get_bbs_translated) ( void );
-
-extern void VG_(show_BB_profile) ( void );
-
-
-/* ---------------------------------------------------------------------
Exports of vg_syscall.S
------------------------------------------------------------------ */
=20
Modified: trunk/coregrind/m_aspacemgr/aspacemgr.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_aspacemgr/aspacemgr.c 2005-05-13 23:32:43 UTC (rev =
3702)
+++ trunk/coregrind/m_aspacemgr/aspacemgr.c 2005-05-13 23:40:55 UTC (rev =
3703)
@@ -34,6 +34,7 @@
#include "pub_core_aspacemgr.h"
#include "pub_core_syscalls.h"
#include "pub_core_tooliface.h"
+#include "pub_core_transtab.h"
#include "vki_unistd.h"
=20
=20
Modified: trunk/coregrind/m_translate.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_translate.c 2005-05-13 23:32:43 UTC (rev 3702)
+++ trunk/coregrind/m_translate.c 2005-05-13 23:40:55 UTC (rev 3703)
@@ -32,6 +32,8 @@
#include "core.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_tooliface.h"
+#include "pub_core_translate.h"
+#include "pub_core_transtab.h"
=20
=20
/*------------------------------------------------------------*/
@@ -496,10 +498,10 @@
if (!debugging_translation) {
// Note that we use orig_addr0, not orig_addr, which might have be=
en
// changed by the redirection
- VG_(add_to_trans_tab)( &vge,
- orig_addr0,
- (Addr)(&tmpbuf[0]),=20
- tmpbuf_used );
+ VG_(add_to_transtab)( &vge,
+ orig_addr0,
+ (Addr)(&tmpbuf[0]),=20
+ tmpbuf_used );
}
=20
VGP_POPCC(VgpTranslate);
Copied: trunk/coregrind/m_transtab.c (from rev 3700, trunk/coregrind/vg_t=
ranstab.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/vg_transtab.c 2005-05-13 23:11:40 UTC (rev 3700)
+++ trunk/coregrind/m_transtab.c 2005-05-13 23:40:55 UTC (rev 3703)
@@ -0,0 +1,810 @@
+
+/*--------------------------------------------------------------------*/
+/*--- Management of the translation table and cache. ---*/
+/*--- m_transtab.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_tooliface.h"
+// XXX: this module should not depend on m_translate!
+#include "pub_core_translate.h"
+#include "pub_core_transtab.h"
+
+/* #define DEBUG_TRANSTAB */
+
+
+/*-------------------------------------------------------------*/
+/*--- Management of the FIFO-based translation table+cache. ---*/
+/*-------------------------------------------------------------*/
+
+/*------------------ CONSTANTS ------------------*/
+
+/* Number of sectors the TC is divided into. If you need a larger
+ overall translation cache, increase this value. */
+#define N_SECTORS 8
+
+/* Number of TC entries in each sector. This needs to be a prime
+ number to work properly, and it is strongly recommended not to
+ change this. */
+#define N_TTES_PER_SECTOR /*30011*/ 40009
+
+/* Because each sector contains a hash table of TTEntries, we need to
+ specify the maximum allowable loading, after which the sector is
+ deemed full. */
+#define SECTOR_TT_LIMIT_PERCENT 60
+
+/* The sector is deemed full when this many entries are in it. */
+#define N_TTES_PER_SECTOR_USABLE \
+ ((N_TTES_PER_SECTOR * SECTOR_TT_LIMIT_PERCENT) / 100)
+
+
+/*------------------ TYPES ------------------*/
+
+/* A translation-cache entry is two parts:
+ - The guest address of the first (entry) bb in the translation,
+ as a 64-bit word.
+ - One or more 64-bit words containing the code.
+ It is supposed to be 64-bit aligned.
+*/
+/*
+typedef
+ struct {
+ Addr64 orig_addr;
+ ULong code[0];
+ }
+ TCEntry;
+*/
+
+/* A translation-table entry. This indicates precisely which areas of
+ guest code are included in the translation, and contains all other
+ auxiliary info too. */
+typedef
+ struct {
+ /* Profiling only: the count and weight (arbitrary meaning) for
+ this translation. Weight is a property of the translation
+ itself and computed once when the translation is created.
+ Count is an entry count for the translation and is
+ incremented by 1 every time the translation is used, if we
+ are profiling. */
+ UInt count;
+ UShort weight;
+
+ /* Status of the slot. Note, we need to be able to do lazy
+ deletion, hence the Deleted state. */
+ enum { InUse, Deleted, Empty } status;
+
+ /* Pointer to the corresponding TCEntry (must be in the same
+ sector!) */
+ ULong* tce;
+
+ /* This is the original guest address that purportedly is the
+ entry point of the translation. You might think that .entry
+ should be the same as .vge->base[0], and most of the time it
+ is. However, when doing redirections, that is not the case.
+ .vge must always correctly describe the guest code sections
+ from which this translation was made. However, .entry may or
+ may not be a lie, depending on whether or not we're doing
+ redirection. */
+ Addr64 entry;
+
+ /* This structure describes precisely what ranges of guest code
+ the translation covers, so we can decide whether or not to
+ delete it when translations of a given address range are
+ invalidated. */
+ VexGuestExtents vge;
+ }
+ TTEntry;
+
+
+/* Finally, a sector itself. Each sector contains an array of
+ TCEntries, which hold code, and an array of TTEntries, containing
+ all required administrative info. Profiling is supported using the
+ TTEntry .count and .weight fields, if required. Each sector is
+ independent in that no cross-sector references are allowed.
+
+ If the sector is not in use, all three pointers are NULL and
+ tt_n_inuse is zero. =20
+*/
+typedef
+ struct {
+ /* The TCEntry area. Size of this depends on the average
+ translation size. We try and size it so it becomes full
+ precisely when this sector's translation table (tt) reaches
+ its load limit (SECTOR_TT_LIMIT_PERCENT). */
+ ULong* tc;
+
+ /* The TTEntry array. This is a fixed size, always containing
+ exactly N_TTES_PER_SECTOR entries. */
+ TTEntry* tt;
+
+ /* This points to the current allocation point in tc. */
+ ULong* tc_next;
+
+ /* The count of tt entries with state InUse. */
+ Int tt_n_inuse;
+ }
+ Sector;
+
+
+/*------------------ DECLS ------------------*/
+
+/* The root data structure is an array of sectors. The index of the
+ youngest sector is recorded, and new translations are put into that
+ sector. When it fills up, we move along to the next sector and
+ start to fill that up, wrapping around at the end of the array.
+ That way, once all N_TC_SECTORS have been bought into use for the
+ first time, and are full, we then re-use the oldest sector,
+ endlessly.=20
+
+ When running, youngest sector should be between >=3D 0 and <
+ N_TC_SECTORS. The initial -1 value indicates the TT/TC system is
+ not yet initialised.=20
+*/
+static Sector sectors[N_SECTORS];
+static Int youngest_sector =3D -1;
+
+/* The number of ULongs in each TCEntry area. This is computed once
+ at startup and does not change. */
+static Int tc_sector_szQ;
+
+
+/* Fast helper for the TC. A direct-mapped cache which holds a
+ pointer to a TC entry which may or may not be the correct one, but
+ which we hope usually is. This array is referred to directly from
+ <arch>/dispatch.S.
+
+ Entries in tt_fast may point to any valid TC entry, regardless of
+ which sector it's in. Consequently we must be very careful to
+ invalidate this cache when TC entries are changed or disappear.
+
+ A special TCEntry -- bogus_tc_entry -- must be pointed at to cause
+ that cache entry to miss. This relies on the assumption that no
+ guest code actually has an address of 0x1.
+*/
+/*global*/ ULong* VG_(tt_fast)[VG_TT_FAST_SIZE];
+
+static ULong bogus_tc_entry =3D (Addr64)1;
+
+
+/* For profiling, we have a parallel array of pointers to .count
+ fields in TT entries. Again, these pointers must be invalidated
+ when translations disappear. A NULL pointer suffices to indicate
+ an unused slot.
+
+ tt_fast and tt_fastN change together: if tt_fast[i] points to
+ bogus_tc_entry then the corresponding tt_fastN[i] must be null. If
+ tt_fast[i] points to some TC entry somewhere, then tt_fastN[i]
+ *must* point to the .count field of the corresponding TT entry.
+
+ tt_fast and tt_fastN are referred to from assembly code
+ (dispatch.S).
+*/
+/*global*/ UInt* VG_(tt_fastN)[VG_TT_FAST_SIZE];
+
+
+/* Make sure we're not used before initialisation. */
+static Bool init_done =3D False;
+
+
+/*------------------ STATS DECLS ------------------*/
+
+/* Number of fast-cache updates and flushes done. */
+ULong n_fast_flushes =3D 0;
+ULong n_fast_updates =3D 0;
+
+/* Number of full lookups done. */
+ULong n_full_lookups =3D 0;
+ULong n_lookup_probes =3D 0;
+
+/* Number/osize/tsize of translations entered. */
+ULong n_in_count =3D 0;
+ULong n_in_osize =3D 0;
+ULong n_in_tsize =3D 0;
+
+/* Number/osize of translations discarded due to lack of space. */
+ULong n_dump_count =3D 0;
+ULong n_dump_osize =3D 0;
+
+/* Number/osize of translations discarded due to requests to do so. */
+ULong n_disc_count =3D 0;
+ULong n_disc_osize =3D 0;
+
+
+
+/*-------------------------------------------------------------*/
+/*--- Add/delete/find translations ---*/
+/*-------------------------------------------------------------*/
+
+static UInt vge_osize ( VexGuestExtents* vge )
+{
+ UInt i, n =3D 0;
+ for (i =3D 0; i < vge->n_used; i++)
+ n +=3D (UInt)vge->len[i];
+ return n;
+}
+
+static Bool isValidSector ( Int sector )
+{
+ if (sector < 0 || sector >=3D N_SECTORS)
+ return False;
+ return True;
+}
+
+static inline UInt HASH_TT ( Addr64 key )
+{
+ UInt kHi =3D (UInt)(key >> 32);
+ UInt kLo =3D (UInt)key;
+ return (kHi ^ kLo) % N_TTES_PER_SECTOR;
+}
+
+static void setFastCacheEntry ( Addr64 key, ULong* tce, UInt* count )
+{
+ UInt cno =3D ((UInt)key) & VG_TT_FAST_MASK;
+ VG_(tt_fast)[cno] =3D tce;
+ VG_(tt_fastN)[cno] =3D count;
+ n_fast_updates++;
+}
+
+static void invalidateFastCache ( void )
+{
+ UInt j;
+ for (j =3D 0; j < VG_TT_FAST_SIZE; j++) {
+ VG_(tt_fast)[j] =3D &bogus_tc_entry;
+ VG_(tt_fastN)[j] =3D NULL;
+ }
+ n_fast_flushes++;
+}
+
+static void initialiseSector ( Int sno )
+{
+ Int i;
+ vg_assert(isValidSector(sno));
+
+ if (sectors[sno].tc =3D=3D NULL) {
+ /* Sector has never been used before. Need to allocate tt and
+ tc. */
+ vg_assert(sectors[sno].tt =3D=3D NULL);
+ vg_assert(sectors[sno].tc_next =3D=3D NULL);
+ vg_assert(sectors[sno].tt_n_inuse =3D=3D 0);
+ sectors[sno].tc=20
+ =3D VG_(get_memory_from_mmap)
+ ( 8 * tc_sector_szQ, "sectors[sno].tc" );
+ sectors[sno].tt=20
+ =3D VG_(get_memory_from_mmap)=20
+ ( N_TTES_PER_SECTOR * sizeof(TTEntry), "sectors[sno].tt" )=
;
+ if (VG_(clo_verbosity) > 2)
+ VG_(message)(Vg_DebugMsg, "TT/TC: initialise sector %d", sno);
+ } else {
+ /* Sector has been used before. */
+ vg_assert(sectors[sno].tt !=3D NULL);
+ vg_assert(sectors[sno].tc_next !=3D NULL);
+ n_dump_count +=3D sectors[sno].tt_n_inuse;
+ for (i =3D 0; i < N_TTES_PER_SECTOR; i++) {
+ if (sectors[sno].tt[i].status =3D=3D InUse) {
+ n_dump_osize +=3D vge_osize(§ors[sno].tt[i].vge);
+ }
+ }
+ if (VG_(clo_verbosity) > 2)
+ VG_(message)(Vg_DebugMsg, "TT/TC: recycle sector %d", sno);
+ }
+
+ sectors[sno].tc_next =3D sectors[sno].tc;
+ sectors[sno].tt_n_inuse =3D 0;
+ for (i =3D 0; i < N_TTES_PER_SECTOR; i++)
+ sectors[sno].tt[i].status =3D Empty;
+
+ invalidateFastCache();
+}
+
+
+/* Add a translation of vge to TT/TC. The translation is temporarily
+ in code[0 .. code_len-1].
+
+ pre: youngest_sector points to a valid (although possibly full)
+ sector.
+*/
+void VG_(add_to_transtab)( VexGuestExtents* vge,
+ Addr64 entry,
+ AddrH code,
+ UInt code_len )
+{
+ Int tcAvailQ, reqdQ, y, i;
+ ULong *tce, *tce2;
+ UChar* srcP;
+ UChar* dstP;
+
+ vg_assert(init_done);
+ vg_assert(vge->n_used >=3D 1 && vge->n_used <=3D 3);
+ vg_assert(code_len > 0 && code_len < 20000);
+
+ if (0)
+ VG_(printf)("add_to_transtab(entry =3D 0x%llx, len =3D %d)\n",
+ entry, code_len);
+
+ n_in_count++;
+ n_in_tsize +=3D code_len;
+ n_in_osize +=3D vge_osize(vge);
+
+ y =3D youngest_sector;
+ vg_assert(isValidSector(y));
+
+ if (sectors[y].tc =3D=3D NULL)
+ initialiseSector(y);
+
+ /* Try putting the translation in this sector. */
+ reqdQ =3D 1 + ((code_len + 7) >> 3);
+
+ /* Will it fit in tc? */
+ tcAvailQ =3D ((ULong*)(§ors[y].tc[tc_sector_szQ]))
+ - ((ULong*)(sectors[y].tc_next));
+ vg_assert(tcAvailQ >=3D 0);
+ vg_assert(tcAvailQ <=3D tc_sector_szQ);
+
+ if (tcAvailQ < reqdQ=20
+ || sectors[y].tt_n_inuse >=3D N_TTES_PER_SECTOR_USABLE) {
+ /* No. So move on to the next sector. Either it's never been
+ used before, in which case it will get its tt/tc allocated
+ now, or it has been used before, in which case it is set to be
+ empty, hence throwing out the oldest sector. */
+ youngest_sector++;
+ if (youngest_sector >=3D N_SECTORS)
+ youngest_sector =3D 0;
+ y =3D youngest_sector;
+ initialiseSector(y);
+ }
+
+ /* Be sure ... */
+ tcAvailQ =3D ((ULong*)(§ors[y].tc[tc_sector_szQ]))
+ - ((ULong*)(sectors[y].tc_next));
+ vg_assert(tcAvailQ >=3D 0);
+ vg_assert(tcAvailQ <=3D tc_sector_szQ);
+ vg_assert(tcAvailQ >=3D reqdQ);
+ vg_assert(sectors[y].tt_n_inuse < N_TTES_PER_SECTOR_USABLE);
+ vg_assert(sectors[y].tt_n_inuse >=3D 0);
+=20
+ /* Copy into tc. */
+ tce =3D sectors[y].tc_next;
+ vg_assert(tce >=3D §ors[y].tc[0]);
+ vg_assert(tce <=3D §ors[y].tc[tc_sector_szQ]);
+
+ tce[0] =3D entry;
+ dstP =3D (UChar*)(&tce[1]);
+ srcP =3D (UChar*)code;
+ for (i =3D 0; i < code_len; i++)
+ dstP[i] =3D srcP[i];
+ sectors[y].tc_next +=3D reqdQ;
+ sectors[y].tt_n_inuse++;
+
+ /* more paranoia */
+ tce2 =3D sectors[y].tc_next;
+ vg_assert(tce2 >=3D §ors[y].tc[0]);
+ vg_assert(tce2 <=3D §ors[y].tc[tc_sector_szQ]);
+
+ /* Find an empty tt slot, and use it. There must be such a slot
+ since tt is never allowed to get completely full. */
+ i =3D HASH_TT(entry);
+ vg_assert(i >=3D 0 && i < N_TTES_PER_SECTOR);
+ while (True) {
+ if (sectors[y].tt[i].status =3D=3D Empty
+ || sectors[y].tt[i].status =3D=3D Deleted)
+ break;
+ i++;
+ if (i >=3D N_TTES_PER_SECTOR)
+ i =3D 0;
+ }
+
+ sectors[y].tt[i].status =3D InUse;
+ sectors[y].tt[i].tce =3D tce;
+ sectors[y].tt[i].count =3D 0;
+ sectors[y].tt[i].weight =3D 1;
+ sectors[y].tt[i].vge =3D *vge;
+ sectors[y].tt[i].entry =3D entry;
+
+ setFastCacheEntry( entry, tce, §ors[y].tt[i].count );
+}
+
+
+/* Search for the translation of the given guest address. If
+ requested, a successful search can also cause the fast-caches to be
+ updated. =20
+*/
+Bool VG_(search_transtab) ( /*OUT*/AddrH* result,
+ Addr64 guest_addr,=20
+ Bool upd_cache )
+{
+ Int i, j, k, kstart, sno;
+
+ vg_assert(init_done);
+ /* Find the initial probe point just once. It will be the same in
+ all sectors and avoids multiple expensive % operations. */
+ n_full_lookups++;
+ k =3D -1;
+ kstart =3D HASH_TT(guest_addr);
+ vg_assert(kstart >=3D 0 && kstart < N_TTES_PER_SECTOR);
+
+ /* Search in all the sectors. Although the order should not matter,
+ it might be most efficient to search in the order youngest to
+ oldest. */
+ sno =3D youngest_sector;
+ for (i =3D 0; i < N_SECTORS; i++) {
+
+ if (sectors[sno].tc =3D=3D NULL)
+ goto notfound; /* sector not in use. */
+
+ k =3D kstart;
+ for (j =3D 0; j < N_TTES_PER_SECTOR; j++) {
+ n_lookup_probes++;
+ if (sectors[sno].tt[k].status =3D=3D InUse
+ && sectors[sno].tt[k].entry =3D=3D guest_addr) {
+ /* found it */
+ if (upd_cache)
+ setFastCacheEntry(=20
+ guest_addr, sectors[sno].tt[k].tce,=20
+ §ors[sno].tt[k].count );
+ if (result)
+ *result =3D sizeof(Addr64) + (AddrH)sectors[sno].tt[k].tc=
e;
+ return True;
+ }
+ if (sectors[sno].tt[k].status =3D=3D Empty)
+ break; /* not found in this sector */
+ k++;
+ if (k =3D=3D N_TTES_PER_SECTOR)
+ k =3D 0;
+ }
+
+ /* If we fall off the end, all entries are InUse and not
+ matching, or Deleted. In any case we did not find it in this
+ sector. */
+
+ notfound:
+ /* move to the next oldest sector */
+ sno =3D sno=3D=3D0 ? (N_SECTORS-1) : (sno-1);
+ }
+
+ /* Not found in any sector. */
+ return False;
+}
+
+
+/* Delete all translations which intersect with any part of the
+ specified guest address range. Note, this is SLOW.=20
+*/
+
+static inline
+Bool overlap1 ( Addr64 s1, UInt r1, Addr64 s2, UInt r2 )
+{
+ Addr64 e1 =3D s1 + (ULong)r1 - 1ULL;
+ Addr64 e2 =3D s2 + (ULong)r1 - 1ULL;
+ if (e1 < s2 || e2 < s1)=20
+ return False;
+ return True;
+}
+
+static inline
+Bool overlaps ( Addr64 start, UInt range, VexGuestExtents* vge )
+{
+ if (overlap1(start, range, vge->base[0], (UInt)vge->len[0]))
+ return True;
+ if (vge->n_used < 2)
+ return False;
+ if (overlap1(start, range, vge->base[1], (UInt)vge->len[1]))
+ return True;
+ if (vge->n_used < 3)
+ return False;
+ if (overlap1(start, range, vge->base[2], (UInt)vge->len[2]))
+ return True;
+ return False;
+}
+
+
+void VG_(discard_translations) ( Addr64 guest_start, UInt range )
+{
+ Int sno, i;
+ Bool anyDeleted =3D False;
+
+ vg_assert(init_done);
+
+ for (sno =3D 0; sno < N_SECTORS; sno++) {
+ if (sectors[sno].tc =3D=3D NULL)
+ continue;
+ for (i =3D 0; i < N_TTES_PER_SECTOR; i++) {
+ if (sectors[sno].tt[i].status =3D=3D InUse
+ && overlaps( guest_start, range, §ors[sno].tt[i].vge ))=
{
+ sectors[sno].tt[i].status =3D Deleted;
+ sectors[sno].tt_n_inuse--;
+ anyDeleted =3D True;
+ n_disc_count++;
+ n_disc_osize +=3D vge_osize(§ors[sno].tt[i].vge);
+ }
+ } =20
+ }
+
+ if (anyDeleted)
+ invalidateFastCache();
+}
+
+
+/*------------------------------------------------------------*/
+/*--- Sanity checking ---*/
+/*------------------------------------------------------------*/
+
+void VG_(sanity_check_tt_tc) ( Char* who )
+{
+}
+
+
+/*------------------------------------------------------------*/
+/*--- Initialisation. ---*/
+/*------------------------------------------------------------*/
+
+void VG_(init_tt_tc) ( void )
+{
+ Int i, avg_codeszQ;
+
+ vg_assert(!init_done);
+ init_done =3D True;
+
+ /* Otherwise lots of things go wrong... */
+ vg_assert(sizeof(ULong) =3D=3D 8);
+ vg_assert(sizeof(Addr64) =3D=3D 8);
+
+ if (VG_(clo_verbosity) > 2)
+ VG_(message)(Vg_DebugMsg,=20
+ "TT/TC: VG_(init_tt_tc) "
+ "(startup of code management)");
+
+ /* Figure out how big each tc area should be. */
+ avg_codeszQ =3D (VG_(details).avg_translation_sizeB + 7) / 8;
+ tc_sector_szQ =3D N_TTES_PER_SECTOR_USABLE * (1 + avg_codeszQ);
+
+ /* Ensure the calculated value is not way crazy. */
+ vg_assert(tc_sector_szQ >=3D 2 * N_TTES_PER_SECTOR_USABLE);
+ vg_assert(tc_sector_szQ <=3D 50 * N_TTES_PER_SECTOR_USABLE);
+
+ /* Initialise the sectors */
+ youngest_sector =3D 0;
+ for (i =3D 0; i < N_SECTORS; i++) {
+ sectors[i].tc =3D NULL;
+ sectors[i].tt =3D NULL;
+ sectors[i].tc_next =3D NULL;
+ sectors[i].tt_n_inuse =3D 0;
+ }
+
+ /* and the fast caches. */
+ invalidateFastCache();
+
+ if (VG_(clo_verbosity) > 2) {
+ VG_(message)(Vg_DebugMsg,
+ "TT/TC: cache: %d sectors of %d bytes each =3D %d total",=20
+ N_SECTORS, 8 * tc_sector_szQ,
+ N_SECTORS * 8 * tc_sector_szQ );
+ VG_(message)(Vg_DebugMsg,
+ "TT/TC: table: %d total entries, max occupancy %d (%d%%)",
+ N_SECTORS * N_TTES_PER_SECTOR,
+ N_SECTORS * N_TTES_PER_SECTOR_USABLE,=20
+ SECTOR_TT_LIMIT_PERCENT );
+ }
+}
+
+
+/*------------------------------------------------------------*/
+/*--- Printing out statistics. ---*/
+/*------------------------------------------------------------*/
+
+static ULong safe_idiv( ULong a, ULong b )
+{
+ return (b =3D=3D 0 ? 0 : a / b);
+}
+
+UInt VG_(get_bbs_translated) ( void )
+{
+ return n_in_count;
+}
+
+void VG_(print_tt_tc_stats) ( void )
+{
+ VG_(message)(Vg_DebugMsg,
+ " tt/tc: %llu tt lookups requiring %llu probes",=20
+ n_full_lookups, n_lookup_probes );
+ VG_(message)(Vg_DebugMsg,
+ " tt/tc: %llu fast-cache updates, %llu flushes",=20
+ n_fast_updates, n_fast_flushes );
+
+ VG_(message)(Vg_DebugMsg,
+ "translate: new %lld (%lld -> %lld; ratio %lld:10=
)",
+ n_in_count, n_in_osize, n_in_tsize,
+ safe_idiv(10*n_in_tsize, n_in_osize));
+ VG_(message)(Vg_DebugMsg,
+ "translate: dumped %lld (%lld -> ?" "?)",
+ n_dump_count, n_dump_osize );
+ VG_(message)(Vg_DebugMsg,
+ "translate: discarded %lld (%lld -> ?" "?)",
+ n_disc_count, n_disc_osize );
+}
+
+/*------------------------------------------------------------*/
+/*--- Printing out of profiling results. ---*/
+/*------------------------------------------------------------*/
+
+/* Only the top N_MAX bbs will be displayed. */
+#define N_MAX 200
+
+static TTEntry* tops[N_MAX];
+
+static ULong score ( TTEntry* tte )
+{
+ return ((ULong)tte->weight) * ((ULong)tte->count);
+}
+
+static Bool heavier ( TTEntry* t1, TTEntry* t2 )
+{
+ return score(t1) > score(t2);
+}
+
+/* Print n/m in form xx.yy% */
+static
+void percentify ( ULong n, ULong m, Int field_width, Char* buf)
+{
+ Int i, len, space;
+ ULong lo, hi;
+ if (m =3D=3D 0) m =3D 1; /* stay sane */
+ hi =3D (n * 100) / m;
+ lo =3D (((n * 100) - hi * m) * 100) / m;
+ vg_assert(lo < 100);
+ if (lo < 10)
+ VG_(sprintf)(buf, "%lld.0%lld%%", hi, lo);
+ else
+ VG_(sprintf)(buf, "%lld.%lld%%", hi, lo);
+
+ len =3D VG_(strlen)(buf);
+ space =3D field_width - len;
+ if (space < 0) space =3D 0; /* Allow for v. small field_width */
+ i =3D len;
+
+ /* Right justify in field */
+ for ( ; i >=3D 0; i--) buf[i + space] =3D buf[i];
+ for (i =3D 0; i < space; i++) buf[i] =3D ' ';
+}
+
+
+void VG_(show_BB_profile) ( void )
+{
+ Char name[64];
+ Int sno, i, r, s;
+ ULong score_total, score_cumul, score_here;
+ Char buf_cumul[10];
+ Char buf_here[10];
+
+ /* First, compute the total weighted count, and find the top N
+ ttes. tops contains pointers to the most-used N_MAX blocks, in
+ descending order (viz, tops[0] is the highest scorer). */
+ for (i =3D 0; i < N_MAX; i++)
+ tops[i] =3D NULL;
+
+ score_total =3D 0;
+
+ for (sno =3D 0; sno < N_SECTORS; sno++) {
+ if (sectors[sno].tc =3D=3D NULL)
+ continue;
+ for (i =3D 0; i < N_TTES_PER_SECTOR; i++) {
+ if (sectors[sno].tt[i].status !=3D InUse)
+ continue;
+ score_total +=3D score(§ors[sno].tt[i]);
+ /* Find the rank for sectors[sno].tt[i]. */
+ r =3D N_MAX-1;
+ while (True) {
+ if (r =3D=3D -1)
+ break;
+ if (tops[r] =3D=3D NULL) {
+ r--;=20
+ continue;
+ }
+ if (heavier(§ors[sno].tt[i], tops[r])) {
+ r--;
+ continue;
+ }
+ break;
+ }
+ r++;
+ vg_assert(r >=3D 0 && r <=3D N_MAX);
+ /* This bb should be placed at r, and bbs above it shifted
+ upwards one slot. */
+ if (r < N_MAX) {
+ for (s =3D N_MAX-1; s > r; s--)
+ tops[s] =3D tops[s-1];
+ tops[r] =3D §ors[sno].tt[i];
+ }
+ }
+ }
+
+ VG_(printf)("\n");
+ VG_(printf)("--------------------------------------------------------=
----\n");
+ VG_(printf)("--- BEGIN BB Profile (summary of scores) =
---\n");
+ VG_(printf)("--------------------------------------------------------=
----\n");
+ VG_(printf)("\n");
+
+ VG_(printf)("Total score =3D %lld\n\n", score_total);
+
+ score_cumul =3D 0;
+ for (r =3D 0; r < N_MAX; r++) {
+ if (tops[r] =3D=3D NULL)
+ continue;
+ name[0] =3D 0;
+ VG_(get_fnname_w_offset)(tops[r]->entry, name, 64);
+ name[63] =3D 0;
+ score_here =3D score(tops[r]);
+ score_cumul +=3D score_here;
+ percentify(score_cumul, score_total, 6, buf_cumul);
+ percentify(score_here, score_total, 6, buf_here);
+ VG_(printf)("%3d: (%9lld %s) %9lld %s 0x%llx %s\n",
+ r,
+ score_cumul, buf_cumul,
+ score_here, buf_here, tops[r]->entry, name );
+ }
+
+ VG_(printf)("\n");
+ VG_(printf)("--------------------------------------------------------=
----\n");
+ VG_(printf)("--- BB Profile (BB details) =
---\n");
+ VG_(printf)("--------------------------------------------------------=
----\n");
+ VG_(printf)("\n");
+
+ score_cumul =3D 0;
+ for (r =3D 0; r < N_MAX; r++) {
+ if (tops[r] =3D=3D NULL)
+ continue;
+ name[0] =3D 0;
+ VG_(get_fnname_w_offset)(tops[r]->entry, name, 64);
+ name[63] =3D 0;
+ score_here =3D score(tops[r]);
+ score_cumul +=3D score_here;
+ percentify(score_cumul, score_total, 6, buf_cumul);
+ percentify(score_here, score_total, 6, buf_here);
+ VG_(printf)("\n");
+ VG_(printf)("=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D=
begin BB rank %d "
+ "=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D=
\n\n", r);
+ VG_(printf)("%3d: (%9lld %s) %9lld %s 0x%llx %s\n",
+ r,
+ score_cumul, buf_cumul,
+ score_here, buf_here, tops[r]->entry, name );
+ VG_(printf)("\n");
+ VG_(translate)(0, tops[r]->entry, True, VG_(clo_profile_flags));
+ VG_(printf)("=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D=
end BB rank %d "
+ "=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D=
\n\n", r);
+ }
+
+ VG_(printf)("\n");
+ VG_(printf)("--------------------------------------------------------=
----\n");
+ VG_(printf)("--- END BB Profile =
---\n");
+ VG_(printf)("--------------------------------------------------------=
----\n");
+ VG_(printf)("\n");
+}
+
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
Added: trunk/coregrind/pub_core_transtab.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_transtab.h 2005-05-13 23:32:43 UTC (rev 3702=
)
+++ trunk/coregrind/pub_core_transtab.h 2005-05-13 23:40:55 UTC (rev 3703=
)
@@ -0,0 +1,71 @@
+
+/*--------------------------------------------------------------------*/
+/*--- The translation table and cache. ---*/
+/*--- pub_core_transtab.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_TRANSTAB_H
+#define __PUB_CORE_TRANSTAB_H
+
+//--------------------------------------------------------------------
+// PURPOSE: This module is responsible for caching translations, and
+// enabling fast look-ups of them.
+//--------------------------------------------------------------------
+
+/* The fast-cache for tt-lookup, and for finding counters. */
+extern ULong* VG_(tt_fast) [VG_TT_FAST_SIZE];
+extern UInt* VG_(tt_fastN)[VG_TT_FAST_SIZE];
+
+extern void VG_(init_tt_tc) ( void );
+
+extern
+void VG_(add_to_transtab)( VexGuestExtents* vge,
+ Addr64 entry,
+ AddrH code,
+ UInt code_len );
+
+extern Bool VG_(search_transtab) ( /*OUT*/AddrH* result,
+ Addr64 guest_addr,=20
+ Bool upd_cache );
+
+extern void VG_(discard_translations) ( Addr64 start, UInt range );
+
+extern void VG_(sanity_check_tt_tc) ( Char* caller );
+
+extern void VG_(print_tt_tc_stats) ( void );
+
+extern UInt VG_(get_bbs_translated) ( void );
+
+extern void VG_(show_BB_profile) ( void );
+
+
+#endif // __PUB_CORE_TRANSTAB_H
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/vg_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/vg_main.c 2005-05-13 23:32:43 UTC (rev 3702)
+++ trunk/coregrind/vg_main.c 2005-05-13 23:40:55 UTC (rev 3703)
@@ -38,6 +38,7 @@
#include "pub_core_execontext.h"
#include "pub_core_syscalls.h"
#include "pub_core_tooliface.h"
+#include "pub_core_transtab.h"
=20
#include <dirent.h>
#include <dlfcn.h>
Modified: trunk/coregrind/vg_redir.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/vg_redir.c 2005-05-13 23:32:43 UTC (rev 3702)
+++ trunk/coregrind/vg_redir.c 2005-05-13 23:40:55 UTC (rev 3703)
@@ -34,6 +34,7 @@
=20
#include "pub_core_aspacemgr.h"
#include "pub_core_skiplist.h"
+#include "pub_core_transtab.h"
=20
/*------------------------------------------------------------*/
/*--- General purpose redirection. ---*/
Modified: trunk/coregrind/vg_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/vg_scheduler.c 2005-05-13 23:32:43 UTC (rev 3702)
+++ trunk/coregrind/vg_scheduler.c 2005-05-13 23:40:55 UTC (rev 3703)
@@ -67,6 +67,7 @@
#include "pub_core_syscalls.h"
#include "pub_core_tooliface.h"
#include "pub_core_translate.h"
+#include "pub_core_transtab.h"
#include "vki_unistd.h"
=20
/* ---------------------------------------------------------------------
Deleted: trunk/coregrind/vg_transtab.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/vg_transtab.c 2005-05-13 23:32:43 UTC (rev 3702)
+++ trunk/coregrind/vg_transtab.c 2005-05-13 23:40:55 UTC (rev 3703)
@@ -1,808 +0,0 @@
-
-/*--------------------------------------------------------------------*/
-/*--- Management of the translation table and cache. ---*/
-/*--- vg_transtab.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_tooliface.h"
-#include "pub_core_translate.h"
-
-/* #define DEBUG_TRANSTAB */
-
-
-/*-------------------------------------------------------------*/
-/*--- Management of the FIFO-based translation table+cache. ---*/
-/*-------------------------------------------------------------*/
-
-/*------------------ CONSTANTS ------------------*/
-
-/* Number of sectors the TC is divided into. If you need a larger
- overall translation cache, increase this value. */
-#define N_SECTORS 8
-
-/* Number of TC entries in each sector. This needs to be a prime
- number to work properly, and it is strongly recommended not to
- change this. */
-#define N_TTES_PER_SECTOR /*30011*/ 40009
-
-/* Because each sector contains a hash table of TTEntries, we need to
- specify the maximum allowable loading, after which the sector is
- deemed full. */
-#define SECTOR_TT_LIMIT_PERCENT 60
-
-/* The sector is deemed full when this many entries are in it. */
-#define N_TTES_PER_SECTOR_USABLE \
- ((N_TTES_PER_SECTOR * SECTOR_TT_LIMIT_PERCENT) / 100)
-
-
-/*------------------ TYPES ------------------*/
-
-/* A translation-cache entry is two parts:
- - The guest address of the first (entry) bb in the translation,
- as a 64-bit word.
- - One or more 64-bit words containing the code.
- It is supposed to be 64-bit aligned.
-*/
-/*
-typedef
- struct {
- Addr64 orig_addr;
- ULong code[0];
- }
- TCEntry;
-*/
-
-/* A translation-table entry. This indicates precisely which areas of
- guest code are included in the translation, and contains all other
- auxiliary info too. */
-typedef
- struct {
- /* Profiling only: the count and weight (arbitrary meaning) for
- this translation. Weight is a property of the translation
- itself and computed once when the translation is created.
- Count is an entry count for the translation and is
- incremented by 1 every time the translation is used, if we
- are profiling. */
- UInt count;
- UShort weight;
-
- /* Status of the slot. Note, we need to be able to do lazy
- deletion, hence the Deleted state. */
- enum { InUse, Deleted, Empty } status;
-
- /* Pointer to the corresponding TCEntry (must be in the same
- sector!) */
- ULong* tce;
-
- /* This is the original guest address that purportedly is the
- entry point of the translation. You might think that .entry
- should be the same as .vge->base[0], and most of the time it
- is. However, when doing redirections, that is not the case.
- .vge must always correctly describe the guest code sections
- from which this translation was made. However, .entry may or
- may not be a lie, depending on whether or not we're doing
- redirection. */
- Addr64 entry;
-
- /* This structure describes precisely what ranges of guest code
- the translation covers, so we can decide whether or not to
- delete it when translations of a given address range are
- invalidated. */
- VexGuestExtents vge;
- }
- TTEntry;
-
-
-/* Finally, a sector itself. Each sector contains an array of
- TCEntries, which hold code, and an array of TTEntries, containing
- all required administrative info. Profiling is supported using the
- TTEntry .count and .weight fields, if required. Each sector is
- independent in that no cross-sector references are allowed.
-
- If the sector is not in use, all three pointers are NULL and
- tt_n_inuse is zero. =20
-*/
-typedef
- struct {
- /* The TCEntry area. Size of this depends on the average
- translation size. We try and size it so it becomes full
- precisely when this sector's translation table (tt) reaches
- its load limit (SECTOR_TT_LIMIT_PERCENT). */
- ULong* tc;
-
- /* The TTEntry array. This is a fixed size, always containing
- exactly N_TTES_PER_SECTOR entries. */
- TTEntry* tt;
-
- /* This points to the current allocation point in tc. */
- ULong* tc_next;
-
- /* The count of tt entries with state InUse. */
- Int tt_n_inuse;
- }
- Sector;
-
-
-/*------------------ DECLS ------------------*/
-
-/* The root data structure is an array of sectors. The index of the
- youngest sector is recorded, and new translations are put into that
- sector. When it fills up, we move along to the next sector and
- start to fill that up, wrapping around at the end of the array.
- That way, once all N_TC_SECTORS have been bought into use for the
- first time, and are full, we then re-use the oldest sector,
- endlessly.=20
-
- When running, youngest sector should be between >=3D 0 and <
- N_TC_SECTORS. The initial -1 value indicates the TT/TC system is
- not yet initialised.=20
-*/
-static Sector sectors[N_SECTORS];
-static Int youngest_sector =3D -1;
-
-/* The number of ULongs in each TCEntry area. This is computed once
- at startup and does not change. */
-static Int tc_sector_szQ;
-
-
-/* Fast helper for the TC. A direct-mapped cache which holds a
- pointer to a TC entry which may or may not be the correct one, but
- which we hope usually is. This array is referred to directly from
- <arch>/dispatch.S.
-
- Entries in tt_fast may point to any valid TC entry, regardless of
- which sector it's in. Consequently we must be very careful to
- invalidate this cache when TC entries are changed or disappear.
-
- A special TCEntry -- bogus_tc_entry -- must be pointed at to cause
- that cache entry to miss. This relies on the assumption that no
- guest code actually has an address of 0x1.
-*/
-/*global*/ ULong* VG_(tt_fast)[VG_TT_FAST_SIZE];
-
-static ULong bogus_tc_entry =3D (Addr64)1;
-
-
-/* For profiling, we have a parallel array of pointers to .count
- fields in TT entries. Again, these pointers must be invalidated
- when translations disappear. A NULL pointer suffices to indicate
- an unused slot.
-
- tt_fast and tt_fastN change together: if tt_fast[i] points to
- bogus_tc_entry then the corresponding tt_fastN[i] must be null. If
- tt_fast[i] points to some TC entry somewhere, then tt_fastN[i]
- *must* point to the .count field of the corresponding TT entry.
-
- tt_fast and tt_fastN are referred to from assembly code
- (dispatch.S).
-*/
-/*global*/ UInt* VG_(tt_fastN)[VG_TT_FAST_SIZE];
-
-
-/* Make sure we're not used before initialisation. */
-static Bool init_done =3D False;
-
-
-/*------------------ STATS DECLS ------------------*/
-
-/* Number of fast-cache updates and flushes done. */
-ULong n_fast_flushes =3D 0;
-ULong n_fast_updates =3D 0;
-
-/* Number of full lookups done. */
-ULong n_full_lookups =3D 0;
-ULong n_lookup_probes =3D 0;
-
-/* Number/osize/tsize of translations entered. */
-ULong n_in_count =3D 0;
-ULong n_in_osize =3D 0;
-ULong n_in_tsize =3D 0;
-
-/* Number/osize of translations discarded due to lack of space. */
-ULong n_dump_count =3D 0;
-ULong n_dump_osize =3D 0;
-
-/* Number/osize of translations discarded due to requests to do so. */
-ULong n_disc_count =3D 0;
-ULong n_disc_osize =3D 0;
-
-
-
-/*-------------------------------------------------------------*/
-/*--- Add/delete/find translations ---*/
-/*-------------------------------------------------------------*/
-
-static UInt vge_osize ( VexGuestExtents* vge )
-{
- UInt i, n =3D 0;
- for (i =3D 0; i < vge->n_used; i++)
- n +=3D (UInt)vge->len[i];
- return n;
-}
-
-static Bool isValidSector ( Int sector )
-{
- if (sector < 0 || sector >=3D N_SECTORS)
- return False;
- return True;
-}
-
-static inline UInt HASH_TT ( Addr64 key )
-{
- UInt kHi =3D (UInt)(key >> 32);
- UInt kLo =3D (UInt)key;
- return (kHi ^ kLo) % N_TTES_PER_SECTOR;
-}
-
-static void setFastCacheEntry ( Addr64 key, ULong* tce, UInt* count )
-{
- UInt cno =3D ((UInt)key) & VG_TT_FAST_MASK;
- VG_(tt_fast)[cno] =3D tce;
- VG_(tt_fastN)[cno] =3D count;
- n_fast_updates++;
-}
-
-static void invalidateFastCache ( void )
-{
- UInt j;
- for (j =3D 0; j < VG_TT_FAST_SIZE; j++) {
- VG_(tt_fast)[j] =3D &bogus_tc_entry;
- VG_(tt_fastN)[j] =3D NULL;
- }
- n_fast_flushes++;
-}
-
-static void initialiseSector ( Int sno )
-{
- Int i;
- vg_assert(isValidSector(sno));
-
- if (sectors[sno].tc =3D=3D NULL) {
- /* Sector has never been used before. Need to allocate tt and
- tc. */
- vg_assert(sectors[sno].tt =3D=3D NULL);
- vg_assert(sectors[sno].tc_next =3D=3D NULL);
- vg_assert(sectors[sno].tt_n_inuse =3D=3D 0);
- sectors[sno].tc=20
- =3D VG_(get_memory_from_mmap)
- ( 8 * tc_sector_szQ, "sectors[sno].tc" );
- sectors[sno].tt=20
- =3D VG_(get_memory_from_mmap)=20
- ( N_TTES_PER_SECTOR * sizeof(TTEntry), "sectors[sno].tt" )=
;
- if (VG_(clo_verbosity) > 2)
- VG_(message)(Vg_DebugMsg, "TT/TC: initialise sector %d", sno);
- } else {
- /* Sector has been used before. */
- vg_assert(sectors[sno].tt !=3D NULL);
- vg_assert(sectors[sno].tc_next !=3D NULL);
- n_dump_count +=3D sectors[sno].tt_n_inuse;
- for (i =3D 0; i < N_TTES_PER_SECTOR; i++) {
- if (sectors[sno].tt[i].status =3D=3D InUse) {
- n_dump_osize +=3D vge_osize(§ors[sno].tt[i].vge);
- }
- }
- if (VG_(clo_verbosity) > 2)
- VG_(message)(Vg_DebugMsg, "TT/TC: recycle sector %d", sno);
- }
-
- sectors[sno].tc_next =3D sectors[sno].tc;
- sectors[sno].tt_n_inuse =3D 0;
- for (i =3D 0; i < N_TTES_PER_SECTOR; i++)
- sectors[sno].tt[i].status =3D Empty;
-
- invalidateFastCache();
-}
-
-
-/* Add a translation of vge to TT/TC. The translation is temporarily
- in code[0 .. code_len-1].
-
- pre: youngest_sector points to a valid (although possibly full)
- sector.
-*/
-void VG_(add_to_trans_tab)( VexGuestExtents* vge,
- Addr64 entry,
- AddrH code,
- UInt code_len )
-{
- Int tcAvailQ, reqdQ, y, i;
- ULong *tce, *tce2;
- UChar* srcP;
- UChar* dstP;
-
- vg_assert(init_done);
- vg_assert(vge->n_used >=3D 1 && vge->n_used <=3D 3);
- vg_assert(code_len > 0 && code_len < 20000);
-
- if (0)
- VG_(printf)("add_to_trans_tab(entry =3D 0x%llx, len =3D %d)\n",
- entry, code_len);
-
- n_in_count++;
- n_in_tsize +=3D code_len;
- n_in_osize +=3D vge_osize(vge);
-
- y =3D youngest_sector;
- vg_assert(isValidSector(y));
-
- if (sectors[y].tc =3D=3D NULL)
- initialiseSector(y);
-
- /* Try putting the translation in this sector. */
- reqdQ =3D 1 + ((code_len + 7) >> 3);
-
- /* Will it fit in tc? */
- tcAvailQ =3D ((ULong*)(§ors[y].tc[tc_sector_szQ]))
- - ((ULong*)(sectors[y].tc_next));
- vg_assert(tcAvailQ >=3D 0);
- vg_assert(tcAvailQ <=3D tc_sector_szQ);
-
- if (tcAvailQ < reqdQ=20
- || sectors[y].tt_n_inuse >=3D N_TTES_PER_SECTOR_USABLE) {
- /* No. So move on to the next sector. Either it's never been
- used before, in which case it will get its tt/tc allocated
- now, or it has been used before, in which case it is set to be
- empty, hence throwing out the oldest sector. */
- youngest_sector++;
- if (youngest_sector >=3D N_SECTORS)
- youngest_sector =3D 0;
- y =3D youngest_sector;
- initialiseSector(y);
- }
-
- /* Be sure ... */
- tcAvailQ =3D ((ULong*)(§ors[y].tc[tc_sector_szQ]))
- - ((ULong*)(sectors[y].tc_next));
- vg_assert(tcAvailQ >=3D 0);
- vg_assert(tcAvailQ <=3D tc_sector_szQ);
- vg_assert(tcAvailQ >=3D reqdQ);
- vg_assert(sectors[y].tt_n_inuse < N_TTES_PER_SECTOR_USABLE);
- vg_assert(sectors[y].tt_n_inuse >=3D 0);
-=20
- /* Copy into tc. */
- tce =3D sectors[y].tc_next;
- vg_assert(tce >=3D §ors[y].tc[0]);
- vg_assert(tce <=3D §ors[y].tc[tc_sector_szQ]);
-
- tce[0] =3D entry;
- dstP =3D (UChar*)(&tce[1]);
- srcP =3D (UChar*)code;
- for (i =3D 0; i < code_len; i++)
- dstP[i] =3D srcP[i];
- sectors[y].tc_next +=3D reqdQ;
- sectors[y].tt_n_inuse++;
-
- /* more paranoia */
- tce2 =3D sectors[y].tc_next;
- vg_assert(tce2 >=3D §ors[y].tc[0]);
- vg_assert(tce2 <=3D §ors[y].tc[tc_sector_szQ]);
-
- /* Find an empty tt slot, and use it. There must be such a slot
- since tt is never allowed to get completely full. */
- i =3D HASH_TT(entry);
- vg_assert(i >=3D 0 && i < N_TTES_PER_SECTOR);
- while (True) {
- if (sectors[y].tt[i].status =3D=3D Empty
- || sectors[y].tt[i].status =3D=3D Deleted)
- break;
- i++;
- if (i >=3D N_TTES_PER_SECTOR)
- i =3D 0;
- }
-
- sectors[y].tt[i].status =3D InUse;
- sectors[y].tt[i].tce =3D tce;
- sectors[y].tt[i].count =3D 0;
- sectors[y].tt[i].weight =3D 1;
- sectors[y].tt[i].vge =3D *vge;
- sectors[y].tt[i].entry =3D entry;
-
- setFastCacheEntry( entry, tce, §ors[y].tt[i].count );
-}
-
-
-/* Search for the translation of the given guest address. If
- requested, a successful search can also cause the fast-caches to be
- updated. =20
-*/
-Bool VG_(search_transtab) ( /*OUT*/AddrH* result,
- Addr64 guest_addr,=20
- Bool upd_cache )
-{
- Int i, j, k, kstart, sno;
-
- vg_assert(init_done);
- /* Find the initial probe point just once. It will be the same in
- all sectors and avoids multiple expensive % operations. */
- n_full_lookups++;
- k =3D -1;
- kstart =3D HASH_TT(guest_addr);
- vg_assert(kstart >=3D 0 && kstart < N_TTES_PER_SECTOR);
-
- /* Search in all the sectors. Although the order should not matter,
- it might be most efficient to search in the order youngest to
- oldest. */
- sno =3D youngest_sector;
- for (i =3D 0; i < N_SECTORS; i++) {
-
- if (sectors[sno].tc =3D=3D NULL)
- goto notfound; /* sector not in use. */
-
- k =3D kstart;
- for (j =3D 0; j < N_TTES_PER_SECTOR; j++) {
- n_lookup_probes++;
- if (sectors[sno].tt[k].status =3D=3D InUse
- && sectors[sno].tt[k].entry =3D=3D guest_addr) {
- /* found it */
- if (upd_cache)
- setFastCacheEntry(=20
- guest_addr, sectors[sno].tt[k].tce,=20
- §ors[sno].tt[k].count );
- if (result)
- *result =3D sizeof(Addr64) + (AddrH)sectors[sno].tt[k].tc=
e;
- return True;
- }
- if (sectors[sno].tt[k].status =3D=3D Empty)
- break; /* not found in this sector */
- k++;
- if (k =3D=3D N_TTES_PER_SECTOR)
- k =3D 0;
- }
-
- /* If we fall off the end, all entries are InUse and not
- matching, or Deleted. In any case we did not find it in this
- sector. */
-
- notfound:
- /* move to the next oldest sector */
- sno =3D sno=3D=3D0 ? (N_SECTORS-1) : (sno-1);
- }
-
- /* Not found in any sector. */
- return False;
-}
-
-
-/* Delete all translations which intersect with any part of the
- specified guest address range. Note, this is SLOW.=20
-*/
-
-static inline
-Bool overlap1 ( Addr64 s1, UInt r1, Addr64 s2, UInt r2 )
-{
- Addr64 e1 =3D s1 + (ULong)r1 - 1ULL;
- Addr64 e2 =3D s2 + (ULong)r1 - 1ULL;
- if (e1 < s2 || e2 < s1)=20
- return False;
- return True;
-}
-
-static inline
-Bool overlaps ( Addr64 start, UInt range, VexGuestExtents* vge )
-{
- if (overlap1(start, range, vge->base[0], (UInt)vge->len[0]))
- return True;
- if (vge->n_used < 2)
- return False;
- if (overlap1(start, range, vge->base[1], (UInt)vge->len[1]))
- return True;
- if (vge->n_used < 3)
- return False;
- if (overlap1(start, range, vge->base[2], (UInt)vge->len[2]))
- return True;
- return False;
-}
-
-
-void VG_(discard_translations) ( Addr64 guest_start, UInt range )
-{
- Int sno, i;
- Bool anyDeleted =3D False;
-
- vg_assert(init_done);
-
- for (sno =3D 0; sno < N_SECTORS; sno++) {
- if (sectors[sno].tc =3D=3D NULL)
- continue;
- for (i =3D 0; i < N_TTES_PER_SECTOR; i++) {
- if (sectors[sno].tt[i].status =3D=3D InUse
- && overlaps( guest_start, range, §ors[sno].tt[i].vge ))=
{
- sectors[sno].tt[i].status =3D Deleted;
- sectors[sno].tt_n_inuse--;
- anyDeleted =3D True;
- n_disc_count++;
- n_disc_osize +=3D vge_osize(§ors[sno].tt[i].vge);
- }
- } =20
- }
-
- if (anyDeleted)
- invalidateFastCache();
-}
-
-
-/*------------------------------------------------------------*/
-/*--- Sanity checking ---*/
-/*------------------------------------------------------------*/
-
-void VG_(sanity_check_tt_tc) ( Char* who )
-{
-}
-
-
-/*------------------------------------------------------------*/
-/*--- Initialisation. ---*/
-/*------------------------------------------------------------*/
-
-void VG_(init_tt_tc) ( void )
-{
- Int i, avg_codeszQ;
-
- vg_assert(!init_done);
- init_done =3D True;
-
- /* Otherwise lots of things go wrong... */
- vg_assert(sizeof(ULong) =3D=3D 8);
- vg_assert(sizeof(Addr64) =3D=3D 8);
-
- if (VG_(clo_verbosity) > 2)
- VG_(message)(Vg_DebugMsg,=20
- "TT/TC: VG_(init_tt_tc) "
- "(startup of code management)");
-
- /* Figure out how big each tc area should be. */
- avg_codeszQ =3D (VG_(details).avg_translation_sizeB + 7) / 8;
- tc_sector_szQ =3D N_TTES_PER_SECTOR_USABLE * (1 + avg_codeszQ);
-
- /* Ensure the calculated value is not way crazy. */
- vg_assert(tc_sector_szQ >=3D 2 * N_TTES_PER_SECTOR_USABLE);
- vg_assert(tc_sector_szQ <=3D 50 * N_TTES_PER_SECTOR_USABLE);
-
- /* Initialise the sectors */
- youngest_sector =3D 0;
- for (i =3D 0; i < N_SECTORS; i++) {
- sectors[i].tc =3D NULL;
- sectors[i].tt =3D NULL;
- sectors[i].tc_next =3D NULL;
- sectors[i].tt_n_inuse =3D 0;
- }
-
- /* and the fast caches. */
- invalidateFastCache();
-
- if (VG_(clo_verbosity) > 2) {
- VG_(message)(Vg_DebugMsg,
- "TT/TC: cache: %d sectors of %d bytes each =3D %d total",=20
- N_SECTORS, 8 * tc_sector_szQ,
- N_SECTORS * 8 * tc_sector_szQ );
- VG_(message)(Vg_DebugMsg,
- "TT/TC: table: %d total entries, max occupancy %d (%d%%)",
- N_SECTORS * N_TTES_PER_SECTOR,
- N_SECTORS * N_TTES_PER_SECTOR_USABLE,=20
- SECTOR_TT_LIMIT_PERCENT );
- }
-}
-
-
-/*------------------------------------------------------------*/
-/*--- Printing out statistics. ---*/
-/*------------------------------------------------------------*/
-
-static ULong safe_idiv( ULong a, ULong b )
-{
- return (b =3D=3D 0 ? 0 : a / b);
-}
-
-UInt VG_(get_bbs_translated) ( void )
-{
- return n_in_count;
-}
-
-void VG_(print_tt_tc_stats) ( void )
-{
- VG_(message)(Vg_DebugMsg,
- " tt/tc: %llu tt lookups requiring %llu probes",=20
- n_full_lookups, n_lookup_probes );
- VG_(message)(Vg_DebugMsg,
- " tt/tc: %llu fast-cache updates, %llu flushes",=20
- n_fast_updates, n_fast_flushes );
-
- VG_(message)(Vg_DebugMsg,
- "translate: new %lld (%lld -> %lld; ratio %lld:10=
)",
- n_in_count, n_in_osize, n_in_tsize,
- safe_idiv(10*n_in_tsize, n_in_osize));
- VG_(message)(Vg_DebugMsg,
- "translate: dumped %lld (%lld -> ?" "?)",
- n_dump_count, n_dump_osize );
- VG_(message)(Vg_DebugMsg,
- "translate: discarded %lld (%lld -> ?" "?)",
- n_disc_count, n_disc_osize );
-}
-
-/*------------------------------------------------------------*/
-/*--- Printing out of profiling results. ---*/
-/*------------------------------------------------------------*/
-
-/* Only the top N_MAX bbs will be displayed. */
-#define N_MAX 200
-
-static TTEntry* tops[N_MAX];
-
-static ULong score ( TTEntry* tte )
-{
- return ((ULong)tte->weight) * ((ULong)tte->count);
-}
-
-static Bool heavier ( TTEntry* t1, TTEntry* t2 )
-{
- return score(t1) > score(t2);
-}
-
-/* Print n/m in form xx.yy% */
-static
-void percentify ( ULong n, ULong m, Int field_width, Char* buf)
-{
- Int i, len, space;
- ULong lo, hi;
- if (m =3D=3D 0) m =3D 1; /* stay sane */
- hi =3D (n * 100) / m;
- lo =3D (((n * 100) - hi * m) * 100) / m;
- vg_assert(lo < 100);
- if (lo < 10)
- VG_(sprintf)(buf, "%lld.0%lld%%", hi, lo);
- else
- VG_(sprintf)(buf, "%lld.%lld%%", hi, lo);
-
- len =3D VG_(strlen)(buf);
- space =3D field_width - len;
- if (space < 0) space =3D 0; /* Allow for v. small field_width */
- i =3D len;
-
- /* Right justify in field */
- for ( ; i >=3D 0; i--) buf[i + space] =3D buf[i];
- for (i =3D 0; i < space; i++) buf[i] =3D ' ';
-}
-
-
-void VG_(show_BB_profile) ( void )
-{
- Char name[64];
- Int sno, i, r, s;
- ULong score_total, score_cumul, score_here;
- Char buf_cumul[10];
- Char buf_here[10];
-
- /* First, compute the total weighted count, and find the top N
- ttes. tops contains pointers to the most-used N_MAX blocks, in
- descending order (viz, tops[0] is the highest scorer). */
- for (i =3D 0; i < N_MAX; i++)
- tops[i] =3D NULL;
-
- score_total =3D 0;
-
- for (sno =...
[truncated message content] |
|
From: <sv...@va...> - 2005-05-13 23:32:46
|
Author: sewardj
Date: 2005-05-14 00:32:43 +0100 (Sat, 14 May 2005)
New Revision: 3702
Modified:
trunk/cachegrind/cg_main.c
Log:
Don't crash when dealing with dealing with naughty programs that set
argv[] elements to NULL. Bad bad GHC ...
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-05-13 23:14:40 UTC (rev 3701)
+++ trunk/cachegrind/cg_main.c 2005-05-13 23:32:43 UTC (rev 3702)
@@ -835,6 +835,8 @@
VG_(strcpy)(buf, "cmd:");
VG_(write)(fd, (void*)buf, VG_(strlen)(buf));
for (i =3D 0; i < VG_(client_argc); i++) {
+ if (VG_(client_argv)[i] =3D=3D NULL)
+ continue;
VG_(write)(fd, " ", 1);
VG_(write)(fd, VG_(client_argv)[i], VG_(strlen)(VG_(client_argv)[=
i]));
}
|
|
From: <sv...@va...> - 2005-05-13 23:14:42
|
Author: njn Date: 2005-05-14 00:14:40 +0100 (Sat, 14 May 2005) New Revision: 3701 Modified: trunk/coregrind/Makefile.am Log: Forgot to add pub_core_translate.h to the Makefile.am. Modified: trunk/coregrind/Makefile.am =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/Makefile.am 2005-05-13 23:11:40 UTC (rev 3700) +++ trunk/coregrind/Makefile.am 2005-05-13 23:14:40 UTC (rev 3701) @@ -52,6 +52,7 @@ pub_core_stacktrace.h \ pub_core_syscalls.h \ pub_core_tooliface.h \ + pub_core_translate.h \ ume.h \ vg_symtab2.h \ vg_symtypes.h |
|
From: <sv...@va...> - 2005-05-13 23:11:44
|
Author: njn
Date: 2005-05-14 00:11:40 +0100 (Sat, 14 May 2005)
New Revision: 3700
Added:
trunk/coregrind/m_translate.c
trunk/coregrind/pub_core_translate.h
Removed:
trunk/coregrind/vg_translate.c
Modified:
trunk/coregrind/Makefile.am
trunk/coregrind/core.h
trunk/coregrind/m_errormgr.c
trunk/coregrind/vg_scheduler.c
trunk/coregrind/vg_transtab.c
Log:
Modularised vg_translate.c as m_translate.
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-05-13 22:18:47 UTC (rev 3699)
+++ trunk/coregrind/Makefile.am 2005-05-13 23:11:40 UTC (rev 3700)
@@ -78,6 +78,7 @@
m_skiplist.c \
m_stacktrace.c \
m_tooliface.c \
+ m_translate.c \
ume.c \
\
vg_scheduler.c \
@@ -94,7 +95,6 @@
vg_dwarf.c \
vg_stabs.c \
vg_symtypes.c \
- vg_translate.c \
vg_transtab.c
=20
## libplatform.a must be before libarch.a and libos.a, it seems.
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-05-13 22:18:47 UTC (rev 3699)
+++ trunk/coregrind/core.h 2005-05-13 23:11:40 UTC (rev 3700)
@@ -634,16 +634,6 @@
extern void VG_(nanosleep)(struct vki_timespec *);
=20
/* ---------------------------------------------------------------------
- Exports of vg_translate.c
- ------------------------------------------------------------------ */
-
-extern=20
-Bool VG_(translate) ( ThreadId tid,=20
- Addr64 orig_addr,
- Bool debugging_translation,
- Int debugging_verbosity );
-
-/* ---------------------------------------------------------------------
Exports of vg_symtab2.c
------------------------------------------------------------------ */
=20
Modified: trunk/coregrind/m_errormgr.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_errormgr.c 2005-05-13 22:18:47 UTC (rev 3699)
+++ trunk/coregrind/m_errormgr.c 2005-05-13 23:11:40 UTC (rev 3700)
@@ -33,6 +33,7 @@
#include "pub_core_execontext.h"
#include "pub_core_stacktrace.h"
#include "pub_core_tooliface.h"
+#include "pub_core_translate.h"
=20
/*------------------------------------------------------------*/
/*--- Globals ---*/
Copied: trunk/coregrind/m_translate.c (from rev 3691, trunk/coregrind/vg_=
translate.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/vg_translate.c 2005-05-13 16:54:09 UTC (rev 3691)
+++ trunk/coregrind/m_translate.c 2005-05-13 23:11:40 UTC (rev 3700)
@@ -0,0 +1,513 @@
+
+/*--------------------------------------------------------------------*/
+/*--- The JITter proper: register allocation & code improvement ---*/
+/*--- m_translate.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_aspacemgr.h"
+#include "pub_core_tooliface.h"
+
+
+/*------------------------------------------------------------*/
+/*--- %SP-update pass ---*/
+/*------------------------------------------------------------*/
+
+/* NOTE: this comment is out of date */
+
+/* For tools that want to know about %ESP changes, this pass adds
+ in the appropriate hooks. We have to do it after the tool's
+ instrumentation, so the tool doesn't have to worry about the CCALLs
+ it adds in, and we must do it before register allocation because
+ spilled temps make it much harder to work out the %esp deltas.
+ Thus we have it as an extra phase between the two.=20
+ =20
+ We look for "GETL %ESP, t_ESP", then track ADDs and SUBs of
+ literal values to t_ESP, and the total delta of the ADDs/SUBs. Then =
if
+ "PUTL t_ESP, %ESP" happens, we call the helper with the known delta. =
We
+ also cope with "MOVL t_ESP, tX", making tX the new t_ESP. If any oth=
er
+ instruction clobbers t_ESP, we don't track it anymore, and fall back =
to
+ the delta-is-unknown case. That case is also used when the delta is =
not
+ a nice small amount, or an unknown amount.
+*/
+
+static
+IRBB* vg_SP_update_pass ( IRBB* bb_in, VexGuestLayout* layout,=20
+ IRType gWordTy, IRType hWordTy )
+{
+ Int i, j, minoff_ST, maxoff_ST, sizeof_SP, offset_SP;
+ IRDirty *dcall, *d;
+ IRStmt* st;
+ IRExpr* e;
+ IRArray* descr;
+ IRTemp curr;
+ IRType typeof_SP;
+ Long delta;
+
+ /* Set up BB */
+ IRBB* bb =3D emptyIRBB();
+ bb->tyenv =3D dopyIRTypeEnv(bb_in->tyenv);
+ bb->next =3D dopyIRExpr(bb_in->next);
+ bb->jumpkind =3D bb_in->jumpkind;
+
+ curr =3D IRTemp_INVALID;
+ delta =3D 0;
+
+ sizeof_SP =3D layout->sizeof_SP;
+ offset_SP =3D layout->offset_SP;
+ typeof_SP =3D sizeof_SP=3D=3D4 ? Ity_I32 : Ity_I64;
+ vg_assert(sizeof_SP =3D=3D 4 || sizeof_SP =3D=3D 8);
+
+# define IS_ADD(op) (sizeof_SP=3D=3D4 ? ((op)=3D=3DIop_Add32) : ((op)=3D=
=3DIop_Add64))
+# define IS_SUB(op) (sizeof_SP=3D=3D4 ? ((op)=3D=3DIop_Sub32) : ((op)=3D=
=3DIop_Sub64))
+
+# define IS_ADD_OR_SUB(op) (IS_ADD(op) || IS_SUB(op))
+
+# define GET_CONST(con) =
\
+ (sizeof_SP=3D=3D4 ? (Long)(Int)(con->Ico.U32) =
\
+ : (Long)(con->Ico.U64))
+
+# define DO(kind, syze) =
\
+ do { =
\
+ if (!VG_(tdict).track_##kind##_mem_stack_##syze) \
+ goto generic; =
\
+ =
\
+ /* I don't know if it's really necessary to say that the */ =
\
+ /* call reads the stack pointer. But anyway, we do. */ =
\
+ dcall =3D unsafeIRDirty_0_N( =
\
+ 1/*regparms*/, =
\
+ "track_" #kind "_mem_stack_" #syze, =
\
+ VG_(tdict).track_##kind##_mem_stack_##syze, =
\
+ mkIRExprVec_1(IRExpr_Tmp(curr)) =
\
+ ); =
\
+ dcall->nFxState =3D 1; =
\
+ dcall->fxState[0].fx =3D Ifx_Read; =
\
+ dcall->fxState[0].offset =3D layout->offset_SP; =
\
+ dcall->fxState[0].size =3D layout->sizeof_SP; =
\
+ =
\
+ addStmtToIRBB( bb, IRStmt_Dirty(dcall) ); =
\
+ } while (0)
+
+ for (i =3D 0; i < bb_in->stmts_used; i++) {
+
+ st =3D bb_in->stmts[i];
+ if (!st)
+ continue;
+
+ /* t =3D Get(sp): curr =3D t, delta =3D 0 */
+ if (st->tag !=3D Ist_Tmp) goto case2;
+ e =3D st->Ist.Tmp.data;
+ if (e->tag !=3D Iex_Get) goto case2;
+ if (e->Iex.Get.offset !=3D offset_SP) goto case2;
+ if (e->Iex.Get.ty !=3D typeof_SP) goto case2;
+ curr =3D st->Ist.Tmp.tmp;
+ delta =3D 0;
+ addStmtToIRBB( bb, st );
+ continue;
+
+ case2:
+ /* t' =3D curr +/- const: curr =3D t', delta +=3D/-=3D const */
+ if (st->tag !=3D Ist_Tmp) goto case3;
+ e =3D st->Ist.Tmp.data;
+ if (e->tag !=3D Iex_Binop) goto case3;
+ if (e->Iex.Binop.arg1->tag !=3D Iex_Tmp) goto case3;
+ if (e->Iex.Binop.arg1->Iex.Tmp.tmp !=3D curr) goto case3;
+ if (e->Iex.Binop.arg2->tag !=3D Iex_Const) goto case3;
+ if (!IS_ADD_OR_SUB(e->Iex.Binop.op)) goto case3;
+ curr =3D st->Ist.Tmp.tmp;
+ if (IS_ADD(e->Iex.Binop.op))
+ delta +=3D GET_CONST(e->Iex.Binop.arg2->Iex.Const.con);
+ else
+ delta -=3D GET_CONST(e->Iex.Binop.arg2->Iex.Const.con);
+ addStmtToIRBB( bb, st );
+ continue;
+
+ case3:
+ /* t' =3D curr: curr =3D t' */
+ if (st->tag !=3D Ist_Tmp) goto case4;
+ e =3D st->Ist.Tmp.data;
+ if (e->tag !=3D Iex_Tmp) goto case4;
+ if (e->Iex.Tmp.tmp !=3D curr) goto case4;
+ curr =3D st->Ist.Tmp.tmp;
+ addStmtToIRBB( bb, st );
+ continue;
+
+ case4:
+ /* Put(sp) =3D curr */
+ if (st->tag !=3D Ist_Put) goto case5;
+ if (st->Ist.Put.offset !=3D offset_SP) goto case5;
+ if (st->Ist.Put.data->tag !=3D Iex_Tmp) goto case5;
+ if (st->Ist.Put.data->Iex.Tmp.tmp =3D=3D curr) {
+ switch (delta) {
+ case 0: addStmtToIRBB(bb,st); delta =3D 0; co=
ntinue;
+ case 4: DO(die, 4); addStmtToIRBB(bb,st); delta =3D 0; co=
ntinue;
+ case -4: DO(new, 4); addStmtToIRBB(bb,st); delta =3D 0; co=
ntinue;
+ case 8: DO(die, 8); addStmtToIRBB(bb,st); delta =3D 0; co=
ntinue;
+ case -8: DO(new, 8); addStmtToIRBB(bb,st); delta =3D 0; co=
ntinue;
+ case 12: DO(die, 12); addStmtToIRBB(bb,st); delta =3D 0; co=
ntinue;
+ case -12: DO(new, 12); addStmtToIRBB(bb,st); delta =3D 0; co=
ntinue;
+ case 16: DO(die, 16); addStmtToIRBB(bb,st); delta =3D 0; co=
ntinue;
+ case -16: DO(new, 16); addStmtToIRBB(bb,st); delta =3D 0; co=
ntinue;
+ case 32: DO(die, 32); addStmtToIRBB(bb,st); delta =3D 0; co=
ntinue;
+ case -32: DO(new, 32); addStmtToIRBB(bb,st); delta =3D 0; co=
ntinue;
+ default: goto generic;
+ }
+ } else {
+ IRTemp old_SP;
+ generic:
+ /* Pass both the old and new SP values to this helper. */
+ old_SP =3D newIRTemp(bb->tyenv, typeof_SP);
+ addStmtToIRBB(=20
+ bb,
+ IRStmt_Tmp( old_SP, IRExpr_Get(offset_SP, typeof_SP) )=20
+ );
+
+ dcall =3D unsafeIRDirty_0_N(=20
+ 2/*regparms*/,=20
+ "VG_(unknown_SP_update)", &VG_(unknown_SP_update),
+ mkIRExprVec_2( IRExpr_Tmp(old_SP), st->Ist.Put.data =
)=20
+ );
+ addStmtToIRBB( bb, IRStmt_Dirty(dcall) );
+
+ addStmtToIRBB( bb, st );
+
+ curr =3D st->Ist.Put.data->Iex.Tmp.tmp;
+ delta =3D 0;
+ continue;
+ }
+
+ case5:
+ /* PutI or Dirty call which overlaps SP: complain. We can't
+ deal with SP changing in weird ways (well, we can, but not at
+ this time of night). */
+ if (st->tag =3D=3D Ist_PutI) {
+ descr =3D st->Ist.PutI.descr;
+ minoff_ST =3D descr->base;
+ maxoff_ST =3D descr->base + descr->nElems * sizeofIRType(descr-=
>elemTy) - 1;
+ if (!(offset_SP > maxoff_ST || (offset_SP + sizeof_SP - 1) < mi=
noff_ST))
+ goto complain;
+ }
+ if (st->tag =3D=3D Ist_Dirty) {
+ d =3D st->Ist.Dirty.details;
+ for (j =3D 0; j < d->nFxState; j++) {
+ minoff_ST =3D d->fxState[j].offset;
+ maxoff_ST =3D d->fxState[j].offset + d->fxState[j].size - 1;
+ if (d->fxState[j].fx =3D=3D Ifx_Read || d->fxState[j].fx =3D=
=3D Ifx_None)
+ continue;
+ if (!(offset_SP > maxoff_ST || (offset_SP + sizeof_SP - 1) <=
minoff_ST))
+ goto complain;
+ }
+ }
+
+ /* well, not interesting. Just copy and keep going. */
+ addStmtToIRBB( bb, st );
+
+ } /* for (i =3D 0; i < bb_in->stmts_used; i++) */
+
+ return bb;
+
+ complain:
+ VG_(core_panic)("vg_SP_update_pass: PutI or Dirty which overlaps SP")=
;
+
+}
+
+
+
+#if 0
+ for (i =3D 0; i < bb_in->stmts_used; i++) {
+ st =3D bb_in->stmts[i];
+ if (!st)
+ continue;
+ if (st->tag !=3D Ist_Put)=20
+ goto boring;
+ offP =3D st->Ist.Put.offset;
+ if (offP !=3D layout->offset_SP)=20
+ goto boring;
+ szP =3D sizeofIRType(typeOfIRExpr(bb_in->tyenv, st->Ist.Put.data))=
;
+ if (szP !=3D layout->sizeof_SP)
+ goto boring;
+ vg_assert(isAtom(st->Ist.Put.data));
+
+ /* I don't know if it's really necessary to say that the call read=
s
+ the stack pointer. But anyway, we do. */ =20
+ dcall =3D unsafeIRDirty_0_N(=20
+ mkIRCallee(1, "VG_(unknown_esp_update)",=20
+ (HWord)&VG_(unknown_esp_update)),
+ mkIRExprVec_1(st->Ist.Put.data)=20
+ );
+ dcall->nFxState =3D 1;
+ dcall->fxState[0].fx =3D Ifx_Read;
+ dcall->fxState[0].offset =3D layout->offset_SP;
+ dcall->fxState[0].size =3D layout->sizeof_SP;
+
+ addStmtToIRBB( bb, IRStmt_Dirty(dcall) );
+
+ boring:
+ addStmtToIRBB( bb, st );
+ }
+#endif
+
+
+/*------------------------------------------------------------*/
+/*--- Main entry point for the JITter. ---*/
+/*------------------------------------------------------------*/
+
+/* Vex dumps the final code in here. Then we can copy it off
+ wherever we like. */
+#define N_TMPBUF 20000
+static UChar tmpbuf[N_TMPBUF];
+
+/* Function pointers we must supply to LibVEX in order that it
+ can bomb out and emit messages under Valgrind's control. */
+__attribute__ ((noreturn))
+static
+void failure_exit ( void )
+{
+ LibVEX_ShowAllocStats();
+ VG_(core_panic)("LibVEX called failure_exit().");
+}
+
+static
+void log_bytes ( HChar* bytes, Int nbytes )
+{
+ Int i;
+ for (i =3D 0; i < nbytes-3; i +=3D 4)
+ VG_(printf)("%c%c%c%c", bytes[i], bytes[i+1], bytes[i+2], bytes[i+3=
]);
+ for (; i < nbytes; i++)=20
+ VG_(printf)("%c", bytes[i]);
+}
+
+/* Translate the basic block beginning at orig_addr, and add it to
+ the translation cache & translation table. Unless 'debugging' is tru=
e,
+ in which case the call is being done for debugging purposes, so
+ (a) throw away the translation once it is made, and (b) produce a
+ load of debugging output.=20
+
+ 'tid' is the identity of the thread needing this block.
+*/
+
+/* This stops Vex from chasing into function entry points that we wish
+ to redirect. Chasing across them obviously defeats the redirect
+ mechanism, with bad effects for Memcheck, Addrcheck, and possibly
+ others. */
+static Bool chase_into_ok ( Addr64 addr64 )
+{
+ Addr addr =3D (Addr)addr64;
+ if (addr !=3D VG_(code_redirect)(addr)) {
+ if (0) VG_(printf)("not chasing into 0x%x\n", addr);
+ return False;
+ } else {
+ return True; /* ok to chase into 'addr' */
+ }
+}
+
+static Bool need_to_handle_SP_assignment(void)
+{
+ return ( VG_(tdict).track_new_mem_stack_4 ||
+ VG_(tdict).track_die_mem_stack_4 ||
+ VG_(tdict).track_new_mem_stack_8 ||
+ VG_(tdict).track_die_mem_stack_8 ||
+ VG_(tdict).track_new_mem_stack_12 ||
+ VG_(tdict).track_die_mem_stack_12 ||
+ VG_(tdict).track_new_mem_stack_16 ||
+ VG_(tdict).track_die_mem_stack_16 ||
+ VG_(tdict).track_new_mem_stack_32 ||
+ VG_(tdict).track_die_mem_stack_32 ||
+ VG_(tdict).track_new_mem_stack ||
+ VG_(tdict).track_die_mem_stack );
+}
+
+Bool VG_(translate) ( ThreadId tid,=20
+ Addr64 orig_addr,
+ Bool debugging_translation,
+ Int debugging_verbosity )
+{
+ Addr64 redir, orig_addr0 =3D orig_addr;
+ Int tmpbuf_used, verbosity;
+ Bool notrace_until_done;
+ UInt notrace_until_limit =3D 0;
+ Segment* seg;
+ VexGuestExtents vge;
+
+ /* Indicates what arch and subarch we are running on. */
+ static VexArch vex_arch =3D VexArch_INVALID;
+ static VexSubArch vex_subarch =3D VexSubArch_INVALID;
+
+ /* Make sure Vex is initialised right. */
+ VexTranslateResult tres;
+ static Bool vex_init_done =3D False;
+
+ if (!vex_init_done) {
+ Bool ok =3D VGA_(getArchAndSubArch)( &vex_arch, &vex_subarch );
+ if (!ok) {
+ VG_(printf)("\n");
+ VG_(printf)("valgrind: fatal error: unsupported CPU.\n");
+ VG_(printf)(" Supported CPUs are:\n");
+ VG_(printf)(" * x86 with SSE state (Pentium II or above, "
+ "AMD Athlon or above)\n");
+ VG_(printf)("\n");
+ VG_(exit)(1);
+ }
+ if (VG_(clo_verbosity) > 2) {
+ VG_(message)(Vg_DebugMsg,=20
+ "Host CPU: arch =3D %s, subarch =3D %s",
+ LibVEX_ppVexArch ( vex_arch ),
+ LibVEX_ppVexSubArch( vex_subarch ) );
+ }
+
+ LibVEX_Init ( &failure_exit, &log_bytes,=20
+ 1, /* debug_paranoia */=20
+ False, /* valgrind support */
+ &VG_(clo_vex_control) );
+ vex_init_done =3D True;
+ }
+
+ /* profiling ... */
+ VGP_PUSHCC(VgpTranslate);
+
+ /* Look in the code redirect table to see if we should
+ translate an alternative address for orig_addr. */
+ redir =3D VG_(code_redirect)(orig_addr);
+
+ if (redir !=3D orig_addr && VG_(clo_verbosity) >=3D 2) {
+ Bool ok;
+ Char name1[64] =3D "";
+ Char name2[64] =3D "";
+ name1[0] =3D name2[0] =3D 0;
+ ok =3D VG_(get_fnname_w_offset)(orig_addr, name1, 64);
+ if (!ok) VG_(strcpy)(name1, "???");
+ ok =3D VG_(get_fnname_w_offset)(redir, name2, 64);
+ if (!ok) VG_(strcpy)(name2, "???");
+ VG_(message)(Vg_DebugMsg,=20
+ "TRANSLATE: 0x%llx (%s) redirected to 0x%llx (%s)",
+ orig_addr, name1,
+ redir, name2 );
+ }
+ orig_addr =3D redir;
+
+ /* If codegen tracing, don't start tracing until
+ notrace_until_limit blocks have gone by. This avoids printing
+ huge amounts of useless junk when all we want to see is the last
+ few blocks translated prior to a failure. Set
+ notrace_until_limit to be the number of translations to be made
+ before --trace-codegen=3D style printing takes effect. */
+ notrace_until_done
+ =3D VG_(get_bbs_translated)() >=3D notrace_until_limit;
+
+ seg =3D VG_(find_segment)(orig_addr);
+
+ if (!debugging_translation)
+ VG_TRACK( pre_mem_read, Vg_CoreTranslate, tid, "", orig_addr, 1 );
+
+ /* If doing any code printing, print a basic block start marker */
+ if (VG_(clo_trace_flags) || debugging_translation) {
+ Char fnname[64] =3D "";
+ VG_(get_fnname_w_offset)(orig_addr, fnname, 64);
+ VG_(printf)(
+ "=3D=3D=3D=3D BB %d %s(0x%llx) approx BBs exec'd %lld =3D=3D=
=3D=3D\n",
+ VG_(get_bbs_translated)(), fnname, orig_addr,=20
+ VG_(bbs_done));
+ }
+
+ if (seg =3D=3D NULL ||
+ !VG_(seg_contains)(seg, orig_addr, 1) ||=20
+ (seg->prot & (VKI_PROT_READ|VKI_PROT_EXEC)) =3D=3D 0) {
+ /* Code address is bad - deliver a signal instead */
+ vg_assert(!VG_(is_addressable)(orig_addr, 1,=20
+ VKI_PROT_READ|VKI_PROT_EXEC));
+
+ if (seg !=3D NULL && VG_(seg_contains)(seg, orig_addr, 1)) {
+ vg_assert((seg->prot & VKI_PROT_EXEC) =3D=3D 0);
+ VG_(synth_fault_perms)(tid, orig_addr);
+ } else
+ VG_(synth_fault_mapping)(tid, orig_addr);
+
+ return False;
+ } else
+ seg->flags |=3D SF_CODE; /* contains cached code */
+
+ /* True if a debug trans., or if bit N set in VG_(clo_trace_codegen).=
*/
+ verbosity =3D 0;
+ if (debugging_translation) {
+ verbosity =3D debugging_verbosity;
+ }
+ else
+ if ( (VG_(clo_trace_flags) > 0
+ && VG_(get_bbs_translated)() >=3D VG_(clo_trace_notbelow) )) {
+ verbosity =3D VG_(clo_trace_flags);
+ }
+
+ /* Actually do the translation. */
+ tl_assert2(VG_(tdict).tool_instrument,
+ "you forgot to set VgToolInterface function 'tool_instrume=
nt'");
+ tres =3D LibVEX_Translate (=20
+ vex_arch, vex_subarch,
+ vex_arch, vex_subarch,
+ (UChar*)ULong_to_Ptr(orig_addr),=20
+ (Addr64)orig_addr,=20
+ chase_into_ok,
+ &vge,
+ tmpbuf, N_TMPBUF, &tmpbuf_used,
+ VG_(tdict).tool_instrument,
+ need_to_handle_SP_assignment()
+ ? vg_SP_update_pass
+ : NULL,
+ True, /* cleanup after instrumentation */
+ NULL,
+ verbosity
+ );
+
+ vg_assert(tres =3D=3D VexTransOK);
+ vg_assert(tmpbuf_used <=3D N_TMPBUF);
+ vg_assert(tmpbuf_used > 0);
+
+#undef DECIDE_IF_PRINTING_CODEGEN
+
+ /* Copy data at trans_addr into the translation cache. */
+ vg_assert(tmpbuf_used > 0 && tmpbuf_used < 65536);
+
+ // If debugging, don't do anything with the translated block; we
+ // only did this for the debugging output produced along the way.
+ if (!debugging_translation) {
+ // Note that we use orig_addr0, not orig_addr, which might have be=
en
+ // changed by the redirection
+ VG_(add_to_trans_tab)( &vge,
+ orig_addr0,
+ (Addr)(&tmpbuf[0]),=20
+ tmpbuf_used );
+ }
+
+ VGP_POPCC(VgpTranslate);
+
+ return True;
+}
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
+
Added: trunk/coregrind/pub_core_translate.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_translate.h 2005-05-13 22:18:47 UTC (rev 369=
9)
+++ trunk/coregrind/pub_core_translate.h 2005-05-13 23:11:40 UTC (rev 370=
0)
@@ -0,0 +1,49 @@
+
+/*--------------------------------------------------------------------*/
+/*--- The JITter wrapper. pub_core_translate.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_TRANSLATE_H
+#define __PUB_CORE_TRANSLATE_H
+
+//--------------------------------------------------------------------
+// PURPOSE: This module is Valgrind's interface to the JITter. It's
+// basically a wrapper around Vex.
+//--------------------------------------------------------------------
+
+extern=20
+Bool VG_(translate) ( ThreadId tid,=20
+ Addr64 orig_addr,
+ Bool debugging_translation,
+ Int debugging_verbosity );
+
+#endif // __PUB_CORE_TRANSLATE_H
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/vg_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/vg_scheduler.c 2005-05-13 22:18:47 UTC (rev 3699)
+++ trunk/coregrind/vg_scheduler.c 2005-05-13 23:11:40 UTC (rev 3700)
@@ -66,6 +66,7 @@
#include "pub_core_stacktrace.h"
#include "pub_core_syscalls.h"
#include "pub_core_tooliface.h"
+#include "pub_core_translate.h"
#include "vki_unistd.h"
=20
/* ---------------------------------------------------------------------
Deleted: trunk/coregrind/vg_translate.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/vg_translate.c 2005-05-13 22:18:47 UTC (rev 3699)
+++ trunk/coregrind/vg_translate.c 2005-05-13 23:11:40 UTC (rev 3700)
@@ -1,513 +0,0 @@
-
-/*--------------------------------------------------------------------*/
-/*--- The JITter proper: register allocation & code improvement ---*/
-/*--- vg_translate.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_aspacemgr.h"
-#include "pub_core_tooliface.h"
-
-
-/*------------------------------------------------------------*/
-/*--- %SP-update pass ---*/
-/*------------------------------------------------------------*/
-
-/* NOTE: this comment is out of date */
-
-/* For tools that want to know about %ESP changes, this pass adds
- in the appropriate hooks. We have to do it after the tool's
- instrumentation, so the tool doesn't have to worry about the CCALLs
- it adds in, and we must do it before register allocation because
- spilled temps make it much harder to work out the %esp deltas.
- Thus we have it as an extra phase between the two.=20
- =20
- We look for "GETL %ESP, t_ESP", then track ADDs and SUBs of
- literal values to t_ESP, and the total delta of the ADDs/SUBs. Then =
if
- "PUTL t_ESP, %ESP" happens, we call the helper with the known delta. =
We
- also cope with "MOVL t_ESP, tX", making tX the new t_ESP. If any oth=
er
- instruction clobbers t_ESP, we don't track it anymore, and fall back =
to
- the delta-is-unknown case. That case is also used when the delta is =
not
- a nice small amount, or an unknown amount.
-*/
-
-static
-IRBB* vg_SP_update_pass ( IRBB* bb_in, VexGuestLayout* layout,=20
- IRType gWordTy, IRType hWordTy )
-{
- Int i, j, minoff_ST, maxoff_ST, sizeof_SP, offset_SP;
- IRDirty *dcall, *d;
- IRStmt* st;
- IRExpr* e;
- IRArray* descr;
- IRTemp curr;
- IRType typeof_SP;
- Long delta;
-
- /* Set up BB */
- IRBB* bb =3D emptyIRBB();
- bb->tyenv =3D dopyIRTypeEnv(bb_in->tyenv);
- bb->next =3D dopyIRExpr(bb_in->next);
- bb->jumpkind =3D bb_in->jumpkind;
-
- curr =3D IRTemp_INVALID;
- delta =3D 0;
-
- sizeof_SP =3D layout->sizeof_SP;
- offset_SP =3D layout->offset_SP;
- typeof_SP =3D sizeof_SP=3D=3D4 ? Ity_I32 : Ity_I64;
- vg_assert(sizeof_SP =3D=3D 4 || sizeof_SP =3D=3D 8);
-
-# define IS_ADD(op) (sizeof_SP=3D=3D4 ? ((op)=3D=3DIop_Add32) : ((op)=3D=
=3DIop_Add64))
-# define IS_SUB(op) (sizeof_SP=3D=3D4 ? ((op)=3D=3DIop_Sub32) : ((op)=3D=
=3DIop_Sub64))
-
-# define IS_ADD_OR_SUB(op) (IS_ADD(op) || IS_SUB(op))
-
-# define GET_CONST(con) =
\
- (sizeof_SP=3D=3D4 ? (Long)(Int)(con->Ico.U32) =
\
- : (Long)(con->Ico.U64))
-
-# define DO(kind, syze) =
\
- do { =
\
- if (!VG_(tdict).track_##kind##_mem_stack_##syze) \
- goto generic; =
\
- =
\
- /* I don't know if it's really necessary to say that the */ =
\
- /* call reads the stack pointer. But anyway, we do. */ =
\
- dcall =3D unsafeIRDirty_0_N( =
\
- 1/*regparms*/, =
\
- "track_" #kind "_mem_stack_" #syze, =
\
- VG_(tdict).track_##kind##_mem_stack_##syze, =
\
- mkIRExprVec_1(IRExpr_Tmp(curr)) =
\
- ); =
\
- dcall->nFxState =3D 1; =
\
- dcall->fxState[0].fx =3D Ifx_Read; =
\
- dcall->fxState[0].offset =3D layout->offset_SP; =
\
- dcall->fxState[0].size =3D layout->sizeof_SP; =
\
- =
\
- addStmtToIRBB( bb, IRStmt_Dirty(dcall) ); =
\
- } while (0)
-
- for (i =3D 0; i < bb_in->stmts_used; i++) {
-
- st =3D bb_in->stmts[i];
- if (!st)
- continue;
-
- /* t =3D Get(sp): curr =3D t, delta =3D 0 */
- if (st->tag !=3D Ist_Tmp) goto case2;
- e =3D st->Ist.Tmp.data;
- if (e->tag !=3D Iex_Get) goto case2;
- if (e->Iex.Get.offset !=3D offset_SP) goto case2;
- if (e->Iex.Get.ty !=3D typeof_SP) goto case2;
- curr =3D st->Ist.Tmp.tmp;
- delta =3D 0;
- addStmtToIRBB( bb, st );
- continue;
-
- case2:
- /* t' =3D curr +/- const: curr =3D t', delta +=3D/-=3D const */
- if (st->tag !=3D Ist_Tmp) goto case3;
- e =3D st->Ist.Tmp.data;
- if (e->tag !=3D Iex_Binop) goto case3;
- if (e->Iex.Binop.arg1->tag !=3D Iex_Tmp) goto case3;
- if (e->Iex.Binop.arg1->Iex.Tmp.tmp !=3D curr) goto case3;
- if (e->Iex.Binop.arg2->tag !=3D Iex_Const) goto case3;
- if (!IS_ADD_OR_SUB(e->Iex.Binop.op)) goto case3;
- curr =3D st->Ist.Tmp.tmp;
- if (IS_ADD(e->Iex.Binop.op))
- delta +=3D GET_CONST(e->Iex.Binop.arg2->Iex.Const.con);
- else
- delta -=3D GET_CONST(e->Iex.Binop.arg2->Iex.Const.con);
- addStmtToIRBB( bb, st );
- continue;
-
- case3:
- /* t' =3D curr: curr =3D t' */
- if (st->tag !=3D Ist_Tmp) goto case4;
- e =3D st->Ist.Tmp.data;
- if (e->tag !=3D Iex_Tmp) goto case4;
- if (e->Iex.Tmp.tmp !=3D curr) goto case4;
- curr =3D st->Ist.Tmp.tmp;
- addStmtToIRBB( bb, st );
- continue;
-
- case4:
- /* Put(sp) =3D curr */
- if (st->tag !=3D Ist_Put) goto case5;
- if (st->Ist.Put.offset !=3D offset_SP) goto case5;
- if (st->Ist.Put.data->tag !=3D Iex_Tmp) goto case5;
- if (st->Ist.Put.data->Iex.Tmp.tmp =3D=3D curr) {
- switch (delta) {
- case 0: addStmtToIRBB(bb,st); delta =3D 0; co=
ntinue;
- case 4: DO(die, 4); addStmtToIRBB(bb,st); delta =3D 0; co=
ntinue;
- case -4: DO(new, 4); addStmtToIRBB(bb,st); delta =3D 0; co=
ntinue;
- case 8: DO(die, 8); addStmtToIRBB(bb,st); delta =3D 0; co=
ntinue;
- case -8: DO(new, 8); addStmtToIRBB(bb,st); delta =3D 0; co=
ntinue;
- case 12: DO(die, 12); addStmtToIRBB(bb,st); delta =3D 0; co=
ntinue;
- case -12: DO(new, 12); addStmtToIRBB(bb,st); delta =3D 0; co=
ntinue;
- case 16: DO(die, 16); addStmtToIRBB(bb,st); delta =3D 0; co=
ntinue;
- case -16: DO(new, 16); addStmtToIRBB(bb,st); delta =3D 0; co=
ntinue;
- case 32: DO(die, 32); addStmtToIRBB(bb,st); delta =3D 0; co=
ntinue;
- case -32: DO(new, 32); addStmtToIRBB(bb,st); delta =3D 0; co=
ntinue;
- default: goto generic;
- }
- } else {
- IRTemp old_SP;
- generic:
- /* Pass both the old and new SP values to this helper. */
- old_SP =3D newIRTemp(bb->tyenv, typeof_SP);
- addStmtToIRBB(=20
- bb,
- IRStmt_Tmp( old_SP, IRExpr_Get(offset_SP, typeof_SP) )=20
- );
-
- dcall =3D unsafeIRDirty_0_N(=20
- 2/*regparms*/,=20
- "VG_(unknown_SP_update)", &VG_(unknown_SP_update),
- mkIRExprVec_2( IRExpr_Tmp(old_SP), st->Ist.Put.data =
)=20
- );
- addStmtToIRBB( bb, IRStmt_Dirty(dcall) );
-
- addStmtToIRBB( bb, st );
-
- curr =3D st->Ist.Put.data->Iex.Tmp.tmp;
- delta =3D 0;
- continue;
- }
-
- case5:
- /* PutI or Dirty call which overlaps SP: complain. We can't
- deal with SP changing in weird ways (well, we can, but not at
- this time of night). */
- if (st->tag =3D=3D Ist_PutI) {
- descr =3D st->Ist.PutI.descr;
- minoff_ST =3D descr->base;
- maxoff_ST =3D descr->base + descr->nElems * sizeofIRType(descr-=
>elemTy) - 1;
- if (!(offset_SP > maxoff_ST || (offset_SP + sizeof_SP - 1) < mi=
noff_ST))
- goto complain;
- }
- if (st->tag =3D=3D Ist_Dirty) {
- d =3D st->Ist.Dirty.details;
- for (j =3D 0; j < d->nFxState; j++) {
- minoff_ST =3D d->fxState[j].offset;
- maxoff_ST =3D d->fxState[j].offset + d->fxState[j].size - 1;
- if (d->fxState[j].fx =3D=3D Ifx_Read || d->fxState[j].fx =3D=
=3D Ifx_None)
- continue;
- if (!(offset_SP > maxoff_ST || (offset_SP + sizeof_SP - 1) <=
minoff_ST))
- goto complain;
- }
- }
-
- /* well, not interesting. Just copy and keep going. */
- addStmtToIRBB( bb, st );
-
- } /* for (i =3D 0; i < bb_in->stmts_used; i++) */
-
- return bb;
-
- complain:
- VG_(core_panic)("vg_SP_update_pass: PutI or Dirty which overlaps SP")=
;
-
-}
-
-
-
-#if 0
- for (i =3D 0; i < bb_in->stmts_used; i++) {
- st =3D bb_in->stmts[i];
- if (!st)
- continue;
- if (st->tag !=3D Ist_Put)=20
- goto boring;
- offP =3D st->Ist.Put.offset;
- if (offP !=3D layout->offset_SP)=20
- goto boring;
- szP =3D sizeofIRType(typeOfIRExpr(bb_in->tyenv, st->Ist.Put.data))=
;
- if (szP !=3D layout->sizeof_SP)
- goto boring;
- vg_assert(isAtom(st->Ist.Put.data));
-
- /* I don't know if it's really necessary to say that the call read=
s
- the stack pointer. But anyway, we do. */ =20
- dcall =3D unsafeIRDirty_0_N(=20
- mkIRCallee(1, "VG_(unknown_esp_update)",=20
- (HWord)&VG_(unknown_esp_update)),
- mkIRExprVec_1(st->Ist.Put.data)=20
- );
- dcall->nFxState =3D 1;
- dcall->fxState[0].fx =3D Ifx_Read;
- dcall->fxState[0].offset =3D layout->offset_SP;
- dcall->fxState[0].size =3D layout->sizeof_SP;
-
- addStmtToIRBB( bb, IRStmt_Dirty(dcall) );
-
- boring:
- addStmtToIRBB( bb, st );
- }
-#endif
-
-
-/*------------------------------------------------------------*/
-/*--- Main entry point for the JITter. ---*/
-/*------------------------------------------------------------*/
-
-/* Vex dumps the final code in here. Then we can copy it off
- wherever we like. */
-#define N_TMPBUF 20000
-static UChar tmpbuf[N_TMPBUF];
-
-/* Function pointers we must supply to LibVEX in order that it
- can bomb out and emit messages under Valgrind's control. */
-__attribute__ ((noreturn))
-static
-void failure_exit ( void )
-{
- LibVEX_ShowAllocStats();
- VG_(core_panic)("LibVEX called failure_exit().");
-}
-
-static
-void log_bytes ( HChar* bytes, Int nbytes )
-{
- Int i;
- for (i =3D 0; i < nbytes-3; i +=3D 4)
- VG_(printf)("%c%c%c%c", bytes[i], bytes[i+1], bytes[i+2], bytes[i+3=
]);
- for (; i < nbytes; i++)=20
- VG_(printf)("%c", bytes[i]);
-}
-
-/* Translate the basic block beginning at orig_addr, and add it to
- the translation cache & translation table. Unless 'debugging' is tru=
e,
- in which case the call is being done for debugging purposes, so
- (a) throw away the translation once it is made, and (b) produce a
- load of debugging output.=20
-
- 'tid' is the identity of the thread needing this block.
-*/
-
-/* This stops Vex from chasing into function entry points that we wish
- to redirect. Chasing across them obviously defeats the redirect
- mechanism, with bad effects for Memcheck, Addrcheck, and possibly
- others. */
-static Bool chase_into_ok ( Addr64 addr64 )
-{
- Addr addr =3D (Addr)addr64;
- if (addr !=3D VG_(code_redirect)(addr)) {
- if (0) VG_(printf)("not chasing into 0x%x\n", addr);
- return False;
- } else {
- return True; /* ok to chase into 'addr' */
- }
-}
-
-static Bool need_to_handle_SP_assignment(void)
-{
- return ( VG_(tdict).track_new_mem_stack_4 ||
- VG_(tdict).track_die_mem_stack_4 ||
- VG_(tdict).track_new_mem_stack_8 ||
- VG_(tdict).track_die_mem_stack_8 ||
- VG_(tdict).track_new_mem_stack_12 ||
- VG_(tdict).track_die_mem_stack_12 ||
- VG_(tdict).track_new_mem_stack_16 ||
- VG_(tdict).track_die_mem_stack_16 ||
- VG_(tdict).track_new_mem_stack_32 ||
- VG_(tdict).track_die_mem_stack_32 ||
- VG_(tdict).track_new_mem_stack ||
- VG_(tdict).track_die_mem_stack );
-}
-
-Bool VG_(translate) ( ThreadId tid,=20
- Addr64 orig_addr,
- Bool debugging_translation,
- Int debugging_verbosity )
-{
- Addr64 redir, orig_addr0 =3D orig_addr;
- Int tmpbuf_used, verbosity;
- Bool notrace_until_done;
- UInt notrace_until_limit =3D 0;
- Segment* seg;
- VexGuestExtents vge;
-
- /* Indicates what arch and subarch we are running on. */
- static VexArch vex_arch =3D VexArch_INVALID;
- static VexSubArch vex_subarch =3D VexSubArch_INVALID;
-
- /* Make sure Vex is initialised right. */
- VexTranslateResult tres;
- static Bool vex_init_done =3D False;
-
- if (!vex_init_done) {
- Bool ok =3D VGA_(getArchAndSubArch)( &vex_arch, &vex_subarch );
- if (!ok) {
- VG_(printf)("\n");
- VG_(printf)("valgrind: fatal error: unsupported CPU.\n");
- VG_(printf)(" Supported CPUs are:\n");
- VG_(printf)(" * x86 with SSE state (Pentium II or above, "
- "AMD Athlon or above)\n");
- VG_(printf)("\n");
- VG_(exit)(1);
- }
- if (VG_(clo_verbosity) > 2) {
- VG_(message)(Vg_DebugMsg,=20
- "Host CPU: arch =3D %s, subarch =3D %s",
- LibVEX_ppVexArch ( vex_arch ),
- LibVEX_ppVexSubArch( vex_subarch ) );
- }
-
- LibVEX_Init ( &failure_exit, &log_bytes,=20
- 1, /* debug_paranoia */=20
- False, /* valgrind support */
- &VG_(clo_vex_control) );
- vex_init_done =3D True;
- }
-
- /* profiling ... */
- VGP_PUSHCC(VgpTranslate);
-
- /* Look in the code redirect table to see if we should
- translate an alternative address for orig_addr. */
- redir =3D VG_(code_redirect)(orig_addr);
-
- if (redir !=3D orig_addr && VG_(clo_verbosity) >=3D 2) {
- Bool ok;
- Char name1[64] =3D "";
- Char name2[64] =3D "";
- name1[0] =3D name2[0] =3D 0;
- ok =3D VG_(get_fnname_w_offset)(orig_addr, name1, 64);
- if (!ok) VG_(strcpy)(name1, "???");
- ok =3D VG_(get_fnname_w_offset)(redir, name2, 64);
- if (!ok) VG_(strcpy)(name2, "???");
- VG_(message)(Vg_DebugMsg,=20
- "TRANSLATE: 0x%llx (%s) redirected to 0x%llx (%s)",
- orig_addr, name1,
- redir, name2 );
- }
- orig_addr =3D redir;
-
- /* If codegen tracing, don't start tracing until
- notrace_until_limit blocks have gone by. This avoids printing
- huge amounts of useless junk when all we want to see is the last
- few blocks translated prior to a failure. Set
- notrace_until_limit to be the number of translations to be made
- before --trace-codegen=3D style printing takes effect. */
- notrace_until_done
- =3D VG_(get_bbs_translated)() >=3D notrace_until_limit;
-
- seg =3D VG_(find_segment)(orig_addr);
-
- if (!debugging_translation)
- VG_TRACK( pre_mem_read, Vg_CoreTranslate, tid, "", orig_addr, 1 );
-
- /* If doing any code printing, print a basic block start marker */
- if (VG_(clo_trace_flags) || debugging_translation) {
- Char fnname[64] =3D "";
- VG_(get_fnname_w_offset)(orig_addr, fnname, 64);
- VG_(printf)(
- "=3D=3D=3D=3D BB %d %s(0x%llx) approx BBs exec'd %lld =3D=3D=
=3D=3D\n",
- VG_(get_bbs_translated)(), fnname, orig_addr,=20
- VG_(bbs_done));
- }
-
- if (seg =3D=3D NULL ||
- !VG_(seg_contains)(seg, orig_addr, 1) ||=20
- (seg->prot & (VKI_PROT_READ|VKI_PROT_EXEC)) =3D=3D 0) {
- /* Code address is bad - deliver a signal instead */
- vg_assert(!VG_(is_addressable)(orig_addr, 1,=20
- VKI_PROT_READ|VKI_PROT_EXEC));
-
- if (seg !=3D NULL && VG_(seg_contains)(seg, orig_addr, 1)) {
- vg_assert((seg->prot & VKI_PROT_EXEC) =3D=3D 0);
- VG_(synth_fault_perms)(tid, orig_addr);
- } else
- VG_(synth_fault_mapping)(tid, orig_addr);
-
- return False;
- } else
- seg->flags |=3D SF_CODE; /* contains cached code */
-
- /* True if a debug trans., or if bit N set in VG_(clo_trace_codegen).=
*/
- verbosity =3D 0;
- if (debugging_translation) {
- verbosity =3D debugging_verbosity;
- }
- else
- if ( (VG_(clo_trace_flags) > 0
- && VG_(get_bbs_translated)() >=3D VG_(clo_trace_notbelow) )) {
- verbosity =3D VG_(clo_trace_flags);
- }
-
- /* Actually do the translation. */
- tl_assert2(VG_(tdict).tool_instrument,
- "you forgot to set VgToolInterface function 'tool_instrume=
nt'");
- tres =3D LibVEX_Translate (=20
- vex_arch, vex_subarch,
- vex_arch, vex_subarch,
- (UChar*)ULong_to_Ptr(orig_addr),=20
- (Addr64)orig_addr,=20
- chase_into_ok,
- &vge,
- tmpbuf, N_TMPBUF, &tmpbuf_used,
- VG_(tdict).tool_instrument,
- need_to_handle_SP_assignment()
- ? vg_SP_update_pass
- : NULL,
- True, /* cleanup after instrumentation */
- NULL,
- verbosity
- );
-
- vg_assert(tres =3D=3D VexTransOK);
- vg_assert(tmpbuf_used <=3D N_TMPBUF);
- vg_assert(tmpbuf_used > 0);
-
-#undef DECIDE_IF_PRINTING_CODEGEN
-
- /* Copy data at trans_addr into the translation cache. */
- vg_assert(tmpbuf_used > 0 && tmpbuf_used < 65536);
-
- // If debugging, don't do anything with the translated block; we
- // only did this for the debugging output produced along the way.
- if (!debugging_translation) {
- // Note that we use orig_addr0, not orig_addr, which might have be=
en
- // changed by the redirection
- VG_(add_to_trans_tab)( &vge,
- orig_addr0,
- (Addr)(&tmpbuf[0]),=20
- tmpbuf_used );
- }
-
- VGP_POPCC(VgpTranslate);
-
- return True;
-}
-
-/*--------------------------------------------------------------------*/
-/*--- end vg_translate.c ---*/
-/*--------------------------------------------------------------------*/
-
Modified: trunk/coregrind/vg_transtab.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/vg_transtab.c 2005-05-13 22:18:47 UTC (rev 3699)
+++ trunk/coregrind/vg_transtab.c 2005-05-13 23:11:40 UTC (rev 3700)
@@ -31,6 +31,7 @@
=20
#include "core.h"
#include "pub_core_tooliface.h"
+#include "pub_core_translate.h"
=20
/* #define DEBUG_TRANSTAB */
=20
|
|
From: <sv...@va...> - 2005-05-13 22:18:49
|
Author: njn
Date: 2005-05-13 23:18:47 +0100 (Fri, 13 May 2005)
New Revision: 3699
Modified:
trunk/coregrind/core.h
trunk/coregrind/m_aspacemgr/aspacemgr.c
trunk/coregrind/m_syscalls/priv_syscalls.h
trunk/coregrind/vg_mylibc.c
trunk/coregrind/vg_scheduler.c
trunk/coregrind/x86/state.c
Log:
Import vki_unistd.h on a need-to-know basis, rather than
universally through core.h.
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-05-13 22:09:26 UTC (rev 3698)
+++ trunk/coregrind/core.h 2005-05-13 22:18:47 UTC (rev 3699)
@@ -82,9 +82,6 @@
external tools.
*/
=20
-/* For system call numbers __NR_... */
-#include "vki_unistd.h"
-
#include "core_asm.h" // asm stuff
#include "tool.h" // tool stuff
#include "core_arch.h" // arch-specific stuff, eg. x86/core_arch.h
Modified: trunk/coregrind/m_aspacemgr/aspacemgr.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_aspacemgr/aspacemgr.c 2005-05-13 22:09:26 UTC (rev =
3698)
+++ trunk/coregrind/m_aspacemgr/aspacemgr.c 2005-05-13 22:18:47 UTC (rev =
3699)
@@ -34,6 +34,7 @@
#include "pub_core_aspacemgr.h"
#include "pub_core_syscalls.h"
#include "pub_core_tooliface.h"
+#include "vki_unistd.h"
=20
=20
/* Define to debug the memory-leak-detector. */
Modified: trunk/coregrind/m_syscalls/priv_syscalls.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_syscalls/priv_syscalls.h 2005-05-13 22:09:26 UTC (r=
ev 3698)
+++ trunk/coregrind/m_syscalls/priv_syscalls.h 2005-05-13 22:18:47 UTC (r=
ev 3699)
@@ -42,6 +42,8 @@
# error Unknown platform
#endif
=20
+#include "vki_unistd.h"
+
// Offsets for the shadow state
#define O_SYSCALL_NUM (offsetof(VexGuestArchState, VGP_SYSCALL_NUM))
#define O_SYSCALL_ARG1 (offsetof(VexGuestArchState, VGP_SYSCALL_ARG1))
Modified: trunk/coregrind/vg_mylibc.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/vg_mylibc.c 2005-05-13 22:09:26 UTC (rev 3698)
+++ trunk/coregrind/vg_mylibc.c 2005-05-13 22:18:47 UTC (rev 3699)
@@ -36,6 +36,7 @@
#include "pub_core_stacktrace.h"
#include "pub_core_syscalls.h"
#include "pub_core_tooliface.h"
+#include "vki_unistd.h"
=20
=20
/* ---------------------------------------------------------------------
Modified: trunk/coregrind/vg_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/vg_scheduler.c 2005-05-13 22:09:26 UTC (rev 3698)
+++ trunk/coregrind/vg_scheduler.c 2005-05-13 22:18:47 UTC (rev 3699)
@@ -66,6 +66,7 @@
#include "pub_core_stacktrace.h"
#include "pub_core_syscalls.h"
#include "pub_core_tooliface.h"
+#include "vki_unistd.h"
=20
/* ---------------------------------------------------------------------
Types and globals for the scheduler.
Modified: trunk/coregrind/x86/state.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/x86/state.c 2005-05-13 22:09:26 UTC (rev 3698)
+++ trunk/coregrind/x86/state.c 2005-05-13 22:18:47 UTC (rev 3699)
@@ -31,6 +31,7 @@
#include "core.h"
#include "pub_core_tooliface.h"
#include "x86_private.h"
+#include "vki_unistd.h"
#include <sys/ptrace.h>
=20
#include "libvex_guest_x86.h"
|
|
From: <sv...@va...> - 2005-05-13 22:09:28
|
Author: njn
Date: 2005-05-13 23:09:26 +0100 (Fri, 13 May 2005)
New Revision: 3698
Modified:
trunk/coregrind/core.h
trunk/coregrind/linux/core_os.c
Log:
VGA_(terminate) doesn't need to be exported.
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-05-13 22:07:12 UTC (rev 3697)
+++ trunk/coregrind/core.h 2005-05-13 22:09:26 UTC (rev 3698)
@@ -886,9 +886,6 @@
// Return how many bytes of a thread's Valgrind stack are unused
SSizeT VGA_(stack_unused)(ThreadId tid);
=20
-// Terminate the process. Does not return.
-void VGA_(terminate)(ThreadId tid, VgSchedReturnCode src) __attribute__(=
(__noreturn__));
-
// wait until all other threads are dead
extern void VGA_(reap_threads)(ThreadId self);
=20
Modified: trunk/coregrind/linux/core_os.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/linux/core_os.c 2005-05-13 22:07:12 UTC (rev 3697)
+++ trunk/coregrind/linux/core_os.c 2005-05-13 22:09:26 UTC (rev 3698)
@@ -45,6 +45,33 @@
VGA_(os_state_clear)(tst);
}
=20
+static void terminate(ThreadId tid, VgSchedReturnCode src)
+{
+ vg_assert(tid =3D=3D VG_(master_tid));
+ vg_assert(VG_(count_living_threads)() =3D=3D 0);
+
+ //--------------------------------------------------------------
+ // Exit, according to the scheduler's return code
+ //--------------------------------------------------------------
+ switch (src) {
+ case VgSrc_ExitSyscall: /* the normal way out */
+ VG_(exit)( VG_(threads)[VG_(master_tid)].os_state.exitcode );
+ /* NOT ALIVE HERE! */
+ VG_(core_panic)("entered the afterlife in main() -- ExitSyscall");
+ break; /* what the hell :) */
+
+ case VgSrc_FatalSig:
+ /* We were killed by a fatal signal, so replicate the effect */
+ vg_assert(VG_(threads)[VG_(master_tid)].os_state.fatalsig !=3D 0);
+ VG_(kill_self)(VG_(threads)[VG_(master_tid)].os_state.fatalsig);
+ VG_(core_panic)("main(): signal was supposed to be fatal");
+ break;
+
+ default:
+ VG_(core_panic)("main(): unexpected scheduler return code");
+ }
+}
+
/* Run a thread from beginning to end. Does not return. */
void VGA_(thread_wrapper)(Word /*ThreadId*/ tidW)
{
@@ -78,37 +105,10 @@
=20
if (tid =3D=3D VG_(master_tid)) {
VG_(shutdown_actions)(tid);
- VGA_(terminate)(tid, ret);
+ terminate(tid, ret);
}
}
=20
-void VGA_(terminate)(ThreadId tid, VgSchedReturnCode src)
-{
- vg_assert(tid =3D=3D VG_(master_tid));
- vg_assert(VG_(count_living_threads)() =3D=3D 0);
-
- //--------------------------------------------------------------
- // Exit, according to the scheduler's return code
- //--------------------------------------------------------------
- switch (src) {
- case VgSrc_ExitSyscall: /* the normal way out */
- VG_(exit)( VG_(threads)[VG_(master_tid)].os_state.exitcode );
- /* NOT ALIVE HERE! */
- VG_(core_panic)("entered the afterlife in main() -- ExitSyscall");
- break; /* what the hell :) */
-
- case VgSrc_FatalSig:
- /* We were killed by a fatal signal, so replicate the effect */
- vg_assert(VG_(threads)[VG_(master_tid)].os_state.fatalsig !=3D 0);
- VG_(kill_self)(VG_(threads)[VG_(master_tid)].os_state.fatalsig);
- VG_(core_panic)("main(): signal was supposed to be fatal");
- break;
-
- default:
- VG_(core_panic)("main(): unexpected scheduler return code");
- }
-}
-
/* wait until all other threads are dead */
static Bool alldead(void *v)
{
|
|
From: <sv...@va...> - 2005-05-13 22:07:16
|
Author: njn
Date: 2005-05-13 23:07:12 +0100 (Fri, 13 May 2005)
New Revision: 3697
Modified:
trunk/coregrind/m_syscalls/priv_syscalls.h
trunk/coregrind/m_syscalls/syscalls-amd64-linux.c
trunk/coregrind/m_syscalls/syscalls-arm-linux.c
trunk/coregrind/m_syscalls/syscalls-x86-linux.c
Log:
VGA_(restart_syscall)() doesn't need to be exported.
Modified: trunk/coregrind/m_syscalls/priv_syscalls.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_syscalls/priv_syscalls.h 2005-05-13 21:49:30 UTC (r=
ev 3696)
+++ trunk/coregrind/m_syscalls/priv_syscalls.h 2005-05-13 22:07:12 UTC (r=
ev 3697)
@@ -73,8 +73,6 @@
=20
extern const UInt VGA_(syscall_table_size);
=20
-extern void VGA_(restart_syscall)(ThreadArchState* arch);
-
extern Int VG_(clone) ( Int (*fn)(void *), void *stack, Int flags, void =
*arg,=20
Int *child_tid, Int *parent_tid, vki_modify_ldt_t * );
=20
Modified: trunk/coregrind/m_syscalls/syscalls-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_syscalls/syscalls-amd64-linux.c 2005-05-13 21:49:30=
UTC (rev 3696)
+++ trunk/coregrind/m_syscalls/syscalls-amd64-linux.c 2005-05-13 22:07:12=
UTC (rev 3697)
@@ -57,7 +57,7 @@
extern const Addr VGA_(blksys_finished);
=20
// Back up to restart a system call.
-void VGA_(restart_syscall)(ThreadArchState *arch)
+static void restart_syscall(ThreadArchState *arch)
{
arch->vex.guest_RIP -=3D 2; // sizeof(syscall)
=20
@@ -133,13 +133,13 @@
/* syscall hasn't even started; go around again */
if (debug)
VG_(printf)(" not started: restart\n");
- VGA_(restart_syscall)(th_regs);
+ restart_syscall(th_regs);
} else if (ip =3D=3D VGA_(blksys_restart)) {
/* We're either about to run the syscall, or it was interrupted
and the kernel restarted it. Restart if asked, otherwise
EINTR it. */
if (restart)
- VGA_(restart_syscall)(th_regs);
+ restart_syscall(th_regs);
else {
th_regs->vex.VGP_SYSCALL_RET =3D -VKI_EINTR;
VG_(post_syscall)(tid);
@@ -548,7 +548,7 @@
=20
/* This is only so that the RIP is (might be) useful to report if
something goes wrong in the sigreturn */
- VGA_(restart_syscall)(&tst->arch);
+ restart_syscall(&tst->arch);
=20
VG_(sigframe_destroy)(tid, True);
=20
Modified: trunk/coregrind/m_syscalls/syscalls-arm-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_syscalls/syscalls-arm-linux.c 2005-05-13 21:49:30 U=
TC (rev 3696)
+++ trunk/coregrind/m_syscalls/syscalls-arm-linux.c 2005-05-13 22:07:12 U=
TC (rev 3697)
@@ -49,7 +49,7 @@
=20
=20
// Back up to restart a system call.
-void VGA_(restart_syscall)(ThreadArchState *arch)
+static void restart_syscall(ThreadArchState *arch)
{
I_die_here;
#if 0
Modified: trunk/coregrind/m_syscalls/syscalls-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_syscalls/syscalls-x86-linux.c 2005-05-13 21:49:30 U=
TC (rev 3696)
+++ trunk/coregrind/m_syscalls/syscalls-x86-linux.c 2005-05-13 22:07:12 U=
TC (rev 3697)
@@ -55,7 +55,7 @@
extern const Addr VGA_(blksys_finished);
=20
// Back up to restart a system call.
-void VGA_(restart_syscall)(ThreadArchState *arch)
+static void restart_syscall(ThreadArchState *arch)
{
arch->vex.guest_EIP -=3D 2; // sizeof(int $0x80)
=20
@@ -131,13 +131,13 @@
/* syscall hasn't even started; go around again */
if (debug)
VG_(printf)(" not started: restart\n");
- VGA_(restart_syscall)(th_regs);
+ restart_syscall(th_regs);
} else if (eip =3D=3D VGA_(blksys_restart)) {
/* We're either about to run the syscall, or it was interrupted
and the kernel restarted it. Restart if asked, otherwise
EINTR it. */
if (restart)
- VGA_(restart_syscall)(th_regs);
+ restart_syscall(th_regs);
else {
th_regs->vex.VGP_SYSCALL_RET =3D -VKI_EINTR;
VG_(post_syscall)(tid);
@@ -593,7 +593,7 @@
=20
/* This is only so that the EIP is (might be) useful to report if
something goes wrong in the sigreturn */
- VGA_(restart_syscall)(&tst->arch);
+ restart_syscall(&tst->arch);
=20
VG_(sigframe_destroy)(tid, False);
=20
@@ -614,7 +614,7 @@
=20
/* This is only so that the EIP is (might be) useful to report if
something goes wrong in the sigreturn */
- VGA_(restart_syscall)(&tst->arch);
+ restart_syscall(&tst->arch);
=20
VG_(sigframe_destroy)(tid, True);
=20
|
|
From: <sv...@va...> - 2005-05-13 21:49:35
|
Author: njn
Date: 2005-05-13 22:49:30 +0100 (Fri, 13 May 2005)
New Revision: 3696
Modified:
trunk/coregrind/vg_messages.c
trunk/coregrind/vg_mylibc.c
trunk/include/tool.h
Log:
Use HChar for format strings to printf-like functions.
Modified: trunk/coregrind/vg_messages.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/vg_messages.c 2005-05-13 21:44:07 UTC (rev 3695)
+++ trunk/coregrind/vg_messages.c 2005-05-13 21:49:30 UTC (rev 3696)
@@ -34,7 +34,7 @@
#include <time.h>
#include <sys/time.h>
=20
-UInt VG_(vmessage) ( VgMsgKind kind, const Char* format, va_list vargs )
+UInt VG_(vmessage) ( VgMsgKind kind, const HChar* format, va_list vargs =
)
{
UInt count =3D 0;
Char c;
@@ -79,7 +79,7 @@
}
=20
/* Send a simple single-part message. */
-UInt VG_(message) ( VgMsgKind kind, const Char* format, ... )
+UInt VG_(message) ( VgMsgKind kind, const HChar* format, ... )
{
UInt count;
va_list vargs;
Modified: trunk/coregrind/vg_mylibc.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/vg_mylibc.c 2005-05-13 21:44:07 UTC (rev 3695)
+++ trunk/coregrind/vg_mylibc.c 2005-05-13 21:49:30 UTC (rev 3696)
@@ -427,7 +427,7 @@
myprintf_buf->buf[myprintf_buf->n] =3D 0;
}
=20
-UInt VG_(vprintf) ( const char *format, va_list vargs )
+UInt VG_(vprintf) ( const HChar *format, va_list vargs )
{
UInt ret =3D 0;
printf_buf myprintf_buf =3D {"",0};
@@ -444,7 +444,7 @@
return ret;
}
=20
-UInt VG_(printf) ( const char *format, ... )
+UInt VG_(printf) ( const HChar *format, ... )
{
UInt ret;
va_list vargs;
@@ -463,7 +463,7 @@
*(*vg_sprintf_ptr)++ =3D c;
}
=20
-UInt VG_(vsprintf) ( Char* buf, const Char *format, va_list vargs )
+UInt VG_(vsprintf) ( Char* buf, const HChar *format, va_list vargs )
{
Int ret;
Char *vg_sprintf_ptr =3D buf;
@@ -477,7 +477,7 @@
return ret;
}
=20
-UInt VG_(sprintf) ( Char* buf, const Char *format, ... )
+UInt VG_(sprintf) ( Char* buf, const HChar *format, ... )
{
UInt ret;
va_list vargs;
@@ -954,7 +954,7 @@
}
=20
void VG_(assert_fail) ( Bool isCore, const Char* expr, const Char* file,=
=20
- Int line, const Char* fn, const Char* format, ..=
. )
+ Int line, const Char* fn, const HChar* format, .=
.. )
{
va_list vargs;
Char buf[256];
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-05-13 21:44:07 UTC (rev 3695)
+++ trunk/include/tool.h 2005-05-13 21:49:30 UTC (rev 3696)
@@ -139,8 +139,8 @@
VgMsgKind;
=20
/* Send a single-part message. Appends a newline. */
-extern UInt VG_(message) ( VgMsgKind kind, const Char* format, ... );
-extern UInt VG_(vmessage) ( VgMsgKind kind, const Char* format, va_lis=
t vargs );
+extern UInt VG_(message) ( VgMsgKind kind, const HChar* format, ... )=
;
+extern UInt VG_(vmessage) ( VgMsgKind kind, const HChar* format, va_li=
st vargs );
=20
=20
/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
@@ -261,11 +261,11 @@
* --log-fd/--log-file/--log-socket argument, which defaults to 2 (stder=
r).
* Hence no need for VG_(fprintf)().
*/
-extern UInt VG_(printf) ( const char *format, ... );
-extern UInt VG_(vprintf) ( const char *format, va_list vargs );
+extern UInt VG_(printf) ( const HChar *format, ... );
+extern UInt VG_(vprintf) ( const HChar *format, va_list vargs );
/* too noisy ... __attribute__ ((format (printf, 1, 2))) ; */
-extern UInt VG_(sprintf) ( Char* buf, const Char* format, ... );
-extern UInt VG_(vsprintf)( Char* buf, const Char* format, va_list vargs =
);
+extern UInt VG_(sprintf) ( Char* buf, const HChar* format, ... );
+extern UInt VG_(vsprintf)( Char* buf, const HChar* format, va_list vargs=
);
=20
extern Int VG_(rename) ( Char* old_name, Char* new_name );
=20
@@ -408,7 +408,7 @@
__attribute__ ((__noreturn__))
extern void VG_(assert_fail) ( Bool isCore, const Char* expr, const Char=
* file,=20
Int line, const Char* fn,=20
- const Char* format, ... );
+ const HChar* format, ... );
=20
/* ------------------------------------------------------------------ */
/* Get memory by anonymous mmap. */
|
|
From: <sv...@va...> - 2005-05-13 21:44:08
|
Author: njn
Date: 2005-05-13 22:44:07 +0100 (Fri, 13 May 2005)
New Revision: 3695
Modified:
trunk/coregrind/amd64/core_arch.h
trunk/coregrind/arm/core_arch.h
trunk/coregrind/core.h
Log:
Remove all traces of the now-defunct ThreadArchAux type.
Modified: trunk/coregrind/amd64/core_arch.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/amd64/core_arch.h 2005-05-13 21:42:08 UTC (rev 3694)
+++ trunk/coregrind/amd64/core_arch.h 2005-05-13 21:44:07 UTC (rev 3695)
@@ -104,17 +104,6 @@
typedef VexGuestAMD64State VexGuestArchState;
=20
/* ---------------------------------------------------------------------
- libpthread stuff
- ------------------------------------------------------------------ */
-
-// ToDo XXX??? not at all sure about this...
-struct _ThreadArchAux {
- // void* tls_data;
- // int tls_segment;
- // unsigned long sysinfo;
-};
-
-/* ---------------------------------------------------------------------
Miscellaneous constants
------------------------------------------------------------------ */
=20
Modified: trunk/coregrind/arm/core_arch.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/arm/core_arch.h 2005-05-13 21:42:08 UTC (rev 3694)
+++ trunk/coregrind/arm/core_arch.h 2005-05-13 21:44:07 UTC (rev 3695)
@@ -105,14 +105,6 @@
typedef VexGuestARMState VexGuestArchState;
=20
/* ---------------------------------------------------------------------
- libpthread stuff
- ------------------------------------------------------------------ */
-
-struct _ThreadArchAux {
- // XXX: nothing?
-};
-
-/* ---------------------------------------------------------------------
Miscellaneous constants
------------------------------------------------------------------ */
=20
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-05-13 21:42:08 UTC (rev 3694)
+++ trunk/coregrind/core.h 2005-05-13 21:44:07 UTC (rev 3695)
@@ -907,9 +907,7 @@
// Used by leakcheck
extern void VGA_(mark_from_registers)(ThreadId tid, void (*marker)(Addr)=
);
=20
-////typedef struct _ThreadArchAux ThreadArchAux;
=20
-
// ---------------------------------------------------------------------
// Platform-specific things defined in eg. x86/*.c
// ---------------------------------------------------------------------
|
|
From: <sv...@va...> - 2005-05-13 21:42:10
|
Author: njn
Date: 2005-05-13 22:42:08 +0100 (Fri, 13 May 2005)
New Revision: 3694
Modified:
trunk/coregrind/vg_intercept.c
Log:
Remove unnecessary #includes.
Modified: trunk/coregrind/vg_intercept.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/vg_intercept.c 2005-05-13 21:41:13 UTC (rev 3693)
+++ trunk/coregrind/vg_intercept.c 2005-05-13 21:42:08 UTC (rev 3694)
@@ -39,9 +39,6 @@
=20
#include "valgrind.h"
#include "core.h"
-#include <unistd.h>
-#include <pthread.h>
-#include <dlfcn.h>
=20
/* ---------------------------------------------------------------------
Hook for running __libc_freeres once the program exits.
|
|
From: <sv...@va...> - 2005-05-13 21:41:14
|
Author: njn Date: 2005-05-13 22:41:13 +0100 (Fri, 13 May 2005) New Revision: 3693 Modified: trunk/NOTES.txt trunk/coregrind/core_asm.h Log: Remove all the unused x86 and AMD64 *_FEAT_* macros, as NOTES.txt=20 suggests. Modified: trunk/NOTES.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/NOTES.txt 2005-05-13 21:39:45 UTC (rev 3692) +++ trunk/NOTES.txt 2005-05-13 21:41:13 UTC (rev 3693) @@ -29,11 +29,7 @@ [tool_asm.h will need to remain in some form -- there are still assemb= ly files that need to see VG_() and related macros. --njn] =20 - Urk. Perhaps nuke all that X86_FEAT gunk in coregrind/core_asm.h - though. Vex isn't clever enough to distinguish dozens of CPU - subvariants. =20 - 23 March 05 ~~~~~~~~~~~ Do we still need ARCH_PTHREQ_RET (or *PTHREQ* for that matter) ? Modified: trunk/coregrind/core_asm.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_asm.h 2005-05-13 21:39:45 UTC (rev 3692) +++ trunk/coregrind/core_asm.h 2005-05-13 21:41:13 UTC (rev 3693) @@ -43,71 +43,6 @@ #define VG_TT_FAST_SIZE (1 << VG_TT_FAST_BITS) #define VG_TT_FAST_MASK ((VG_TT_FAST_SIZE) - 1) =20 -// XXX: all this will go into x86/ eventually... -/*=20 - 0 - standard feature flags - 1 - Intel extended flags - 2 - Valgrind internal flags - 3 - AMD-specific flags - */ -#define VG_N_FEATURE_WORDS 4 - -#define VG_X86_FEAT 0 -#define VG_EXT_FEAT 1 -#define VG_INT_FEAT 2 -#define VG_AMD_FEAT 3 - -/* CPU features (generic) */ -#define VG_X86_FEAT_FPU (VG_X86_FEAT*32 + 0) -#define VG_X86_FEAT_VME (VG_X86_FEAT*32 + 1) -#define VG_X86_FEAT_DE (VG_X86_FEAT*32 + 2) -#define VG_X86_FEAT_PSE (VG_X86_FEAT*32 + 3) -#define VG_X86_FEAT_TSC (VG_X86_FEAT*32 + 4) -#define VG_X86_FEAT_MSR (VG_X86_FEAT*32 + 5) -#define VG_X86_FEAT_PAE (VG_X86_FEAT*32 + 6) -#define VG_X86_FEAT_MCE (VG_X86_FEAT*32 + 7) -#define VG_X86_FEAT_CX8 (VG_X86_FEAT*32 + 8) -#define VG_X86_FEAT_APIC (VG_X86_FEAT*32 + 9) -#define VG_X86_FEAT_SEP (VG_X86_FEAT*32 + 11) -#define VG_X86_FEAT_MTRR (VG_X86_FEAT*32 + 12) -#define VG_X86_FEAT_PGE (VG_X86_FEAT*32 + 13) -#define VG_X86_FEAT_MCA (VG_X86_FEAT*32 + 14) -#define VG_X86_FEAT_CMOV (VG_X86_FEAT*32 + 15) -#define VG_X86_FEAT_PAT (VG_X86_FEAT*32 + 16) -#define VG_X86_FEAT_PSE36 (VG_X86_FEAT*32 + 17) -#define VG_X86_FEAT_CLFSH (VG_X86_FEAT*32 + 19) -#define VG_X86_FEAT_DS (VG_X86_FEAT*32 + 21) -#define VG_X86_FEAT_ACPI (VG_X86_FEAT*32 + 22) -#define VG_X86_FEAT_MMX (VG_X86_FEAT*32 + 23) -#define VG_X86_FEAT_FXSR (VG_X86_FEAT*32 + 24) -#define VG_X86_FEAT_SSE (VG_X86_FEAT*32 + 25) -#define VG_X86_FEAT_SSE2 (VG_X86_FEAT*32 + 26) -#define VG_X86_FEAT_SS (VG_X86_FEAT*32 + 27) -#define VG_X86_FEAT_HT (VG_X86_FEAT*32 + 28) -#define VG_X86_FEAT_TM (VG_X86_FEAT*32 + 29) -#define VG_X86_FEAT_IA64 (VG_X86_FEAT*32 + 30) -#define VG_X86_FEAT_PBE (VG_X86_FEAT*32 + 31) - -/* Intel extended feature word */ -#define VG_X86_FEAT_SSE3 (VG_EXT_FEAT*32 + 0) -#define VG_X86_FEAT_MON (VG_EXT_FEAT*32 + 3) -#define VG_X86_FEAT_DSCPL (VG_EXT_FEAT*32 + 4) -#define VG_X86_FEAT_EST (VG_EXT_FEAT*32 + 7) -#define VG_X86_FEAT_TM2 (VG_EXT_FEAT*32 + 8) -#define VG_X86_FEAT_CNXTID (VG_EXT_FEAT*32 + 10) - -/* Used internally to mark whether CPUID is even implemented */ -#define VG_X86_FEAT_CPUID (VG_INT_FEAT*32 + 0) - -/* AMD special features */ -#define VG_AMD_FEAT_SYSCALL (VG_AMD_FEAT*32 + 11) -#define VG_AMD_FEAT_NXP (VG_AMD_FEAT*32 + 20) -#define VG_AMD_FEAT_MMXEXT (VG_AMD_FEAT*32 + 22) -#define VG_AMD_FEAT_FFXSR (VG_AMD_FEAT*32 + 25) -#define VG_AMD_FEAT_LONGMODE (VG_AMD_FEAT*32 + 29) -#define VG_AMD_FEAT_3DNOWEXT (VG_AMD_FEAT*32 + 30) -#define VG_AMD_FEAT_3DNOW (VG_AMD_FEAT*32 + 31) - #endif /* __CORE_ASM_H */ =20 /*--------------------------------------------------------------------*/ |
|
From: <sv...@va...> - 2005-05-13 21:39:49
|
Author: njn Date: 2005-05-13 22:39:45 +0100 (Fri, 13 May 2005) New Revision: 3692 Removed: trunk/memcheck/mc_asm.h Modified: trunk/NOTES.txt trunk/memcheck/Makefile.am trunk/memcheck/mc_include.h Log: Removed mc_asm.h, which is no longer needed since Memcheck has no=20 assembly files any more. Moved MC_() into mc_include.h. Modified: trunk/NOTES.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/NOTES.txt 2005-05-13 16:54:09 UTC (rev 3691) +++ trunk/NOTES.txt 2005-05-13 21:39:45 UTC (rev 3692) @@ -21,16 +21,13 @@ =20 9 Apr 05 (starting work on memcheck for 32/64-bit and big/little endian) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -* get rid of memcheck/mc_asm.h and include/tool_asm.h. I think=20 - these are left over from single-platform days, when it made +* get rid of include/tool_asm.h. I think=20 + this is left over from single-platform days, when it made sense to have tool-helpers written in assembly. Looks like we need to retain coregrind/core_asm.h, though. =20 - [core_asm.h includes tool_asm.h. The contents of tool_asm.h could be = put - into core_asm.h, but that would deviate from the structure described a= t - the top of core.h... that structure will slowly change as core.h/tool.= h - are split up into separate headers for each module, but it might be - worthwhile keeping the asm-only headers? Not sure. --njn] + [tool_asm.h will need to remain in some form -- there are still assemb= ly + files that need to see VG_() and related macros. --njn] =20 Urk. Perhaps nuke all that X86_FEAT gunk in coregrind/core_asm.h though. Vex isn't clever enough to distinguish dozens of CPU Modified: trunk/memcheck/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/Makefile.am 2005-05-13 16:54:09 UTC (rev 3691) +++ trunk/memcheck/Makefile.am 2005-05-13 21:39:45 UTC (rev 3692) @@ -29,7 +29,6 @@ =20 noinst_HEADERS =3D \ mac_shared.h \ - mc_asm.h \ mc_include.h =20 mac_replace_strmem.o: CFLAGS +=3D -fno-omit-frame-pointer Deleted: trunk/memcheck/mc_asm.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/memcheck/mc_asm.h 2005-05-13 16:54:09 UTC (rev 3691) +++ trunk/memcheck/mc_asm.h 2005-05-13 21:39:45 UTC (rev 3692) @@ -1,43 +0,0 @@ - -/*--------------------------------------------------------------------*/ -/*--- mc_asm.h ---*/ -/*--------------------------------------------------------------------*/ - -/* - This file is part of MemCheck, a heavyweight Valgrind tool for - detecting memory errors. - - Copyright (C) 2000-2005 Julian Seward=20 - js...@ac... - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307, USA. - - The GNU General Public License is contained in the file COPYING. -*/ - -#ifndef __MC_ASM_H -#define __MC_ASM_H - -#include "tool_asm.h" - -#define MC_(str) VGAPPEND(vgMemCheck_,str) - -#endif /* __MC_ASM_H */ - -/*--------------------------------------------------------------------*/ -/*--- end ---*/ -/*--------------------------------------------------------------------*/ - Modified: trunk/memcheck/mc_include.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/memcheck/mc_include.h 2005-05-13 16:54:09 UTC (rev 3691) +++ trunk/memcheck/mc_include.h 2005-05-13 21:39:45 UTC (rev 3692) @@ -37,8 +37,8 @@ #define __MC_INCLUDE_H =20 #include "mac_shared.h" -#include "mc_asm.h" =20 +#define MC_(str) VGAPPEND(vgMemCheck_,str) =20 /*------------------------------------------------------------*/ /*--- Command line options ---*/ |
|
From: <sv...@va...> - 2005-05-13 16:54:18
|
Author: cerion Date: 2005-05-13 17:54:09 +0100 (Fri, 13 May 2005) New Revision: 3691 Modified: trunk/NOTES.txt Log: Tidy up (arch)/dispatch.S Modified: trunk/NOTES.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/NOTES.txt 2005-05-13 12:17:33 UTC (rev 3690) +++ trunk/NOTES.txt 2005-05-13 16:54:09 UTC (rev 3691) @@ -1,4 +1,8 @@ +13 May 05 +~~~~~~~~~ +ToDo: (arch)/dispatch.S: In dispatch_exceptional, there's no point testi= ng the guest code return value against VG_TRC_INNER_COUNTERZERO, as vex n= ever sets this flag. =20 + 11 May 05 ~~~~~~~~~ ToDo: vex-x86: check/fix behaviour on SSE MOVQ / MOVSD insns. |
|
From: <sv...@va...> - 2005-05-13 13:54:54
|
Author: sewardj
Date: 2005-05-13 14:54:48 +0100 (Fri, 13 May 2005)
New Revision: 1195
Modified:
trunk/priv/guest-amd64/toIR.c
Log:
Reinstate a SBB case.
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-05-12 19:21:55 UTC (rev 1194)
+++ trunk/priv/guest-amd64/toIR.c 2005-05-13 13:54:48 UTC (rev 1195)
@@ -3091,7 +3091,6 @@
helper_ADC( sz, dst1, dst0, src );
} else=20
if (gregLO3ofRM(modrm) =3D=3D 3 /* SBB */) {
- vassert(0); /* awaiting test case */
helper_SBB( sz, dst1, dst0, src );
} else {
assign(dst1, binop(mkSizedOp(ty,op8), mkexpr(dst0), mkexpr(src)=
));
|
|
From: <sv...@va...> - 2005-05-13 12:17:42
|
Author: sewardj
Date: 2005-05-13 13:17:33 +0100 (Fri, 13 May 2005)
New Revision: 3690
Modified:
trunk/coregrind/vg_dwarf.c
Log:
CFI reader: don't assume RA_REG is anything in particular; instead use
what's specified in the currenty applicable CIE.
Modified: trunk/coregrind/vg_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/vg_dwarf.c 2005-05-12 23:25:43 UTC (rev 3689)
+++ trunk/coregrind/vg_dwarf.c 2005-05-13 12:17:33 UTC (rev 3690)
@@ -918,13 +918,13 @@
/* --------------- Decls --------------- */
=20
#if defined(VGP_x86_linux)
-#define FP_COL 5
-#define SP_COL 4
-#define RA_COL 8
+#define FP_REG 5
+#define SP_REG 4
+#define RA_REG_DEFAULT 8
#elif defined(VGP_amd64_linux)
-#define FP_COL 6
-#define SP_COL 7
-#define RA_COL 16
+#define FP_REG 6
+#define SP_REG 7
+#define RA_REG_DEFAULT 16
#endif
=20
/* the number of regs we are prepared to unwind */
@@ -1017,10 +1017,11 @@
=20
typedef
struct {
- /* Read-only fields. */
+ /* Read-only fields (set by the CIE) */
Int code_a_f;
Int data_a_f;
Addr initloc;
+ Int ra_reg;
/* The rest of these fields can be modifed by
run_CF_instruction. */
/* The LOC entry */
@@ -1046,10 +1047,12 @@
static void initUnwindContext ( /*OUT*/UnwindContext* ctx )
{
Int i;
- ctx->code_a_f =3D 0;
- ctx->data_a_f =3D 0;
- ctx->loc =3D 0;
- ctx->cfa_reg =3D 0;
+ ctx->code_a_f =3D 0;
+ ctx->data_a_f =3D 0;
+ ctx->initloc =3D 0;
+ ctx->ra_reg =3D RA_REG_DEFAULT;
+ ctx->loc =3D 0;
+ ctx->cfa_reg =3D 0;
ctx->cfa_offset =3D 0;
for (i =3D 0; i < N_CFI_REGS; i++) {
ctx->reg[i].tag =3D RR_Undef;
@@ -1074,11 +1077,11 @@
initCfiSI(si);
=20
/* How to generate the CFA */
- if (ctx->cfa_reg =3D=3D SP_COL) {
+ if (ctx->cfa_reg =3D=3D SP_REG) {
si->cfa_sprel =3D True;
si->cfa_off =3D ctx->cfa_offset;
} else
- if (ctx->cfa_reg =3D=3D FP_COL) {
+ if (ctx->cfa_reg =3D=3D FP_REG) {
si->cfa_sprel =3D False;
si->cfa_off =3D ctx->cfa_offset;
} else {
@@ -1094,8 +1097,8 @@
default: { why =3D 2; goto failed; } /* otherwise give up *=
/ \
}
=20
- SUMMARISE_HOW(si->ra_how, si->ra_off, ctx->reg[RA_COL] );
- SUMMARISE_HOW(si->fp_how, si->fp_off, ctx->reg[FP_COL] );
+ SUMMARISE_HOW(si->ra_how, si->ra_off, ctx->reg[ctx->ra_reg] );
+ SUMMARISE_HOW(si->fp_how, si->fp_off, ctx->reg[FP_REG] );
=20
# undef SUMMARISE_HOW
=20
@@ -1106,7 +1109,7 @@
=20
/* also, gcc says "Undef" for %{e,r}bp when it is unchanged. So
.. */
- if (ctx->reg[FP_COL].tag =3D=3D RR_Undef)
+ if (ctx->reg[FP_REG].tag =3D=3D RR_Undef)
si->fp_how =3D CFIR_SAME;
=20
/* knock out some obviously stupid cases */
@@ -1139,20 +1142,20 @@
{
VG_(printf)("0x%llx-1: ", (ULong)ctx->loc);
=20
- if (ctx->cfa_reg =3D=3D SP_COL) {
+ if (ctx->cfa_reg =3D=3D SP_REG) {
VG_(printf)("SP/CFA=3D%d+SP ", ctx->cfa_offset);
} else
- if (ctx->cfa_reg =3D=3D FP_COL) {
+ if (ctx->cfa_reg =3D=3D FP_REG) {
VG_(printf)("SP/CFA=3D%d+FP ", ctx->cfa_offset);
} else {
VG_(printf)("SP/CFA=3Dunknown ", ctx->cfa_offset);
}
=20
VG_(printf)("RA=3D");
- ppRegRule( &ctx->reg[RA_COL] );
+ ppRegRule( &ctx->reg[ctx->ra_reg] );
=20
VG_(printf)("FP=3D");
- ppRegRule( &ctx->reg[FP_COL] );
+ ppRegRule( &ctx->reg[FP_REG] );
VG_(printf)("\n");
}
=20
@@ -1647,6 +1650,7 @@
HChar* how =3D NULL;
Int cie_codeaf =3D 0;
Int cie_dataaf =3D 0;
+ Int cie_rareg =3D 0;
Bool ok;
=20
UChar* current_cie =3D NULL;
@@ -1697,7 +1701,7 @@
if (ciefde_len =3D=3D 0) {
if (data =3D=3D ehframe + ehframe_sz)
return;
- how =3D "zero-sized CIE/FDE but not at section end\n";
+ how =3D "zero-sized CIE/FDE but not at section end";
goto bad;
}
=20
@@ -1743,11 +1747,11 @@
if (VG_(clo_trace_cfi))=20
VG_(printf)("cie.data_af =3D %d\n", cie_dataaf);
=20
- UChar cie_rareg =3D read_UChar(data); data +=3D sizeof(UChar);
+ cie_rareg =3D read_UChar(data); data +=3D sizeof(UChar);
if (VG_(clo_trace_cfi))=20
VG_(printf)("cie.ra_reg =3D %d\n", (Int)cie_rareg);
- if (cie_rareg !=3D RA_COL) {
- how =3D "cie.ra_reg does not match RA_COL";
+ if (cie_rareg < 0 || cie_rareg >=3D N_CFI_REGS) {
+ how =3D "cie.ra_reg has implausible value";
goto bad;
}
=20
@@ -1865,6 +1869,7 @@
ctx.code_a_f =3D cie_codeaf;
ctx.data_a_f =3D cie_dataaf;
ctx.initloc =3D fde_initloc;
+ ctx.ra_reg =3D cie_rareg;
=20
initUnwindContext(&restore_ctx);
=20
|
|
From: <js...@ac...> - 2005-05-13 03:05:28
|
Nightly build on phoenix ( SuSE 9.1 ) started at 2005-05-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 insn_mmx: valgrind ./insn_mmx insn_mmxext: (skipping, prereq failed: ../../../tests/cputest x86-mmxext) insn_sse: valgrind ./insn_sse insn_sse2: (skipping, prereq failed: ../../../tests/cputest x86-sse2) int: valgrind ./int pushpopseg: valgrind ./pushpopseg rcl_assert: valgrind ./rcl_assert seg_override: valgrind ./seg_override -- Finished tests in none/tests/x86 ------------------------------------ yield: valgrind ./yield -- Finished tests in none/tests ---------------------------------------- == 201 tests, 5 stderr failures, 0 stdout failures ================= memcheck/tests/pth_once (stderr) memcheck/tests/scalar (stderr) memcheck/tests/threadederrno (stderr) memcheck/tests/writev (stderr) corecheck/tests/fdleak_fcntl (stderr) make: *** [regtest] Error 1 |
|
From: Tom H. <to...@co...> - 2005-05-13 02:35:59
|
Nightly build on dunsmere ( athlon, Fedora Core 3 ) started at 2005-05-13 03:30: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 == 175 tests, 167 stderr failures, 1 stdout failure ================= memcheck/tests/addressable (stderr) memcheck/tests/badaddrvalue (stderr) memcheck/tests/badfree-2trace (stderr) memcheck/tests/badfree (stderr) memcheck/tests/badjump (stderr) memcheck/tests/badjump2 (stderr) memcheck/tests/badloop (stderr) memcheck/tests/badpoll (stderr) memcheck/tests/badrw (stderr) memcheck/tests/brk (stderr) memcheck/tests/brk2 (stderr) memcheck/tests/buflen_check (stderr) memcheck/tests/clientperm (stderr) memcheck/tests/custom_alloc (stderr) memcheck/tests/describe-block (stderr) memcheck/tests/doublefree (stderr) memcheck/tests/errs1 (stderr) memcheck/tests/execve (stderr) memcheck/tests/execve2 (stderr) memcheck/tests/exitprog (stderr) memcheck/tests/fprw (stderr) memcheck/tests/fwrite (stderr) memcheck/tests/inits (stderr) memcheck/tests/inline (stderr) memcheck/tests/leak-0 (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-regroot (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/malloc1 (stderr) memcheck/tests/malloc2 (stderr) memcheck/tests/malloc3 (stderr) memcheck/tests/manuel1 (stderr) memcheck/tests/manuel2 (stderr) memcheck/tests/manuel3 (stderr) memcheck/tests/match-overrun (stderr) memcheck/tests/memalign2 (stderr) memcheck/tests/memalign_test (stderr) memcheck/tests/memcmptest (stderr) memcheck/tests/mempool (stderr) memcheck/tests/mismatches (stderr) memcheck/tests/mmaptest (stderr) memcheck/tests/nanoleak (stderr) memcheck/tests/nanoleak_supp (stderr) memcheck/tests/new_nothrow (stderr) memcheck/tests/new_override (stderr) memcheck/tests/null_socket (stderr) memcheck/tests/overlap (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/post-syscall (stderr) memcheck/tests/realloc1 (stderr) memcheck/tests/realloc2 (stderr) memcheck/tests/realloc3 (stderr) memcheck/tests/sigaltstack (stderr) memcheck/tests/signal2 (stderr) memcheck/tests/sigprocmask (stderr) memcheck/tests/str_tester (stderr) memcheck/tests/supp1 (stderr) memcheck/tests/supp2 (stderr) memcheck/tests/suppfree (stderr) memcheck/tests/toobig-allocs (stderr) memcheck/tests/trivialleak (stderr) memcheck/tests/vgtest_ume (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/writev (stderr) memcheck/tests/x86/fpeflags (stderr) memcheck/tests/x86/pushfpopf (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/x86/scalar_exit_group (stderr) memcheck/tests/x86/scalar_fork (stderr) memcheck/tests/x86/scalar_supp (stderr) memcheck/tests/x86/scalar_vfork (stderr) memcheck/tests/x86/tronical (stderr) memcheck/tests/zeropage (stderr) cachegrind/tests/chdir (stderr) cachegrind/tests/dlclose (stderr) cachegrind/tests/x86/fpu-28-108 (stderr) corecheck/tests/as_mmap (stderr) corecheck/tests/as_shm (stderr) corecheck/tests/erringfds (stderr) corecheck/tests/fdleak_cmsg (stderr) corecheck/tests/fdleak_creat (stderr) corecheck/tests/fdleak_dup (stderr) corecheck/tests/fdleak_dup2 (stderr) corecheck/tests/fdleak_fcntl (stderr) corecheck/tests/fdleak_ipv4 (stderr) corecheck/tests/fdleak_open (stderr) corecheck/tests/fdleak_pipe (stderr) corecheck/tests/fdleak_socketpair (stderr) corecheck/tests/pth_atfork1 (stderr) corecheck/tests/pth_cancel1 (stderr) corecheck/tests/pth_cancel2 (stderr) corecheck/tests/pth_cvsimple (stderr) corecheck/tests/pth_empty (stderr) corecheck/tests/pth_exit (stderr) corecheck/tests/pth_exit2 (stderr) corecheck/tests/pth_mutexspeed (stderr) corecheck/tests/pth_once (stderr) corecheck/tests/pth_rwlock (stderr) corecheck/tests/res_search (stderr) corecheck/tests/sigkill (stderr) corecheck/tests/threadederrno (stderr) corecheck/tests/vgprintf (stderr) massif/tests/toobig-allocs (stderr) massif/tests/true_html (stderr) massif/tests/true_text (stderr) lackey/tests/true (stderr) none/tests/args (stderr) none/tests/async-sigs (stderr) none/tests/bitfield1 (stderr) none/tests/blockfault (stderr) none/tests/closeall (stderr) none/tests/coolo_sigaction (stderr) none/tests/coolo_strlen (stderr) none/tests/discard (stderr) none/tests/exec-sigmask (stderr) none/tests/execve (stderr) none/tests/faultstatus (stderr) none/tests/fcntl_setown (stderr) none/tests/floored (stderr) none/tests/fork (stderr) none/tests/fucomip (stderr) none/tests/gxx304 (stderr) none/tests/manythreads (stderr) none/tests/map_unaligned (stderr) none/tests/map_unmap (stderr) none/tests/mq (stderr) none/tests/mremap (stderr) none/tests/munmap_exe (stderr) none/tests/pending (stderr) none/tests/pth_blockedsig (stderr) none/tests/pth_stackalign (stderr) none/tests/rcrl (stderr) none/tests/readline1 (stderr) none/tests/resolv (stderr) none/tests/rlimit_nofile (stderr) none/tests/selfrun (stdout) none/tests/selfrun (stderr) none/tests/sem (stderr) none/tests/semlimit (stderr) none/tests/sha1_test (stderr) none/tests/shortpush (stderr) none/tests/shorts (stderr) none/tests/sigstackgrowth (stderr) none/tests/smc1 (stderr) none/tests/stackgrowth (stderr) none/tests/syscall-restart1 (stderr) none/tests/syscall-restart2 (stderr) none/tests/system (stderr) none/tests/thread-exits (stderr) none/tests/threaded-fork (stderr) none/tests/tls (stderr) none/tests/x86/badseg (stderr) none/tests/x86/bt_everything (stderr) none/tests/x86/bt_literal (stderr) none/tests/x86/cpuid (stderr) none/tests/x86/fpu_lazy_eflags (stderr) none/tests/x86/getseg (stderr) none/tests/x86/insn_basic (stderr) none/tests/x86/insn_cmov (stderr) none/tests/x86/insn_fpu (stderr) none/tests/x86/insn_mmx (stderr) none/tests/x86/insn_mmxext (stderr) none/tests/x86/insn_sse (stderr) none/tests/x86/int (stderr) none/tests/x86/pushpopseg (stderr) none/tests/x86/seg_override (stderr) none/tests/x86/sigcontext (stderr) none/tests/yield (stderr) |
|
From: Tom H. <th...@cy...> - 2005-05-13 02:31:07
|
Nightly build on audi ( i686, Red Hat 9 ) started at 2005-05-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 == 174 tests, 3 stderr failures, 1 stdout failure ================= corecheck/tests/fdleak_cmsg (stderr) none/tests/faultstatus (stderr) none/tests/x86/int (stderr) none/tests/yield (stdout) |
|
From: Tom H. <to...@co...> - 2005-05-13 02:26:27
|
Nightly build on dunsmere ( Fedora Core 3 ) started at 2005-05-13 03:20:04 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow insn_mmx: valgrind ./insn_mmx insn_mmxext: valgrind ./insn_mmxext insn_sse: valgrind ./insn_sse insn_sse2: (skipping, prereq failed: ../../../tests/cputest x86-sse2) int: valgrind ./int sh: line 1: 14897 Segmentation fault VALGRINDLIB=/tmp/valgrind.21595/valgrind/.in_place /tmp/valgrind.21595/valgrind/./coregrind/valgrind --command-line-only=yes --memcheck:leak-check=no --addrcheck:leak-check=no --tool=none ./int >int.stdout.out 2>int.stderr.out pushpopseg: valgrind ./pushpopseg rcl_assert: valgrind ./rcl_assert seg_override: valgrind ./seg_override -- Finished tests in none/tests/x86 ------------------------------------ yield: valgrind ./yield -- Finished tests in none/tests ---------------------------------------- == 207 tests, 4 stderr failures, 0 stdout failures ================= memcheck/tests/execve (stderr) memcheck/tests/execve2 (stderr) memcheck/tests/scalar (stderr) memcheck/tests/scalar_supp (stderr) make: *** [regtest] Error 1 |
|
From: Tom H. <th...@cy...> - 2005-05-13 02:25:35
|
Nightly build on ginetta ( i686, Red Hat 8.0 ) started at 2005-05-13 03:20:01 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 == 173 tests, 3 stderr failures, 0 stdout failures ================= corecheck/tests/fdleak_cmsg (stderr) none/tests/faultstatus (stderr) none/tests/x86/int (stderr) |
|
From: Tom H. <th...@cy...> - 2005-05-13 02:22:41
|
Nightly build on audi ( Red Hat 9 ) started at 2005-05-13 03:15:03 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow fpu_lazy_eflags: valgrind ./fpu_lazy_eflags insn_basic: valgrind ./insn_basic insn_cmov: valgrind ./insn_cmov insn_fpu: valgrind ./insn_fpu insn_mmx: valgrind ./insn_mmx insn_mmxext: valgrind ./insn_mmxext insn_sse: valgrind ./insn_sse insn_sse2: (skipping, prereq failed: ../../../tests/cputest x86-sse2) int: valgrind ./int pushpopseg: valgrind ./pushpopseg rcl_assert: valgrind ./rcl_assert seg_override: valgrind ./seg_override -- Finished tests in none/tests/x86 ------------------------------------ yield: valgrind ./yield -- Finished tests in none/tests ---------------------------------------- == 206 tests, 1 stderr failure, 0 stdout failures ================= memcheck/tests/scalar (stderr) make: *** [regtest] Error 1 |
|
From: Tom H. <th...@cy...> - 2005-05-13 02:20:53
|
Nightly build on alvis ( i686, Red Hat 7.3 ) started at 2005-05-13 03:15:01 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 == 173 tests, 12 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) corecheck/tests/fdleak_cmsg (stderr) none/tests/faultstatus (stderr) none/tests/x86/int (stderr) |
|
From: Tom H. <th...@cy...> - 2005-05-13 02:19:52
|
Nightly build on dellow ( x86_64, Fedora Core 3 ) started at 2005-05-13 03:10:05 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 == 154 tests, 17 stderr failures, 3 stdout failures ================= memcheck/tests/brk (stderr) memcheck/tests/error_counts (stdout) memcheck/tests/sigaltstack (stderr) memcheck/tests/sigprocmask (stderr) memcheck/tests/toobig-allocs (stderr) memcheck/tests/weirdioctl (stderr) corecheck/tests/fdleak_cmsg (stderr) corecheck/tests/fdleak_creat (stderr) corecheck/tests/fdleak_dup (stderr) corecheck/tests/fdleak_dup2 (stderr) corecheck/tests/fdleak_fcntl (stderr) corecheck/tests/fdleak_ipv4 (stderr) corecheck/tests/fdleak_open (stderr) corecheck/tests/fdleak_pipe (stderr) corecheck/tests/fdleak_socketpair (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-05-13 02:16:39
|
Nightly build on ginetta ( Red Hat 8.0 ) started at 2005-05-13 03:10:01 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow insn_cmov: valgrind ./insn_cmov insn_fpu: valgrind ./insn_fpu insn_mmx: valgrind ./insn_mmx insn_mmxext: valgrind ./insn_mmxext insn_sse: valgrind ./insn_sse insn_sse2: (skipping, prereq failed: ../../../tests/cputest x86-sse2) int: valgrind ./int pushpopseg: valgrind ./pushpopseg rcl_assert: valgrind ./rcl_assert seg_override: valgrind ./seg_override -- Finished tests in none/tests/x86 ------------------------------------ yield: valgrind ./yield -- Finished tests in none/tests ---------------------------------------- == 205 tests, 3 stderr failures, 0 stdout failures ================= memcheck/tests/pth_once (stderr) memcheck/tests/scalar (stderr) memcheck/tests/threadederrno (stderr) make: *** [regtest] Error 1 |
|
From: Tom H. <th...@cy...> - 2005-05-13 02:11:45
|
Nightly build on alvis ( Red Hat 7.3 ) started at 2005-05-13 03:05:02 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow == 205 tests, 17 stderr failures, 0 stdout failures ================= memcheck/tests/addressable (stderr) memcheck/tests/describe-block (stderr) memcheck/tests/distinguished-writes (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/pth_once (stderr) memcheck/tests/scalar (stderr) memcheck/tests/threadederrno (stderr) memcheck/tests/vgtest_ume (stderr) addrcheck/tests/leak-0 (stderr) addrcheck/tests/leak-cycle (stderr) addrcheck/tests/leak-regroot (stderr) addrcheck/tests/leak-tree (stderr) make: *** [regtest] Error 1 |