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

Unified Diff: common/windows/pdb_source_line_writer.cc

Issue 1252913009: Fix compile error with Windows clang. (Closed)
Patch Set: Created 5 years, 5 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: common/windows/pdb_source_line_writer.cc
diff --git a/common/windows/pdb_source_line_writer.cc b/common/windows/pdb_source_line_writer.cc
index a3213dc34379ada00d870cd4ab33a6d9fd7f1677..b519b8b60037bf8e62f480e06e8f4ecf0c77abb0 100644
--- a/common/windows/pdb_source_line_writer.cc
+++ b/common/windows/pdb_source_line_writer.cc
@@ -278,8 +278,9 @@ bool PDBSourceLineWriter::PrintFunction(IDiaSymbol *function,
MapAddressRange(image_map_, AddressRange(rva, static_cast<DWORD>(length)),
&ranges);
for (size_t i = 0; i < ranges.size(); ++i) {
+ wstring wname(name);
fprintf(output_, "FUNC %x %x %x %ws\n",
- ranges[i].rva, ranges[i].length, stack_param_size, name);
+ ranges[i].rva, ranges[i].length, stack_param_size, wname.c_str());
}
CComPtr<IDiaEnumLineNumbers> lines;
@@ -330,7 +331,7 @@ bool PDBSourceLineWriter::PrintSourceFiles() {
if (!FileIDIsCached(file_name_string)) {
// this is a new file name, cache it and output a FILE line.
CacheFileID(file_name_string, file_id);
- fwprintf(output_, L"FILE %d %s\n", file_id, file_name);
+ fwprintf(output_, L"FILE %d %ws\n", file_id, file_name_string.c_str());
} else {
// this file name has already been seen, just save this
// ID for later lookup.
@@ -635,7 +636,8 @@ bool PDBSourceLineWriter::PrintFrameDataUsingPDB() {
0 /* epilog_size */, parameter_size, saved_register_size,
local_size, max_stack_size, program_string_result == S_OK);
if (program_string_result == S_OK) {
- fprintf(output_, "%ws\n", program_string);
+ wstring wprogram_string(program_string);
+ fprintf(output_, "%ws\n", wprogram_string.c_str());
} else {
fprintf(output_, "%d\n", allocates_base_pointer);
}
@@ -819,8 +821,9 @@ bool PDBSourceLineWriter::PrintCodePublicSymbol(IDiaSymbol *symbol) {
AddressRangeVector ranges;
MapAddressRange(image_map_, AddressRange(rva, 1), &ranges);
for (size_t i = 0; i < ranges.size(); ++i) {
+ wstring wname(name);
fprintf(output_, "PUBLIC %x %x %ws\n", ranges[i].rva,
- stack_param_size > 0 ? stack_param_size : 0, name);
+ stack_param_size > 0 ? stack_param_size : 0, wname.c_str());
}
return true;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698