Index: snapshot/win/process_reader_win.cc |
diff --git a/snapshot/win/process_reader_win.cc b/snapshot/win/process_reader_win.cc |
index b8086afda7568c56bfb1307f2125be32ec453fe7..0588a6fb6afa5c44e5c38e41164c0482483c9fd7 100644 |
--- a/snapshot/win/process_reader_win.cc |
+++ b/snapshot/win/process_reader_win.cc |
@@ -231,6 +231,20 @@ bool ProcessReaderWin::ReadMemory(WinVMAddress at, |
return true; |
} |
+WinVMSize ProcessReaderWin::ReadAvailableMemory(WinVMAddress at, |
+ WinVMSize num_bytes, |
+ void* into) const { |
+ auto ranges = GetAccessibleRangesInMemoryMap( |
+ at, num_bytes, process_info_.MemoryInformation()); |
+ // We only read up until the first unavailable block, so we only read from the |
+ // first range. |
+ if (ranges.empty()) |
+ return 0; |
+ if (!ReadMemory(ranges.front().base(), ranges.front().size(), into)) |
+ return 0; |
+ return ranges.front().size(); |
+} |
+ |
bool ProcessReaderWin::StartTime(timeval* start_time) const { |
FILETIME creation, exit, kernel, user; |
if (!GetProcessTimes(process_, &creation, &exit, &kernel, &user)) { |