aboutsummaryrefslogtreecommitdiff
path: root/coregrind
diff options
context:
space:
mode:
authornjn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9>2009-07-01 02:39:26 +0000
committernjn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9>2009-07-01 02:39:26 +0000
commita192dafc5336c5e586dfce6c4e6d3f7e82aef266 (patch)
tree12df89f48d3aefa43ddecac5889e3be28bc7c00f /coregrind
parent58899e8e2af51859289d0badea881b7b72c3fb13 (diff)
downloadvalgrind-a192dafc5336c5e586dfce6c4e6d3f7e82aef266.tar.gz
Just whitespace and comment changes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10388 a5019735-40e9-0310-863c-91ae7b9d1cf9
Diffstat (limited to 'coregrind')
-rw-r--r--coregrind/launcher-darwin.c17
-rw-r--r--coregrind/m_main.c23
2 files changed, 32 insertions, 8 deletions
diff --git a/coregrind/launcher-darwin.c b/coregrind/launcher-darwin.c
index 3c81feea2..d68cd57b2 100644
--- a/coregrind/launcher-darwin.c
+++ b/coregrind/launcher-darwin.c
@@ -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 @@ static struct {
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 @@ static int fat_has_cputype(struct fat_header *fh, cpu_type_t cputype)
}
/* 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;
diff --git a/coregrind/m_main.c b/coregrind/m_main.c
index f3dfbcd57..e0544d360 100644
--- a/coregrind/m_main.c
+++ b/coregrind/m_main.c
@@ -1253,6 +1253,29 @@ Int valgrind_main ( Int argc, HChar **argv, HChar **envp )
// (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);