Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Side by Side Diff: snapshot/win/module_snapshot_win.cc

Issue 1430773003: win: Handle binary with embedded CodeView debug record (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: rebase Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « snapshot/win/end_to_end_test.py ('k') | snapshot/win/pe_image_reader.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « snapshot/win/end_to_end_test.py ('k') | snapshot/win/pe_image_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698