|
From: <sv...@va...> - 2009-07-01 02:39:47
|
Author: njn
Date: 2009-07-01 03:39:26 +0100 (Wed, 01 Jul 2009)
New Revision: 10388
Log:
Just whitespace and comment changes.
Modified:
trunk/coregrind/launcher-darwin.c
trunk/coregrind/m_main.c
Modified: trunk/coregrind/launcher-darwin.c
===================================================================
--- trunk/coregrind/launcher-darwin.c 2009-06-30 06:06:14 UTC (rev 10387)
+++ trunk/coregrind/launcher-darwin.c 2009-07-01 02:39:26 UTC (rev 10388)
@@ -50,8 +50,7 @@
#include <mach-o/loader.h>
#include "pub_core_debuglog.h"
-#include "pub_core_vki.h" // Avoids warnings from
- // pub_core_libcfile.h
+#include "pub_core_vki.h" // Avoids warnings from pub_core_libcfile.h
#include "pub_core_libcproc.h" // For VALGRIND_LIB, VALGRIND_LAUNCHER
#include "pub_core_ume.h"
@@ -60,11 +59,11 @@
const char *apple_name; // e.g. x86_64
const char *valgrind_name; // e.g. amd64
} valid_archs[] = {
- { CPU_TYPE_X86, "i386", "x86" },
- { CPU_TYPE_X86_64, "x86_64", "amd64" },
- { CPU_TYPE_ARM, "arm", "arm" },
- { CPU_TYPE_POWERPC, "ppc", "ppc32" },
- { CPU_TYPE_POWERPC64, "ppc64", "ppc64" },
+ { CPU_TYPE_X86, "i386", "x86" },
+ { CPU_TYPE_X86_64, "x86_64", "amd64" },
+ { CPU_TYPE_ARM, "arm", "arm" },
+ { CPU_TYPE_POWERPC, "ppc", "ppc32" },
+ { CPU_TYPE_POWERPC64, "ppc64", "ppc64" },
};
static int valid_archs_count = sizeof(valid_archs)/sizeof(valid_archs[0]);
@@ -139,7 +138,9 @@
}
/* Examine the client and work out which arch it is for */
-static const char *select_arch(const char *clientname, cpu_type_t default_cputype, const char *default_arch)
+static const char *select_arch(
+ const char *clientname, cpu_type_t default_cputype,
+ const char *default_arch)
{
uint8_t buf[4096];
ssize_t bytes;
Modified: trunk/coregrind/m_main.c
===================================================================
--- trunk/coregrind/m_main.c 2009-06-30 06:06:14 UTC (rev 10387)
+++ trunk/coregrind/m_main.c 2009-07-01 02:39:26 UTC (rev 10388)
@@ -1253,6 +1253,29 @@
// (oversized pagezero or stack)
// p: none
//--------------------------------------------------------------
+ // DDD: comments from Greg Parker why these address-space-filling segments
+ // are necessary:
+ //
+ // The memory maps are there to make sure that Valgrind's copies of libc
+ // and dyld load in a non-default location, so that the inferior's own
+ // libc and dyld do load in the default locations. (The kernel performs
+ // the work of loading several things as described by the executable's
+ // load commands, including the executable itself, dyld, the main
+ // thread's stack, and the page-zero segment.) There might be a way to
+ // fine-tune it so the maps are smaller but still do the job.
+ //
+ // The post-launch mmap behavior can be cleaned up - looks like we don't
+ // unmap as much as we should - which would improve post-launch
+ // performance.
+ //
+ // Hmm, there might be an extra-clever way to give Valgrind a custom
+ // MH_DYLINKER that performs the "bootloader" work of loading dyld in an
+ // acceptable place and then unloading itself. Then no mmaps would be
+ // needed. I'll have to think about that one.
+ //
+ // [I can't work out where the address-space-filling segments are
+ // created in the first place. --njn]
+ //
#if defined(VGO_darwin)
# if VG_WORDSIZE == 4
VG_(do_syscall2)(__NR_munmap, 0x00000000, 0xf0000000);
|