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

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

Issue 1985643004: Don't let PDBSourceLineWriter::GetSymbolFunctionName return empty function names (Closed) Base URL: https://chromium.googlesource.com/breakpad/breakpad.git@master
Patch Set: Created 4 years, 7 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 957 matching lines...) Expand 10 before | Expand all | Expand 10 after
968 UNDNAME_NO_MEMBER_TYPE | 968 UNDNAME_NO_MEMBER_TYPE |
969 UNDNAME_NO_RETURN_UDT_MODEL | 969 UNDNAME_NO_RETURN_UDT_MODEL |
970 UNDNAME_NO_ECSU; 970 UNDNAME_NO_ECSU;
971 971
972 // Use get_undecoratedNameEx to get readable C++ names with arguments. 972 // Use get_undecoratedNameEx to get readable C++ names with arguments.
973 if (function->get_undecoratedNameEx(undecorate_options, name) != S_OK) { 973 if (function->get_undecoratedNameEx(undecorate_options, name) != S_OK) {
974 if (function->get_name(name) != S_OK) { 974 if (function->get_name(name) != S_OK) {
975 fprintf(stderr, "failed to get function name\n"); 975 fprintf(stderr, "failed to get function name\n");
976 return false; 976 return false;
977 } 977 }
978
979 // It's possible for get_name to return an empty string, so
980 // special-case that.
981 if (wcscmp(*name, L"") == 0) {
982 SysFreeString(*name);
983 // dwarf_cu_to_module.cc uses "<name omitted>", so match that.
984 *name = SysAllocString(L"<name omitted>");
985 return true;
986 }
987
978 // If a name comes from get_name because no undecorated form existed, 988 // If a name comes from get_name because no undecorated form existed,
979 // it's already formatted properly to be used as output. Don't do any 989 // it's already formatted properly to be used as output. Don't do any
980 // additional processing. 990 // additional processing.
981 // 991 //
982 // MSVC7's DIA seems to not undecorate names in as many cases as MSVC8's. 992 // MSVC7's DIA seems to not undecorate names in as many cases as MSVC8's.
983 // This will result in calling get_name for some C++ symbols, so 993 // This will result in calling get_name for some C++ symbols, so
984 // all of the parameter and return type information may not be included in 994 // all of the parameter and return type information may not be included in
985 // the name string. 995 // the name string.
986 } else { 996 } else {
987 // C++ uses a bogus "void" argument for functions and methods that don't 997 // C++ uses a bogus "void" argument for functions and methods that don't
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
1350 // an old-style CodeView record if a real 128-bit GUID has its first 32 1360 // an old-style CodeView record if a real 128-bit GUID has its first 32
1351 // bits set the same as the module's signature (timestamp) and the rest of 1361 // bits set the same as the module's signature (timestamp) and the rest of
1352 // the GUID is set to 0. This is highly unlikely. 1362 // the GUID is set to 0. This is highly unlikely.
1353 1363
1354 GUID signature_guid = {signature}; // 0-initializes other members 1364 GUID signature_guid = {signature}; // 0-initializes other members
1355 *uses_guid = !IsEqualGUID(guid, signature_guid); 1365 *uses_guid = !IsEqualGUID(guid, signature_guid);
1356 return true; 1366 return true;
1357 } 1367 }
1358 1368
1359 } // namespace google_breakpad 1369 } // 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