forked from OSchip/llvm-project
Reverting r237460 to fix test failures introduced on OSX & Linux
TestExitDuringStep.py TestNumThreads.py TestThreadExit.py TestThreadStates.py llvm-svn: 237479
This commit is contained in:
parent
80735a2d8e
commit
a66c695340
|
@ -32,8 +32,7 @@ public:
|
||||||
const FileSpec &resolver,
|
const FileSpec &resolver,
|
||||||
uint32_t line_no,
|
uint32_t line_no,
|
||||||
bool check_inlines,
|
bool check_inlines,
|
||||||
bool skip_prologue,
|
bool skip_prologue);
|
||||||
bool exact_match);
|
|
||||||
|
|
||||||
virtual
|
virtual
|
||||||
~BreakpointResolverFileLine ();
|
~BreakpointResolverFileLine ();
|
||||||
|
@ -68,7 +67,6 @@ protected:
|
||||||
uint32_t m_line_number; // This is the line number that we are looking for.
|
uint32_t m_line_number; // This is the line number that we are looking for.
|
||||||
bool m_inlines; // This determines whether the resolver looks for inlined functions or not.
|
bool m_inlines; // This determines whether the resolver looks for inlined functions or not.
|
||||||
bool m_skip_prologue;
|
bool m_skip_prologue;
|
||||||
bool m_exact_match;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DISALLOW_COPY_AND_ASSIGN(BreakpointResolverFileLine);
|
DISALLOW_COPY_AND_ASSIGN(BreakpointResolverFileLine);
|
||||||
|
|
|
@ -29,8 +29,7 @@ class BreakpointResolverFileRegex :
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BreakpointResolverFileRegex (Breakpoint *bkpt,
|
BreakpointResolverFileRegex (Breakpoint *bkpt,
|
||||||
RegularExpression ®ex,
|
RegularExpression ®ex);
|
||||||
bool exact_match);
|
|
||||||
|
|
||||||
virtual
|
virtual
|
||||||
~BreakpointResolverFileRegex ();
|
~BreakpointResolverFileRegex ();
|
||||||
|
@ -62,7 +61,6 @@ public:
|
||||||
protected:
|
protected:
|
||||||
friend class Breakpoint;
|
friend class Breakpoint;
|
||||||
RegularExpression m_regex; // This is the line expression that we are looking for.
|
RegularExpression m_regex; // This is the line expression that we are looking for.
|
||||||
bool m_exact_match;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DISALLOW_COPY_AND_ASSIGN(BreakpointResolverFileRegex);
|
DISALLOW_COPY_AND_ASSIGN(BreakpointResolverFileRegex);
|
||||||
|
|
|
@ -64,9 +64,6 @@ public:
|
||||||
void
|
void
|
||||||
SetDefaultArchitecture (const ArchSpec& arch);
|
SetDefaultArchitecture (const ArchSpec& arch);
|
||||||
|
|
||||||
bool
|
|
||||||
GetMoveToNearestCode () const;
|
|
||||||
|
|
||||||
lldb::DynamicValueType
|
lldb::DynamicValueType
|
||||||
GetPreferDynamicValue() const;
|
GetPreferDynamicValue() const;
|
||||||
|
|
||||||
|
@ -704,8 +701,7 @@ public:
|
||||||
LazyBool check_inlines,
|
LazyBool check_inlines,
|
||||||
LazyBool skip_prologue,
|
LazyBool skip_prologue,
|
||||||
bool internal,
|
bool internal,
|
||||||
bool request_hardware,
|
bool request_hardware);
|
||||||
LazyBool move_to_nearest_code);
|
|
||||||
|
|
||||||
// Use this to create breakpoint that matches regex against the source lines in files given in source_file_list:
|
// Use this to create breakpoint that matches regex against the source lines in files given in source_file_list:
|
||||||
lldb::BreakpointSP
|
lldb::BreakpointSP
|
||||||
|
@ -713,8 +709,7 @@ public:
|
||||||
const FileSpecList *source_file_list,
|
const FileSpecList *source_file_list,
|
||||||
RegularExpression &source_regex,
|
RegularExpression &source_regex,
|
||||||
bool internal,
|
bool internal,
|
||||||
bool request_hardware,
|
bool request_hardware);
|
||||||
LazyBool move_to_nearest_code);
|
|
||||||
|
|
||||||
// Use this to create a breakpoint from a load address
|
// Use this to create a breakpoint from a load address
|
||||||
lldb::BreakpointSP
|
lldb::BreakpointSP
|
||||||
|
|
|
@ -808,8 +808,7 @@ SBTarget::BreakpointCreateByLocation (const SBFileSpec &sb_file_spec,
|
||||||
const LazyBool skip_prologue = eLazyBoolCalculate;
|
const LazyBool skip_prologue = eLazyBoolCalculate;
|
||||||
const bool internal = false;
|
const bool internal = false;
|
||||||
const bool hardware = false;
|
const bool hardware = false;
|
||||||
const LazyBool move_to_nearest_code = eLazyBoolCalculate;
|
*sb_bp = target_sp->CreateBreakpoint (NULL, *sb_file_spec, line, check_inlines, skip_prologue, internal, hardware);
|
||||||
*sb_bp = target_sp->CreateBreakpoint (NULL, *sb_file_spec, line, check_inlines, skip_prologue, internal, hardware, move_to_nearest_code);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (log)
|
if (log)
|
||||||
|
@ -1056,7 +1055,6 @@ SBTarget::BreakpointCreateBySourceRegex (const char *source_regex,
|
||||||
RegularExpression regexp(source_regex);
|
RegularExpression regexp(source_regex);
|
||||||
FileSpecList source_file_spec_list;
|
FileSpecList source_file_spec_list;
|
||||||
const bool hardware = false;
|
const bool hardware = false;
|
||||||
const LazyBool move_to_nearest_code = eLazyBoolCalculate;
|
|
||||||
source_file_spec_list.Append (source_file.ref());
|
source_file_spec_list.Append (source_file.ref());
|
||||||
|
|
||||||
if (module_name && module_name[0])
|
if (module_name && module_name[0])
|
||||||
|
@ -1064,11 +1062,11 @@ SBTarget::BreakpointCreateBySourceRegex (const char *source_regex,
|
||||||
FileSpecList module_spec_list;
|
FileSpecList module_spec_list;
|
||||||
module_spec_list.Append (FileSpec (module_name, false));
|
module_spec_list.Append (FileSpec (module_name, false));
|
||||||
|
|
||||||
*sb_bp = target_sp->CreateSourceRegexBreakpoint (&module_spec_list, &source_file_spec_list, regexp, false, hardware, move_to_nearest_code);
|
*sb_bp = target_sp->CreateSourceRegexBreakpoint (&module_spec_list, &source_file_spec_list, regexp, false, hardware);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
*sb_bp = target_sp->CreateSourceRegexBreakpoint (NULL, &source_file_spec_list, regexp, false, hardware, move_to_nearest_code);
|
*sb_bp = target_sp->CreateSourceRegexBreakpoint (NULL, &source_file_spec_list, regexp, false, hardware);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1097,9 +1095,8 @@ SBTarget::BreakpointCreateBySourceRegex (const char *source_regex,
|
||||||
{
|
{
|
||||||
Mutex::Locker api_locker (target_sp->GetAPIMutex());
|
Mutex::Locker api_locker (target_sp->GetAPIMutex());
|
||||||
const bool hardware = false;
|
const bool hardware = false;
|
||||||
const LazyBool move_to_nearest_code = eLazyBoolCalculate;
|
|
||||||
RegularExpression regexp(source_regex);
|
RegularExpression regexp(source_regex);
|
||||||
*sb_bp = target_sp->CreateSourceRegexBreakpoint (module_list.get(), source_file_list.get(), regexp, false, hardware, move_to_nearest_code);
|
*sb_bp = target_sp->CreateSourceRegexBreakpoint (module_list.get(), source_file_list.get(), regexp, false, hardware);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (log)
|
if (log)
|
||||||
|
|
|
@ -32,15 +32,13 @@ BreakpointResolverFileLine::BreakpointResolverFileLine
|
||||||
const FileSpec &file_spec,
|
const FileSpec &file_spec,
|
||||||
uint32_t line_no,
|
uint32_t line_no,
|
||||||
bool check_inlines,
|
bool check_inlines,
|
||||||
bool skip_prologue,
|
bool skip_prologue
|
||||||
bool exact_match
|
|
||||||
) :
|
) :
|
||||||
BreakpointResolver (bkpt, BreakpointResolver::FileLineResolver),
|
BreakpointResolver (bkpt, BreakpointResolver::FileLineResolver),
|
||||||
m_file_spec (file_spec),
|
m_file_spec (file_spec),
|
||||||
m_line_number (line_no),
|
m_line_number (line_no),
|
||||||
m_inlines (check_inlines),
|
m_inlines (check_inlines),
|
||||||
m_skip_prologue(skip_prologue),
|
m_skip_prologue(skip_prologue)
|
||||||
m_exact_match(exact_match)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,7 +78,7 @@ BreakpointResolverFileLine::SearchCallback
|
||||||
if (cu_sp)
|
if (cu_sp)
|
||||||
{
|
{
|
||||||
if (filter.CompUnitPasses(*cu_sp))
|
if (filter.CompUnitPasses(*cu_sp))
|
||||||
cu_sp->ResolveSymbolContext (m_file_spec, m_line_number, m_inlines, m_exact_match, eSymbolContextEverything, sc_list);
|
cu_sp->ResolveSymbolContext (m_file_spec, m_line_number, m_inlines, false, eSymbolContextEverything, sc_list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
StreamString s;
|
StreamString s;
|
||||||
|
@ -102,7 +100,7 @@ BreakpointResolverFileLine::GetDepth()
|
||||||
void
|
void
|
||||||
BreakpointResolverFileLine::GetDescription (Stream *s)
|
BreakpointResolverFileLine::GetDescription (Stream *s)
|
||||||
{
|
{
|
||||||
s->Printf ("file = '%s', line = %u, exact_match = %d", m_file_spec.GetPath().c_str(), m_line_number, m_exact_match);
|
s->Printf ("file = '%s', line = %u", m_file_spec.GetPath().c_str(), m_line_number);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -118,8 +116,7 @@ BreakpointResolverFileLine::CopyForBreakpoint (Breakpoint &breakpoint)
|
||||||
m_file_spec,
|
m_file_spec,
|
||||||
m_line_number,
|
m_line_number,
|
||||||
m_inlines,
|
m_inlines,
|
||||||
m_skip_prologue,
|
m_skip_prologue));
|
||||||
m_exact_match));
|
|
||||||
|
|
||||||
return ret_sp;
|
return ret_sp;
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,12 +29,10 @@ using namespace lldb_private;
|
||||||
BreakpointResolverFileRegex::BreakpointResolverFileRegex
|
BreakpointResolverFileRegex::BreakpointResolverFileRegex
|
||||||
(
|
(
|
||||||
Breakpoint *bkpt,
|
Breakpoint *bkpt,
|
||||||
RegularExpression ®ex,
|
RegularExpression ®ex
|
||||||
bool exact_match
|
|
||||||
) :
|
) :
|
||||||
BreakpointResolver (bkpt, BreakpointResolver::FileLineResolver),
|
BreakpointResolver (bkpt, BreakpointResolver::FileLineResolver),
|
||||||
m_regex (regex),
|
m_regex (regex)
|
||||||
m_exact_match (exact_match)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,8 +64,9 @@ BreakpointResolverFileRegex::SearchCallback
|
||||||
{
|
{
|
||||||
SymbolContextList sc_list;
|
SymbolContextList sc_list;
|
||||||
const bool search_inlines = false;
|
const bool search_inlines = false;
|
||||||
|
const bool exact = false;
|
||||||
|
|
||||||
cu->ResolveSymbolContext (cu_file_spec, line_matches[i], search_inlines, m_exact_match, eSymbolContextEverything, sc_list);
|
cu->ResolveSymbolContext (cu_file_spec, line_matches[i], search_inlines, exact, eSymbolContextEverything, sc_list);
|
||||||
const bool skip_prologue = true;
|
const bool skip_prologue = true;
|
||||||
|
|
||||||
BreakpointResolver::SetSCMatchesByLine (filter, sc_list, skip_prologue, m_regex.GetText());
|
BreakpointResolver::SetSCMatchesByLine (filter, sc_list, skip_prologue, m_regex.GetText());
|
||||||
|
@ -86,7 +85,7 @@ BreakpointResolverFileRegex::GetDepth()
|
||||||
void
|
void
|
||||||
BreakpointResolverFileRegex::GetDescription (Stream *s)
|
BreakpointResolverFileRegex::GetDescription (Stream *s)
|
||||||
{
|
{
|
||||||
s->Printf ("source regex = \"%s\", exact_match = %d", m_regex.GetText(), m_exact_match);
|
s->Printf ("source regex = \"%s\"", m_regex.GetText());
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -98,7 +97,7 @@ BreakpointResolverFileRegex::Dump (Stream *s) const
|
||||||
lldb::BreakpointResolverSP
|
lldb::BreakpointResolverSP
|
||||||
BreakpointResolverFileRegex::CopyForBreakpoint (Breakpoint &breakpoint)
|
BreakpointResolverFileRegex::CopyForBreakpoint (Breakpoint &breakpoint)
|
||||||
{
|
{
|
||||||
lldb::BreakpointResolverSP ret_sp(new BreakpointResolverFileRegex(&breakpoint, m_regex, m_exact_match));
|
lldb::BreakpointResolverSP ret_sp(new BreakpointResolverFileRegex(&breakpoint, m_regex));
|
||||||
return ret_sp;
|
return ret_sp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -115,8 +115,7 @@ public:
|
||||||
m_exception_language (eLanguageTypeUnknown),
|
m_exception_language (eLanguageTypeUnknown),
|
||||||
m_skip_prologue (eLazyBoolCalculate),
|
m_skip_prologue (eLazyBoolCalculate),
|
||||||
m_one_shot (false),
|
m_one_shot (false),
|
||||||
m_all_files (false),
|
m_all_files (false)
|
||||||
m_move_to_nearest_code (eLazyBoolCalculate)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -250,22 +249,6 @@ public:
|
||||||
error.SetErrorStringWithFormat ("invalid line number: %s.", option_arg);
|
error.SetErrorStringWithFormat ("invalid line number: %s.", option_arg);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case 'm':
|
|
||||||
{
|
|
||||||
bool success;
|
|
||||||
bool value;
|
|
||||||
value = Args::StringToBoolean (option_arg, true, &success);
|
|
||||||
if (value)
|
|
||||||
m_move_to_nearest_code = eLazyBoolYes;
|
|
||||||
else
|
|
||||||
m_move_to_nearest_code = eLazyBoolNo;
|
|
||||||
|
|
||||||
if (!success)
|
|
||||||
error.SetErrorStringWithFormat ("Invalid boolean value for move-to-nearest-code option: '%s'", option_arg);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case 'M':
|
case 'M':
|
||||||
m_func_names.push_back (option_arg);
|
m_func_names.push_back (option_arg);
|
||||||
m_func_name_type_mask |= eFunctionNameTypeMethod;
|
m_func_name_type_mask |= eFunctionNameTypeMethod;
|
||||||
|
@ -378,7 +361,6 @@ public:
|
||||||
m_breakpoint_names.clear();
|
m_breakpoint_names.clear();
|
||||||
m_all_files = false;
|
m_all_files = false;
|
||||||
m_exception_extra_args.Clear();
|
m_exception_extra_args.Clear();
|
||||||
m_move_to_nearest_code = eLazyBoolCalculate;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const OptionDefinition*
|
const OptionDefinition*
|
||||||
|
@ -418,7 +400,6 @@ public:
|
||||||
bool m_use_dummy;
|
bool m_use_dummy;
|
||||||
bool m_all_files;
|
bool m_all_files;
|
||||||
Args m_exception_extra_args;
|
Args m_exception_extra_args;
|
||||||
LazyBool m_move_to_nearest_code;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -496,8 +477,7 @@ protected:
|
||||||
check_inlines,
|
check_inlines,
|
||||||
m_options.m_skip_prologue,
|
m_options.m_skip_prologue,
|
||||||
internal,
|
internal,
|
||||||
m_options.m_hardware,
|
m_options.m_hardware).get();
|
||||||
m_options.m_move_to_nearest_code).get();
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -578,8 +558,7 @@ protected:
|
||||||
&(m_options.m_filenames),
|
&(m_options.m_filenames),
|
||||||
regexp,
|
regexp,
|
||||||
internal,
|
internal,
|
||||||
m_options.m_hardware,
|
m_options.m_hardware).get();
|
||||||
m_options.m_move_to_nearest_code).get();
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case eSetTypeException:
|
case eSetTypeException:
|
||||||
|
@ -710,7 +689,6 @@ private:
|
||||||
#define LLDB_OPT_FILE ( LLDB_OPT_SET_FROM_TO(1, 9) & ~LLDB_OPT_SET_2 )
|
#define LLDB_OPT_FILE ( LLDB_OPT_SET_FROM_TO(1, 9) & ~LLDB_OPT_SET_2 )
|
||||||
#define LLDB_OPT_NOT_10 ( LLDB_OPT_SET_FROM_TO(1, 10) & ~LLDB_OPT_SET_10 )
|
#define LLDB_OPT_NOT_10 ( LLDB_OPT_SET_FROM_TO(1, 10) & ~LLDB_OPT_SET_10 )
|
||||||
#define LLDB_OPT_SKIP_PROLOGUE ( LLDB_OPT_SET_1 | LLDB_OPT_SET_FROM_TO(3,8) )
|
#define LLDB_OPT_SKIP_PROLOGUE ( LLDB_OPT_SET_1 | LLDB_OPT_SET_FROM_TO(3,8) )
|
||||||
#define LLDB_OPT_MOVE_TO_NEAREST_CODE ( LLDB_OPT_SET_1 | LLDB_OPT_SET_9 )
|
|
||||||
|
|
||||||
OptionDefinition
|
OptionDefinition
|
||||||
CommandObjectBreakpointSet::CommandOptions::g_option_table[] =
|
CommandObjectBreakpointSet::CommandOptions::g_option_table[] =
|
||||||
|
@ -811,9 +789,6 @@ CommandObjectBreakpointSet::CommandOptions::g_option_table[] =
|
||||||
{ LLDB_OPT_SET_ALL, false, "breakpoint-name", 'N', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeBreakpointName,
|
{ LLDB_OPT_SET_ALL, false, "breakpoint-name", 'N', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeBreakpointName,
|
||||||
"Adds this to the list of names for this breakopint."},
|
"Adds this to the list of names for this breakopint."},
|
||||||
|
|
||||||
{ LLDB_OPT_MOVE_TO_NEAREST_CODE, false, "move-to-nearest-code", 'm', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeBoolean,
|
|
||||||
"Move breakpoints to nearest code. If not set the target.move-to-nearest-code setting is used." },
|
|
||||||
|
|
||||||
{ 0, false, NULL, 0, 0, NULL, NULL, 0, eArgTypeNone, NULL }
|
{ 0, false, NULL, 0, 0, NULL, NULL, 0, eArgTypeNone, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -5326,8 +5326,7 @@ public:
|
||||||
eLazyBoolCalculate, // Check inlines using global setting
|
eLazyBoolCalculate, // Check inlines using global setting
|
||||||
eLazyBoolCalculate, // Skip prologue using global setting,
|
eLazyBoolCalculate, // Skip prologue using global setting,
|
||||||
false, // internal
|
false, // internal
|
||||||
false, // request_hardware
|
false); // request_hardware
|
||||||
eLazyBoolCalculate); // move_to_nearest_code
|
|
||||||
// Make breakpoint one shot
|
// Make breakpoint one shot
|
||||||
bp_sp->GetOptions()->SetOneShot(true);
|
bp_sp->GetOptions()->SetOneShot(true);
|
||||||
exe_ctx.GetProcessRef().Resume();
|
exe_ctx.GetProcessRef().Resume();
|
||||||
|
@ -5362,8 +5361,7 @@ public:
|
||||||
eLazyBoolCalculate, // Check inlines using global setting
|
eLazyBoolCalculate, // Check inlines using global setting
|
||||||
eLazyBoolCalculate, // Skip prologue using global setting,
|
eLazyBoolCalculate, // Skip prologue using global setting,
|
||||||
false, // internal
|
false, // internal
|
||||||
false, // request_hardware
|
false); // request_hardware
|
||||||
eLazyBoolCalculate); // move_to_nearest_code
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_selected_line < GetNumDisassemblyLines())
|
else if (m_selected_line < GetNumDisassemblyLines())
|
||||||
|
|
|
@ -273,13 +273,10 @@ Target::CreateSourceRegexBreakpoint (const FileSpecList *containingModules,
|
||||||
const FileSpecList *source_file_spec_list,
|
const FileSpecList *source_file_spec_list,
|
||||||
RegularExpression &source_regex,
|
RegularExpression &source_regex,
|
||||||
bool internal,
|
bool internal,
|
||||||
bool hardware,
|
bool hardware)
|
||||||
LazyBool move_to_nearest_code)
|
|
||||||
{
|
{
|
||||||
SearchFilterSP filter_sp(GetSearchFilterForModuleAndCUList (containingModules, source_file_spec_list));
|
SearchFilterSP filter_sp(GetSearchFilterForModuleAndCUList (containingModules, source_file_spec_list));
|
||||||
if (move_to_nearest_code == eLazyBoolCalculate)
|
BreakpointResolverSP resolver_sp(new BreakpointResolverFileRegex (NULL, source_regex));
|
||||||
move_to_nearest_code = GetMoveToNearestCode() ? eLazyBoolYes : eLazyBoolNo;
|
|
||||||
BreakpointResolverSP resolver_sp(new BreakpointResolverFileRegex (NULL, source_regex, !static_cast<bool>(move_to_nearest_code)));
|
|
||||||
return CreateBreakpoint (filter_sp, resolver_sp, internal, hardware, true);
|
return CreateBreakpoint (filter_sp, resolver_sp, internal, hardware, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -291,8 +288,7 @@ Target::CreateBreakpoint (const FileSpecList *containingModules,
|
||||||
LazyBool check_inlines,
|
LazyBool check_inlines,
|
||||||
LazyBool skip_prologue,
|
LazyBool skip_prologue,
|
||||||
bool internal,
|
bool internal,
|
||||||
bool hardware,
|
bool hardware)
|
||||||
LazyBool move_to_nearest_code)
|
|
||||||
{
|
{
|
||||||
if (check_inlines == eLazyBoolCalculate)
|
if (check_inlines == eLazyBoolCalculate)
|
||||||
{
|
{
|
||||||
|
@ -329,15 +325,12 @@ Target::CreateBreakpoint (const FileSpecList *containingModules,
|
||||||
}
|
}
|
||||||
if (skip_prologue == eLazyBoolCalculate)
|
if (skip_prologue == eLazyBoolCalculate)
|
||||||
skip_prologue = GetSkipPrologue() ? eLazyBoolYes : eLazyBoolNo;
|
skip_prologue = GetSkipPrologue() ? eLazyBoolYes : eLazyBoolNo;
|
||||||
if (move_to_nearest_code == eLazyBoolCalculate)
|
|
||||||
move_to_nearest_code = GetMoveToNearestCode() ? eLazyBoolYes : eLazyBoolNo;
|
|
||||||
|
|
||||||
BreakpointResolverSP resolver_sp(new BreakpointResolverFileLine (NULL,
|
BreakpointResolverSP resolver_sp(new BreakpointResolverFileLine (NULL,
|
||||||
file,
|
file,
|
||||||
line_no,
|
line_no,
|
||||||
check_inlines,
|
check_inlines,
|
||||||
skip_prologue,
|
skip_prologue));
|
||||||
!static_cast<bool>(move_to_nearest_code)));
|
|
||||||
return CreateBreakpoint (filter_sp, resolver_sp, internal, hardware, true);
|
return CreateBreakpoint (filter_sp, resolver_sp, internal, hardware, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2935,7 +2928,6 @@ static PropertyDefinition
|
||||||
g_properties[] =
|
g_properties[] =
|
||||||
{
|
{
|
||||||
{ "default-arch" , OptionValue::eTypeArch , true , 0 , NULL, NULL, "Default architecture to choose, when there's a choice." },
|
{ "default-arch" , OptionValue::eTypeArch , true , 0 , NULL, NULL, "Default architecture to choose, when there's a choice." },
|
||||||
{ "move-to-nearest-code" , OptionValue::eTypeBoolean , false, true , NULL, NULL, "Move breakpoints to nearest code." },
|
|
||||||
{ "expr-prefix" , OptionValue::eTypeFileSpec , false, 0 , NULL, NULL, "Path to a file containing expressions to be prepended to all expressions." },
|
{ "expr-prefix" , OptionValue::eTypeFileSpec , false, 0 , NULL, NULL, "Path to a file containing expressions to be prepended to all expressions." },
|
||||||
{ "prefer-dynamic-value" , OptionValue::eTypeEnum , false, eDynamicDontRunTarget , NULL, g_dynamic_value_types, "Should printed values be shown as their dynamic value." },
|
{ "prefer-dynamic-value" , OptionValue::eTypeEnum , false, eDynamicDontRunTarget , NULL, g_dynamic_value_types, "Should printed values be shown as their dynamic value." },
|
||||||
{ "enable-synthetic-value" , OptionValue::eTypeBoolean , false, true , NULL, NULL, "Should synthetic values be used by default whenever available." },
|
{ "enable-synthetic-value" , OptionValue::eTypeBoolean , false, true , NULL, NULL, "Should synthetic values be used by default whenever available." },
|
||||||
|
@ -2993,7 +2985,6 @@ g_properties[] =
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
ePropertyDefaultArch,
|
ePropertyDefaultArch,
|
||||||
ePropertyMoveToNearestCode,
|
|
||||||
ePropertyExprPrefix,
|
ePropertyExprPrefix,
|
||||||
ePropertyPreferDynamic,
|
ePropertyPreferDynamic,
|
||||||
ePropertyEnableSynthetic,
|
ePropertyEnableSynthetic,
|
||||||
|
@ -3202,13 +3193,6 @@ TargetProperties::SetDefaultArchitecture (const ArchSpec& arch)
|
||||||
return value->SetCurrentValue(arch, true);
|
return value->SetCurrentValue(arch, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
|
||||||
TargetProperties::GetMoveToNearestCode() const
|
|
||||||
{
|
|
||||||
const uint32_t idx = ePropertyMoveToNearestCode;
|
|
||||||
return m_collection_sp->GetPropertyAtIndexAsBoolean (NULL, idx, g_properties[idx].default_uint_value != 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
lldb::DynamicValueType
|
lldb::DynamicValueType
|
||||||
TargetProperties::GetPreferDynamicValue() const
|
TargetProperties::GetPreferDynamicValue() const
|
||||||
{
|
{
|
||||||
|
|
|
@ -64,12 +64,12 @@ class BreakpointCommandTestCase(TestBase):
|
||||||
|
|
||||||
# The breakpoint list now only contains breakpoint 1.
|
# The breakpoint list now only contains breakpoint 1.
|
||||||
self.expect("breakpoint list", "Breakpoints 1 & 2 created",
|
self.expect("breakpoint list", "Breakpoints 1 & 2 created",
|
||||||
substrs = ["2: file = 'main.c', line = %d, exact_match = 0, locations = 1" % self.line],
|
substrs = ["2: file = 'main.c', line = %d, locations = 1" % self.line],
|
||||||
patterns = ["1: file = '.*main.c', line = %d, exact_match = 0, locations = 1" % self.line] )
|
patterns = ["1: file = '.*main.c', line = %d, locations = 1" % self.line] )
|
||||||
|
|
||||||
self.expect("breakpoint list -f", "Breakpoints 1 & 2 created",
|
self.expect("breakpoint list -f", "Breakpoints 1 & 2 created",
|
||||||
substrs = ["2: file = 'main.c', line = %d, exact_match = 0, locations = 1" % self.line],
|
substrs = ["2: file = 'main.c', line = %d, locations = 1" % self.line],
|
||||||
patterns = ["1: file = '.*main.c', line = %d, exact_match = 0, locations = 1" % self.line,
|
patterns = ["1: file = '.*main.c', line = %d, locations = 1" % self.line,
|
||||||
"1.1: .+at main.c:%d, .+unresolved, hit count = 0" % self.line,
|
"1.1: .+at main.c:%d, .+unresolved, hit count = 0" % self.line,
|
||||||
"2.1: .+at main.c:%d, .+unresolved, hit count = 0" % self.line])
|
"2.1: .+at main.c:%d, .+unresolved, hit count = 0" % self.line])
|
||||||
|
|
||||||
|
@ -151,13 +151,13 @@ class BreakpointCommandTestCase(TestBase):
|
||||||
|
|
||||||
# The breakpoint list now only contains breakpoint 1.
|
# The breakpoint list now only contains breakpoint 1.
|
||||||
self.expect("breakpoint list -f", "Breakpoint 1 exists",
|
self.expect("breakpoint list -f", "Breakpoint 1 exists",
|
||||||
patterns = ["1: file = '.*main.c', line = %d, exact_match = 0, locations = 1, resolved = 1" %
|
patterns = ["1: file = '.*main.c', line = %d, locations = 1, resolved = 1" %
|
||||||
self.line,
|
self.line,
|
||||||
"hit count = 1"])
|
"hit count = 1"])
|
||||||
|
|
||||||
# Not breakpoint 2.
|
# Not breakpoint 2.
|
||||||
self.expect("breakpoint list -f", "No more breakpoint 2", matching=False,
|
self.expect("breakpoint list -f", "No more breakpoint 2", matching=False,
|
||||||
substrs = ["2: file = 'main.c', line = %d, exact_match = 0, locations = 1, resolved = 1" %
|
substrs = ["2: file = 'main.c', line = %d, locations = 1, resolved = 1" %
|
||||||
self.line])
|
self.line])
|
||||||
|
|
||||||
# Run the program again, with breakpoint 1 remaining.
|
# Run the program again, with breakpoint 1 remaining.
|
||||||
|
|
|
@ -41,7 +41,7 @@ class BreakpointLocationsTestCase(TestBase):
|
||||||
|
|
||||||
# The breakpoint list should show 3 locations.
|
# The breakpoint list should show 3 locations.
|
||||||
self.expect("breakpoint list -f", "Breakpoint locations shown correctly",
|
self.expect("breakpoint list -f", "Breakpoint locations shown correctly",
|
||||||
substrs = ["1: file = 'main.c', line = %d, exact_match = 0, locations = 3" % self.line],
|
substrs = ["1: file = 'main.c', line = %d, locations = 3" % self.line],
|
||||||
patterns = ["where = a.out`func_inlined .+unresolved, hit count = 0",
|
patterns = ["where = a.out`func_inlined .+unresolved, hit count = 0",
|
||||||
"where = a.out`main .+\[inlined\].+unresolved, hit count = 0"])
|
"where = a.out`main .+\[inlined\].+unresolved, hit count = 0"])
|
||||||
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
LEVEL = ../../../make
|
|
||||||
|
|
||||||
C_SOURCES := main.c
|
|
||||||
|
|
||||||
include $(LEVEL)/Makefile.rules
|
|
|
@ -1,77 +0,0 @@
|
||||||
"""
|
|
||||||
Test breakpoint command for different options.
|
|
||||||
"""
|
|
||||||
|
|
||||||
import os
|
|
||||||
import unittest2
|
|
||||||
import lldb
|
|
||||||
from lldbtest import *
|
|
||||||
import lldbutil
|
|
||||||
|
|
||||||
class BreakpointOptionsTestCase(TestBase):
|
|
||||||
|
|
||||||
mydir = TestBase.compute_mydir(__file__)
|
|
||||||
|
|
||||||
@skipUnlessDarwin
|
|
||||||
@dsym_test
|
|
||||||
def test_with_dsym(self):
|
|
||||||
"""Test breakpoint command for different options."""
|
|
||||||
self.buildDsym()
|
|
||||||
self.breakpoint_options_test()
|
|
||||||
|
|
||||||
@dwarf_test
|
|
||||||
def test_with_dwarf(self):
|
|
||||||
"""Test breakpoint command for different options."""
|
|
||||||
self.buildDwarf()
|
|
||||||
self.breakpoint_options_test()
|
|
||||||
|
|
||||||
def setUp(self):
|
|
||||||
# Call super's setUp().
|
|
||||||
TestBase.setUp(self)
|
|
||||||
# Find the line number to break inside main().
|
|
||||||
self.line = line_number('main.c', '// Set break point at this line.')
|
|
||||||
|
|
||||||
def breakpoint_options_test(self):
|
|
||||||
"""Test breakpoint command for different options."""
|
|
||||||
exe = os.path.join(os.getcwd(), "a.out")
|
|
||||||
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
|
|
||||||
|
|
||||||
# This should create a breakpoint with 1 locations.
|
|
||||||
lldbutil.run_break_set_by_file_and_line (self, "main.c", self.line, extra_options = "-K 1", num_expected_locations = 1)
|
|
||||||
lldbutil.run_break_set_by_file_and_line (self, "main.c", self.line, extra_options = "-K 0", num_expected_locations = 1)
|
|
||||||
|
|
||||||
# This should create a breakpoint 0 locations.
|
|
||||||
lldbutil.run_break_set_by_file_and_line (self, "main.c", self.line, extra_options = "-m 0", num_expected_locations = 0)
|
|
||||||
|
|
||||||
# Run the program.
|
|
||||||
self.runCmd("run", RUN_SUCCEEDED)
|
|
||||||
|
|
||||||
# Stopped once.
|
|
||||||
self.expect("thread backtrace", STOPPED_DUE_TO_BREAKPOINT,
|
|
||||||
substrs = ["stop reason = breakpoint 2."])
|
|
||||||
|
|
||||||
# Check the list of breakpoint.
|
|
||||||
self.expect("breakpoint list -f", "Breakpoint locations shown correctly",
|
|
||||||
substrs = ["1: file = 'main.c', line = %d, exact_match = 0, locations = 1" % self.line,
|
|
||||||
"2: file = 'main.c', line = %d, exact_match = 0, locations = 1" % self.line,
|
|
||||||
"3: file = 'main.c', line = %d, exact_match = 1, locations = 0" % self.line])
|
|
||||||
|
|
||||||
# Continue the program, there should be another stop.
|
|
||||||
self.runCmd("process continue")
|
|
||||||
|
|
||||||
# Stopped again.
|
|
||||||
self.expect("thread backtrace", STOPPED_DUE_TO_BREAKPOINT,
|
|
||||||
substrs = ["stop reason = breakpoint 1."])
|
|
||||||
|
|
||||||
# Continue the program, we should exit.
|
|
||||||
self.runCmd("process continue")
|
|
||||||
|
|
||||||
# We should exit.
|
|
||||||
self.expect("process status", "Process exited successfully",
|
|
||||||
patterns = ["^Process [0-9]+ exited with status = 0"])
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
import atexit
|
|
||||||
lldb.SBDebugger.Initialize()
|
|
||||||
atexit.register(lambda: lldb.SBDebugger.Terminate())
|
|
||||||
unittest2.main()
|
|
|
@ -1,7 +0,0 @@
|
||||||
// Set break point at this line.
|
|
||||||
|
|
||||||
int
|
|
||||||
main (int argc, char **argv)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -54,8 +54,8 @@ class BreakpointInDummyTarget (TestBase):
|
||||||
|
|
||||||
# The breakpoint list should show 3 locations.
|
# The breakpoint list should show 3 locations.
|
||||||
self.expect("breakpoint list -f", "Breakpoint locations shown correctly",
|
self.expect("breakpoint list -f", "Breakpoint locations shown correctly",
|
||||||
substrs = ["1: file = 'main.c', line = %d, exact_match = 0, locations = 1" % self.line,
|
substrs = ["1: file = 'main.c', line = %d, locations = 1" % self.line,
|
||||||
"2: file = 'main.c', line = %d, exact_match = 0, locations = 1" % self.line2])
|
"2: file = 'main.c', line = %d, locations = 1" % self.line2])
|
||||||
|
|
||||||
# Run the program.
|
# Run the program.
|
||||||
self.runCmd("run", RUN_SUCCEEDED)
|
self.runCmd("run", RUN_SUCCEEDED)
|
||||||
|
|
|
@ -466,7 +466,7 @@ def check_breakpoint_result (test, break_results, file_name=None, line_number=-1
|
||||||
test.assertTrue (file_name == out_file_name, "Breakpoint file name '%s' doesn't match resultant name '%s'."%(file_name, out_file_name))
|
test.assertTrue (file_name == out_file_name, "Breakpoint file name '%s' doesn't match resultant name '%s'."%(file_name, out_file_name))
|
||||||
|
|
||||||
if line_number != -1:
|
if line_number != -1:
|
||||||
out_line_number = -1
|
out_file_line = -1
|
||||||
if 'line_no' in break_results:
|
if 'line_no' in break_results:
|
||||||
out_line_number = break_results['line_no']
|
out_line_number = break_results['line_no']
|
||||||
|
|
||||||
|
@ -486,7 +486,7 @@ def check_breakpoint_result (test, break_results, file_name=None, line_number=-1
|
||||||
test.assertTrue(out_symbol_name.find(symbol_name) != -1, "Symbol name '%s' isn't in resultant symbol '%s'."%(symbol_name, out_symbol_name))
|
test.assertTrue(out_symbol_name.find(symbol_name) != -1, "Symbol name '%s' isn't in resultant symbol '%s'."%(symbol_name, out_symbol_name))
|
||||||
|
|
||||||
if module_name:
|
if module_name:
|
||||||
out_module_name = None
|
out_nodule_name = None
|
||||||
if 'module' in break_results:
|
if 'module' in break_results:
|
||||||
out_module_name = break_results['module']
|
out_module_name = break_results['module']
|
||||||
|
|
||||||
|
|
|
@ -450,7 +450,6 @@ class SettingsCommandTestCase(TestBase):
|
||||||
"thread-format",
|
"thread-format",
|
||||||
"use-external-editor",
|
"use-external-editor",
|
||||||
"target.default-arch",
|
"target.default-arch",
|
||||||
"target.move-to-nearest-code",
|
|
||||||
"target.expr-prefix",
|
"target.expr-prefix",
|
||||||
"target.prefer-dynamic-value",
|
"target.prefer-dynamic-value",
|
||||||
"target.enable-synthetic-value",
|
"target.enable-synthetic-value",
|
||||||
|
|
|
@ -159,52 +159,5 @@ class MiBreakTestCase(lldbmi_testcase.MiTestCaseBase):
|
||||||
self.expect("\^running")
|
self.expect("\^running")
|
||||||
self.expect("\*stopped,reason=\"breakpoint-hit\"")
|
self.expect("\*stopped,reason=\"breakpoint-hit\"")
|
||||||
|
|
||||||
@lldbmi_test
|
|
||||||
@expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
|
|
||||||
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
|
|
||||||
def test_lldbmi_break_insert_settings(self):
|
|
||||||
"""Test that 'lldb-mi --interpreter' can set breakpoints accoridng to global options."""
|
|
||||||
|
|
||||||
self.spawnLldbMi(args = None)
|
|
||||||
|
|
||||||
# Load executable
|
|
||||||
self.runCmd("-file-exec-and-symbols %s" % self.myexe)
|
|
||||||
self.expect("\^done")
|
|
||||||
|
|
||||||
# Set target.move-to-nearest-code=off and try to set BP #1 that shouldn't be hit
|
|
||||||
self.runCmd("-interpreter-exec console \"settings set target.move-to-nearest-code off\"")
|
|
||||||
self.expect("\^done")
|
|
||||||
line = line_number('main.cpp', '// BP_before_main')
|
|
||||||
self.runCmd("-break-insert -f main.cpp:%d" % line)
|
|
||||||
self.expect("\^done,bkpt={number=\"1\"")
|
|
||||||
|
|
||||||
# Set target.move-to-nearest-code=on and target.skip-prologue=on and set BP #2
|
|
||||||
self.runCmd("-interpreter-exec console \"settings set target.move-to-nearest-code on\"")
|
|
||||||
self.runCmd("-interpreter-exec console \"settings set target.skip-prologue on\"")
|
|
||||||
self.expect("\^done")
|
|
||||||
self.runCmd("-break-insert main.cpp:%d" % line)
|
|
||||||
self.expect("\^done,bkpt={number=\"2\"")
|
|
||||||
|
|
||||||
# Set target.skip-prologue=off and set BP #3
|
|
||||||
self.runCmd("-interpreter-exec console \"settings set target.skip-prologue off\"")
|
|
||||||
self.expect("\^done")
|
|
||||||
self.runCmd("-break-insert main.cpp:%d" % line)
|
|
||||||
self.expect("\^done,bkpt={number=\"3\"")
|
|
||||||
|
|
||||||
# Test that BP #3 is located before BP #2
|
|
||||||
self.runCmd("-exec-run")
|
|
||||||
self.expect("\^running")
|
|
||||||
self.expect("\*stopped,reason=\"breakpoint-hit\",disp=\"del\",bkptno=\"3\"")
|
|
||||||
|
|
||||||
# Test that BP #2 is hit
|
|
||||||
self.runCmd("-exec-continue")
|
|
||||||
self.expect("\^running")
|
|
||||||
self.expect("\*stopped,reason=\"breakpoint-hit\",disp=\"del\",bkptno=\"2\"")
|
|
||||||
|
|
||||||
# Test that BP #1 wasn't set
|
|
||||||
self.runCmd("-exec-continue")
|
|
||||||
self.expect("\^running")
|
|
||||||
self.expect("\*stopped,reason=\"exited-normally\"")
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest2.main()
|
unittest2.main()
|
||||||
|
|
|
@ -9,8 +9,6 @@
|
||||||
|
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
// BP_before_main
|
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char const *argv[])
|
main(int argc, char const *argv[])
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue