diff options
author | Dawn Perchik <dawn@burble.org> | 2015-12-04 19:34:00 +0000 |
---|---|---|
committer | Dawn Perchik <dawn@burble.org> | 2015-12-04 19:34:00 +0000 |
commit | f268357514456a2cf077a3afb7712877623d8e02 (patch) | |
tree | 9adde94570c8297a4ee10d8749d2bc0b817c280e /lldb/source/Target/LanguageRuntime.cpp | |
parent | 1eb9234fd3d3777666d7d81156baea330f969282 (diff) | |
download | bcm5719-llvm-f268357514456a2cf077a3afb7712877623d8e02.tar.gz bcm5719-llvm-f268357514456a2cf077a3afb7712877623d8e02.zip |
Fix breakpoint language filtering for other C variants (like C99) and Pascal.
This patch fixes setting breakpoints on symbol for variants of C and
Pascal where the language is "unknown" within the filter-by-language
process added in r252356. It also renames GetLanguageForSymbolByName to
GuessLanguageForSymbolByName and adds comments explaining the pitfalls
of the flawed assumption that the language can be determined solely from
the name and target.
Reviewed by: jingham
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D15175
llvm-svn: 254753
Diffstat (limited to 'lldb/source/Target/LanguageRuntime.cpp')
-rw-r--r-- | lldb/source/Target/LanguageRuntime.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/lldb/source/Target/LanguageRuntime.cpp b/lldb/source/Target/LanguageRuntime.cpp index 0d67436a38e..09ecc2a9bc8 100644 --- a/lldb/source/Target/LanguageRuntime.cpp +++ b/lldb/source/Target/LanguageRuntime.cpp @@ -347,15 +347,20 @@ LanguageRuntime::CreateExceptionSearchFilter () } lldb::LanguageType -LanguageRuntime::GetLanguageForSymbolByName (Target &target, const char *symbol_name) +LanguageRuntime::GuessLanguageForSymbolByName (Target &target, const char *symbol_name) { - // This is not the right way to do this. Different targets could have different ways of mangling names - // from a given language. So we should ask the various LanguageRuntime plugin instances for this target - // to recognize the name. But right now the plugin instances depend on the process, not the target. - // That is unfortunate, because I want to use this for filtering breakpoints by language, and so I need to know - // the "language for symbol-name" prior to running. So we'd have to make a "LanguageRuntimeTarget" and - // "LanguageRuntimeProcess", and direct the questions that don't need a running process to the former, and that - // do to the latter. + // We "guess" the language because we can't determine a symbol's language from it's name. + // For example, a Pascal symbol can be mangled using the C++ Itanium scheme, and defined + // in a compilation unit within the same module as other C++ units. + // + // In addition, different targets could have different ways of mangling names from a given + // language, likewise compilation units within those targets. It would help to be able to + // ask the various LanguageRuntime plugin instances for this target to recognize the name, + // but right now the plugin instances depend on the process, not the target. That is + // unfortunate, because to use this for filtering breakpoints by language, we need to know + // the "language for symbol-name" prior to running. So we'd have to make a + // "LanguageRuntimeTarget" and "LanguageRuntimeProcess", and direct the questions that don't + // need a running process to the former, and that do to the latter. // // That's more work than I want to do for this feature. if (CPlusPlusLanguage::IsCPPMangledName (symbol_name)) |