| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 process_reader_module.size, | 53 process_reader_module.size, |
| 54 base::UTF16ToUTF8(name_))) { | 54 base::UTF16ToUTF8(name_))) { |
| 55 return false; | 55 return false; |
| 56 } | 56 } |
| 57 | 57 |
| 58 DWORD age_dword; | 58 DWORD age_dword; |
| 59 if (pe_image_reader_->DebugDirectoryInformation( | 59 if (pe_image_reader_->DebugDirectoryInformation( |
| 60 &uuid_, &age_dword, &pdb_name_)) { | 60 &uuid_, &age_dword, &pdb_name_)) { |
| 61 static_assert(sizeof(DWORD) == sizeof(uint32_t), "unexpected age size"); | 61 static_assert(sizeof(DWORD) == sizeof(uint32_t), "unexpected age size"); |
| 62 age_ = age_dword; | 62 age_ = age_dword; |
| 63 } else { |
| 64 // If we fully supported all old debugging formats, we would want to extract |
| 65 // and emit a different type of CodeView record here (as old Microsoft tools |
| 66 // would do). As we don't expect to ever encounter a module that wouldn't be |
| 67 // be using .PDB that we actually have symbols for, we simply set a |
| 68 // plausible name here, but this will never correspond to symbols that we |
| 69 // have. |
| 70 pdb_name_ = base::UTF16ToUTF8(name_); |
| 63 } | 71 } |
| 64 | 72 |
| 65 INITIALIZATION_STATE_SET_VALID(initialized_); | 73 INITIALIZATION_STATE_SET_VALID(initialized_); |
| 66 return true; | 74 return true; |
| 67 } | 75 } |
| 68 | 76 |
| 69 void ModuleSnapshotWin::GetCrashpadOptions(CrashpadInfoClientOptions* options) { | 77 void ModuleSnapshotWin::GetCrashpadOptions(CrashpadInfoClientOptions* options) { |
| 70 INITIALIZATION_STATE_DCHECK_VALID(initialized_); | 78 INITIALIZATION_STATE_DCHECK_VALID(initialized_); |
| 71 if (process_reader_->Is64Bit()) | 79 if (process_reader_->Is64Bit()) |
| 72 GetCrashpadOptionsInternal<process_types::internal::Traits64>(options); | 80 GetCrashpadOptionsInternal<process_types::internal::Traits64>(options); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 CrashpadInfoClientOptions::TriStateFromCrashpadInfo( | 195 CrashpadInfoClientOptions::TriStateFromCrashpadInfo( |
| 188 crashpad_info.crashpad_handler_behavior); | 196 crashpad_info.crashpad_handler_behavior); |
| 189 | 197 |
| 190 options->system_crash_reporter_forwarding = | 198 options->system_crash_reporter_forwarding = |
| 191 CrashpadInfoClientOptions::TriStateFromCrashpadInfo( | 199 CrashpadInfoClientOptions::TriStateFromCrashpadInfo( |
| 192 crashpad_info.system_crash_reporter_forwarding); | 200 crashpad_info.system_crash_reporter_forwarding); |
| 193 } | 201 } |
| 194 | 202 |
| 195 } // namespace internal | 203 } // namespace internal |
| 196 } // namespace crashpad | 204 } // namespace crashpad |
| OLD | NEW |