aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorJoshua Peraza <jperaza@chromium.org>2019-10-29 17:55:54 -0700
committerMike Frysinger <vapier@chromium.org>2019-10-30 17:54:00 +0000
commit5085b1d0df9c4b6f0f32b100f88611bc2beb3c09 (patch)
treec1bca3a2626ed1dfbdfc8814ddac3f56b0b1d716 /src/common
parentlinux, dump_syms: Make style consistent in module unittest (diff)
downloadbreakpad-5085b1d0df9c4b6f0f32b100f88611bc2beb3c09.tar.xz
linux, client: set module name from DT_SONAME
3e56ef9d changed dump_syms to set the module name from DT_SONAME expecting that clients were already using DT_SONAME when it was present. The Breakpad client previously only used DT_SONAME as the name for a module if it detected that it was likely mapped from a zip file. This patch updates the Breakpad Linux client to always use the DT_SONAME in minidumps if it's present. Also included are changes to address comments that were missed from that review. Bug: 1016924 Change-Id: I4aae8c05e6793d4b0598049a8964ddd4cb0c6194 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1889231 Reviewed-by: Mark Mentovai <mark@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
Diffstat (limited to 'src/common')
-rw-r--r--src/common/linux/dump_symbols.cc12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/common/linux/dump_symbols.cc b/src/common/linux/dump_symbols.cc
index e561ad94..0eea2b54 100644
--- a/src/common/linux/dump_symbols.cc
+++ b/src/common/linux/dump_symbols.cc
@@ -963,13 +963,11 @@ bool InitModuleForElfClass(const typename ElfClass::Ehdr* elf_header,
return false;
}
- string name;
- char name_buf[NAME_MAX];
- memset(name_buf, 0, sizeof(name_buf));
- name = google_breakpad::ElfFileSoNameFromMappedFile(elf_header, name_buf,
- sizeof(name_buf))
- ? name_buf
- : google_breakpad::BaseName(obj_filename);
+ char name_buf[NAME_MAX] = {};
+ std::string name = google_breakpad::ElfFileSoNameFromMappedFile(
+ elf_header, name_buf, sizeof(name_buf))
+ ? name_buf
+ : google_breakpad::BaseName(obj_filename);
// Add an extra "0" at the end. PDB files on Windows have an 'age'
// number appended to the end of the file identifier; this isn't