OLD | NEW |
1 // -*- mode: c++ -*- | 1 // -*- mode: c++ -*- |
2 | 2 |
3 // Copyright (c) 2010 Google Inc. | 3 // Copyright (c) 2010 Google Inc. |
4 // All rights reserved. | 4 // All rights reserved. |
5 // | 5 // |
6 // Redistribution and use in source and binary forms, with or without | 6 // Redistribution and use in source and binary forms, with or without |
7 // modification, are permitted provided that the following conditions are | 7 // modification, are permitted provided that the following conditions are |
8 // met: | 8 // met: |
9 // | 9 // |
10 // * Redistributions of source code must retain the above copyright | 10 // * Redistributions of source code must retain the above copyright |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 // parent's name, and that we don't need to know anything else about | 70 // parent's name, and that we don't need to know anything else about |
71 // the parent or the child (say, their DIEs' tags) to do the job. | 71 // the parent or the child (say, their DIEs' tags) to do the job. |
72 // This is true for the languages we support at the moment, and | 72 // This is true for the languages we support at the moment, and |
73 // keeps things concrete. Perhaps a more refined operation would | 73 // keeps things concrete. Perhaps a more refined operation would |
74 // take into account the parent and child DIE types, allow languages | 74 // take into account the parent and child DIE types, allow languages |
75 // to use their own data type for complex parent names, etc. But if | 75 // to use their own data type for complex parent names, etc. But if |
76 // C++ doesn't need all that, who would? | 76 // C++ doesn't need all that, who would? |
77 virtual string MakeQualifiedName (const string &parent_name, | 77 virtual string MakeQualifiedName (const string &parent_name, |
78 const string &name) const = 0; | 78 const string &name) const = 0; |
79 | 79 |
| 80 enum DemangleResult { |
| 81 // Demangling was not performed because it’s not appropriate to attempt. |
| 82 kDontDemangle = -1, |
| 83 |
| 84 kDemangleSuccess, |
| 85 kDemangleFailure, |
| 86 }; |
| 87 |
| 88 // Wraps abi::__cxa_demangle() or similar for languages where appropriate. |
| 89 virtual DemangleResult DemangleName(const string& mangled, |
| 90 std::string* demangled) const { |
| 91 demangled->clear(); |
| 92 return kDontDemangle; |
| 93 } |
| 94 |
80 // Instances for specific languages. | 95 // Instances for specific languages. |
81 static const Language * const CPlusPlus, | 96 static const Language * const CPlusPlus, |
82 * const Java, | 97 * const Java, |
| 98 * const Swift, |
83 * const Assembler; | 99 * const Assembler; |
84 }; | 100 }; |
85 | 101 |
86 } // namespace google_breakpad | 102 } // namespace google_breakpad |
87 | 103 |
88 #endif // COMMON_LINUX_LANGUAGE_H__ | 104 #endif // COMMON_LINUX_LANGUAGE_H__ |
OLD | NEW |