Author: [EMAIL PROTECTED]
Date: Tue Sep 23 01:56:12 2008
New Revision: 360
Modified:
branches/bleeding_edge/src/platform-linux.cc
Log:
Parse /proc/self/maps lines better to handle variations between Linux
kernels.
It seems noone has had time to file a bug on this.
Review URL: http://codereview.chromium.org/4210
Modified: branches/bleeding_edge/src/platform-linux.cc
==============================================================================
--- branches/bleeding_edge/src/platform-linux.cc (original)
+++ branches/bleeding_edge/src/platform-linux.cc Tue Sep 23 01:56:12 2008
@@ -38,11 +38,12 @@
// executable. Otherwise, OS raises an exception when executing code
// in that page.
#include <sys/types.h> // mmap & munmap
-#include <sys/mman.h> // mmap & munmap
-#include <sys/stat.h> // open
+#include <sys/mman.h> // mmap & munmap
+#include <sys/stat.h> // open
#include <sys/fcntl.h> // open
-#include <unistd.h> // getpagesize
-#include <execinfo.h> // backtrace, backtrace_symbols
+#include <unistd.h> // getpagesize
+#include <execinfo.h> // backtrace, backtrace_symbols
+#include <strings.h> // index
#include <errno.h>
#include <stdarg.h>
@@ -335,12 +336,13 @@
if (result < 1) break;
} while (buffer[bytes_read] != '\n');
buffer[bytes_read] = 0;
- // There are 56 chars to ignore at this point in the line.
- if (bytes_read < 56) continue;
// Ignore mappings that are not executable.
if (buffer[3] != 'x') continue;
+ char* start_of_path = index(buffer, '/');
+ // There may be no filename in this line. Skip to next.
+ if (start_of_path == NULL) continue;
buffer[bytes_read] = 0;
- LOG(SharedLibraryEvent(buffer + 56, start, end));
+ LOG(SharedLibraryEvent(start_of_path, start, end));
}
close(fd);
#endif
--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---