mirror of
https://github.com/chromium/crashpad.git
synced 2025-03-09 22:26:06 +00:00
Mac: Expect timestamp for main executable in macOS 12+ in process reader
dyld4 *does* record a timestamp for the main executable (confirmed with a test app). Bug: chromium:1268776 Change-Id: I13380181903be7b4886dfdf37f1aa42018a0ef55 Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3833512 Reviewed-by: Mark Mentovai <mark@chromium.org> Commit-Queue: Leonard Grey <lgrey@chromium.org>
This commit is contained in:
parent
0c369760bd
commit
05e3bd85eb
@ -826,9 +826,9 @@ TEST(ProcessReaderMac, SelfModules) {
|
||||
FromPointerCast<mach_vm_address_t>(_dyld_get_image_header(index)));
|
||||
|
||||
bool expect_timestamp;
|
||||
if (index == 0) {
|
||||
// dyld didn’t load the main executable, so it couldn’t record its
|
||||
// timestamp, and it is reported as 0.
|
||||
if (index == 0 && MacOSVersionNumber() < 12'00'00) {
|
||||
// Pre-dyld4, dyld didn’t set the main executable's timestamp, and it was
|
||||
// reported as 0.
|
||||
EXPECT_EQ(modules[index].timestamp, 0);
|
||||
} else if (IsMalformedCLKernelsModule(modules[index].reader->FileType(),
|
||||
modules[index].name,
|
||||
@ -918,13 +918,15 @@ class ProcessReaderModulesChild final : public MachMultiprocess {
|
||||
EXPECT_EQ(modules[index].reader->Address(), expect_address);
|
||||
|
||||
bool expect_timestamp;
|
||||
if (index == 0 || index == modules.size() - 1) {
|
||||
// dyld didn’t load the main executable or itself, so it couldn’t record
|
||||
// these timestamps, and they are reported as 0.
|
||||
EXPECT_EQ(modules[index].timestamp, 0);
|
||||
} else if (IsMalformedCLKernelsModule(modules[index].reader->FileType(),
|
||||
modules[index].name,
|
||||
&expect_timestamp)) {
|
||||
if ((index == 0 && MacOSVersionNumber() < 12'00'00) || index == modules.size() - 1) {
|
||||
// Pre-dyld4, dyld didn’t set the main executable's timestamp, and it
|
||||
// was reported as 0.
|
||||
// The last module is dyld.
|
||||
EXPECT_EQ(modules[index].timestamp, 0);
|
||||
}
|
||||
else if (IsMalformedCLKernelsModule(modules[index].reader->FileType(),
|
||||
modules[index].name,
|
||||
&expect_timestamp)) {
|
||||
// cl_kernels doesn’t exist as a file, but may still have a timestamp.
|
||||
if (!expect_timestamp) {
|
||||
EXPECT_EQ(modules[index].timestamp, 0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user