diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /toolkit/crashreporter/breakpad-patches/10-macho-cpu-subtype.patch | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/crashreporter/breakpad-patches/10-macho-cpu-subtype.patch')
-rw-r--r-- | toolkit/crashreporter/breakpad-patches/10-macho-cpu-subtype.patch | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/toolkit/crashreporter/breakpad-patches/10-macho-cpu-subtype.patch b/toolkit/crashreporter/breakpad-patches/10-macho-cpu-subtype.patch new file mode 100644 index 0000000000..be743f9fe7 --- /dev/null +++ b/toolkit/crashreporter/breakpad-patches/10-macho-cpu-subtype.patch @@ -0,0 +1,47 @@ +changeset: 571402:0c63dcd7a1c6 +user: Steven Michaud <smichaud@pobox.com> +date: Tue Nov 19 21:42:37 2019 +0000 +summary: Bug 1371390 - Pay attention to macho images' cpusubtype when creating minidumps (revised). r=gsvelto + +diff --git a/src/common/mac/macho_walker.cc b/src/common/mac/macho_walker.cc +--- a/src/common/mac/macho_walker.cc ++++ b/src/common/mac/macho_walker.cc +@@ -151,16 +151,18 @@ bool MachoWalker::FindHeader(cpu_type_t + // header + struct mach_header header; + if (!ReadBytes(&header, sizeof(header), 0)) + return false; + + if (magic == MH_CIGAM || magic == MH_CIGAM_64) + breakpad_swap_mach_header(&header); + ++ header.cpusubtype &= ~CPU_SUBTYPE_MASK; ++ + if (cpu_type != header.cputype || + (cpu_subtype != CPU_SUBTYPE_MULTIPLE && + cpu_subtype != header.cpusubtype)) { + return false; + } + + offset = 0; + return true; +@@ -180,16 +182,18 @@ bool MachoWalker::FindHeader(cpu_type_t + struct fat_arch arch; + for (uint32_t i = 0; i < fat.nfat_arch; ++i) { + if (!ReadBytes(&arch, sizeof(arch), offset)) + return false; + + if (NXHostByteOrder() != NX_BigEndian) + breakpad_swap_fat_arch(&arch, 1); + ++ arch.cpusubtype &= ~CPU_SUBTYPE_MASK; ++ + if (arch.cputype == cpu_type && + (cpu_subtype == CPU_SUBTYPE_MULTIPLE || + arch.cpusubtype == cpu_subtype)) { + offset = arch.offset; + return true; + } + + offset += sizeof(arch); + |