Index: snapshot/minidump/module_snapshot_minidump.h |
diff --git a/snapshot/mac/module_snapshot_mac.h b/snapshot/minidump/module_snapshot_minidump.h |
similarity index 50% |
copy from snapshot/mac/module_snapshot_mac.h |
copy to snapshot/minidump/module_snapshot_minidump.h |
index e86ed432ee5a9c84aa53e82d5d8b0e06d3cf3af5..b04d498a7fd020b748400299e8e0b0f2bbd21a2b 100644 |
--- a/snapshot/mac/module_snapshot_mac.h |
+++ b/snapshot/minidump/module_snapshot_minidump.h |
@@ -1,4 +1,4 @@ |
-// Copyright 2014 The Crashpad Authors. All rights reserved. |
+// Copyright 2015 The Crashpad Authors. All rights reserved. |
// |
// Licensed under the Apache License, Version 2.0 (the "License"); |
// you may not use this file except in compliance with the License. |
@@ -12,9 +12,11 @@ |
// See the License for the specific language governing permissions and |
// limitations under the License. |
-#ifndef CRASHPAD_SNAPSHOT_MAC_MODULE_SNAPSHOT_MAC_H_ |
-#define CRASHPAD_SNAPSHOT_MAC_MODULE_SNAPSHOT_MAC_H_ |
+#ifndef CRASHPAD_SNAPSHOT_MINIDUMP_MODULE_SNAPSHOT_MINIDUMP_H_ |
+#define CRASHPAD_SNAPSHOT_MINIDUMP_MODULE_SNAPSHOT_MINIDUMP_H_ |
+#include <windows.h> |
+#include <dbghelp.h> |
#include <stdint.h> |
#include <sys/types.h> |
@@ -23,35 +25,37 @@ |
#include <vector> |
#include "base/basictypes.h" |
-#include "snapshot/mac/process_reader.h" |
#include "snapshot/module_snapshot.h" |
+#include "util/file/file_reader.h" |
#include "util/misc/initialization_state_dcheck.h" |
namespace crashpad { |
- |
-class MachOImageReader; |
-struct UUID; |
- |
namespace internal { |
-//! \brief A ModuleSnapshot of a code module (binary image) loaded into a |
-//! running (or crashed) process on a Mac OS X system. |
-class ModuleSnapshotMac final : public ModuleSnapshot { |
+//! \brief A ModuleSnapshot based on a module in a minidump file. |
+class ModuleSnapshotMinidump final : public ModuleSnapshot { |
public: |
- ModuleSnapshotMac(); |
- ~ModuleSnapshotMac() override; |
+ ModuleSnapshotMinidump(); |
+ ~ModuleSnapshotMinidump() override; |
//! \brief Initializes the object. |
//! |
- //! \param[in] process_reader A ProcessReader for the task containing the |
- //! module. |
- //! \param[in] process_reader_module The module within the ProcessReader for |
- //! which the snapshot should be created. |
+ //! \param[in] file_reader A file reader corresponding to a minidump file. |
+ //! The file reader must support seeking. |
+ //! \param[in] minidump_module_rva The file offset in \a file_reader at which |
+ //! the module’s MINIDUMP_MODULE structure is located. |
+ //! \param[in] minidump_crashpad_module_info_location The location in \a |
+ //! file_reader at which the module’s corresponding |
+ //! MinidumpModuleCrashpadInfo structure is located. If no such |
+ //! corresponding structure is available for a module, this may be |
+ //! `nullptr`. |
//! |
//! \return `true` if the snapshot could be created, `false` otherwise with |
//! an appropriate message logged. |
- bool Initialize(ProcessReader* process_reader, |
- const ProcessReader::Module& process_reader_module); |
+ bool Initialize(FileReaderInterface* file_reader, |
+ RVA minidump_module_rva, |
+ const MINIDUMP_LOCATION_DESCRIPTOR* |
+ minidump_crashpad_module_info_location); |
// ModuleSnapshot: |
@@ -73,16 +77,21 @@ class ModuleSnapshotMac final : public ModuleSnapshot { |
std::map<std::string, std::string> AnnotationsSimpleMap() const override; |
private: |
- std::string name_; |
- time_t timestamp_; |
- const MachOImageReader* mach_o_image_reader_; // weak |
- ProcessReader* process_reader_; // weak |
+ // Initializes data carried in a MinidumpModuleCrashpadInfo structure on |
+ // behalf of Initialize(). |
+ bool InitializeModuleCrashpadInfo(FileReaderInterface* file_reader, |
+ const MINIDUMP_LOCATION_DESCRIPTOR* |
+ minidump_module_crashpad_info_location); |
+ |
+ MINIDUMP_MODULE minidump_module_; |
+ std::vector<std::string> annotations_vector_; |
+ std::map<std::string, std::string> annotations_simple_map_; |
InitializationStateDcheck initialized_; |
- DISALLOW_COPY_AND_ASSIGN(ModuleSnapshotMac); |
+ DISALLOW_COPY_AND_ASSIGN(ModuleSnapshotMinidump); |
}; |
} // namespace internal |
} // namespace crashpad |
-#endif // CRASHPAD_SNAPSHOT_MAC_MODULE_SNAPSHOT_MAC_H_ |
+#endif // CRASHPAD_SNAPSHOT_MINIDUMP_MODULE_SNAPSHOT_MINIDUMP_H_ |