本文整理汇总了C++中Target::CreateBreakpoint方法的典型用法代码示例。如果您正苦于以下问题:C++ Target::CreateBreakpoint方法的具体用法?C++ Target::CreateBreakpoint怎么用?C++ Target::CreateBreakpoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Target
的用法示例。
在下文中一共展示了Target::CreateBreakpoint方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: resolver_sp
BreakpointSP
LanguageRuntime::CreateExceptionBreakpoint(
Target &target,
lldb::LanguageType language,
bool catch_bp,
bool throw_bp,
bool is_internal)
{
BreakpointSP exc_breakpt_sp;
BreakpointResolverSP resolver_sp(new ExceptionBreakpointResolver(NULL, language, catch_bp, throw_bp));
SearchFilterSP filter_sp(target.GetSearchFilterForModule(NULL));
exc_breakpt_sp = target.CreateBreakpoint (filter_sp, resolver_sp, is_internal);
return exc_breakpt_sp;
}
示例2: resolver_sp
BreakpointSP
LanguageRuntime::CreateExceptionBreakpoint (Target &target,
lldb::LanguageType language,
bool catch_bp,
bool throw_bp,
bool is_internal)
{
BreakpointResolverSP resolver_sp(new ExceptionBreakpointResolver(language, catch_bp, throw_bp));
SearchFilterSP filter_sp(new ExceptionSearchFilter(target.shared_from_this(), language));
bool hardware = false;
bool resolve_indirect_functions = false;
BreakpointSP exc_breakpt_sp (target.CreateBreakpoint (filter_sp, resolver_sp, is_internal, hardware, resolve_indirect_functions));
if (exc_breakpt_sp)
{
Breakpoint::BreakpointPreconditionSP precondition_sp = CreateExceptionPrecondition(language, catch_bp, throw_bp);
if (precondition_sp)
exc_breakpt_sp->SetPrecondition(precondition_sp);
if (is_internal)
exc_breakpt_sp->SetBreakpointKind("exception");
}
return exc_breakpt_sp;
}
示例3: sizeof
BreakpointSP
PlatformDarwin::SetThreadCreationBreakpoint (Target &target)
{
BreakpointSP bp_sp;
static const char *g_bp_names[] =
{
"start_wqthread",
"_pthread_wqthread",
"_pthread_start",
};
static const char *g_bp_modules[] =
{
"libsystem_c.dylib",
"libSystem.B.dylib"
};
FileSpecList bp_modules;
for (int i = 0; i < sizeof(g_bp_modules)/sizeof(const char *); i++)
{
const char *bp_module = g_bp_modules[i];
bp_modules.Append(FileSpec(bp_module, false));
}
bool internal = true;
LazyBool skip_prologue = eLazyBoolNo;
bp_sp = target.CreateBreakpoint (&bp_modules,
NULL,
g_bp_names,
sizeof(g_bp_names)/sizeof(const char *),
eFunctionNameTypeFull,
skip_prologue,
internal);
return bp_sp;
}
示例4: CreateFromStructuredData
lldb::BreakpointSP Breakpoint::CreateFromStructuredData(
Target &target, StructuredData::ObjectSP &object_data, Status &error) {
BreakpointSP result_sp;
StructuredData::Dictionary *breakpoint_dict = object_data->GetAsDictionary();
if (!breakpoint_dict || !breakpoint_dict->IsValid()) {
error.SetErrorString("Can't deserialize from an invalid data object.");
return result_sp;
}
StructuredData::Dictionary *resolver_dict;
bool success = breakpoint_dict->GetValueForKeyAsDictionary(
BreakpointResolver::GetSerializationKey(), resolver_dict);
if (!success) {
error.SetErrorStringWithFormat(
"Breakpoint data missing toplevel resolver key");
return result_sp;
}
Status create_error;
BreakpointResolverSP resolver_sp =
BreakpointResolver::CreateFromStructuredData(*resolver_dict,
create_error);
if (create_error.Fail()) {
error.SetErrorStringWithFormat(
"Error creating breakpoint resolver from data: %s.",
create_error.AsCString());
return result_sp;
}
StructuredData::Dictionary *filter_dict;
success = breakpoint_dict->GetValueForKeyAsDictionary(
SearchFilter::GetSerializationKey(), filter_dict);
SearchFilterSP filter_sp;
if (!success)
filter_sp.reset(
new SearchFilterForUnconstrainedSearches(target.shared_from_this()));
else {
filter_sp = SearchFilter::CreateFromStructuredData(target, *filter_dict,
create_error);
if (create_error.Fail()) {
error.SetErrorStringWithFormat(
"Error creating breakpoint filter from data: %s.",
create_error.AsCString());
return result_sp;
}
}
std::unique_ptr<BreakpointOptions> options_up;
StructuredData::Dictionary *options_dict;
success = breakpoint_dict->GetValueForKeyAsDictionary(
BreakpointOptions::GetSerializationKey(), options_dict);
if (success) {
options_up = BreakpointOptions::CreateFromStructuredData(
target, *options_dict, create_error);
if (create_error.Fail()) {
error.SetErrorStringWithFormat(
"Error creating breakpoint options from data: %s.",
create_error.AsCString());
return result_sp;
}
}
bool hardware = false;
success = breakpoint_dict->GetValueForKeyAsBoolean(
Breakpoint::GetKey(OptionNames::Hardware), hardware);
result_sp =
target.CreateBreakpoint(filter_sp, resolver_sp, false, hardware, true);
if (result_sp && options_up) {
result_sp->m_options_up = std::move(options_up);
}
StructuredData::Array *names_array;
success = breakpoint_dict->GetValueForKeyAsArray(
Breakpoint::GetKey(OptionNames::Names), names_array);
if (success && names_array) {
size_t num_names = names_array->GetSize();
for (size_t i = 0; i < num_names; i++) {
llvm::StringRef name;
Status error;
success = names_array->GetItemAtIndexAsString(i, name);
target.AddNameToBreakpoint(result_sp, name.str().c_str(), error);
}
}
return result_sp;
}