diff options
author | Jim Ingham <jingham@apple.com> | 2015-11-06 22:48:59 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2015-11-06 22:48:59 +0000 |
commit | 0fcdac363cbff6c16cf205cc88e072e82bbf8975 (patch) | |
tree | 1e90db3b67c17ae66fe0c205e47535fbcd2e431f /lldb/source/Target/LanguageRuntime.cpp | |
parent | 569aaf9e1a22df61f15ac7840fc8800f8c948de0 (diff) | |
download | bcm5719-llvm-0fcdac363cbff6c16cf205cc88e072e82bbf8975.tar.gz bcm5719-llvm-0fcdac363cbff6c16cf205cc88e072e82bbf8975.zip |
Make the language specifier to "break set" actually filter the names by their language. So for
instance:
break set -l c++ -r Name
will only break on C++ symbols that match Name, not ObjC or plain C symbols. This also works
for "break set -n" and there are SB API's to pass this as well.
llvm-svn: 252356
Diffstat (limited to 'lldb/source/Target/LanguageRuntime.cpp')
-rw-r--r-- | lldb/source/Target/LanguageRuntime.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lldb/source/Target/LanguageRuntime.cpp b/lldb/source/Target/LanguageRuntime.cpp index f930f40ace6..0d67436a38e 100644 --- a/lldb/source/Target/LanguageRuntime.cpp +++ b/lldb/source/Target/LanguageRuntime.cpp @@ -12,6 +12,8 @@ // Other libraries and framework includes // Project includes #include "lldb/Target/LanguageRuntime.h" +#include "Plugins/Language/CPlusPlus/CPlusPlusLanguage.h" +#include "Plugins/Language/ObjC/ObjCLanguage.h" #include "lldb/Target/ObjCLanguageRuntime.h" #include "lldb/Target/Target.h" #include "lldb/Core/PluginManager.h" @@ -343,3 +345,23 @@ LanguageRuntime::CreateExceptionSearchFilter () { return m_process->GetTarget().GetSearchFilterForModule(NULL); } + +lldb::LanguageType +LanguageRuntime::GetLanguageForSymbolByName (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. + // + // That's more work than I want to do for this feature. + if (CPlusPlusLanguage::IsCPPMangledName (symbol_name)) + return eLanguageTypeC_plus_plus; + else if (ObjCLanguage::IsPossibleObjCMethodName (symbol_name)) + return eLanguageTypeObjC; + else + return eLanguageTypeUnknown; +} |