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

Unified Diff: snapshot/win/module_snapshot_win.cc

Issue 1415543003: win: Plumb module PDB name through snapshot (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: . 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « snapshot/win/module_snapshot_win.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: snapshot/win/module_snapshot_win.cc
diff --git a/snapshot/win/module_snapshot_win.cc b/snapshot/win/module_snapshot_win.cc
index 86aae48f2e7cc0881feb3ddb3d1f346da1dba2c2..f45bedc68741075ba5c4523dbba1bf60b2fd17ae 100644
--- a/snapshot/win/module_snapshot_win.cc
+++ b/snapshot/win/module_snapshot_win.cc
@@ -27,8 +27,12 @@ namespace internal {
ModuleSnapshotWin::ModuleSnapshotWin()
: ModuleSnapshot(),
name_(),
- timestamp_(0),
+ pdb_name_(),
+ uuid_(),
+ pe_image_reader_(),
process_reader_(nullptr),
+ timestamp_(0),
+ age_(0),
initialized_() {
}
@@ -51,6 +55,13 @@ bool ModuleSnapshotWin::Initialize(
return false;
}
+ DWORD age_dword;
+ if (pe_image_reader_->DebugDirectoryInformation(
+ &uuid_, &age_dword, &pdb_name_)) {
+ static_assert(sizeof(DWORD) == sizeof(uint32_t), "unexpected age size");
+ age_ = age_dword;
+ }
+
INITIALIZATION_STATE_SET_VALID(initialized_);
return true;
}
@@ -137,16 +148,13 @@ ModuleSnapshot::ModuleType ModuleSnapshotWin::GetModuleType() const {
void ModuleSnapshotWin::UUIDAndAge(crashpad::UUID* uuid, uint32_t* age) const {
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
- // TODO(scottmg): Consider passing pdbname through to snapshot.
- std::string pdbname;
- DWORD age_dword;
- if (!pe_image_reader_->DebugDirectoryInformation(
- uuid, &age_dword, &pdbname)) {
- *uuid = crashpad::UUID();
- *age = 0;
- }
- static_assert(sizeof(DWORD) == sizeof(uint32_t), "unexpected age size");
- *age = age_dword;
+ *uuid = uuid_;
+ *age = age_;
+}
+
+std::string ModuleSnapshotWin::DebugFileName() const {
+ INITIALIZATION_STATE_DCHECK_VALID(initialized_);
+ return pdb_name_;
}
std::vector<std::string> ModuleSnapshotWin::AnnotationsVector() const {
« no previous file with comments | « snapshot/win/module_snapshot_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698