| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // A utility for printing the contents of a postmortem stability minidump. | 5 // A utility for printing the contents of a postmortem stability minidump. |
| 6 | 6 |
| 7 #include <windows.h> // NOLINT | 7 #include <windows.h> // NOLINT |
| 8 #include <dbghelp.h> | 8 #include <dbghelp.h> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 void PrintActivity(FILE* out, | 94 void PrintActivity(FILE* out, |
| 95 int indent_level, | 95 int indent_level, |
| 96 const browser_watcher::Activity& activity) { | 96 const browser_watcher::Activity& activity) { |
| 97 DCHECK(out); | 97 DCHECK(out); |
| 98 Indent(out, indent_level); | 98 Indent(out, indent_level); |
| 99 fprintf(out, "Activity\n"); | 99 fprintf(out, "Activity\n"); |
| 100 Indent(out, indent_level + 1); | 100 Indent(out, indent_level + 1); |
| 101 fprintf(out, "type: %d\n", activity.type()); | 101 fprintf(out, "type: %d\n", activity.type()); |
| 102 Indent(out, indent_level + 1); | 102 Indent(out, indent_level + 1); |
| 103 fprintf(out, "time: %lld\n", activity.time()); | 103 fprintf(out, "time: %lld\n", activity.time()); |
| 104 Indent(out, indent_level + 1); |
| 105 fprintf(out, "address: %llX\n", activity.address()); |
| 104 switch (activity.type()) { | 106 switch (activity.type()) { |
| 105 case browser_watcher::Activity::UNKNOWN: | 107 case browser_watcher::Activity::UNKNOWN: |
| 106 break; | 108 break; |
| 107 case browser_watcher::Activity::ACT_TASK_RUN: | 109 case browser_watcher::Activity::ACT_TASK_RUN: |
| 108 Indent(out, indent_level + 1); | 110 Indent(out, indent_level + 1); |
| 109 fprintf(out, "origin_address: %llX\n", activity.origin_address()); | 111 fprintf(out, "origin_address: %llX\n", activity.origin_address()); |
| 110 fprintf(out, "task_sequence_id: %lld\n", activity.task_sequence_id()); | 112 fprintf(out, "task_sequence_id: %lld\n", activity.task_sequence_id()); |
| 111 break; | 113 break; |
| 112 case browser_watcher::Activity::ACT_LOCK_ACQUIRE: | 114 case browser_watcher::Activity::ACT_LOCK_ACQUIRE: |
| 113 Indent(out, indent_level + 1); | 115 Indent(out, indent_level + 1); |
| 114 fprintf(out, "lock_address: %llX\n", activity.lock_address()); | 116 fprintf(out, "lock_address: %llX\n", activity.lock_address()); |
| 115 break; | 117 break; |
| 116 case browser_watcher::Activity::ACT_EVENT_WAIT: | 118 case browser_watcher::Activity::ACT_EVENT_WAIT: |
| 117 Indent(out, indent_level + 1); | 119 Indent(out, indent_level + 1); |
| 118 fprintf(out, "event_address: %llX\n", activity.event_address()); | 120 fprintf(out, "event_address: %llX\n", activity.event_address()); |
| 119 break; | 121 break; |
| 120 case browser_watcher::Activity::ACT_THREAD_JOIN: | 122 case browser_watcher::Activity::ACT_THREAD_JOIN: |
| 121 Indent(out, indent_level + 1); | 123 Indent(out, indent_level + 1); |
| 122 fprintf(out, "thread_id: %lld\n", activity.thread_id()); | 124 fprintf(out, "thread_id: %lld\n", activity.thread_id()); |
| 123 break; | 125 break; |
| 124 case browser_watcher::Activity::ACT_PROCESS_WAIT: | 126 case browser_watcher::Activity::ACT_PROCESS_WAIT: |
| 125 Indent(out, indent_level + 1); | 127 Indent(out, indent_level + 1); |
| 126 fprintf(out, "process_id: %lld\n", activity.process_id()); | 128 fprintf(out, "process_id: %lld\n", activity.process_id()); |
| 127 break; | 129 break; |
| 130 case browser_watcher::Activity::ACT_GENERIC: |
| 131 Indent(out, indent_level + 1); |
| 132 fprintf(out, "id: %u, data: %d\n", activity.generic_id(), |
| 133 activity.generic_data()); |
| 134 break; |
| 128 } | 135 } |
| 129 | 136 |
| 130 PrintUserData(out, indent_level + 1, activity.user_data()); | 137 PrintUserData(out, indent_level + 1, activity.user_data()); |
| 131 } | 138 } |
| 132 | 139 |
| 133 void PrintProcessState(FILE* out, | 140 void PrintProcessState(FILE* out, |
| 134 const browser_watcher::ProcessState& process) { | 141 const browser_watcher::ProcessState& process) { |
| 135 fprintf(out, "Process %lld (%d threads)\n", process.process_id(), | 142 fprintf(out, "Process %lld (%d threads)\n", process.process_id(), |
| 136 process.threads_size()); | 143 process.threads_size()); |
| 137 for (const browser_watcher::ThreadState& thread : process.threads()) { | 144 for (const browser_watcher::ThreadState& thread : process.threads()) { |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 PrintReport(stdout, report); | 204 PrintReport(stdout, report); |
| 198 | 205 |
| 199 return 0; | 206 return 0; |
| 200 } | 207 } |
| 201 | 208 |
| 202 } // namespace | 209 } // namespace |
| 203 | 210 |
| 204 int main(int argc, char** argv) { | 211 int main(int argc, char** argv) { |
| 205 return Main(argc, argv); | 212 return Main(argc, argv); |
| 206 } | 213 } |
| OLD | NEW |