Debugger: Add UI for configuring breakpoint conditions.
General: - Add message codes for requesting breakpoint configuration. UserInterfaceListener/TeamDebugger: - Add/implement hooks for requesting breakpoint condition changes. BreakpointsView: - Add button to request editing the currently selected breakpoint's condition. TeamWindow: - Handle request to show breakpoint edit window. BreakpointEditWindow: - Implement simple radio-based UI for modifying the current breakpoint's condition. Still missing: Actually handling/evaluating the breakpoint conditions in the ThreadHandler when the breakpoint is hit.
This commit is contained in:
@@ -582,9 +582,10 @@ TeamDebugger::MessageReceived(BMessage* message)
|
||||
BReference<UserBreakpoint> breakpointReference;
|
||||
uint64 address = 0;
|
||||
|
||||
if (message->FindPointer("breakpoint", (void**)&breakpoint) == B_OK)
|
||||
if (message->FindPointer("breakpoint", (void**)&breakpoint)
|
||||
== B_OK) {
|
||||
breakpointReference.SetTo(breakpoint, true);
|
||||
else if (message->FindUInt64("address", &address) != B_OK)
|
||||
} else if (message->FindUInt64("address", &address) != B_OK)
|
||||
break;
|
||||
|
||||
if (message->what == MSG_SET_BREAKPOINT) {
|
||||
@@ -610,6 +611,45 @@ TeamDebugger::MessageReceived(BMessage* message)
|
||||
break;
|
||||
}
|
||||
|
||||
case MSG_SET_BREAKPOINT_CONDITION:
|
||||
{
|
||||
UserBreakpoint* breakpoint = NULL;
|
||||
BReference<UserBreakpoint> breakpointReference;
|
||||
if (message->FindPointer("breakpoint", (void**)&breakpoint)
|
||||
!= B_OK) {
|
||||
break;
|
||||
}
|
||||
|
||||
breakpointReference.SetTo(breakpoint, true);
|
||||
|
||||
const char* condition;
|
||||
if (message->FindString("condition", &condition) != B_OK)
|
||||
break;
|
||||
|
||||
AutoLocker< ::Team> teamLocker(fTeam);
|
||||
breakpoint->SetCondition(condition);
|
||||
fTeam->NotifyUserBreakpointChanged(breakpoint);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case MSG_CLEAR_BREAKPOINT_CONDITION:
|
||||
{
|
||||
UserBreakpoint* breakpoint = NULL;
|
||||
BReference<UserBreakpoint> breakpointReference;
|
||||
if (message->FindPointer("breakpoint", (void**)&breakpoint)
|
||||
!= B_OK)
|
||||
break;
|
||||
|
||||
breakpointReference.SetTo(breakpoint, true);
|
||||
|
||||
AutoLocker< ::Team> teamLocker(fTeam);
|
||||
breakpoint->SetCondition(NULL);
|
||||
fTeam->NotifyUserBreakpointChanged(breakpoint);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case MSG_STOP_ON_IMAGE_LOAD:
|
||||
{
|
||||
bool enabled;
|
||||
@@ -986,6 +1026,32 @@ TeamDebugger::SetBreakpointEnabledRequested(UserBreakpoint* breakpoint,
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TeamDebugger::SetBreakpointConditionRequested(UserBreakpoint* breakpoint,
|
||||
const char* condition)
|
||||
{
|
||||
BMessage message(MSG_SET_BREAKPOINT_CONDITION);
|
||||
BReference<UserBreakpoint> breakpointReference(breakpoint);
|
||||
if (message.AddPointer("breakpoint", breakpoint) == B_OK
|
||||
&& message.AddString("condition", condition) == B_OK
|
||||
&& PostMessage(&message) == B_OK) {
|
||||
breakpointReference.Detach();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TeamDebugger::ClearBreakpointConditionRequested(UserBreakpoint* breakpoint)
|
||||
{
|
||||
BMessage message(MSG_CLEAR_BREAKPOINT_CONDITION);
|
||||
BReference<UserBreakpoint> breakpointReference(breakpoint);
|
||||
if (message.AddPointer("breakpoint", breakpoint) == B_OK
|
||||
&& PostMessage(&message) == B_OK) {
|
||||
breakpointReference.Detach();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TeamDebugger::ClearBreakpointRequested(target_addr_t address)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user