Fix linux-gate handling in LinuxDumper so it gets a valid debug ID
A=ted R=nealsid at http://breakpad.appspot.com/284001
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@788 4c0a9323-5329-0410-9bdc-e9ce6186880e
diff --git a/src/client/linux/minidump_writer/linux_dumper.cc b/src/client/linux/minidump_writer/linux_dumper.cc
index 76dc4db..ab3a5ea 100644
--- a/src/client/linux/minidump_writer/linux_dumper.cc
+++ b/src/client/linux/minidump_writer/linux_dumper.cc
@@ -213,6 +213,21 @@
if (IsMappedFileOpenUnsafe(mapping))
return false;
+ // Special-case linux-gate because it's not a real file.
+ if (my_strcmp(mapping.name, kLinuxGateLibraryName) == 0) {
+ const uintptr_t kPageSize = getpagesize();
+ void* linux_gate = NULL;
+ if (pid_ == sys_getpid()) {
+ linux_gate = reinterpret_cast<void*>(mapping.start_addr);
+ } else {
+ linux_gate = allocator_.Alloc(kPageSize);
+ CopyFromProcess(linux_gate, pid_,
+ reinterpret_cast<const void*>(mapping.start_addr),
+ kPageSize);
+ }
+ return FileID::ElfFileIdentifierFromMappedFile(linux_gate, identifier);
+ }
+
char filename[NAME_MAX];
size_t filename_len = my_strlen(mapping.name);
assert(filename_len < NAME_MAX);