From: Nicholas Nethercote Date: Sat, 4 Sep 2004 15:53:35 +0000 (+0000) Subject: Simplify calculation of VG_(shadow_end) to avoid an obscure bug on Paul M's PPC X-Git-Tag: svn/VALGRIND_3_0_0~1622 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8762c939f2a2bf9ce86a167c0151def8b517d40d;p=thirdparty%2Fvalgrind.git Simplify calculation of VG_(shadow_end) to avoid an obscure bug on Paul M's PPC port caused by rounding errors. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2661 --- diff --git a/coregrind/vg_main.c b/coregrind/vg_main.c index 8e9dac6b48..729803b4b7 100644 --- a/coregrind/vg_main.c +++ b/coregrind/vg_main.c @@ -453,9 +453,9 @@ static void layout_remaining_space(Addr argc_addr, float ratio) VG_(client_mapbase) = VG_(client_base) + PGROUNDDN((addr_t)(client_size * CLIENT_HEAP_PROPORTION)); - shadow_size = PGROUNDUP(client_size * ratio); VG_(shadow_base) = VG_(client_end) + REDZONE_SIZE; - VG_(shadow_end) = VG_(shadow_base) + shadow_size; + VG_(shadow_end) = VG_(valgrind_base); + shadow_size = VG_(shadow_end) - VG_(shadow_base); #define SEGSIZE(a,b) ((VG_(b) - VG_(a))/(1024*1024)) @@ -465,14 +465,14 @@ static void layout_remaining_space(Addr argc_addr, float ratio) "client_mapbase %8x (%dMB)\n" "client_end %8x (%dMB)\n" "shadow_base %8x (%dMB)\n" - "shadow_end %8x (%dMB)\n" + "shadow_end %8x\n" "valgrind_base %8x (%dMB)\n" "valgrind_end %8x\n", VG_(client_base), SEGSIZE(client_base, client_mapbase), VG_(client_mapbase), SEGSIZE(client_mapbase, client_end), VG_(client_end), SEGSIZE(client_end, shadow_base), VG_(shadow_base), SEGSIZE(shadow_base, shadow_end), - VG_(shadow_end), SEGSIZE(shadow_end, valgrind_base), + VG_(shadow_end), VG_(valgrind_base), SEGSIZE(valgrind_base, valgrind_end), VG_(valgrind_end) ); @@ -2716,7 +2716,6 @@ void VG_(sanity_check_general) ( Bool force_expensive ) : shadow memory for tools : | (may be 0 sized) | shadow_end +-------------------------+ - : gap (may be 0 sized) : valgrind_base +-------------------------+ | kickstart executable | | valgrind heap vvvvvvvvv| (barely used) diff --git a/coregrind/x86/core_arch.h b/coregrind/x86/core_arch.h index b71a7958a1..59751f2c3c 100644 --- a/coregrind/x86/core_arch.h +++ b/coregrind/x86/core_arch.h @@ -88,7 +88,8 @@ typedef struct _LDT_ENTRY { // Architecture-specific part of a ThreadState // XXX: eventually this should be made abstract, ie. the fields not visible -// to the core... +// to the core... then VgLdtEntry can be made non-visible to the core +// also. typedef struct { /* Pointer to this thread's Local (Segment) Descriptor Table. Starts out as NULL, indicating there is no table, and we hope to