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
This commit is contained in:
Jim Ingham
2015-11-06 22:48:59 +00:00
parent 569aaf9e1a
commit 0fcdac363c
15 changed files with 278 additions and 47 deletions

View File

@@ -870,7 +870,7 @@ SBTarget::BreakpointCreateByName (const char *symbol_name,
const SBFileSpecList &comp_unit_list)
{
uint32_t name_type_mask = eFunctionNameTypeAuto;
return BreakpointCreateByName (symbol_name, name_type_mask, module_list, comp_unit_list);
return BreakpointCreateByName (symbol_name, name_type_mask, eLanguageTypeUnknown, module_list, comp_unit_list);
}
lldb::SBBreakpoint
@@ -878,6 +878,16 @@ SBTarget::BreakpointCreateByName (const char *symbol_name,
uint32_t name_type_mask,
const SBFileSpecList &module_list,
const SBFileSpecList &comp_unit_list)
{
return BreakpointCreateByName (symbol_name, name_type_mask, eLanguageTypeUnknown, module_list, comp_unit_list);
}
lldb::SBBreakpoint
SBTarget::BreakpointCreateByName (const char *symbol_name,
uint32_t name_type_mask,
LanguageType symbol_language,
const SBFileSpecList &module_list,
const SBFileSpecList &comp_unit_list)
{
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
@@ -893,7 +903,7 @@ SBTarget::BreakpointCreateByName (const char *symbol_name,
comp_unit_list.get(),
symbol_name,
name_type_mask,
eLanguageTypeUnknown,
symbol_language,
skip_prologue,
internal,
hardware);
@@ -913,6 +923,17 @@ SBTarget::BreakpointCreateByNames (const char *symbol_names[],
uint32_t name_type_mask,
const SBFileSpecList &module_list,
const SBFileSpecList &comp_unit_list)
{
return BreakpointCreateByNames(symbol_names, num_names, name_type_mask, eLanguageTypeUnknown, module_list, comp_unit_list);
}
lldb::SBBreakpoint
SBTarget::BreakpointCreateByNames (const char *symbol_names[],
uint32_t num_names,
uint32_t name_type_mask,
LanguageType symbol_language,
const SBFileSpecList &module_list,
const SBFileSpecList &comp_unit_list)
{
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
@@ -925,14 +946,14 @@ SBTarget::BreakpointCreateByNames (const char *symbol_names[],
const bool hardware = false;
const LazyBool skip_prologue = eLazyBoolCalculate;
*sb_bp = target_sp->CreateBreakpoint (module_list.get(),
comp_unit_list.get(),
symbol_names,
num_names,
name_type_mask,
eLanguageTypeUnknown,
skip_prologue,
internal,
hardware);
comp_unit_list.get(),
symbol_names,
num_names,
name_type_mask,
symbol_language,
skip_prologue,
internal,
hardware);
}
if (log)
@@ -962,43 +983,29 @@ SBBreakpoint
SBTarget::BreakpointCreateByRegex (const char *symbol_name_regex,
const char *module_name)
{
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
SBBreakpoint sb_bp;
TargetSP target_sp(GetSP());
if (target_sp && symbol_name_regex && symbol_name_regex[0])
SBFileSpecList module_spec_list;
SBFileSpecList comp_unit_list;
if (module_name && module_name[0])
{
Mutex::Locker api_locker (target_sp->GetAPIMutex());
RegularExpression regexp(symbol_name_regex);
const bool internal = false;
const bool hardware = false;
const LazyBool skip_prologue = eLazyBoolCalculate;
if (module_name && module_name[0])
{
FileSpecList module_spec_list;
module_spec_list.Append (FileSpec (module_name, false));
*sb_bp = target_sp->CreateFuncRegexBreakpoint (&module_spec_list, NULL, regexp, skip_prologue, internal, hardware);
}
else
{
*sb_bp = target_sp->CreateFuncRegexBreakpoint (NULL, NULL, regexp, skip_prologue, internal, hardware);
}
module_spec_list.Append (FileSpec (module_name, false));
}
if (log)
log->Printf ("SBTarget(%p)::BreakpointCreateByRegex (symbol_regex=\"%s\", module_name=\"%s\") => SBBreakpoint(%p)",
static_cast<void*>(target_sp.get()), symbol_name_regex,
module_name, static_cast<void*>(sb_bp.get()));
return sb_bp;
return BreakpointCreateByRegex (symbol_name_regex, eLanguageTypeUnknown, module_spec_list, comp_unit_list);
}
lldb::SBBreakpoint
SBTarget::BreakpointCreateByRegex (const char *symbol_name_regex,
const SBFileSpecList &module_list,
const SBFileSpecList &comp_unit_list)
{
return BreakpointCreateByRegex (symbol_name_regex, eLanguageTypeUnknown, module_list, comp_unit_list);
}
lldb::SBBreakpoint
SBTarget::BreakpointCreateByRegex (const char *symbol_name_regex,
LanguageType symbol_language,
const SBFileSpecList &module_list,
const SBFileSpecList &comp_unit_list)
{
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
@@ -1011,8 +1018,8 @@ SBTarget::BreakpointCreateByRegex (const char *symbol_name_regex,
const bool internal = false;
const bool hardware = false;
const LazyBool skip_prologue = eLazyBoolCalculate;
*sb_bp = target_sp->CreateFuncRegexBreakpoint (module_list.get(), comp_unit_list.get(), regexp, skip_prologue, internal, hardware);
*sb_bp = target_sp->CreateFuncRegexBreakpoint (module_list.get(), comp_unit_list.get(), regexp, symbol_language, skip_prologue, internal, hardware);
}
if (log)