]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Simplify calculation of VG_(shadow_end) to avoid an obscure bug on Paul M's PPC
authorNicholas Nethercote <n.nethercote@gmail.com>
Sat, 4 Sep 2004 15:53:35 +0000 (15:53 +0000)
committerNicholas Nethercote <n.nethercote@gmail.com>
Sat, 4 Sep 2004 15:53:35 +0000 (15:53 +0000)
port caused by rounding errors.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2661

coregrind/vg_main.c
coregrind/x86/core_arch.h

index 8e9dac6b48ce5b7ba3d0a9f8c68a2e0e35b36357..729803b4b7c6522f6f47df4c841724c7e8931336 100644 (file)
@@ -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)
index b71a7958a1ee2e3ea3de52d9a498468caaa40e6c..59751f2c3cf47ea5df8307a4842a12ec46e81311 100644 (file)
@@ -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