本文整理汇总了C++中Breakpoint::RemoveUserBreakpoint方法的典型用法代码示例。如果您正苦于以下问题:C++ Breakpoint::RemoveUserBreakpoint方法的具体用法?C++ Breakpoint::RemoveUserBreakpoint怎么用?C++ Breakpoint::RemoveUserBreakpoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Breakpoint
的用法示例。
在下文中一共展示了Breakpoint::RemoveUserBreakpoint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: installLocker
//.........这里部分代码省略.........
Image* image = fTeam->ImageByAddress(address);
if (image == NULL) {
TRACE_CONTROL(" -> no image at that address\n");
error = B_BAD_ADDRESS;
break;
}
breakpoint = new(std::nothrow) Breakpoint(image, address);
if (breakpoint == NULL || !fTeam->AddBreakpoint(breakpoint)) {
delete breakpoint;
error = B_NO_MEMORY;
break;
}
}
TRACE_CONTROL(" -> adding instance to breakpoint %p\n", breakpoint);
breakpoint->AddUserBreakpoint(instance);
instance->SetBreakpoint(breakpoint);
}
// If everything looks good so far mark the user breakpoint according to
// its new state.
if (error == B_OK)
userBreakpoint->SetEnabled(enabled);
// notify user breakpoint listeners
if (error == B_OK)
fTeam->NotifyUserBreakpointChanged(userBreakpoint);
teamLocker.Unlock();
// install/uninstall the breakpoints as needed
TRACE_CONTROL(" updating breakpoints\n");
if (error == B_OK) {
for (int32 i = 0;
UserBreakpointInstance* instance = userBreakpoint->InstanceAt(i);
i++) {
TRACE_CONTROL(" breakpoint instance %p\n", instance);
error = _UpdateBreakpointInstallation(instance->GetBreakpoint());
if (error != B_OK)
break;
}
}
if (error == B_OK) {
TRACE_CONTROL(" success, marking user breakpoint valid\n");
// everything went fine -- mark the user breakpoint valid
if (!userBreakpoint->IsValid()) {
teamLocker.Lock();
userBreakpoint->SetValid(true);
userBreakpoint->AcquireReference();
fTeam->AddUserBreakpoint(userBreakpoint);
fTeam->NotifyUserBreakpointChanged(userBreakpoint);
// notify again -- the breakpoint hadn't been added before
teamLocker.Unlock();
}
} else {
// something went wrong -- revert the situation
TRACE_CONTROL(" error, reverting\n");
teamLocker.Lock();
userBreakpoint->SetEnabled(oldEnabled);
teamLocker.Unlock();
if (!oldEnabled || !userBreakpoint->IsValid()) {
for (int32 i = 0; UserBreakpointInstance* instance
= userBreakpoint->InstanceAt(i);
i++) {
Breakpoint* breakpoint = instance->GetBreakpoint();
if (breakpoint == NULL)
continue;
if (!userBreakpoint->IsValid()) {
instance->SetBreakpoint(NULL);
breakpoint->RemoveUserBreakpoint(instance);
}
_UpdateBreakpointInstallation(breakpoint);
teamLocker.Lock();
if (breakpoint->IsUnused())
fTeam->RemoveBreakpoint(breakpoint);
teamLocker.Unlock();
}
teamLocker.Lock();
fTeam->NotifyUserBreakpointChanged(userBreakpoint);
teamLocker.Unlock();
}
}
installLocker.Unlock();
return error;
}