diff --git a/snapshot/mac/process_reader_mac.h b/snapshot/mac/process_reader_mac.h index 9435b057..9feb8b07 100644 --- a/snapshot/mac/process_reader_mac.h +++ b/snapshot/mac/process_reader_mac.h @@ -138,7 +138,7 @@ class ProcessReaderMac { bool CPUTimes(timeval* user_time, timeval* system_time) const; //! \return Accesses the memory of the target task. - ProcessMemoryMac* Memory() { return &process_memory_; } + const ProcessMemoryMac* Memory() const { return &process_memory_; } //! \return The threads that are in the task (process). The first element (at //! index `0`) corresponds to the main thread. diff --git a/snapshot/mac/process_snapshot_mac.cc b/snapshot/mac/process_snapshot_mac.cc index 68837ff4..528e9213 100644 --- a/snapshot/mac/process_snapshot_mac.cc +++ b/snapshot/mac/process_snapshot_mac.cc @@ -219,8 +219,7 @@ std::vector ProcessSnapshotMac::ExtraMemory() const { const ProcessMemory* ProcessSnapshotMac::Memory() const { INITIALIZATION_STATE_DCHECK_VALID(initialized_); - NOTREACHED(); // https://crashpad.chromium.org/bug/263 - return nullptr; + return process_reader_.Memory(); } void ProcessSnapshotMac::InitializeThreads() { diff --git a/snapshot/mac/process_types/custom.cc b/snapshot/mac/process_types/custom.cc index 7a207e98..90209654 100644 --- a/snapshot/mac/process_types/custom.cc +++ b/snapshot/mac/process_types/custom.cc @@ -36,7 +36,7 @@ namespace internal { namespace { template -bool ReadIntoAndZero(ProcessMemoryMac* process_memory, +bool ReadIntoAndZero(const ProcessMemoryMac* process_memory, mach_vm_address_t address, mach_vm_size_t size, T* specific) { @@ -84,7 +84,7 @@ bool ReadIntoVersioned(ProcessReaderMac* process_reader, return false; } - ProcessMemoryMac* process_memory = process_reader->Memory(); + const ProcessMemoryMac* process_memory = process_reader->Memory(); decltype(specific->version) version; if (!process_memory->Read(field_address, sizeof(version), &version)) { return false; @@ -103,7 +103,7 @@ bool ReadIntoSized(ProcessReaderMac* process_reader, return false; } - ProcessMemoryMac* process_memory = process_reader->Memory(); + const ProcessMemoryMac* process_memory = process_reader->Memory(); decltype(specific->size) size; if (!process_memory->Read(address + offsetof(T, size), sizeof(size), &size)) { return false;