OLD | NEW |
---|---|
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, |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
141 if (ffi.dwFileType == VFT_DLL) | 141 if (ffi.dwFileType == VFT_DLL) |
142 return ModuleSnapshot::kModuleTypeSharedLibrary; | 142 return ModuleSnapshot::kModuleTypeSharedLibrary; |
143 if (ffi.dwFileType == VFT_DRV || ffi.dwFileType == VFT_VXD) | 143 if (ffi.dwFileType == VFT_DRV || ffi.dwFileType == VFT_VXD) |
144 return ModuleSnapshot::kModuleTypeLoadableModule; | 144 return ModuleSnapshot::kModuleTypeLoadableModule; |
145 } | 145 } |
146 return ModuleSnapshot::kModuleTypeUnknown; | 146 return ModuleSnapshot::kModuleTypeUnknown; |
147 } | 147 } |
148 | 148 |
149 void ModuleSnapshotWin::UUID(crashpad::UUID* uuid) const { | 149 void ModuleSnapshotWin::UUID(crashpad::UUID* uuid) const { |
150 INITIALIZATION_STATE_DCHECK_VALID(initialized_); | 150 INITIALIZATION_STATE_DCHECK_VALID(initialized_); |
151 CHECK(false) << "TODO(scottmg)"; | 151 // TODO(scottmg): Also pass the age and pdbname through to snapshot? |
152 DWORD age; | |
153 std::string pdbname; | |
154 pe_image_reader_->DebugDirectoryInformation(uuid, &age, &pdbname); | |
Mark Mentovai
2015/08/31 21:48:20
If this fails, reinitialize uuid to the default UU
scottmg
2015/08/31 23:05:01
Done.
| |
152 } | 155 } |
153 | 156 |
154 std::vector<std::string> ModuleSnapshotWin::AnnotationsVector() const { | 157 std::vector<std::string> ModuleSnapshotWin::AnnotationsVector() const { |
155 INITIALIZATION_STATE_DCHECK_VALID(initialized_); | 158 INITIALIZATION_STATE_DCHECK_VALID(initialized_); |
156 // These correspond to system-logged things on Mac. We don't currently track | 159 // These correspond to system-logged things on Mac. We don't currently track |
157 // any of these on Windows, but could in the future. | 160 // any of these on Windows, but could in the future. |
158 // See https://code.google.com/p/crashpad/issues/detail?id=38. | 161 // See https://code.google.com/p/crashpad/issues/detail?id=38. |
159 return std::vector<std::string>(); | 162 return std::vector<std::string>(); |
160 } | 163 } |
161 | 164 |
162 std::map<std::string, std::string> ModuleSnapshotWin::AnnotationsSimpleMap() | 165 std::map<std::string, std::string> ModuleSnapshotWin::AnnotationsSimpleMap() |
163 const { | 166 const { |
164 INITIALIZATION_STATE_DCHECK_VALID(initialized_); | 167 INITIALIZATION_STATE_DCHECK_VALID(initialized_); |
165 PEImageAnnotationsReader annotations_reader( | 168 PEImageAnnotationsReader annotations_reader( |
166 process_reader_, pe_image_reader_.get(), name_); | 169 process_reader_, pe_image_reader_.get(), name_); |
167 return annotations_reader.SimpleMap(); | 170 return annotations_reader.SimpleMap(); |
168 } | 171 } |
169 | 172 |
170 } // namespace internal | 173 } // namespace internal |
171 } // namespace crashpad | 174 } // namespace crashpad |
OLD | NEW |