OLD | NEW |
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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 for (size_t i = 0; i < ranges.size(); ++i) { | 280 for (size_t i = 0; i < ranges.size(); ++i) { |
| 281 wstring wname(name); |
281 fprintf(output_, "FUNC %x %x %x %ws\n", | 282 fprintf(output_, "FUNC %x %x %x %ws\n", |
282 ranges[i].rva, ranges[i].length, stack_param_size, name); | 283 ranges[i].rva, ranges[i].length, stack_param_size, wname.c_str()); |
283 } | 284 } |
284 | 285 |
285 CComPtr<IDiaEnumLineNumbers> lines; | 286 CComPtr<IDiaEnumLineNumbers> lines; |
286 if (FAILED(session_->findLinesByRVA(rva, DWORD(length), &lines))) { | 287 if (FAILED(session_->findLinesByRVA(rva, DWORD(length), &lines))) { |
287 return false; | 288 return false; |
288 } | 289 } |
289 | 290 |
290 if (!PrintLines(lines)) { | 291 if (!PrintLines(lines)) { |
291 return false; | 292 return false; |
292 } | 293 } |
(...skipping 30 matching lines...) Expand all Loading... |
323 | 324 |
324 CComBSTR file_name; | 325 CComBSTR file_name; |
325 if (FAILED(file->get_fileName(&file_name))) { | 326 if (FAILED(file->get_fileName(&file_name))) { |
326 return false; | 327 return false; |
327 } | 328 } |
328 | 329 |
329 wstring file_name_string(file_name); | 330 wstring file_name_string(file_name); |
330 if (!FileIDIsCached(file_name_string)) { | 331 if (!FileIDIsCached(file_name_string)) { |
331 // this is a new file name, cache it and output a FILE line. | 332 // this is a new file name, cache it and output a FILE line. |
332 CacheFileID(file_name_string, file_id); | 333 CacheFileID(file_name_string, file_id); |
333 fwprintf(output_, L"FILE %d %s\n", file_id, file_name); | 334 fwprintf(output_, L"FILE %d %ws\n", file_id, file_name_string.c_str()); |
334 } else { | 335 } else { |
335 // this file name has already been seen, just save this | 336 // this file name has already been seen, just save this |
336 // ID for later lookup. | 337 // ID for later lookup. |
337 StoreDuplicateFileID(file_name_string, file_id); | 338 StoreDuplicateFileID(file_name_string, file_id); |
338 } | 339 } |
339 file.Release(); | 340 file.Release(); |
340 } | 341 } |
341 compiland.Release(); | 342 compiland.Release(); |
342 } | 343 } |
343 return true; | 344 return true; |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 } | 629 } |
629 } | 630 } |
630 | 631 |
631 for (size_t i = 0; i < frame_infos.size(); ++i) { | 632 for (size_t i = 0; i < frame_infos.size(); ++i) { |
632 const FrameInfo& fi(frame_infos[i]); | 633 const FrameInfo& fi(frame_infos[i]); |
633 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 ", |
634 type, fi.rva, fi.code_size, fi.prolog_size, | 635 type, fi.rva, fi.code_size, fi.prolog_size, |
635 0 /* epilog_size */, parameter_size, saved_register_size, | 636 0 /* epilog_size */, parameter_size, saved_register_size, |
636 local_size, max_stack_size, program_string_result == S_OK); | 637 local_size, max_stack_size, program_string_result == S_OK); |
637 if (program_string_result == S_OK) { | 638 if (program_string_result == S_OK) { |
638 fprintf(output_, "%ws\n", program_string); | 639 wstring wprogram_string(program_string); |
| 640 fprintf(output_, "%ws\n", wprogram_string.c_str()); |
639 } else { | 641 } else { |
640 fprintf(output_, "%d\n", allocates_base_pointer); | 642 fprintf(output_, "%d\n", allocates_base_pointer); |
641 } | 643 } |
642 } | 644 } |
643 | 645 |
644 last_type = type; | 646 last_type = type; |
645 last_rva = rva; | 647 last_rva = rva; |
646 last_code_size = code_size; | 648 last_code_size = code_size; |
647 last_prolog_size = prolog_size; | 649 last_prolog_size = prolog_size; |
648 } | 650 } |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
812 | 814 |
813 CComBSTR name; | 815 CComBSTR name; |
814 int stack_param_size; | 816 int stack_param_size; |
815 if (!GetSymbolFunctionName(symbol, &name, &stack_param_size)) { | 817 if (!GetSymbolFunctionName(symbol, &name, &stack_param_size)) { |
816 return false; | 818 return false; |
817 } | 819 } |
818 | 820 |
819 AddressRangeVector ranges; | 821 AddressRangeVector ranges; |
820 MapAddressRange(image_map_, AddressRange(rva, 1), &ranges); | 822 MapAddressRange(image_map_, AddressRange(rva, 1), &ranges); |
821 for (size_t i = 0; i < ranges.size(); ++i) { | 823 for (size_t i = 0; i < ranges.size(); ++i) { |
| 824 wstring wname(name); |
822 fprintf(output_, "PUBLIC %x %x %ws\n", ranges[i].rva, | 825 fprintf(output_, "PUBLIC %x %x %ws\n", ranges[i].rva, |
823 stack_param_size > 0 ? stack_param_size : 0, name); | 826 stack_param_size > 0 ? stack_param_size : 0, wname.c_str()); |
824 } | 827 } |
825 return true; | 828 return true; |
826 } | 829 } |
827 | 830 |
828 bool PDBSourceLineWriter::PrintPDBInfo() { | 831 bool PDBSourceLineWriter::PrintPDBInfo() { |
829 PDBModuleInfo info; | 832 PDBModuleInfo info; |
830 if (!GetModuleInfo(&info)) { | 833 if (!GetModuleInfo(&info)) { |
831 return false; | 834 return false; |
832 } | 835 } |
833 | 836 |
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1316 // an old-style CodeView record if a real 128-bit GUID has its first 32 | 1319 // an old-style CodeView record if a real 128-bit GUID has its first 32 |
1317 // bits set the same as the module's signature (timestamp) and the rest of | 1320 // bits set the same as the module's signature (timestamp) and the rest of |
1318 // the GUID is set to 0. This is highly unlikely. | 1321 // the GUID is set to 0. This is highly unlikely. |
1319 | 1322 |
1320 GUID signature_guid = {signature}; // 0-initializes other members | 1323 GUID signature_guid = {signature}; // 0-initializes other members |
1321 *uses_guid = !IsEqualGUID(guid, signature_guid); | 1324 *uses_guid = !IsEqualGUID(guid, signature_guid); |
1322 return true; | 1325 return true; |
1323 } | 1326 } |
1324 | 1327 |
1325 } // namespace google_breakpad | 1328 } // namespace google_breakpad |
OLD | NEW |