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

Side by Side Diff: minidump/minidump_module_writer.cc

Issue 1415543003: win: Plumb module PDB name through snapshot (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: . 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 | « no previous file | minidump/minidump_module_writer_test.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 2014 The Crashpad Authors. All rights reserved. 1 // Copyright 2014 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 CodeViewRecordPDB70>; 99 CodeViewRecordPDB70>;
100 100
101 MinidumpModuleCodeViewRecordPDB70Writer:: 101 MinidumpModuleCodeViewRecordPDB70Writer::
102 ~MinidumpModuleCodeViewRecordPDB70Writer() { 102 ~MinidumpModuleCodeViewRecordPDB70Writer() {
103 } 103 }
104 104
105 void MinidumpModuleCodeViewRecordPDB70Writer::InitializeFromSnapshot( 105 void MinidumpModuleCodeViewRecordPDB70Writer::InitializeFromSnapshot(
106 const ModuleSnapshot* module_snapshot) { 106 const ModuleSnapshot* module_snapshot) {
107 DCHECK_EQ(state(), kStateMutable); 107 DCHECK_EQ(state(), kStateMutable);
108 108
109 std::string name = module_snapshot->Name(); 109 SetPDBName(module_snapshot->DebugFileName());
110 std::string leaf_name;
111 size_t last_slash = name.find_last_of('/');
112 if (last_slash != std::string::npos) {
113 leaf_name = name.substr(last_slash + 1);
114 } else {
115 leaf_name = name;
116 }
117 SetPDBName(leaf_name);
118 110
119 UUID uuid; 111 UUID uuid;
120 uint32_t age; 112 uint32_t age;
121 module_snapshot->UUIDAndAge(&uuid, &age); 113 module_snapshot->UUIDAndAge(&uuid, &age);
122 SetUUIDAndAge(uuid, age); 114 SetUUIDAndAge(uuid, age);
123 } 115 }
124 116
125 MinidumpModuleMiscDebugRecordWriter::MinidumpModuleMiscDebugRecordWriter() 117 MinidumpModuleMiscDebugRecordWriter::MinidumpModuleMiscDebugRecordWriter()
126 : internal::MinidumpWritable(), 118 : internal::MinidumpWritable(),
127 image_debug_misc_(), 119 image_debug_misc_(),
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 } 444 }
453 445
454 return file_writer->WriteIoVec(&iovecs); 446 return file_writer->WriteIoVec(&iovecs);
455 } 447 }
456 448
457 MinidumpStreamType MinidumpModuleListWriter::StreamType() const { 449 MinidumpStreamType MinidumpModuleListWriter::StreamType() const {
458 return kMinidumpStreamTypeModuleList; 450 return kMinidumpStreamTypeModuleList;
459 } 451 }
460 452
461 } // namespace crashpad 453 } // namespace crashpad
OLDNEW
« no previous file with comments | « no previous file | minidump/minidump_module_writer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698