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
(26) |
2
(35) |
3
(18) |
4
(14) |
|
5
(12) |
6
(13) |
7
(11) |
8
(15) |
9
(8) |
10
(13) |
11
(25) |
|
12
(13) |
13
(24) |
14
(7) |
15
(6) |
16
(8) |
17
(6) |
18
(7) |
|
19
(8) |
20
(7) |
21
(5) |
22
(7) |
23
(6) |
24
(7) |
25
(6) |
|
26
(7) |
27
(7) |
28
(5) |
29
(5) |
30
(5) |
|
|
|
From: Nicholas N. <nj...@ca...> - 2004-09-06 16:46:46
|
CVS commit by nethercote:
Arch-abstraction:
- moved a lot of the baseBlock initialisation into x86/, including all the
VGOFF variables, and all the x86 asm helper functions.
M +9 -111 coregrind/core.h 1.13
M +13 -238 coregrind/vg_main.c 1.204
M +108 -0 coregrind/x86/core_arch.h 1.5
M +243 -0 coregrind/x86/state.c 1.2
M +28 -81 include/tool.h.base 1.6
M +72 -0 include/x86/tool_arch.h 1.3
--- valgrind/coregrind/core.h #1.12:1.13
@@ -1281,4 +1281,8 @@ extern UInt VG_(unchained_jumps_done); /
extern void VG_(print_scheduler_stats) ( void );
+extern Int VG_(alloc_BaB)( Int ); // Allocate slots in baseBlock
+extern void VG_(align_BaB)( UInt ); // Align baseBlock offset
+extern Int VG_(alloc_BaB_1_set)( Addr ); // Allocate & init baseBlock slot
+
/* ---------------------------------------------------------------------
Exports of vg_memory.c
@@ -1447,55 +1451,4 @@ extern UInt VG_(patch_me);
------------------------------------------------------------------ */
-/* Mul, div, etc, -- we don't codegen these directly. */
-extern void VG_(helper_idiv_64_32);
-extern void VG_(helper_div_64_32);
-extern void VG_(helper_idiv_32_16);
-extern void VG_(helper_div_32_16);
-extern void VG_(helper_idiv_16_8);
-extern void VG_(helper_div_16_8);
-
-extern void VG_(helper_imul_32_64);
-extern void VG_(helper_mul_32_64);
-extern void VG_(helper_imul_16_32);
-extern void VG_(helper_mul_16_32);
-extern void VG_(helper_imul_8_16);
-extern void VG_(helper_mul_8_16);
-
-extern void VG_(helper_CLD);
-extern void VG_(helper_STD);
-extern void VG_(helper_get_dirflag);
-
-extern void VG_(helper_CLC);
-extern void VG_(helper_STC);
-extern void VG_(helper_CMC);
-
-extern void VG_(helper_shldl);
-extern void VG_(helper_shldw);
-extern void VG_(helper_shrdl);
-extern void VG_(helper_shrdw);
-
-extern void VG_(helper_IN);
-extern void VG_(helper_OUT);
-
-extern void VG_(helper_RDTSC);
-extern void VG_(helper_CPUID);
-
-extern void VG_(helper_bsfw);
-extern void VG_(helper_bsfl);
-extern void VG_(helper_bsrw);
-extern void VG_(helper_bsrl);
-
-extern void VG_(helper_fstsw_AX);
-extern void VG_(helper_SAHF);
-extern void VG_(helper_LAHF);
-extern void VG_(helper_DAS);
-extern void VG_(helper_DAA);
-extern void VG_(helper_AAS);
-extern void VG_(helper_AAA);
-extern void VG_(helper_AAD);
-extern void VG_(helper_AAM);
-
-extern void VG_(helper_cmpxchg8b);
-
extern void VG_(helper_undefined_instruction);
@@ -1523,10 +1476,5 @@ extern void VG_(missing_tool_func) ( con
------------------------------------------------------------------ */
-/* ---------------------------------------------------------------------
- Offsets into baseBlock for everything which needs to referred to
- from generated code. The order of these decls does not imply
- what the order of the actual offsets is. The latter is important
- and is set up in vg_main.c.
- ------------------------------------------------------------------ */
+#define INVALID_OFFSET (-1)
/* An array of words. In generated code, %ebp always points to the
@@ -1541,62 +1489,12 @@ extern void VG_(missing_tool_func) ( con
extern UInt VG_(baseBlock)[VG_BASEBLOCK_WORDS];
-/* -----------------------------------------------------
- Read-write parts of baseBlock.
- -------------------------------------------------- */
-
-/* State of the simulated CPU. */
-extern Int VGOFF_(m_eax);
-extern Int VGOFF_(m_ecx);
-extern Int VGOFF_(m_edx);
-extern Int VGOFF_(m_ebx);
-extern Int VGOFF_(m_esp);
-extern Int VGOFF_(m_ebp);
-extern Int VGOFF_(m_esi);
-extern Int VGOFF_(m_edi);
-extern Int VGOFF_(m_eflags);
-extern Int VGOFF_(m_ssestate);
-extern Int VGOFF_(m_eip);
-
-extern Int VGOFF_(m_dflag); /* D flag is handled specially */
-
-extern Int VGOFF_(m_cs);
-extern Int VGOFF_(m_ss);
-extern Int VGOFF_(m_ds);
-extern Int VGOFF_(m_es);
-extern Int VGOFF_(m_fs);
-extern Int VGOFF_(m_gs);
-
-/* Reg-alloc spill area (VG_MAX_SPILLSLOTS words long). */
-extern Int VGOFF_(spillslots);
-
-/* Records the valid bits for the 8 integer regs & flags reg. */
-extern Int VGOFF_(sh_eax);
-extern Int VGOFF_(sh_ecx);
-extern Int VGOFF_(sh_edx);
-extern Int VGOFF_(sh_ebx);
-extern Int VGOFF_(sh_esp);
-extern Int VGOFF_(sh_ebp);
-extern Int VGOFF_(sh_esi);
-extern Int VGOFF_(sh_edi);
-extern Int VGOFF_(sh_eflags);
-
-/* -----------------------------------------------------
- Read-only parts of baseBlock.
- -------------------------------------------------- */
-
-/* This thread's LDT pointer. */
-extern Int VGOFF_(ldt);
-
-/* This thread's TLS pointer. */
-extern Int VGOFF_(tls_ptr);
-
-/* Nb: Most helper offsets are in include/tool.h, for use by tools */
-
-extern Int VGOFF_(helper_undefined_instruction);
-
// ---------------------------------------------------------------------
// Architecture-specific things defined in eg. x86/*.c
// ---------------------------------------------------------------------
+/* For setting up the baseBlock */
+extern void VGA_(init_low_baseBlock) ( Addr client_eip, Addr esp_at_startup );
+extern void VGA_(init_high_baseBlock) ( Addr client_eip, Addr esp_at_startup );
+
extern void VGA_(load_state) ( arch_thread_t*, ThreadId tid );
extern void VGA_(save_state) ( arch_thread_t*, ThreadId tid );
--- valgrind/coregrind/vg_main.c #1.203:1.204
@@ -2108,80 +2108,4 @@ static void setup_file_descriptors(void)
/*====================================================================*/
-/* The variables storing offsets. */
-
-#define INVALID_OFFSET (-1)
-
-Int VGOFF_(m_eax) = INVALID_OFFSET;
-Int VGOFF_(m_ecx) = INVALID_OFFSET;
-Int VGOFF_(m_edx) = INVALID_OFFSET;
-Int VGOFF_(m_ebx) = INVALID_OFFSET;
-Int VGOFF_(m_esp) = INVALID_OFFSET;
-Int VGOFF_(m_ebp) = INVALID_OFFSET;
-Int VGOFF_(m_esi) = INVALID_OFFSET;
-Int VGOFF_(m_edi) = INVALID_OFFSET;
-Int VGOFF_(m_eflags) = INVALID_OFFSET;
-Int VGOFF_(m_dflag) = INVALID_OFFSET;
-Int VGOFF_(m_ssestate) = INVALID_OFFSET;
-Int VGOFF_(ldt) = INVALID_OFFSET;
-Int VGOFF_(tls_ptr) = INVALID_OFFSET;
-Int VGOFF_(m_cs) = INVALID_OFFSET;
-Int VGOFF_(m_ss) = INVALID_OFFSET;
-Int VGOFF_(m_ds) = INVALID_OFFSET;
-Int VGOFF_(m_es) = INVALID_OFFSET;
-Int VGOFF_(m_fs) = INVALID_OFFSET;
-Int VGOFF_(m_gs) = INVALID_OFFSET;
-Int VGOFF_(m_eip) = INVALID_OFFSET;
-Int VGOFF_(spillslots) = INVALID_OFFSET;
-Int VGOFF_(sh_eax) = INVALID_OFFSET;
-Int VGOFF_(sh_ecx) = INVALID_OFFSET;
-Int VGOFF_(sh_edx) = INVALID_OFFSET;
-Int VGOFF_(sh_ebx) = INVALID_OFFSET;
-Int VGOFF_(sh_esp) = INVALID_OFFSET;
-Int VGOFF_(sh_ebp) = INVALID_OFFSET;
-Int VGOFF_(sh_esi) = INVALID_OFFSET;
-Int VGOFF_(sh_edi) = INVALID_OFFSET;
-Int VGOFF_(sh_eflags) = INVALID_OFFSET;
-
-Int VGOFF_(helper_idiv_64_32) = INVALID_OFFSET;
-Int VGOFF_(helper_div_64_32) = INVALID_OFFSET;
-Int VGOFF_(helper_idiv_32_16) = INVALID_OFFSET;
-Int VGOFF_(helper_div_32_16) = INVALID_OFFSET;
-Int VGOFF_(helper_idiv_16_8) = INVALID_OFFSET;
-Int VGOFF_(helper_div_16_8) = INVALID_OFFSET;
-Int VGOFF_(helper_imul_32_64) = INVALID_OFFSET;
-Int VGOFF_(helper_mul_32_64) = INVALID_OFFSET;
-Int VGOFF_(helper_imul_16_32) = INVALID_OFFSET;
-Int VGOFF_(helper_mul_16_32) = INVALID_OFFSET;
-Int VGOFF_(helper_imul_8_16) = INVALID_OFFSET;
-Int VGOFF_(helper_mul_8_16) = INVALID_OFFSET;
-Int VGOFF_(helper_CLD) = INVALID_OFFSET;
-Int VGOFF_(helper_STD) = INVALID_OFFSET;
-Int VGOFF_(helper_get_dirflag) = INVALID_OFFSET;
-Int VGOFF_(helper_CLC) = INVALID_OFFSET;
-Int VGOFF_(helper_STC) = INVALID_OFFSET;
-Int VGOFF_(helper_CMC) = INVALID_OFFSET;
-Int VGOFF_(helper_shldl) = INVALID_OFFSET;
-Int VGOFF_(helper_shldw) = INVALID_OFFSET;
-Int VGOFF_(helper_shrdl) = INVALID_OFFSET;
-Int VGOFF_(helper_shrdw) = INVALID_OFFSET;
-Int VGOFF_(helper_IN) = INVALID_OFFSET;
-Int VGOFF_(helper_OUT) = INVALID_OFFSET;
-Int VGOFF_(helper_RDTSC) = INVALID_OFFSET;
-Int VGOFF_(helper_CPUID) = INVALID_OFFSET;
-Int VGOFF_(helper_BSWAP) = INVALID_OFFSET;
-Int VGOFF_(helper_bsfw) = INVALID_OFFSET;
-Int VGOFF_(helper_bsfl) = INVALID_OFFSET;
-Int VGOFF_(helper_bsrw) = INVALID_OFFSET;
-Int VGOFF_(helper_bsrl) = INVALID_OFFSET;
-Int VGOFF_(helper_fstsw_AX) = INVALID_OFFSET;
-Int VGOFF_(helper_SAHF) = INVALID_OFFSET;
-Int VGOFF_(helper_LAHF) = INVALID_OFFSET;
-Int VGOFF_(helper_DAS) = INVALID_OFFSET;
-Int VGOFF_(helper_DAA) = INVALID_OFFSET;
-Int VGOFF_(helper_AAS) = INVALID_OFFSET;
-Int VGOFF_(helper_AAA) = INVALID_OFFSET;
-Int VGOFF_(helper_AAD) = INVALID_OFFSET;
-Int VGOFF_(helper_AAM) = INVALID_OFFSET;
-Int VGOFF_(helper_cmpxchg8b) = INVALID_OFFSET;
Int VGOFF_(helper_undefined_instruction) = INVALID_OFFSET;
@@ -2211,10 +2135,10 @@ static Int baB_off = 0;
/* Returns the offset, in words. */
-static Int alloc_BaB ( Int words )
+Int VG_(alloc_BaB) ( Int words )
{
Int off = baB_off;
baB_off += words;
if (baB_off >= VG_BASEBLOCK_WORDS)
- VG_(core_panic)( "alloc_BaB: baseBlock is too small");
+ VG_(core_panic)( "VG_(alloc_BaB): baseBlock is too small");
return off;
@@ -2222,5 +2146,5 @@ static Int alloc_BaB ( Int words )
/* Align offset, in *bytes* */
-static void align_BaB ( UInt align )
+void VG_(align_BaB) ( UInt align )
{
vg_assert(2 == align || 4 == align || 8 == align || 16 == align);
@@ -2230,7 +2154,7 @@ static void align_BaB ( UInt align )
/* Allocate 1 word in baseBlock and set it to the given value. */
-static Int alloc_BaB_1_set ( Addr a )
+Int VG_(alloc_BaB_1_set) ( Addr a )
{
- Int off = alloc_BaB(1);
+ Int off = VG_(alloc_BaB)(1);
VG_(baseBlock)[off] = (UInt)a;
return off;
@@ -2271,5 +2195,5 @@ void assign_helpers_in_baseBlock(UInt n,
UInt i;
for (i = 0; i < n; i++)
- offsets[i] = alloc_BaB_1_set( addrs[i] );
+ offsets[i] = VG_(alloc_BaB_1_set)( addrs[i] );
}
@@ -2291,50 +2215,11 @@ Bool VG_(need_to_handle_esp_assignment)(
}
-/* Here we assign actual offsets. It's important to get the most
- popular referents within 128 bytes of the start, so we can take
- advantage of short addressing modes relative to %ebp. Popularity
- of offsets was measured on 22 Feb 02 running a KDE application, and
- the slots rearranged accordingly, with a 1.5% reduction in total
- size of translations. */
+// The low/high split is for x86, so that the more common helpers can be
+// in the first 128 bytes of the start, which allows the use of a more
+// compact addressing mode.
static void init_baseBlock ( Addr client_eip, Addr esp_at_startup )
{
- /* Those with offsets under 128 are carefully chosen. */
-
- /* WORD offsets in this column */
- /* 0 */ VGOFF_(m_eax) = alloc_BaB_1_set(0);
- /* 1 */ VGOFF_(m_ecx) = alloc_BaB_1_set(0);
- /* 2 */ VGOFF_(m_edx) = alloc_BaB_1_set(0);
- /* 3 */ VGOFF_(m_ebx) = alloc_BaB_1_set(0);
- /* 4 */ VGOFF_(m_esp) = alloc_BaB_1_set(esp_at_startup);
- /* 5 */ VGOFF_(m_ebp) = alloc_BaB_1_set(0);
- /* 6 */ VGOFF_(m_esi) = alloc_BaB_1_set(0);
- /* 7 */ VGOFF_(m_edi) = alloc_BaB_1_set(0);
- /* 8 */ VGOFF_(m_eflags) = alloc_BaB_1_set(0);
-
- if (VG_(needs).shadow_regs) {
- /* 9 */ VGOFF_(sh_eax) = alloc_BaB_1_set(0);
- /* 10 */ VGOFF_(sh_ecx) = alloc_BaB_1_set(0);
- /* 11 */ VGOFF_(sh_edx) = alloc_BaB_1_set(0);
- /* 12 */ VGOFF_(sh_ebx) = alloc_BaB_1_set(0);
- /* 13 */ VGOFF_(sh_esp) = alloc_BaB_1_set(0);
- /* 14 */ VGOFF_(sh_ebp) = alloc_BaB_1_set(0);
- /* 15 */ VGOFF_(sh_esi) = alloc_BaB_1_set(0);
- /* 16 */ VGOFF_(sh_edi) = alloc_BaB_1_set(0);
- /* 17 */ VGOFF_(sh_eflags) = alloc_BaB_1_set(0);
- VG_TRACK( post_regs_write_init );
- }
-
- /* 9,10,11 or 18,19,20... depends on number whether shadow regs are used
- * and on compact helpers registered */
-
- /* Make these most-frequently-called specialised ones compact, if they
- are used. */
- if (VG_(defined_new_mem_stack_4)())
- VG_(register_compact_helper)( (Addr) VG_(tool_interface).track_new_mem_stack_4);
-
- if (VG_(defined_die_mem_stack_4)())
- VG_(register_compact_helper)( (Addr) VG_(tool_interface).track_die_mem_stack_4);
+ VGA_(init_low_baseBlock)(client_eip, esp_at_startup);
- /* (9 or 18) + n_compact_helpers */
/* Allocate slots for compact helpers */
assign_helpers_in_baseBlock(VG_(n_compact_helpers),
@@ -2342,80 +2227,5 @@ static void init_baseBlock ( Addr client
VG_(compact_helper_addrs));
- /* (9/10 or 18/19) + n_compact_helpers */
- VGOFF_(m_eip) = alloc_BaB_1_set(client_eip);
-
- /* There are currently 24 spill slots */
- /* (11+/20+ .. 32+/43+) + n_compact_helpers. This can overlap the magic
- * boundary at >= 32 words, but most spills are to low numbered spill
- * slots, so the ones above the boundary don't see much action. */
- VGOFF_(spillslots) = alloc_BaB(VG_MAX_SPILLSLOTS);
-
- /* I gave up counting at this point. Since they're above the
- short-amode-boundary, there's no point. */
-
- VGOFF_(m_dflag) = alloc_BaB_1_set(1); // 1 == forward D-flag
-
- /* The FPU/SSE state. This _must_ be 16-byte aligned. Initial
- state doesn't matter much, as long as it's not totally borked. */
- align_BaB(16);
- VGOFF_(m_ssestate) = alloc_BaB(VG_SIZE_OF_SSESTATE_W);
- vg_assert(
- 0 == ( ((UInt)(& VG_(baseBlock)[VGOFF_(m_ssestate)])) % 16 )
- );
-
- /* I assume that if we have SSE2 we also have SSE */
- VG_(have_ssestate) =
- VG_(cpu_has_feature)(VG_X86_FEAT_FXSR) &&
- VG_(cpu_has_feature)(VG_X86_FEAT_SSE);
-
- /* set up an initial FPU state (doesn't really matter what it is,
- so long as it's somewhat valid) */
- if (!VG_(have_ssestate))
- asm volatile("fwait; fnsave %0; fwait; frstor %0; fwait"
- :
- : "m" (VG_(baseBlock)[VGOFF_(m_ssestate)])
- : "cc", "memory");
- else
- asm volatile("fwait; fxsave %0; fwait; andl $0xffbf, %1;"
- "fxrstor %0; fwait"
- :
- : "m" (VG_(baseBlock)[VGOFF_(m_ssestate)]),
- "m" (VG_(baseBlock)[VGOFF_(m_ssestate)+(24/4)])
- : "cc", "memory");
-
- if (0) {
- if (VG_(have_ssestate))
- VG_(printf)("Looks like a SSE-capable CPU\n");
- else
- VG_(printf)("Looks like a MMX-only CPU\n");
- }
-
- /* LDT pointer: pretend the root thread has an empty LDT to start with. */
- VGOFF_(ldt) = alloc_BaB_1_set((UInt)NULL);
-
- /* TLS pointer: pretend the root thread has no TLS array for now. */
- VGOFF_(tls_ptr) = alloc_BaB_1_set((UInt)NULL);
-
- /* segment registers */
- VGOFF_(m_cs) = alloc_BaB_1_set(0);
- VGOFF_(m_ss) = alloc_BaB_1_set(0);
- VGOFF_(m_ds) = alloc_BaB_1_set(0);
- VGOFF_(m_es) = alloc_BaB_1_set(0);
- VGOFF_(m_fs) = alloc_BaB_1_set(0);
- VGOFF_(m_gs) = alloc_BaB_1_set(0);
-
- /* initialise %cs, %ds and %ss to point at the operating systems
- default code, data and stack segments */
- asm volatile("movw %%cs, %0"
- :
- : "m" (VG_(baseBlock)[VGOFF_(m_cs)]));
- asm volatile("movw %%ds, %0"
- :
- : "m" (VG_(baseBlock)[VGOFF_(m_ds)]));
- asm volatile("movw %%ss, %0"
- :
- : "m" (VG_(baseBlock)[VGOFF_(m_ss)]));
-
- VG_(register_noncompact_helper)( (Addr) & VG_(do_useseg) );
+ VGA_(init_high_baseBlock)(client_eip, esp_at_startup);
#define REG(kind, size) \
@@ -2438,41 +2248,6 @@ static void init_baseBlock ( Addr client
VG_(register_noncompact_helper)((Addr) VG_(unknown_esp_update));
-# define HELPER(name) \
- VGOFF_(helper_##name) = alloc_BaB_1_set( (Addr) & VG_(helper_##name))
-
- /* Helper functions. */
- HELPER(idiv_64_32); HELPER(div_64_32);
- HELPER(idiv_32_16); HELPER(div_32_16);
- HELPER(idiv_16_8); HELPER(div_16_8);
-
- HELPER(imul_32_64); HELPER(mul_32_64);
- HELPER(imul_16_32); HELPER(mul_16_32);
- HELPER(imul_8_16); HELPER(mul_8_16);
-
- HELPER(CLD); HELPER(STD);
- HELPER(get_dirflag);
-
- HELPER(CLC); HELPER(STC);
- HELPER(CMC);
-
- HELPER(shldl); HELPER(shldw);
- HELPER(shrdl); HELPER(shrdw);
-
- HELPER(RDTSC); HELPER(CPUID);
-
- HELPER(bsfw); HELPER(bsfl);
- HELPER(bsrw); HELPER(bsrl);
-
- HELPER(fstsw_AX);
- HELPER(SAHF); HELPER(LAHF);
- HELPER(DAS); HELPER(DAA);
- HELPER(AAS); HELPER(AAA);
- HELPER(AAD); HELPER(AAM);
- HELPER(IN); HELPER(OUT);
- HELPER(cmpxchg8b);
-
- HELPER(undefined_instruction);
-
-# undef HELPER
+ VGOFF_(helper_undefined_instruction)
+ = VG_(alloc_BaB_1_set)( (Addr) & VG_(helper_undefined_instruction));
/* Allocate slots for noncompact helpers */
--- valgrind/coregrind/x86/core_arch.h #1.4:1.5
@@ -60,4 +60,112 @@
#define VGOFF_FRAME_PTR VGOFF_(m_ebp)
+/* -----------------------------------------------------
+ Read-write parts of baseBlock.
+ -------------------------------------------------- */
+
+/* State of the simulated CPU. */
+extern Int VGOFF_(m_eax);
+extern Int VGOFF_(m_ecx);
+extern Int VGOFF_(m_edx);
+extern Int VGOFF_(m_ebx);
+extern Int VGOFF_(m_esp);
+extern Int VGOFF_(m_ebp);
+extern Int VGOFF_(m_esi);
+extern Int VGOFF_(m_edi);
+extern Int VGOFF_(m_eflags);
+extern Int VGOFF_(m_ssestate);
+extern Int VGOFF_(m_eip);
+
+extern Int VGOFF_(m_dflag); /* D flag is handled specially */
+
+extern Int VGOFF_(m_cs);
+extern Int VGOFF_(m_ss);
+extern Int VGOFF_(m_ds);
+extern Int VGOFF_(m_es);
+extern Int VGOFF_(m_fs);
+extern Int VGOFF_(m_gs);
+
+/* Reg-alloc spill area (VG_MAX_SPILLSLOTS words long). */
+extern Int VGOFF_(spillslots);
+
+/* Records the valid bits for the 8 integer regs & flags reg. */
+extern Int VGOFF_(sh_eax);
+extern Int VGOFF_(sh_ecx);
+extern Int VGOFF_(sh_edx);
+extern Int VGOFF_(sh_ebx);
+extern Int VGOFF_(sh_esp);
+extern Int VGOFF_(sh_ebp);
+extern Int VGOFF_(sh_esi);
+extern Int VGOFF_(sh_edi);
+extern Int VGOFF_(sh_eflags);
+
+/* -----------------------------------------------------
+ Read-only parts of baseBlock.
+ -------------------------------------------------- */
+
+/* This thread's LDT pointer. */
+extern Int VGOFF_(ldt);
+
+/* This thread's TLS pointer. */
+extern Int VGOFF_(tls_ptr);
+
+/* Nb: Most helper offsets are in include/tool.h, for use by tools */
+extern Int VGOFF_(helper_undefined_instruction);
+
+
+/* ---------------------------------------------------------------------
+ Exports of vg_helpers.S
+ ------------------------------------------------------------------ */
+
+/* Mul, div, etc, -- we don't codegen these directly. */
+extern void VG_(helper_idiv_64_32);
+extern void VG_(helper_div_64_32);
+extern void VG_(helper_idiv_32_16);
+extern void VG_(helper_div_32_16);
+extern void VG_(helper_idiv_16_8);
+extern void VG_(helper_div_16_8);
+
+extern void VG_(helper_imul_32_64);
+extern void VG_(helper_mul_32_64);
+extern void VG_(helper_imul_16_32);
+extern void VG_(helper_mul_16_32);
+extern void VG_(helper_imul_8_16);
+extern void VG_(helper_mul_8_16);
+
+extern void VG_(helper_CLD);
+extern void VG_(helper_STD);
+extern void VG_(helper_get_dirflag);
+
+extern void VG_(helper_CLC);
+extern void VG_(helper_STC);
+extern void VG_(helper_CMC);
+
+extern void VG_(helper_shldl);
+extern void VG_(helper_shldw);
+extern void VG_(helper_shrdl);
+extern void VG_(helper_shrdw);
+
+extern void VG_(helper_IN);
+extern void VG_(helper_OUT);
+
+extern void VG_(helper_RDTSC);
+extern void VG_(helper_CPUID);
+
+extern void VG_(helper_bsfw);
+extern void VG_(helper_bsfl);
+extern void VG_(helper_bsrw);
+extern void VG_(helper_bsrl);
+
+extern void VG_(helper_fstsw_AX);
+extern void VG_(helper_SAHF);
+extern void VG_(helper_LAHF);
+extern void VG_(helper_DAS);
+extern void VG_(helper_DAA);
+extern void VG_(helper_AAS);
+extern void VG_(helper_AAA);
+extern void VG_(helper_AAD);
+extern void VG_(helper_AAM);
+
+extern void VG_(helper_cmpxchg8b);
/* ---------------------------------------------------------------------
--- valgrind/coregrind/x86/state.c #1.1:1.2
@@ -31,4 +31,83 @@
#include "core.h"
+/*------------------------------------------------------------*/
+/*--- baseBlock setup ---*/
+/*------------------------------------------------------------*/
+
+/* The variables storing offsets. */
+
+Int VGOFF_(m_eax) = INVALID_OFFSET;
+Int VGOFF_(m_ecx) = INVALID_OFFSET;
+Int VGOFF_(m_edx) = INVALID_OFFSET;
+Int VGOFF_(m_ebx) = INVALID_OFFSET;
+Int VGOFF_(m_esp) = INVALID_OFFSET;
+Int VGOFF_(m_ebp) = INVALID_OFFSET;
+Int VGOFF_(m_esi) = INVALID_OFFSET;
+Int VGOFF_(m_edi) = INVALID_OFFSET;
+Int VGOFF_(m_eflags) = INVALID_OFFSET;
+Int VGOFF_(m_dflag) = INVALID_OFFSET;
+Int VGOFF_(m_ssestate) = INVALID_OFFSET;
+Int VGOFF_(ldt) = INVALID_OFFSET;
+Int VGOFF_(tls_ptr) = INVALID_OFFSET;
+Int VGOFF_(m_cs) = INVALID_OFFSET;
+Int VGOFF_(m_ss) = INVALID_OFFSET;
+Int VGOFF_(m_ds) = INVALID_OFFSET;
+Int VGOFF_(m_es) = INVALID_OFFSET;
+Int VGOFF_(m_fs) = INVALID_OFFSET;
+Int VGOFF_(m_gs) = INVALID_OFFSET;
+Int VGOFF_(m_eip) = INVALID_OFFSET;
+Int VGOFF_(spillslots) = INVALID_OFFSET;
+Int VGOFF_(sh_eax) = INVALID_OFFSET;
+Int VGOFF_(sh_ecx) = INVALID_OFFSET;
+Int VGOFF_(sh_edx) = INVALID_OFFSET;
+Int VGOFF_(sh_ebx) = INVALID_OFFSET;
+Int VGOFF_(sh_esp) = INVALID_OFFSET;
+Int VGOFF_(sh_ebp) = INVALID_OFFSET;
+Int VGOFF_(sh_esi) = INVALID_OFFSET;
+Int VGOFF_(sh_edi) = INVALID_OFFSET;
+Int VGOFF_(sh_eflags) = INVALID_OFFSET;
+
+Int VGOFF_(helper_idiv_64_32) = INVALID_OFFSET;
+Int VGOFF_(helper_div_64_32) = INVALID_OFFSET;
+Int VGOFF_(helper_idiv_32_16) = INVALID_OFFSET;
+Int VGOFF_(helper_div_32_16) = INVALID_OFFSET;
+Int VGOFF_(helper_idiv_16_8) = INVALID_OFFSET;
+Int VGOFF_(helper_div_16_8) = INVALID_OFFSET;
+Int VGOFF_(helper_imul_32_64) = INVALID_OFFSET;
+Int VGOFF_(helper_mul_32_64) = INVALID_OFFSET;
+Int VGOFF_(helper_imul_16_32) = INVALID_OFFSET;
+Int VGOFF_(helper_mul_16_32) = INVALID_OFFSET;
+Int VGOFF_(helper_imul_8_16) = INVALID_OFFSET;
+Int VGOFF_(helper_mul_8_16) = INVALID_OFFSET;
+Int VGOFF_(helper_CLD) = INVALID_OFFSET;
+Int VGOFF_(helper_STD) = INVALID_OFFSET;
+Int VGOFF_(helper_get_dirflag) = INVALID_OFFSET;
+Int VGOFF_(helper_CLC) = INVALID_OFFSET;
+Int VGOFF_(helper_STC) = INVALID_OFFSET;
+Int VGOFF_(helper_CMC) = INVALID_OFFSET;
+Int VGOFF_(helper_shldl) = INVALID_OFFSET;
+Int VGOFF_(helper_shldw) = INVALID_OFFSET;
+Int VGOFF_(helper_shrdl) = INVALID_OFFSET;
+Int VGOFF_(helper_shrdw) = INVALID_OFFSET;
+Int VGOFF_(helper_IN) = INVALID_OFFSET;
+Int VGOFF_(helper_OUT) = INVALID_OFFSET;
+Int VGOFF_(helper_RDTSC) = INVALID_OFFSET;
+Int VGOFF_(helper_CPUID) = INVALID_OFFSET;
+Int VGOFF_(helper_BSWAP) = INVALID_OFFSET;
+Int VGOFF_(helper_bsfw) = INVALID_OFFSET;
+Int VGOFF_(helper_bsfl) = INVALID_OFFSET;
+Int VGOFF_(helper_bsrw) = INVALID_OFFSET;
+Int VGOFF_(helper_bsrl) = INVALID_OFFSET;
+Int VGOFF_(helper_fstsw_AX) = INVALID_OFFSET;
+Int VGOFF_(helper_SAHF) = INVALID_OFFSET;
+Int VGOFF_(helper_LAHF) = INVALID_OFFSET;
+Int VGOFF_(helper_DAS) = INVALID_OFFSET;
+Int VGOFF_(helper_DAA) = INVALID_OFFSET;
+Int VGOFF_(helper_AAS) = INVALID_OFFSET;
+Int VGOFF_(helper_AAA) = INVALID_OFFSET;
+Int VGOFF_(helper_AAD) = INVALID_OFFSET;
+Int VGOFF_(helper_AAM) = INVALID_OFFSET;
+Int VGOFF_(helper_cmpxchg8b) = INVALID_OFFSET;
+
static Int extractDflag(UInt eflags)
{
@@ -44,4 +123,168 @@ static UInt insertDflag(UInt eflags, Int
}
+/* Here we assign actual offsets. It's important on x86 to get the most
+ popular referents within 128 bytes of the start, so we can take
+ advantage of short addressing modes relative to %ebp. Popularity
+ of offsets was measured on 22 Feb 02 running a KDE application, and
+ the slots rearranged accordingly, with a 1.5% reduction in total
+ size of translations. */
+void VGA_(init_low_baseBlock) ( Addr client_eip, Addr esp_at_startup )
+{
+ /* Those with offsets under 128 are carefully chosen. */
+
+ /* WORD offsets in this column */
+ /* 0 */ VGOFF_(m_eax) = VG_(alloc_BaB_1_set)(0);
+ /* 1 */ VGOFF_(m_ecx) = VG_(alloc_BaB_1_set)(0);
+ /* 2 */ VGOFF_(m_edx) = VG_(alloc_BaB_1_set)(0);
+ /* 3 */ VGOFF_(m_ebx) = VG_(alloc_BaB_1_set)(0);
+ /* 4 */ VGOFF_(m_esp) = VG_(alloc_BaB_1_set)(esp_at_startup);
+ /* 5 */ VGOFF_(m_ebp) = VG_(alloc_BaB_1_set)(0);
+ /* 6 */ VGOFF_(m_esi) = VG_(alloc_BaB_1_set)(0);
+ /* 7 */ VGOFF_(m_edi) = VG_(alloc_BaB_1_set)(0);
+ /* 8 */ VGOFF_(m_eflags) = VG_(alloc_BaB_1_set)(0);
+
+ if (VG_(needs).shadow_regs) {
+ /* 9 */ VGOFF_(sh_eax) = VG_(alloc_BaB_1_set)(0);
+ /* 10 */ VGOFF_(sh_ecx) = VG_(alloc_BaB_1_set)(0);
+ /* 11 */ VGOFF_(sh_edx) = VG_(alloc_BaB_1_set)(0);
+ /* 12 */ VGOFF_(sh_ebx) = VG_(alloc_BaB_1_set)(0);
+ /* 13 */ VGOFF_(sh_esp) = VG_(alloc_BaB_1_set)(0);
+ /* 14 */ VGOFF_(sh_ebp) = VG_(alloc_BaB_1_set)(0);
+ /* 15 */ VGOFF_(sh_esi) = VG_(alloc_BaB_1_set)(0);
+ /* 16 */ VGOFF_(sh_edi) = VG_(alloc_BaB_1_set)(0);
+ /* 17 */ VGOFF_(sh_eflags) = VG_(alloc_BaB_1_set)(0);
+ VG_TRACK( post_regs_write_init );
+ }
+
+ /* 9,10,11 or 18,19,20... depends on number whether shadow regs are used
+ * and on compact helpers registered */
+
+ /* Make these most-frequently-called specialised ones compact, if they
+ are used. */
+ if (VG_(defined_new_mem_stack_4)())
+ VG_(register_compact_helper)( (Addr) VG_(tool_interface).track_new_mem_stack_4);
+
+ if (VG_(defined_die_mem_stack_4)())
+ VG_(register_compact_helper)( (Addr) VG_(tool_interface).track_die_mem_stack_4);
+
+}
+
+void VGA_(init_high_baseBlock)( Addr client_eip, Addr esp_at_startup )
+{
+ /* (9/10 or 18/19) + n_compact_helpers */
+ VGOFF_(m_eip) = VG_(alloc_BaB_1_set)(client_eip);
+
+ /* There are currently 24 spill slots */
+ /* (11+/20+ .. 32+/43+) + n_compact_helpers. This can overlap the magic
+ * boundary at >= 32 words, but most spills are to low numbered spill
+ * slots, so the ones above the boundary don't see much action. */
+ VGOFF_(spillslots) = VG_(alloc_BaB)(VG_MAX_SPILLSLOTS);
+
+ /* I gave up counting at this point. Since they're above the
+ short-amode-boundary, there's no point. */
+
+ VGOFF_(m_dflag) = VG_(alloc_BaB_1_set)(1); // 1 == forward D-flag
+
+ /* The FPU/SSE state. This _must_ be 16-byte aligned. Initial
+ state doesn't matter much, as long as it's not totally borked. */
+ VG_(align_BaB)(16);
+ VGOFF_(m_ssestate) = VG_(alloc_BaB)(VG_SIZE_OF_SSESTATE_W);
+ vg_assert(
+ 0 == ( ((UInt)(& VG_(baseBlock)[VGOFF_(m_ssestate)])) % 16 )
+ );
+
+ /* I assume that if we have SSE2 we also have SSE */
+ VG_(have_ssestate) =
+ VG_(cpu_has_feature)(VG_X86_FEAT_FXSR) &&
+ VG_(cpu_has_feature)(VG_X86_FEAT_SSE);
+
+ /* set up an initial FPU state (doesn't really matter what it is,
+ so long as it's somewhat valid) */
+ if (!VG_(have_ssestate))
+ asm volatile("fwait; fnsave %0; fwait; frstor %0; fwait"
+ :
+ : "m" (VG_(baseBlock)[VGOFF_(m_ssestate)])
+ : "cc", "memory");
+ else
+ asm volatile("fwait; fxsave %0; fwait; andl $0xffbf, %1;"
+ "fxrstor %0; fwait"
+ :
+ : "m" (VG_(baseBlock)[VGOFF_(m_ssestate)]),
+ "m" (VG_(baseBlock)[VGOFF_(m_ssestate)+(24/4)])
+ : "cc", "memory");
+
+ if (0) {
+ if (VG_(have_ssestate))
+ VG_(printf)("Looks like a SSE-capable CPU\n");
+ else
+ VG_(printf)("Looks like a MMX-only CPU\n");
+ }
+
+ /* LDT pointer: pretend the root thread has an empty LDT to start with. */
+ VGOFF_(ldt) = VG_(alloc_BaB_1_set)((UInt)NULL);
+
+ /* TLS pointer: pretend the root thread has no TLS array for now. */
+ VGOFF_(tls_ptr) = VG_(alloc_BaB_1_set)((UInt)NULL);
+
+ /* segment registers */
+ VGOFF_(m_cs) = VG_(alloc_BaB_1_set)(0);
+ VGOFF_(m_ss) = VG_(alloc_BaB_1_set)(0);
+ VGOFF_(m_ds) = VG_(alloc_BaB_1_set)(0);
+ VGOFF_(m_es) = VG_(alloc_BaB_1_set)(0);
+ VGOFF_(m_fs) = VG_(alloc_BaB_1_set)(0);
+ VGOFF_(m_gs) = VG_(alloc_BaB_1_set)(0);
+
+ /* initialise %cs, %ds and %ss to point at the operating systems
+ default code, data and stack segments */
+ asm volatile("movw %%cs, %0"
+ :
+ : "m" (VG_(baseBlock)[VGOFF_(m_cs)]));
+ asm volatile("movw %%ds, %0"
+ :
+ : "m" (VG_(baseBlock)[VGOFF_(m_ds)]));
+ asm volatile("movw %%ss, %0"
+ :
+ : "m" (VG_(baseBlock)[VGOFF_(m_ss)]));
+
+ VG_(register_noncompact_helper)( (Addr) & VG_(do_useseg) );
+
+# define HELPER(name) \
+ VGOFF_(helper_##name) = VG_(alloc_BaB_1_set)( (Addr) & VG_(helper_##name))
+
+ /* Helper functions. */
+ HELPER(idiv_64_32); HELPER(div_64_32);
+ HELPER(idiv_32_16); HELPER(div_32_16);
+ HELPER(idiv_16_8); HELPER(div_16_8);
+
+ HELPER(imul_32_64); HELPER(mul_32_64);
+ HELPER(imul_16_32); HELPER(mul_16_32);
+ HELPER(imul_8_16); HELPER(mul_8_16);
+
+ HELPER(CLD); HELPER(STD);
+ HELPER(get_dirflag);
+
+ HELPER(CLC); HELPER(STC);
+ HELPER(CMC);
+
+ HELPER(shldl); HELPER(shldw);
+ HELPER(shrdl); HELPER(shrdw);
+
+ HELPER(RDTSC); HELPER(CPUID);
+
+ HELPER(bsfw); HELPER(bsfl);
+ HELPER(bsrw); HELPER(bsrl);
+
+ HELPER(fstsw_AX);
+ HELPER(SAHF); HELPER(LAHF);
+ HELPER(DAS); HELPER(DAA);
+ HELPER(AAS); HELPER(AAA);
+ HELPER(AAD); HELPER(AAM);
+ HELPER(IN); HELPER(OUT);
+ HELPER(cmpxchg8b);
+
+ HELPER(undefined_instruction);
+
+# undef HELPER
+}
/* Junk to fill up a thread's shadow regs with when shadow regs aren't
--- valgrind/include/tool.h.base #1.5:1.6
@@ -36,5 +36,32 @@
#include "tool_asm.h" // asm stuff
+
+/*====================================================================*/
+/*=== Basic types ===*/
+/*====================================================================*/
+
+typedef unsigned char UChar;
+typedef unsigned short UShort;
+typedef unsigned int UInt;
+typedef unsigned long long int ULong;
+
+typedef signed char Char;
+typedef signed short Short;
+typedef signed int Int;
+typedef signed long long int Long;
+
+typedef unsigned int Addr;
+
+typedef unsigned char Bool;
+#define False ((Bool)0)
+#define True ((Bool)1)
+
+/* ---------------------------------------------------------------------
+ Now the basic types are set up, we can haul in the kernel-interface
+ definitions and tool_arch.h
+ ------------------------------------------------------------------ */
+
#include "tool_arch.h" // arch-specific tool stuff
+#include "vg_kerneliface.h"
/* ---------------------------------------------------------------------
@@ -81,24 +108,7 @@
/*====================================================================*/
-/*=== Basic types, useful macros ===*/
+/*=== Useful macros ===*/
/*====================================================================*/
-typedef unsigned char UChar;
-typedef unsigned short UShort;
-typedef unsigned int UInt;
-typedef unsigned long long int ULong;
-
-typedef signed char Char;
-typedef signed short Short;
-typedef signed int Int;
-typedef signed long long int Long;
-
-typedef unsigned int Addr;
-
-typedef unsigned char Bool;
-#define False ((Bool)0)
-#define True ((Bool)1)
-
-
#define mycat_wrk(aaa,bbb) aaa##bbb
#define mycat(aaa,bbb) mycat_wrk(aaa,bbb)
@@ -107,12 +117,4 @@
#define OINK(nnn) VG_(message)(Vg_DebugMsg, "OINK %d",nnn)
-/* ---------------------------------------------------------------------
- Now the basic types are set up, we can haul in the kernel-interface
- definitions.
- ------------------------------------------------------------------ */
-
-#include "vg_kerneliface.h"
-
-
/* Path to all our library/aux files */
extern const Char *VG_(libdir);
@@ -1249,59 +1251,4 @@
UInt val );
-/* ------------------------------------------------------------------ */
-/* Offsets of addresses of helper functions. A "helper" function is one
- which is called from generated code via CALLM. */
-
-extern Int VGOFF_(helper_idiv_64_32);
-extern Int VGOFF_(helper_div_64_32);
-extern Int VGOFF_(helper_idiv_32_16);
-extern Int VGOFF_(helper_div_32_16);
-extern Int VGOFF_(helper_idiv_16_8);
-extern Int VGOFF_(helper_div_16_8);
-
-extern Int VGOFF_(helper_imul_32_64);
-extern Int VGOFF_(helper_mul_32_64);
-extern Int VGOFF_(helper_imul_16_32);
-extern Int VGOFF_(helper_mul_16_32);
-extern Int VGOFF_(helper_imul_8_16);
-extern Int VGOFF_(helper_mul_8_16);
-
-extern Int VGOFF_(helper_CLD);
-extern Int VGOFF_(helper_STD);
-extern Int VGOFF_(helper_get_dirflag);
-
-extern Int VGOFF_(helper_CLC);
-extern Int VGOFF_(helper_STC);
-extern Int VGOFF_(helper_CMC);
-
-extern Int VGOFF_(helper_shldl);
-extern Int VGOFF_(helper_shldw);
-extern Int VGOFF_(helper_shrdl);
-extern Int VGOFF_(helper_shrdw);
-
-extern Int VGOFF_(helper_RDTSC);
-extern Int VGOFF_(helper_CPUID);
-
-extern Int VGOFF_(helper_IN);
-extern Int VGOFF_(helper_OUT);
-
-extern Int VGOFF_(helper_bsfw);
-extern Int VGOFF_(helper_bsfl);
-extern Int VGOFF_(helper_bsrw);
-extern Int VGOFF_(helper_bsrl);
-
-extern Int VGOFF_(helper_fstsw_AX);
-extern Int VGOFF_(helper_SAHF);
-extern Int VGOFF_(helper_LAHF);
-extern Int VGOFF_(helper_DAS);
-extern Int VGOFF_(helper_DAA);
-extern Int VGOFF_(helper_AAS);
-extern Int VGOFF_(helper_AAA);
-extern Int VGOFF_(helper_AAD);
-extern Int VGOFF_(helper_AAM);
-
-extern Int VGOFF_(helper_cmpxchg8b);
-
-
/*====================================================================*/
/*=== Generating x86 code from UCode ===*/
--- valgrind/include/x86/tool_arch.h #1.2:1.3
@@ -31,4 +31,12 @@
#define __X86_TOOL_ARCH_H
+// XXX: eventually a lot of the stuff in this file can be made private to
+// the x86/ subdir, and not visible to the core. But as long as the core
+// still refers to them, they'll have to stay in here.
+
+/*====================================================================*/
+/*=== Registers, etc ===*/
+/*====================================================================*/
+
#define REGPARM(n) __attribute__((regparm(n)))
@@ -41,4 +49,68 @@
#define MAX_INSTR_SIZE 16
+
+/*====================================================================*/
+/*=== Instrumenting UCode ===*/
+/*====================================================================*/
+
+/* ------------------------------------------------------------------ */
+/* Offsets of addresses of helper functions. A "helper" function is one
+ which is called from generated code via CALLM. */
+
+// XXX: eventually these should be private to the x86 part, not visible to
+// tools, and the IR should provide a better way than this to see what the
+// original instruction was.
+
+extern Int VGOFF_(helper_idiv_64_32);
+extern Int VGOFF_(helper_div_64_32);
+extern Int VGOFF_(helper_idiv_32_16);
+extern Int VGOFF_(helper_div_32_16);
+extern Int VGOFF_(helper_idiv_16_8);
+extern Int VGOFF_(helper_div_16_8);
+
+extern Int VGOFF_(helper_imul_32_64);
+extern Int VGOFF_(helper_mul_32_64);
+extern Int VGOFF_(helper_imul_16_32);
+extern Int VGOFF_(helper_mul_16_32);
+extern Int VGOFF_(helper_imul_8_16);
+extern Int VGOFF_(helper_mul_8_16);
+
+extern Int VGOFF_(helper_CLD);
+extern Int VGOFF_(helper_STD);
+extern Int VGOFF_(helper_get_dirflag);
+
+extern Int VGOFF_(helper_CLC);
+extern Int VGOFF_(helper_STC);
+extern Int VGOFF_(helper_CMC);
+
+extern Int VGOFF_(helper_shldl);
+extern Int VGOFF_(helper_shldw);
+extern Int VGOFF_(helper_shrdl);
+extern Int VGOFF_(helper_shrdw);
+
+extern Int VGOFF_(helper_RDTSC);
+extern Int VGOFF_(helper_CPUID);
+
+extern Int VGOFF_(helper_IN);
+extern Int VGOFF_(helper_OUT);
+
+extern Int VGOFF_(helper_bsfw);
+extern Int VGOFF_(helper_bsfl);
+extern Int VGOFF_(helper_bsrw);
+extern Int VGOFF_(helper_bsrl);
+
+extern Int VGOFF_(helper_fstsw_AX);
+extern Int VGOFF_(helper_SAHF);
+extern Int VGOFF_(helper_LAHF);
+extern Int VGOFF_(helper_DAS);
+extern Int VGOFF_(helper_DAA);
+extern Int VGOFF_(helper_AAS);
+extern Int VGOFF_(helper_AAA);
+extern Int VGOFF_(helper_AAD);
+extern Int VGOFF_(helper_AAM);
+
+extern Int VGOFF_(helper_cmpxchg8b);
+
+
#endif // __X86_TOOL_ARCH_H
|
|
From: Nicholas N. <nj...@ca...> - 2004-09-06 15:34:43
|
CVS commit by nethercote:
Arch-abstraction: arch-neutralise the startup message.
M +2 -1 coregrind/Makefile.am 1.83
M +5 -4 coregrind/vg_main.c 1.203
M +2 -2 tests/filter_stderr_basic 1.19
--- valgrind/coregrind/Makefile.am #1.82:1.83
@@ -5,5 +5,6 @@
AM_CPPFLAGS += -DVG_LIBDIR="\"$(valdir)"\" -I$(srcdir)/demangle \
- -DKICKSTART_BASE=$(KICKSTART_BASE)
+ -DKICKSTART_BASE=$(KICKSTART_BASE) \
+ -DVG_PLATFORM="\"$(VG_PLATFORM)"\"
AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -O -fno-omit-frame-pointer \
@PREFERRED_STACK_BOUNDARY@ -g -DELFSZ=32
--- valgrind/coregrind/vg_main.c #1.202:1.203
@@ -1917,16 +1917,17 @@ static void process_cmd_line_options( UI
if (VG_(clo_verbosity > 0)) {
/* Tool details */
- VG_(message)(Vg_UserMsg, "%s%s%s, %s for x86-linux.",
+ VG_(message)(Vg_UserMsg, "%s%s%s, %s for %s.",
VG_(details).name,
NULL == VG_(details).version ? "" : "-",
NULL == VG_(details).version
? (Char*)"" : VG_(details).version,
- VG_(details).description);
+ VG_(details).description,
+ VG_PLATFORM);
VG_(message)(Vg_UserMsg, "%s", VG_(details).copyright_author);
/* Core details */
VG_(message)(Vg_UserMsg,
- "Using valgrind-%s, a program supervision framework for x86-linux.",
- VERSION);
+ "Using valgrind-%s, a program supervision framework for %s.",
+ VERSION, VG_PLATFORM);
VG_(message)(Vg_UserMsg,
"Copyright (C) 2000-2004, and GNU GPL'd, by Julian Seward et al.");
--- valgrind/tests/filter_stderr_basic #1.18:1.19
@@ -7,7 +7,7 @@
sed "s/\(==\|--\|\+\+\|\*\*\)[0-9]\{1,5\}\1 //" |
-# Remove "<name>, a <description> for x86-linux." line and the following
+# Remove "<name>, a <description> for $ARCH-$OS." line and the following
# copyright notice line. Works for tool and core intro lines.
-sed "/^.*, .* for x86-linux\./ , /./ d" |
+sed "/^.*, .* for .*-.*\./ , /./ d" |
# Remove other introductory lines
|
|
From: Nicholas N. <nj...@ca...> - 2004-09-06 15:14:52
|
CVS commit by nethercote: Arch-abstraction: minor name change of params. M +2 -2 core.h 1.12 --- valgrind/coregrind/core.h #1.11:1.12 @@ -1160,6 +1160,6 @@ extern void VG_(print_ExeContext_stats) /* Like VG_(get_ExeContext), but with a slightly different type */ -extern ExeContext* VG_(get_ExeContext2) ( Addr eip, Addr ebp, - Addr ebp_min, Addr ebp_max ); +extern ExeContext* VG_(get_ExeContext2) ( Addr ip, Addr fp, + Addr fp_min, Addr fp_max ); |
|
From: Nicholas N. <nj...@ca...> - 2004-09-06 11:59:56
|
On Mon, 6 Sep 2004, Leandro Lucarella wrote: > Hi! I wonder if it's possible to run the program to check with valgrind in > a chrooted jail. Here's my problem, I'm writing a program to automatically > check for memory leaks of little programs in an untrusted environment. So > I want to run this programs in a chrooted empty directory (well, not > totally empty, the directory has an static linked copy of the program to > test, static so I don't have to make a 'complete' jail with shared > libraries and so). > > The problem is, if I want to check the program with valgrind I have to put > valgrind in the jail (so I have to make the 'complete' jail with shared > libraries), that's what I want to make a patch (if it's possible) to add > valgrind an option to run programs in a chrooted directory (changing the > uid after the chroot), but I don't know if it's possible to do that. I > don't ever know if it's possible to run valgrind on a statically linked > binary (the test I made don't behave very well). Valgrind can run statically linked binaries. However some of the tools (esp. Memcheck) do not work as well as normal in this case -- in particular, they cannot replace malloc() and friends with their own versions, which means that certain errors are not detected. Unfortunately, memory leaks are among these. So I don't think this is going to be possible, unfortunately. N |
|
From: Nicholas N. <nj...@ca...> - 2004-09-06 08:57:40
|
CVS commit by nethercote: Update details about Doug's FreeBSD port. M +3 -3 related.html 1.20 --- devel-home/valgrind/related.html #1.19:1.20 @@ -64,7 +64,7 @@ <ul> -<li>FreeBSD: Doug Rabson has done a fairly complete port. See details in this - <a href="http://sourceforge.net/mailarchive/forum.php?thread_id=3660580&forum_id=12302"> - mailing list thread</a>. We hope to integrate this port into Valgrind. +<li>FreeBSD: Doug Rabson has done a fairly complete port. See details at + <a href="http://www.rabson.org">Doug's homepage</a>. We hope to integrate + this port into Valgrind at some point. <p> </ul> |
|
From: Nicholas N. <nj...@ca...> - 2004-09-06 08:32:34
|
CVS commit by nethercote:
Update info about R Walsh's page.
M +3 -4 related.html 1.19
--- devel-home/valgrind/related.html #1.18:1.19
@@ -32,8 +32,7 @@
<a href="http://www.cl.cam.ac.uk/~njn25/valgrind.html">here</a>.
<p>
-<li>Robert Walsh has two useful
- <a href="http://www.durables.org/software/valgrind/">patches</a>. One
- adds watchpoints on memory locations, the other adds support for pool-based
- allocators.
+<li>Robert Walsh has a page of useful
+ <a href="http://www.durables.org/software/valgrind/">patches</a> for
+ Valgrind, one of which adds watchpoints on memory locations.
<p>
</ul>
|
|
From: Leandro L. <lu...@ll...> - 2004-09-06 04:43:40
|
Hi! I wonder if it's possible to run the program to check with valgrind in a chrooted jail. Here's my problem, I'm writing a program to automatically check for memory leaks of little programs in an untrusted environment. So I want to run this programs in a chrooted empty directory (well, not totally empty, the directory has an static linked copy of the program to test, static so I don't have to make a 'complete' jail with shared libraries and so). The problem is, if I want to check the program with valgrind I have to put valgrind in the jail (so I have to make the 'complete' jail with shared libraries), that's what I want to make a patch (if it's possible) to add valgrind an option to run programs in a chrooted directory (changing the uid after the chroot), but I don't know if it's possible to do that. I don't ever know if it's possible to run valgrind on a statically linked binary (the test I made don't behave very well). I'm sory if the question is too lame, but I saw the web page says the tech docs are a little outdated, so I decided to ask here if is there any chance to do this... Thanks for the time and the great program! PS: Please Cc me, I'm not in the list. |
|
From: Tom H. <th...@cy...> - 2004-09-06 03:04:55
|
Nightly build on standard ( Red Hat 7.2 ) started at 2004-09-06 02:00:03 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow fcntl_setown: valgrind ./fcntl_setown floored: valgrind ./floored fork: valgrind -q ./fork fpu_lazy_eflags: valgrind ./fpu_lazy_eflags fucomip: valgrind ./fucomip gxx304: valgrind ./gxx304 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 int: valgrind ./int map_unmap: valgrind ./map_unmap mq: valgrind ./mq mremap: valgrind ./mremap munmap_exe: valgrind ./munmap_exe pth_blockedsig: valgrind ./pth_blockedsig Could not read `pth_blockedsig.stderr.exp' make: *** [regtest] Error 2 |
|
From: <js...@ac...> - 2004-09-06 02:55:35
|
Nightly build on phoenix ( SuSE 9.1 ) started at 2004-09-06 03:50:00 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow sem: valgrind ./sem semlimit: valgrind ./semlimit sha1_test: valgrind ./sha1_test shortpush: valgrind ./shortpush shorts: valgrind ./shorts smc1: valgrind ./smc1 susphello: valgrind ./susphello syscall-restart1: valgrind ./syscall-restart1 syscall-restart2: valgrind ./syscall-restart2 system: valgrind ./system yield: valgrind ./yield -- Finished tests in none/tests ---------------------------------------- == 174 tests, 4 stderr failures, 0 stdout failures ================= corecheck/tests/as_mmap (stderr) corecheck/tests/fdleak_fcntl (stderr) memcheck/tests/writev (stderr) memcheck/tests/zeropage (stderr) make: *** [regtest] Error 1 |
|
From: Tom H. <to...@co...> - 2004-09-06 02:25:13
|
Nightly build on dunsmere ( Fedora Core 2 ) started at 2004-09-06 03:20:02 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow smc1: valgrind ./smc1 susphello: valgrind ./susphello syscall-restart1: valgrind ./syscall-restart1 syscall-restart2: valgrind ./syscall-restart2 system: valgrind ./system yield: valgrind ./yield -- Finished tests in none/tests ---------------------------------------- == 179 tests, 8 stderr failures, 1 stdout failure ================= corecheck/tests/fdleak_cmsg (stderr) corecheck/tests/fdleak_fcntl (stderr) corecheck/tests/fdleak_ipv4 (stderr) corecheck/tests/fdleak_socketpair (stderr) memcheck/tests/buflen_check (stderr) memcheck/tests/execve (stderr) memcheck/tests/execve2 (stderr) memcheck/tests/writev (stderr) none/tests/exec-sigmask (stdout) make: *** [regtest] Error 1 |
|
From: Tom H. <th...@cy...> - 2004-09-06 02:19:49
|
Nightly build on audi ( Red Hat 9 ) started at 2004-09-06 03:15:03 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow shorts: valgrind ./shorts smc1: valgrind ./smc1 susphello: valgrind ./susphello syscall-restart1: valgrind ./syscall-restart1 syscall-restart2: valgrind ./syscall-restart2 system: valgrind ./system yield: valgrind ./yield -- Finished tests in none/tests ---------------------------------------- == 179 tests, 8 stderr failures, 0 stdout failures ================= corecheck/tests/fdleak_cmsg (stderr) corecheck/tests/fdleak_fcntl (stderr) corecheck/tests/fdleak_ipv4 (stderr) corecheck/tests/fdleak_socketpair (stderr) memcheck/tests/buflen_check (stderr) memcheck/tests/execve (stderr) memcheck/tests/execve2 (stderr) memcheck/tests/writev (stderr) make: *** [regtest] Error 1 |
|
From: Tom H. <th...@cy...> - 2004-09-06 02:13:17
|
Nightly build on ginetta ( Red Hat 8.0 ) started at 2004-09-06 03:10:02 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow seg_override: valgrind ./seg_override sem: valgrind ./sem semlimit: valgrind ./semlimit sha1_test: valgrind ./sha1_test shortpush: valgrind ./shortpush shorts: valgrind ./shorts smc1: valgrind ./smc1 susphello: valgrind ./susphello syscall-restart1: valgrind ./syscall-restart1 syscall-restart2: valgrind ./syscall-restart2 system: valgrind ./system yield: valgrind ./yield -- Finished tests in none/tests ---------------------------------------- == 179 tests, 3 stderr failures, 0 stdout failures ================= helgrind/tests/race (stderr) helgrind/tests/race2 (stderr) memcheck/tests/writev (stderr) make: *** [regtest] Error 1 |
|
From: Tom H. <th...@cy...> - 2004-09-06 02:08:27
|
Nightly build on alvis ( Red Hat 7.3 ) started at 2004-09-06 03:05:02 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow -- Finished tests in none/tests ---------------------------------------- == 179 tests, 14 stderr failures, 1 stdout failure ================= addrcheck/tests/toobig-allocs (stderr) helgrind/tests/deadlock (stderr) helgrind/tests/race (stderr) helgrind/tests/race2 (stderr) memcheck/tests/badjump (stderr) memcheck/tests/brk (stderr) memcheck/tests/brk2 (stderr) memcheck/tests/error_counts (stdout) memcheck/tests/mismatches (stderr) memcheck/tests/new_nothrow (stderr) memcheck/tests/new_override (stderr) memcheck/tests/toobig-allocs (stderr) memcheck/tests/writev (stderr) none/tests/coolo_sigaction (stderr) none/tests/gxx304 (stderr) make: *** [regtest] Error 1 |