From: Tom Hughes Date: Thu, 20 Aug 2009 07:56:45 +0000 (+0000) Subject: Add some extra debugging to the launcher. X-Git-Tag: svn/VALGRIND_3_6_0~538 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=08ce12e17dea2e078b000d5b644b7092d615652b;p=thirdparty%2Fvalgrind.git Add some extra debugging to the launcher. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10854 --- diff --git a/coregrind/launcher-linux.c b/coregrind/launcher-linux.c index 65921fb362..da236f87fd 100644 --- a/coregrind/launcher-linux.c +++ b/coregrind/launcher-linux.c @@ -116,19 +116,27 @@ static const char *select_platform(const char *clientname) ssize_t n_bytes; const char *platform = NULL; + VG_(debugLog)(2, "launcher", "selecting platform for '%s'\n", clientname); + if (strchr(clientname, '/') == NULL) clientname = find_client(clientname); + VG_(debugLog)(2, "launcher", "selecting platform for '%s'\n", clientname); + if ((fd = open(clientname, O_RDONLY)) < 0) return NULL; // barf("open(%s): %s", clientname, strerror(errno)); + VG_(debugLog)(2, "launcher", "opened '%s'\n", clientname); + n_bytes = read(fd, header, sizeof(header)); close(fd); if (n_bytes < 2) { return NULL; } + VG_(debugLog)(2, "launcher", "read %d bytes from '%s'\n", n_bytes, clientname); + if (header[0] == '#' && header[1] == '!') { int i = 2; char *interp = (char *)header + 2; @@ -190,6 +198,9 @@ static const char *select_platform(const char *clientname) } } + VG_(debugLog)(2, "launcher", "selected platform '%s'\n", + platform ? platform : "unknown"); + return platform; }