diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:14:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:14:29 +0000 |
commit | fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch) | |
tree | 4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /toolkit/crashreporter/breakpad-client/linux | |
parent | Releasing progress-linux version 124.0.1-1~progress7.99u1. (diff) | |
download | firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip |
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/crashreporter/breakpad-client/linux')
4 files changed, 29 insertions, 8 deletions
diff --git a/toolkit/crashreporter/breakpad-client/linux/microdump_writer/microdump_writer.cc b/toolkit/crashreporter/breakpad-client/linux/microdump_writer/microdump_writer.cc index 8f25b7be02..2c2e24e071 100644 --- a/toolkit/crashreporter/breakpad-client/linux/microdump_writer/microdump_writer.cc +++ b/toolkit/crashreporter/breakpad-client/linux/microdump_writer/microdump_writer.cc @@ -466,8 +466,8 @@ class MicrodumpWriter { char file_name[NAME_MAX]; char file_path[NAME_MAX]; - dumper_->GetMappingEffectiveNameAndPath( - mapping, file_path, sizeof(file_path), file_name, sizeof(file_name)); + dumper_->GetMappingEffectiveNamePathAndVersion( + mapping, file_path, sizeof(file_path), file_name, sizeof(file_name), nullptr); LogAppend("M "); LogAppend(static_cast<uintptr_t>(mapping.start_addr)); diff --git a/toolkit/crashreporter/breakpad-client/linux/minidump_writer/linux_dumper.cc b/toolkit/crashreporter/breakpad-client/linux/minidump_writer/linux_dumper.cc index 3b400ce8ca..ef05583397 100644 --- a/toolkit/crashreporter/breakpad-client/linux/minidump_writer/linux_dumper.cc +++ b/toolkit/crashreporter/breakpad-client/linux/minidump_writer/linux_dumper.cc @@ -468,11 +468,12 @@ bool ElfFileSoName(const LinuxDumper& dumper, } // namespace -void LinuxDumper::GetMappingEffectiveNameAndPath(const MappingInfo& mapping, +void LinuxDumper::GetMappingEffectiveNamePathAndVersion(const MappingInfo& mapping, char* file_path, size_t file_path_size, char* file_name, - size_t file_name_size) { + size_t file_name_size, + uint32_t* version) { my_strlcpy(file_path, mapping.name, file_path_size); // Tools such as minidump_stackwalk use the name of the module to look up @@ -487,6 +488,9 @@ void LinuxDumper::GetMappingEffectiveNameAndPath(const MappingInfo& mapping, const char* basename = my_strrchr(file_path, '/'); basename = basename == NULL ? file_path : (basename + 1); my_strlcpy(file_name, basename, file_name_size); + if (version) { + ElfFileSoVersion(mapping.name, version); + } return; } @@ -512,6 +516,10 @@ void LinuxDumper::GetMappingEffectiveNameAndPath(const MappingInfo& mapping, my_strlcpy(file_path, file_name, file_path_size); } } + + if (version) { + ElfFileSoVersion(mapping.name, version); + } } bool LinuxDumper::ReadAuxv() { diff --git a/toolkit/crashreporter/breakpad-client/linux/minidump_writer/linux_dumper.h b/toolkit/crashreporter/breakpad-client/linux/minidump_writer/linux_dumper.h index 7155524ffc..7fd0693968 100644 --- a/toolkit/crashreporter/breakpad-client/linux/minidump_writer/linux_dumper.h +++ b/toolkit/crashreporter/breakpad-client/linux/minidump_writer/linux_dumper.h @@ -56,6 +56,10 @@ #include "common/memory_allocator.h" #include "google_breakpad/common/minidump_format.h" +#if defined(XP_LINUX) +# include "linux_utils.h" +#endif // defined(XP_LINUX) + namespace google_breakpad { // Typedef for our parsing of the auxv variables in /proc/pid/auxv. @@ -213,11 +217,12 @@ class LinuxDumper { // other cases, however, a library can be mapped from an archive (e.g., when // loading .so libs from an apk on Android) and this method is able to // reconstruct the original file name. - void GetMappingEffectiveNameAndPath(const MappingInfo& mapping, + void GetMappingEffectiveNamePathAndVersion(const MappingInfo& mapping, char* file_path, size_t file_path_size, char* file_name, - size_t file_name_size); + size_t file_name_size, + uint32_t* version); protected: bool ReadAuxv(); diff --git a/toolkit/crashreporter/breakpad-client/linux/minidump_writer/minidump_writer.cc b/toolkit/crashreporter/breakpad-client/linux/minidump_writer/minidump_writer.cc index 03066e9110..60d1195949 100644 --- a/toolkit/crashreporter/breakpad-client/linux/minidump_writer/minidump_writer.cc +++ b/toolkit/crashreporter/breakpad-client/linux/minidump_writer/minidump_writer.cc @@ -717,8 +717,16 @@ class MinidumpWriter { char file_name[NAME_MAX]; char file_path[NAME_MAX]; - dumper_->GetMappingEffectiveNameAndPath( - mapping, file_path, sizeof(file_path), file_name, sizeof(file_name)); + uint32_t version[4] = { 0, 0, 0, 0 }; + dumper_->GetMappingEffectiveNamePathAndVersion( + mapping, file_path, sizeof(file_path), file_name, sizeof(file_name), version); + + mod->version_info.signature = MD_VSFIXEDFILEINFO_SIGNATURE; + mod->version_info.struct_version |= MD_VSFIXEDFILEINFO_VERSION; + mod->version_info.file_version_hi = version[0]; + mod->version_info.file_version_lo = version[1]; + mod->version_info.product_version_hi = version[2]; + mod->version_info.product_version_lo = version[3]; MDLocationDescriptor ld; if (!minidump_writer_.WriteString(file_path, my_strlen(file_path), &ld)) |