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

Side by Side Diff: common/windows/pdb_source_line_writer.cc

Issue 1318013002: Fix regression on x86 for "Fix compile error with Windows clang" (Closed)
Patch Set: use .m_str instead of static cast. Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006, Google Inc. 1 // Copyright (c) 2006, Google Inc.
2 // All rights reserved. 2 // All rights reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // * Redistributions of source code must retain the above copyright 8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer. 9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above 10 // * Redistributions in binary form must reproduce the above
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 270
271 // If the decorated name didn't give the parameter size, try to 271 // If the decorated name didn't give the parameter size, try to
272 // calculate it. 272 // calculate it.
273 if (stack_param_size < 0) { 273 if (stack_param_size < 0) {
274 stack_param_size = GetFunctionStackParamSize(function); 274 stack_param_size = GetFunctionStackParamSize(function);
275 } 275 }
276 276
277 AddressRangeVector ranges; 277 AddressRangeVector ranges;
278 MapAddressRange(image_map_, AddressRange(rva, static_cast<DWORD>(length)), 278 MapAddressRange(image_map_, AddressRange(rva, static_cast<DWORD>(length)),
279 &ranges); 279 &ranges);
280 wstring wname(name);
281 for (size_t i = 0; i < ranges.size(); ++i) { 280 for (size_t i = 0; i < ranges.size(); ++i) {
282 fprintf(output_, "FUNC %x %x %x %ws\n", 281 fprintf(output_, "FUNC %x %x %x %ws\n",
283 ranges[i].rva, ranges[i].length, stack_param_size, wname.c_str()); 282 ranges[i].rva, ranges[i].length, stack_param_size,
283 name.m_str);
284 } 284 }
285 285
286 CComPtr<IDiaEnumLineNumbers> lines; 286 CComPtr<IDiaEnumLineNumbers> lines;
287 if (FAILED(session_->findLinesByRVA(rva, DWORD(length), &lines))) { 287 if (FAILED(session_->findLinesByRVA(rva, DWORD(length), &lines))) {
288 return false; 288 return false;
289 } 289 }
290 290
291 if (!PrintLines(lines)) { 291 if (!PrintLines(lines)) {
292 return false; 292 return false;
293 } 293 }
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 prolog_ranges[i].length, 622 prolog_ranges[i].length,
623 prolog_ranges[i].length }; 623 prolog_ranges[i].length };
624 frame_infos.push_back(fi); 624 frame_infos.push_back(fi);
625 } 625 }
626 for (size_t i = 0; i < code_ranges.size(); ++i) { 626 for (size_t i = 0; i < code_ranges.size(); ++i) {
627 FrameInfo fi = { code_ranges[i].rva, code_ranges[i].length, 0 }; 627 FrameInfo fi = { code_ranges[i].rva, code_ranges[i].length, 0 };
628 frame_infos.push_back(fi); 628 frame_infos.push_back(fi);
629 } 629 }
630 } 630 }
631 631
632 wstring wprogram_string(program_string);
633 for (size_t i = 0; i < frame_infos.size(); ++i) { 632 for (size_t i = 0; i < frame_infos.size(); ++i) {
634 const FrameInfo& fi(frame_infos[i]); 633 const FrameInfo& fi(frame_infos[i]);
635 fprintf(output_, "STACK WIN %x %x %x %x %x %x %x %x %x %d ", 634 fprintf(output_, "STACK WIN %x %x %x %x %x %x %x %x %x %d ",
636 type, fi.rva, fi.code_size, fi.prolog_size, 635 type, fi.rva, fi.code_size, fi.prolog_size,
637 0 /* epilog_size */, parameter_size, saved_register_size, 636 0 /* epilog_size */, parameter_size, saved_register_size,
638 local_size, max_stack_size, program_string_result == S_OK); 637 local_size, max_stack_size, program_string_result == S_OK);
639 if (program_string_result == S_OK) { 638 if (program_string_result == S_OK) {
640 fprintf(output_, "%ws\n", wprogram_string.c_str()); 639 fprintf(output_, "%ws\n", program_string.m_str);
641 } else { 640 } else {
642 fprintf(output_, "%d\n", allocates_base_pointer); 641 fprintf(output_, "%d\n", allocates_base_pointer);
643 } 642 }
644 } 643 }
645 644
646 last_type = type; 645 last_type = type;
647 last_rva = rva; 646 last_rva = rva;
648 last_code_size = code_size; 647 last_code_size = code_size;
649 last_prolog_size = prolog_size; 648 last_prolog_size = prolog_size;
650 } 649 }
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
814 813
815 CComBSTR name; 814 CComBSTR name;
816 int stack_param_size; 815 int stack_param_size;
817 if (!GetSymbolFunctionName(symbol, &name, &stack_param_size)) { 816 if (!GetSymbolFunctionName(symbol, &name, &stack_param_size)) {
818 return false; 817 return false;
819 } 818 }
820 819
821 AddressRangeVector ranges; 820 AddressRangeVector ranges;
822 MapAddressRange(image_map_, AddressRange(rva, 1), &ranges); 821 MapAddressRange(image_map_, AddressRange(rva, 1), &ranges);
823 for (size_t i = 0; i < ranges.size(); ++i) { 822 for (size_t i = 0; i < ranges.size(); ++i) {
824 wstring wname(name);
825 fprintf(output_, "PUBLIC %x %x %ws\n", ranges[i].rva, 823 fprintf(output_, "PUBLIC %x %x %ws\n", ranges[i].rva,
826 stack_param_size > 0 ? stack_param_size : 0, wname.c_str()); 824 stack_param_size > 0 ? stack_param_size : 0,
825 name.m_str);
827 } 826 }
828 return true; 827 return true;
829 } 828 }
830 829
831 bool PDBSourceLineWriter::PrintPDBInfo() { 830 bool PDBSourceLineWriter::PrintPDBInfo() {
832 PDBModuleInfo info; 831 PDBModuleInfo info;
833 if (!GetModuleInfo(&info)) { 832 if (!GetModuleInfo(&info)) {
834 return false; 833 return false;
835 } 834 }
836 835
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
1319 // an old-style CodeView record if a real 128-bit GUID has its first 32 1318 // an old-style CodeView record if a real 128-bit GUID has its first 32
1320 // bits set the same as the module's signature (timestamp) and the rest of 1319 // bits set the same as the module's signature (timestamp) and the rest of
1321 // the GUID is set to 0. This is highly unlikely. 1320 // the GUID is set to 0. This is highly unlikely.
1322 1321
1323 GUID signature_guid = {signature}; // 0-initializes other members 1322 GUID signature_guid = {signature}; // 0-initializes other members
1324 *uses_guid = !IsEqualGUID(guid, signature_guid); 1323 *uses_guid = !IsEqualGUID(guid, signature_guid);
1325 return true; 1324 return true;
1326 } 1325 }
1327 1326
1328 } // namespace google_breakpad 1327 } // namespace google_breakpad
OLDNEW
« 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