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

Side by Side Diff: snapshot/minidump/process_snapshot_minidump.h

Issue 972383002: snapshot: Add a minimal ModuleSnapshotMinidump and accessor from ProcessSnapshotMinidump (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Add NOTREACHED() comments Created 5 years, 9 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_PROCESS_SNAPSHOT_MINIDUMP_H_ 15 #ifndef CRASHPAD_SNAPSHOT_MINIDUMP_PROCESS_SNAPSHOT_MINIDUMP_H_
16 #define CRASHPAD_SNAPSHOT_MINIDUMP_PROCESS_SNAPSHOT_MINIDUMP_H_ 16 #define CRASHPAD_SNAPSHOT_MINIDUMP_PROCESS_SNAPSHOT_MINIDUMP_H_
17 17
18 #include <sys/time.h> 18 #include <sys/time.h>
19 #include <windows.h> 19 #include <windows.h>
20 #include <dbghelp.h> 20 #include <dbghelp.h>
21 21
22 #include <map> 22 #include <map>
23 #include <string> 23 #include <string>
24 #include <vector> 24 #include <vector>
25 25
26 #include "base/basictypes.h" 26 #include "base/basictypes.h"
27 #include "minidump/minidump_extensions.h" 27 #include "minidump/minidump_extensions.h"
28 #include "snapshot/exception_snapshot.h" 28 #include "snapshot/exception_snapshot.h"
29 #include "snapshot/minidump/module_snapshot_minidump.h"
29 #include "snapshot/module_snapshot.h" 30 #include "snapshot/module_snapshot.h"
30 #include "snapshot/process_snapshot.h" 31 #include "snapshot/process_snapshot.h"
31 #include "snapshot/system_snapshot.h" 32 #include "snapshot/system_snapshot.h"
32 #include "snapshot/thread_snapshot.h" 33 #include "snapshot/thread_snapshot.h"
33 #include "util/file/file_reader.h" 34 #include "util/file/file_reader.h"
34 #include "util/misc/initialization_state_dcheck.h" 35 #include "util/misc/initialization_state_dcheck.h"
36 #include "util/stdlib/pointer_container.h"
35 37
36 namespace crashpad { 38 namespace crashpad {
37 39
38 //! \brief A ProcessSnapshot based on a minidump file. 40 //! \brief A ProcessSnapshot based on a minidump file.
39 class ProcessSnapshotMinidump final : public ProcessSnapshot { 41 class ProcessSnapshotMinidump final : public ProcessSnapshot {
40 public: 42 public:
41 ProcessSnapshotMinidump(); 43 ProcessSnapshotMinidump();
42 ~ProcessSnapshotMinidump() override; 44 ~ProcessSnapshotMinidump() override;
43 45
44 //! \brief Initializes the object. 46 //! \brief Initializes the object.
(...skipping 15 matching lines...) Expand all
60 const std::map<std::string, std::string>& AnnotationsSimpleMap() 62 const std::map<std::string, std::string>& AnnotationsSimpleMap()
61 const override; 63 const override;
62 const SystemSnapshot* System() const override; 64 const SystemSnapshot* System() const override;
63 std::vector<const ThreadSnapshot*> Threads() const override; 65 std::vector<const ThreadSnapshot*> Threads() const override;
64 std::vector<const ModuleSnapshot*> Modules() const override; 66 std::vector<const ModuleSnapshot*> Modules() const override;
65 const ExceptionSnapshot* Exception() const override; 67 const ExceptionSnapshot* Exception() const override;
66 68
67 private: 69 private:
68 // Initializes data carried in a MinidumpCrashpadInfo stream on behalf of 70 // Initializes data carried in a MinidumpCrashpadInfo stream on behalf of
69 // Initialize(). 71 // Initialize().
70 void InitializeCrashpadInfo(); 72 bool InitializeCrashpadInfo();
73
74 // Initializes data carried in a MINIDUMP_MODULE_LIST stream on behalf of
75 // Initialize().
76 bool InitializeModules();
77
78 // Initializes data carried in a MinidumpModuleCrashpadInfoList structure on
79 // behalf of InitializeModules(). This makes use of MinidumpCrashpadInfo as
80 // well, so it must be called after InitializeCrashpadInfo().
81 bool InitializeModulesCrashpadInfo(
82 std::map<uint32_t, MINIDUMP_LOCATION_DESCRIPTOR>*
83 module_crashpad_info_links);
71 84
72 MINIDUMP_HEADER header_; 85 MINIDUMP_HEADER header_;
73 std::vector<MINIDUMP_DIRECTORY> stream_directory_; 86 std::vector<MINIDUMP_DIRECTORY> stream_directory_;
74 std::map<MinidumpStreamType, const MINIDUMP_LOCATION_DESCRIPTOR*> stream_map_; 87 std::map<MinidumpStreamType, const MINIDUMP_LOCATION_DESCRIPTOR*> stream_map_;
88 PointerVector<internal::ModuleSnapshotMinidump> modules_;
75 MinidumpCrashpadInfo crashpad_info_; 89 MinidumpCrashpadInfo crashpad_info_;
76 std::map<std::string, std::string> annotations_simple_map_; 90 std::map<std::string, std::string> annotations_simple_map_;
77 FileReaderInterface* file_reader_; // weak 91 FileReaderInterface* file_reader_; // weak
78 InitializationStateDcheck initialized_; 92 InitializationStateDcheck initialized_;
79 93
80 DISALLOW_COPY_AND_ASSIGN(ProcessSnapshotMinidump); 94 DISALLOW_COPY_AND_ASSIGN(ProcessSnapshotMinidump);
81 }; 95 };
82 96
83 } // namespace crashpad 97 } // namespace crashpad
84 98
85 #endif // CRASHPAD_SNAPSHOT_MINIDUMP_PROCESS_SNAPSHOT_MINIDUMP_H_ 99 #endif // CRASHPAD_SNAPSHOT_MINIDUMP_PROCESS_SNAPSHOT_MINIDUMP_H_
OLDNEW
« no previous file with comments | « snapshot/minidump/module_snapshot_minidump.cc ('k') | snapshot/minidump/process_snapshot_minidump.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698