Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(366)

Side by Side Diff: snapshot/win/memory_map_region_snapshot_win.cc

Issue 1377133006: Mostly-boilerplate to add MemoryMapSnapshot (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@memory-info-to-misc
Patch Set: 80col Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Crashpad Authors. All rights reserved. 1 // Copyright 2015 The Crashpad Authors. All rights reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and 12 // See the License for the specific language governing permissions and
13 // limitations under the License. 13 // limitations under the License.
14 14
15 #ifndef CRASHPAD_SNAPSHOT_MINIDUMP_MINIDUMP_STRING_READER_H_ 15 #include "snapshot/win/memory_map_region_snapshot_win.h"
16 #define CRASHPAD_SNAPSHOT_MINIDUMP_MINIDUMP_STRING_READER_H_
17
18 #include <windows.h>
19 #include <dbghelp.h>
20
21 #include <string>
22
23 #include "util/file/file_reader.h"
24 16
25 namespace crashpad { 17 namespace crashpad {
26 namespace internal { 18 namespace internal {
27 19
28 //! \brief Reads a MinidumpUTF8String from a minidump file at offset \a rva in 20 MemoryMapRegionSnapshotWin::MemoryMapRegionSnapshotWin(
29 //! \a file_reader, and returns it in \a string. 21 const MEMORY_BASIC_INFORMATION64& mbi) {
30 //! 22 memset(&memory_info_, 0, sizeof(memory_info_));
Mark Mentovai 2015/10/12 13:47:52 : memory_info_() instead of an explicit memset() t
scottmg 2015/10/13 19:33:31 Oops, I always feel like that's going to do nothin
31 //! \return `true` on success, with \a string set. `false` on failure, with a 23 memory_info_.BaseAddress = mbi.BaseAddress;
32 //! message logged. 24 memory_info_.AllocationBase = mbi.AllocationBase;
33 bool ReadMinidumpUTF8String(FileReaderInterface* file_reader, 25 memory_info_.AllocationProtect = mbi.AllocationProtect;
34 RVA rva, 26 memory_info_.RegionSize = mbi.RegionSize;
35 std::string* string); 27 memory_info_.State = mbi.State;
28 memory_info_.Protect = mbi.Protect;
29 memory_info_.Type = mbi.Type;
30 }
31
32 MemoryMapRegionSnapshotWin::~MemoryMapRegionSnapshotWin() {
33 }
34
35 MINIDUMP_MEMORY_INFO MemoryMapRegionSnapshotWin::AsMinidumpMemoryInfo() const {
36 return memory_info_;
37 }
36 38
37 } // namespace internal 39 } // namespace internal
38 } // namespace crashpad 40 } // namespace crashpad
39
40 #endif // CRASHPAD_SNAPSHOT_MINIDUMP_MINIDUMP_STRING_READER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698