Chromium Code Reviews| Index: components/browser_watcher/postmortem_report_collector.cc |
| diff --git a/components/browser_watcher/postmortem_report_collector.cc b/components/browser_watcher/postmortem_report_collector.cc |
| index 2b3d9d5a18509828040620859bca530d0d05397d..ccc6903d2ccd3bb3346f0f266961d0dcb115c785 100644 |
| --- a/components/browser_watcher/postmortem_report_collector.cc |
| +++ b/components/browser_watcher/postmortem_report_collector.cc |
| @@ -25,6 +25,7 @@ namespace browser_watcher { |
| using ActivitySnapshot = base::debug::ThreadActivityAnalyzer::Snapshot; |
| using base::debug::ActivityUserData; |
| using base::debug::GlobalActivityAnalyzer; |
| +using base::debug::GlobalActivityTracker; |
| using base::debug::ThreadActivityAnalyzer; |
| using crashpad::CrashReportDatabase; |
| @@ -89,6 +90,37 @@ void CollectUserData( |
| } |
| } |
| +void CollectModuleInformation( |
| + const std::vector<GlobalActivityTracker::ModuleInfo>& modules, |
| + ProcessState* process_state) { |
| + DCHECK(process_state); |
| + |
| + char code_identifier[17]; |
| + char debug_identifier[41]; |
| + |
| + for (const GlobalActivityTracker::ModuleInfo& recorded : modules) { |
| + CodeModule* collected = process_state->add_modules(); |
| + collected->set_base_address(recorded.address); |
| + collected->set_size(recorded.size); |
| + collected->set_code_file(recorded.file); |
| + |
| + snprintf(code_identifier, sizeof(code_identifier), "%08X%zx", |
|
bcwhite
2017/01/27 18:48:26
%08X%zX (both Xs capitalized) for consistency
Do y
manzagop (departed)
2017/01/27 19:25:22
This actually is the specification for the identif
|
| + recorded.timestamp, recorded.size); |
| + collected->set_code_identifier(code_identifier); |
| + collected->set_debug_file(recorded.debug_file); |
| + |
| + const crashpad::UUID* uuid = |
| + reinterpret_cast<const crashpad::UUID*>(recorded.identifier); |
| + snprintf(debug_identifier, sizeof(debug_identifier), |
| + "%08X%04X%04X%02X%02X%02X%02X%02X%02X%02X%02X%x", uuid->data_1, |
|
bcwhite
2017/01/27 18:48:26
Last X should be capitalized.
Same comment about d
manzagop (departed)
2017/01/27 19:25:22
Same as above.
|
| + uuid->data_2, uuid->data_3, uuid->data_4[0], uuid->data_4[1], |
| + uuid->data_5[0], uuid->data_5[1], uuid->data_5[2], uuid->data_5[3], |
| + uuid->data_5[4], uuid->data_5[5], recorded.age); |
| + collected->set_debug_identifier(debug_identifier); |
| + collected->set_is_unloaded(!recorded.is_loaded); |
| + } |
| +} |
| + |
| } // namespace |
| PostmortemReportCollector::PostmortemReportCollector( |
| @@ -273,6 +305,9 @@ PostmortemReportCollector::CollectionStatus PostmortemReportCollector::Collect( |
| CollectThread(thread_analyzer->activity_snapshot(), thread_state); |
| } |
| + // Collect module information. |
| + CollectModuleInformation(global_analyzer->GetModules(), process_state); |
| + |
| return SUCCESS; |
| } |