diff options
| author | Dawn Perchik <dawn@burble.org> | 2015-12-16 19:40:00 +0000 |
|---|---|---|
| committer | Dawn Perchik <dawn@burble.org> | 2015-12-16 19:40:00 +0000 |
| commit | bfd96183ef8fb60f68be1d811fd5222b0ac953a5 (patch) | |
| tree | a9267597ed5a92fd0e3657c3c615532a17a1a015 /lldb/source/Symbol/SymbolContext.cpp | |
| parent | 56bbf54b4303cac8772b6d66e3bd0668f8013067 (diff) | |
| download | bcm5719-llvm-bfd96183ef8fb60f68be1d811fd5222b0ac953a5.tar.gz bcm5719-llvm-bfd96183ef8fb60f68be1d811fd5222b0ac953a5.zip | |
Rework breakpoint language filtering to use the symbol context's language.
This patch reworks the breakpoint filter-by-language patch to use the
symbol context instead of trying to guess the language solely from the
symbol's name. This has the advantage that symbols compiled with debug
info will have their actual language known. Symbols without debug info
will still do the same "guess"ing because Symbol::GetLanguage() is
implemented using Mangled::GuessLanguage(). The recognition of ObjC
names was merged into Mangled::GuessLanguage.
Reviewed by: jingham, clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D15326
llvm-svn: 255808
Diffstat (limited to 'lldb/source/Symbol/SymbolContext.cpp')
| -rw-r--r-- | lldb/source/Symbol/SymbolContext.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/lldb/source/Symbol/SymbolContext.cpp b/lldb/source/Symbol/SymbolContext.cpp index 15d980edab9..54db5e090b8 100644 --- a/lldb/source/Symbol/SymbolContext.cpp +++ b/lldb/source/Symbol/SymbolContext.cpp @@ -525,6 +525,38 @@ SymbolContext::GetAddressRange (uint32_t scope, return false; } +LanguageType +SymbolContext::GetLanguage () const +{ + LanguageType lang; + if (function && + (lang = function->GetLanguage()) != eLanguageTypeUnknown) + { + return lang; + } + else if (variable && + (lang = variable->GetLanguage()) != eLanguageTypeUnknown) + { + return lang; + } + else if (symbol && + (lang = symbol->GetLanguage()) != eLanguageTypeUnknown) + { + return lang; + } + else if (comp_unit && + (lang = comp_unit->GetLanguage()) != eLanguageTypeUnknown) + { + return lang; + } + else if (symbol) + { + // If all else fails, try to guess the language from the name. + return symbol->GetMangled().GuessLanguage(); + } + return eLanguageTypeUnknown; +} + bool SymbolContext::GetParentOfInlinedScope (const Address &curr_frame_pc, SymbolContext &next_frame_sc, |

