SORRY. It seems I've screwed up my commit for http://breakpad.appspot.com/411002/, since revision 1001 only contains the new src/client/linux/linux_libc_support.cc and none of the other required files.

I'm not sure what happened, but I'm re-uploading the patch has another issue.

Review URL: https://breakpad.appspot.com/426002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1002 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
digit@chromium.org
2012-08-03 15:01:52 +00:00
parent 7475fb4bb4
commit e0555f5bdf
10 changed files with 256 additions and 255 deletions

View File

@@ -113,7 +113,7 @@ LinuxDumper::ElfFileIdentifierForMapping(const MappingInfo& mapping,
assert(filename_len < NAME_MAX);
if (filename_len >= NAME_MAX)
return false;
memcpy(filename, mapping.name, filename_len);
my_memcpy(filename, mapping.name, filename_len);
filename[filename_len] = '\0';
bool filename_modified = HandleDeletedFileInMapping(filename);
@@ -151,11 +151,11 @@ LinuxDumper::FindBeginningOfLinuxGateSharedLibrary(pid_t pid) const {
sizeof(elf_aux_entry)) == sizeof(elf_aux_entry) &&
one_aux_entry.a_type != AT_NULL) {
if (one_aux_entry.a_type == AT_SYSINFO_EHDR) {
close(fd);
sys_close(fd);
return reinterpret_cast<void*>(one_aux_entry.a_un.a_val);
}
}
close(fd);
sys_close(fd);
return NULL;
}
@@ -177,11 +177,11 @@ LinuxDumper::FindEntryPoint(pid_t pid) const {
sizeof(elf_aux_entry)) == sizeof(elf_aux_entry) &&
one_aux_entry.a_type != AT_NULL) {
if (one_aux_entry.a_type == AT_ENTRY) {
close(fd);
sys_close(fd);
return reinterpret_cast<void*>(one_aux_entry.a_un.a_val);
}
}
close(fd);
sys_close(fd);
return NULL;
}
@@ -240,14 +240,14 @@ bool LinuxDumper::EnumerateMappings() {
}
}
MappingInfo* const module = new(allocator_) MappingInfo;
memset(module, 0, sizeof(MappingInfo));
my_memset(module, 0, sizeof(MappingInfo));
module->start_addr = start_addr;
module->size = end_addr - start_addr;
module->offset = offset;
if (name != NULL) {
const unsigned l = my_strlen(name);
if (l < sizeof(module->name))
memcpy(module->name, name, l);
my_memcpy(module->name, name, l);
}
// If this is the entry-point mapping, and it's not already the
// first one, then we need to make it be first. This is because
@@ -351,7 +351,7 @@ bool LinuxDumper::HandleDeletedFileInMapping(char* path) const {
return false;
}
memcpy(path, exe_link, NAME_MAX);
my_memcpy(path, exe_link, NAME_MAX);
return true;
}