mirror of
https://github.com/chromium/crashpad.git
synced 2025-01-13 16:58:04 +08:00
Mac: Look for crash annotations in __DATA_DIRTY on macOS 13+
Bug: chromium:1373664 Change-Id: I948eac3a46e8ad0d6fe70413111641e77c7ae57c Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4196074 Reviewed-by: Mark Mentovai <mark@chromium.org> Commit-Queue: Leonard Grey <lgrey@chromium.org>
This commit is contained in:
parent
84627e1ac7
commit
ad2e043288
@ -26,6 +26,7 @@
|
|||||||
#include "snapshot/mac/mach_o_image_reader.h"
|
#include "snapshot/mac/mach_o_image_reader.h"
|
||||||
#include "snapshot/mac/process_reader_mac.h"
|
#include "snapshot/mac/process_reader_mac.h"
|
||||||
#include "snapshot/snapshot_constants.h"
|
#include "snapshot/snapshot_constants.h"
|
||||||
|
#include "util/mac/mac_util.h"
|
||||||
#include "util/stdlib/strnlen.h"
|
#include "util/stdlib/strnlen.h"
|
||||||
|
|
||||||
namespace crashpad {
|
namespace crashpad {
|
||||||
@ -68,9 +69,11 @@ std::vector<AnnotationSnapshot> MachOImageAnnotationsReader::AnnotationsList()
|
|||||||
void MachOImageAnnotationsReader::ReadCrashReporterClientAnnotations(
|
void MachOImageAnnotationsReader::ReadCrashReporterClientAnnotations(
|
||||||
std::vector<std::string>* vector_annotations) const {
|
std::vector<std::string>* vector_annotations) const {
|
||||||
mach_vm_address_t crash_info_address;
|
mach_vm_address_t crash_info_address;
|
||||||
|
const char* segment =
|
||||||
|
MacOSVersionNumber() >= 13'00'00 ? "__DATA_DIRTY" : SEG_DATA;
|
||||||
const process_types::section* crash_info_section =
|
const process_types::section* crash_info_section =
|
||||||
image_reader_->GetSectionByName(
|
image_reader_->GetSectionByName(
|
||||||
SEG_DATA, "__crash_info", &crash_info_address);
|
segment, "__crash_info", &crash_info_address);
|
||||||
if (!crash_info_section) {
|
if (!crash_info_section) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user