summaryrefslogtreecommitdiffstats
path: root/lldb/source/Breakpoint/BreakpointResolverName.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Breakpoint/BreakpointResolverName.cpp')
-rw-r--r--lldb/source/Breakpoint/BreakpointResolverName.cpp110
1 files changed, 3 insertions, 107 deletions
diff --git a/lldb/source/Breakpoint/BreakpointResolverName.cpp b/lldb/source/Breakpoint/BreakpointResolverName.cpp
index 42889091a97..9df1dd73334 100644
--- a/lldb/source/Breakpoint/BreakpointResolverName.cpp
+++ b/lldb/source/Breakpoint/BreakpointResolverName.cpp
@@ -30,55 +30,14 @@ BreakpointResolverName::BreakpointResolverName
bool skip_prologue
) :
BreakpointResolver (bkpt, BreakpointResolver::NameResolver),
- m_func_name (),
- m_basename_filter (),
+ m_func_name (func_name),
m_func_name_type_mask (func_name_type_mask),
m_class_name (),
m_regex (),
m_match_type (type),
m_skip_prologue (skip_prologue)
{
- if (func_name_type_mask == eFunctionNameTypeAuto)
- {
- if ((::strchr (func_name, '(' ) != NULL) ||
- (::strstr (func_name, "-[") == func_name) ||
- (::strstr (func_name, "+[") == func_name))
- {
- // We have a name that contains an open parens, or starts with
- // "+[" or "-[", so this looks like a complete function prototype
- m_func_name_type_mask = eFunctionNameTypeFull;
- }
- else
- {
- // We don't have a full function name, but we might have a partial
- // function basename with namespaces or classes
- if (::strstr (func_name, "::") != NULL)
- {
- // Keep the full name in "m_basename_filter"
- m_basename_filter = func_name;
- // Now set "m_func_name" to just the function basename
- m_func_name.SetCString(m_basename_filter.c_str() + m_basename_filter.rfind("::") + 2);
- // We have a name with a double colon which means we have a
- // function name that is a C++ method or a function in a C++
- // namespace
- m_func_name_type_mask = eFunctionNameTypeBase | eFunctionNameTypeMethod;
- }
- else if (::strstr (func_name, ":") != NULL)
- {
- // Single colon => selector
- m_func_name_type_mask = eFunctionNameTypeSelector;
- }
- else
- {
- // just a basename by default
- m_func_name_type_mask = eFunctionNameTypeBase;
- }
- }
- }
- if (!m_func_name)
- m_func_name.SetCString(func_name);
-
if (m_match_type == Breakpoint::Regexp)
{
if (!m_regex.Compile (m_func_name.AsCString()))
@@ -178,7 +137,7 @@ BreakpointResolverName::SearchCallback
if (num_functions == 0 && !filter_by_cu)
{
- if (m_func_name_type_mask & (eFunctionNameTypeBase | eFunctionNameTypeFull))
+ if (m_func_name_type_mask & (eFunctionNameTypeBase | eFunctionNameTypeFull | eFunctionNameTypeAuto))
context.module_sp->FindSymbolsWithNameAndType (m_func_name, eSymbolTypeCode, sym_list);
}
}
@@ -217,68 +176,7 @@ BreakpointResolverName::SearchCallback
}
}
}
-
-
- if (!m_basename_filter.empty())
- {
- // Filter out any matches whose names don't contain the basename filter
- const char *basename_filter = m_basename_filter.c_str();
- if (func_list.GetSize())
- {
- bool remove = false;
- for (i = 0; i < func_list.GetSize(); remove = false)
- {
- if (func_list.GetContextAtIndex(i, sc) == false)
- remove = true;
- else if (sc.function == NULL)
- remove = true;
- else
- {
- const InlineFunctionInfo* inlined_info = NULL;
-
- if (sc.block)
- inlined_info = sc.block->GetInlinedFunctionInfo();
- if (inlined_info)
- {
- if (::strstr (inlined_info->GetName().AsCString(), basename_filter) == NULL)
- remove = true;
- }
- else if (::strstr (sc.function->GetName().AsCString(), basename_filter) == NULL)
- remove = true;
- }
-
- if (remove)
- {
- func_list.RemoveContextAtIndex(i);
- continue;
- }
- i++;
- }
- }
-
- if (sym_list.GetSize())
- {
- bool remove = false;
- for (i = 0; i < sym_list.GetSize(); remove = false)
- {
- if (sym_list.GetContextAtIndex(i, sc) == false)
- remove = true;
- else if (sc.symbol == NULL)
- remove = true;
- else if (::strstr (sc.symbol->GetName().AsCString(), basename_filter) == NULL)
- remove = true;
-
- if (remove)
- {
- sym_list.RemoveContextAtIndex(i);
- continue;
- }
- i++;
- }
- }
- }
-
// Remove any duplicates between the funcion list and the symbol list
if (func_list.GetSize())
{
@@ -395,10 +293,8 @@ BreakpointResolverName::GetDescription (Stream *s)
{
if (m_match_type == Breakpoint::Regexp)
s->Printf("regex = '%s'", m_regex.GetText());
- else if (m_basename_filter.empty())
- s->Printf("name = '%s'", m_func_name.AsCString());
else
- s->Printf("name = '%s'", m_basename_filter.c_str());
+ s->Printf("name = '%s'", m_func_name.AsCString());
}
void
OpenPOWER on IntegriCloud