| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 | 87 |
| 88 if (!InitializeCrashpadInfo()) { | 88 if (!InitializeCrashpadInfo()) { |
| 89 return false; | 89 return false; |
| 90 } | 90 } |
| 91 | 91 |
| 92 return InitializeModules(); | 92 return InitializeModules(); |
| 93 } | 93 } |
| 94 | 94 |
| 95 pid_t ProcessSnapshotMinidump::ProcessID() const { | 95 pid_t ProcessSnapshotMinidump::ProcessID() const { |
| 96 INITIALIZATION_STATE_DCHECK_VALID(initialized_); | 96 INITIALIZATION_STATE_DCHECK_VALID(initialized_); |
| 97 NOTREACHED(); // https://code.google.com/p/crashpad/issues/detail?id=10 | 97 NOTREACHED(); // https://crashpad.chromium.org/bug/10 |
| 98 return 0; | 98 return 0; |
| 99 } | 99 } |
| 100 | 100 |
| 101 pid_t ProcessSnapshotMinidump::ParentProcessID() const { | 101 pid_t ProcessSnapshotMinidump::ParentProcessID() const { |
| 102 INITIALIZATION_STATE_DCHECK_VALID(initialized_); | 102 INITIALIZATION_STATE_DCHECK_VALID(initialized_); |
| 103 NOTREACHED(); // https://code.google.com/p/crashpad/issues/detail?id=10 | 103 NOTREACHED(); // https://crashpad.chromium.org/bug/10 |
| 104 return 0; | 104 return 0; |
| 105 } | 105 } |
| 106 | 106 |
| 107 void ProcessSnapshotMinidump::SnapshotTime(timeval* snapshot_time) const { | 107 void ProcessSnapshotMinidump::SnapshotTime(timeval* snapshot_time) const { |
| 108 INITIALIZATION_STATE_DCHECK_VALID(initialized_); | 108 INITIALIZATION_STATE_DCHECK_VALID(initialized_); |
| 109 NOTREACHED(); // https://code.google.com/p/crashpad/issues/detail?id=10 | 109 NOTREACHED(); // https://crashpad.chromium.org/bug/10 |
| 110 snapshot_time->tv_sec = 0; | 110 snapshot_time->tv_sec = 0; |
| 111 snapshot_time->tv_usec = 0; | 111 snapshot_time->tv_usec = 0; |
| 112 } | 112 } |
| 113 | 113 |
| 114 void ProcessSnapshotMinidump::ProcessStartTime(timeval* start_time) const { | 114 void ProcessSnapshotMinidump::ProcessStartTime(timeval* start_time) const { |
| 115 INITIALIZATION_STATE_DCHECK_VALID(initialized_); | 115 INITIALIZATION_STATE_DCHECK_VALID(initialized_); |
| 116 NOTREACHED(); // https://code.google.com/p/crashpad/issues/detail?id=10 | 116 NOTREACHED(); // https://crashpad.chromium.org/bug/10 |
| 117 start_time->tv_sec = 0; | 117 start_time->tv_sec = 0; |
| 118 start_time->tv_usec = 0; | 118 start_time->tv_usec = 0; |
| 119 } | 119 } |
| 120 | 120 |
| 121 void ProcessSnapshotMinidump::ProcessCPUTimes(timeval* user_time, | 121 void ProcessSnapshotMinidump::ProcessCPUTimes(timeval* user_time, |
| 122 timeval* system_time) const { | 122 timeval* system_time) const { |
| 123 INITIALIZATION_STATE_DCHECK_VALID(initialized_); | 123 INITIALIZATION_STATE_DCHECK_VALID(initialized_); |
| 124 NOTREACHED(); // https://code.google.com/p/crashpad/issues/detail?id=10 | 124 NOTREACHED(); // https://crashpad.chromium.org/bug/10 |
| 125 user_time->tv_sec = 0; | 125 user_time->tv_sec = 0; |
| 126 user_time->tv_usec = 0; | 126 user_time->tv_usec = 0; |
| 127 system_time->tv_sec = 0; | 127 system_time->tv_sec = 0; |
| 128 system_time->tv_usec = 0; | 128 system_time->tv_usec = 0; |
| 129 } | 129 } |
| 130 | 130 |
| 131 void ProcessSnapshotMinidump::ReportID(UUID* report_id) const { | 131 void ProcessSnapshotMinidump::ReportID(UUID* report_id) const { |
| 132 INITIALIZATION_STATE_DCHECK_VALID(initialized_); | 132 INITIALIZATION_STATE_DCHECK_VALID(initialized_); |
| 133 *report_id = crashpad_info_.report_id; | 133 *report_id = crashpad_info_.report_id; |
| 134 } | 134 } |
| 135 | 135 |
| 136 void ProcessSnapshotMinidump::ClientID(UUID* client_id) const { | 136 void ProcessSnapshotMinidump::ClientID(UUID* client_id) const { |
| 137 INITIALIZATION_STATE_DCHECK_VALID(initialized_); | 137 INITIALIZATION_STATE_DCHECK_VALID(initialized_); |
| 138 *client_id = crashpad_info_.client_id; | 138 *client_id = crashpad_info_.client_id; |
| 139 } | 139 } |
| 140 | 140 |
| 141 const std::map<std::string, std::string>& | 141 const std::map<std::string, std::string>& |
| 142 ProcessSnapshotMinidump::AnnotationsSimpleMap() const { | 142 ProcessSnapshotMinidump::AnnotationsSimpleMap() const { |
| 143 // TODO(mark): This method should not be const, although the interface | 143 // TODO(mark): This method should not be const, although the interface |
| 144 // currently imposes this requirement. Making it non-const would allow | 144 // currently imposes this requirement. Making it non-const would allow |
| 145 // annotations_simple_map_ to be lazily constructed: InitializeCrashpadInfo() | 145 // annotations_simple_map_ to be lazily constructed: InitializeCrashpadInfo() |
| 146 // could be called here, and from other locations that require it, rather than | 146 // could be called here, and from other locations that require it, rather than |
| 147 // calling it from Initialize(). | 147 // calling it from Initialize(). |
| 148 // https://code.google.com/p/crashpad/issues/detail?id=9 | 148 // https://crashpad.chromium.org/bug/9 |
| 149 INITIALIZATION_STATE_DCHECK_VALID(initialized_); | 149 INITIALIZATION_STATE_DCHECK_VALID(initialized_); |
| 150 return annotations_simple_map_; | 150 return annotations_simple_map_; |
| 151 } | 151 } |
| 152 | 152 |
| 153 const SystemSnapshot* ProcessSnapshotMinidump::System() const { | 153 const SystemSnapshot* ProcessSnapshotMinidump::System() const { |
| 154 INITIALIZATION_STATE_DCHECK_VALID(initialized_); | 154 INITIALIZATION_STATE_DCHECK_VALID(initialized_); |
| 155 NOTREACHED(); // https://code.google.com/p/crashpad/issues/detail?id=10 | 155 NOTREACHED(); // https://crashpad.chromium.org/bug/10 |
| 156 return nullptr; | 156 return nullptr; |
| 157 } | 157 } |
| 158 | 158 |
| 159 std::vector<const ThreadSnapshot*> ProcessSnapshotMinidump::Threads() const { | 159 std::vector<const ThreadSnapshot*> ProcessSnapshotMinidump::Threads() const { |
| 160 INITIALIZATION_STATE_DCHECK_VALID(initialized_); | 160 INITIALIZATION_STATE_DCHECK_VALID(initialized_); |
| 161 NOTREACHED(); // https://code.google.com/p/crashpad/issues/detail?id=10 | 161 NOTREACHED(); // https://crashpad.chromium.org/bug/10 |
| 162 return std::vector<const ThreadSnapshot*>(); | 162 return std::vector<const ThreadSnapshot*>(); |
| 163 } | 163 } |
| 164 | 164 |
| 165 std::vector<const ModuleSnapshot*> ProcessSnapshotMinidump::Modules() const { | 165 std::vector<const ModuleSnapshot*> ProcessSnapshotMinidump::Modules() const { |
| 166 INITIALIZATION_STATE_DCHECK_VALID(initialized_); | 166 INITIALIZATION_STATE_DCHECK_VALID(initialized_); |
| 167 std::vector<const ModuleSnapshot*> modules; | 167 std::vector<const ModuleSnapshot*> modules; |
| 168 for (internal::ModuleSnapshotMinidump* module : modules_) { | 168 for (internal::ModuleSnapshotMinidump* module : modules_) { |
| 169 modules.push_back(module); | 169 modules.push_back(module); |
| 170 } | 170 } |
| 171 return modules; | 171 return modules; |
| 172 } | 172 } |
| 173 | 173 |
| 174 const ExceptionSnapshot* ProcessSnapshotMinidump::Exception() const { | 174 const ExceptionSnapshot* ProcessSnapshotMinidump::Exception() const { |
| 175 INITIALIZATION_STATE_DCHECK_VALID(initialized_); | 175 INITIALIZATION_STATE_DCHECK_VALID(initialized_); |
| 176 NOTREACHED(); // https://code.google.com/p/crashpad/issues/detail?id=10 | 176 NOTREACHED(); // https://crashpad.chromium.org/bug/10 |
| 177 return nullptr; | 177 return nullptr; |
| 178 } | 178 } |
| 179 | 179 |
| 180 std::vector<const MemoryMapRegionSnapshot*> ProcessSnapshotMinidump::MemoryMap() | 180 std::vector<const MemoryMapRegionSnapshot*> ProcessSnapshotMinidump::MemoryMap() |
| 181 const { | 181 const { |
| 182 INITIALIZATION_STATE_DCHECK_VALID(initialized_); | 182 INITIALIZATION_STATE_DCHECK_VALID(initialized_); |
| 183 NOTREACHED(); // https://code.google.com/p/crashpad/issues/detail?id=10 | 183 NOTREACHED(); // https://crashpad.chromium.org/bug/10 |
| 184 return std::vector<const MemoryMapRegionSnapshot*>(); | 184 return std::vector<const MemoryMapRegionSnapshot*>(); |
| 185 } | 185 } |
| 186 | 186 |
| 187 std::vector<HandleSnapshot> ProcessSnapshotMinidump::Handles() const { | 187 std::vector<HandleSnapshot> ProcessSnapshotMinidump::Handles() const { |
| 188 INITIALIZATION_STATE_DCHECK_VALID(initialized_); | 188 INITIALIZATION_STATE_DCHECK_VALID(initialized_); |
| 189 NOTREACHED(); // https://code.google.com/p/crashpad/issues/detail?id=10 | 189 NOTREACHED(); // https://crashpad.chromium.org/bug/10 |
| 190 return std::vector<HandleSnapshot>(); | 190 return std::vector<HandleSnapshot>(); |
| 191 } | 191 } |
| 192 | 192 |
| 193 std::vector<const MemorySnapshot*> ProcessSnapshotMinidump::ExtraMemory() | 193 std::vector<const MemorySnapshot*> ProcessSnapshotMinidump::ExtraMemory() |
| 194 const { | 194 const { |
| 195 INITIALIZATION_STATE_DCHECK_VALID(initialized_); | 195 INITIALIZATION_STATE_DCHECK_VALID(initialized_); |
| 196 NOTREACHED(); // https://code.google.com/p/crashpad/issues/detail?id=10 | 196 NOTREACHED(); // https://crashpad.chromium.org/bug/10 |
| 197 return std::vector<const MemorySnapshot*>(); | 197 return std::vector<const MemorySnapshot*>(); |
| 198 } | 198 } |
| 199 | 199 |
| 200 bool ProcessSnapshotMinidump::InitializeCrashpadInfo() { | 200 bool ProcessSnapshotMinidump::InitializeCrashpadInfo() { |
| 201 const auto& stream_it = stream_map_.find(kMinidumpStreamTypeCrashpadInfo); | 201 const auto& stream_it = stream_map_.find(kMinidumpStreamTypeCrashpadInfo); |
| 202 if (stream_it == stream_map_.end()) { | 202 if (stream_it == stream_map_.end()) { |
| 203 return true; | 203 return true; |
| 204 } | 204 } |
| 205 | 205 |
| 206 if (stream_it->second->DataSize < sizeof(crashpad_info_)) { | 206 if (stream_it->second->DataSize < sizeof(crashpad_info_)) { |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 << "duplicate module_crashpad_info_list minidump_module_list_index " | 337 << "duplicate module_crashpad_info_list minidump_module_list_index " |
| 338 << minidump_link.minidump_module_list_index; | 338 << minidump_link.minidump_module_list_index; |
| 339 return false; | 339 return false; |
| 340 } | 340 } |
| 341 } | 341 } |
| 342 | 342 |
| 343 return true; | 343 return true; |
| 344 } | 344 } |
| 345 | 345 |
| 346 } // namespace crashpad | 346 } // namespace crashpad |
| OLD | NEW |