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

Unified Diff: minidump/minidump_misc_info_writer.h

Issue 701783004: Add MinidumpMiscInfoWriter::InitializeFromSnapshot() and its test (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@minidump_init_from_snapshot_system_info
Patch Set: Rebase Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | minidump/minidump_misc_info_writer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: minidump/minidump_misc_info_writer.h
diff --git a/minidump/minidump_misc_info_writer.h b/minidump/minidump_misc_info_writer.h
index 0ca5482608f13cc1c5e94dcce10dd0b8a20bcacd..4e7fc03aeb9785c77eb286eaf36732093318b279 100644
--- a/minidump/minidump_misc_info_writer.h
+++ b/minidump/minidump_misc_info_writer.h
@@ -28,6 +28,24 @@
namespace crashpad {
+class ProcessSnapshot;
+
+namespace internal {
+
+//! \brief Returns the string to set in MINIDUMP_MISC_INFO_4::DbgBldStr.
+//!
+//! dbghelp produces strings like `"dbghelp.i386,6.3.9600.16520"` and
+//! `"dbghelp.amd64,6.3.9600.16520"`. This function mimics that format, and adds
+//! the OS that wrote the minidump along with any relevant platform-specific
+//! data describing the compilation environment.
+//!
+//! This function is an implementation detail of
+//! MinidumpMiscInfoWriter::InitializeFromSnapshot() and is only exposed for
+//! testing purposes.
+std::string MinidumpMiscInfoDebugBuildString();
+
+} // namespace internal
+
//! \brief The writer for a stream in the MINIDUMP_MISC_INFO family in a
//! minidump file.
//!
@@ -41,8 +59,17 @@ class MinidumpMiscInfoWriter final : public internal::MinidumpStreamWriter {
MinidumpMiscInfoWriter();
~MinidumpMiscInfoWriter() override;
+ //! \brief Initializes MINIDUMP_MISC_INFO_N based on \a process_snapshot.
+ //!
+ //! \param[in] process_snapshot The process snapshot to use as source data.
+ //!
+ //! \note Valid in #kStateMutable. No mutator methods may be called before
+ //! this method, and it is not normally necessary to call any mutator
+ //! methods after this method.
+ void InitializeFromSnapshot(const ProcessSnapshot* process_snapshot);
+
//! \brief Sets the field referenced by #MINIDUMP_MISC1_PROCESS_ID.
- void SetProcessId(uint32_t process_id);
+ void SetProcessID(uint32_t process_id);
//! \brief Sets the fields referenced by #MINIDUMP_MISC1_PROCESS_TIMES.
void SetProcessTimes(time_t process_create_time,
« no previous file with comments | « no previous file | minidump/minidump_misc_info_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698