aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectBreakpointCommand.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Commands/CommandObjectBreakpointCommand.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectBreakpointCommand.cpp63
1 files changed, 32 insertions, 31 deletions
diff --git a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp
index de49119..ecb00f9 100644
--- a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp
+++ b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp
@@ -673,48 +673,49 @@ protected:
target->GetBreakpointByID(cur_bp_id.GetBreakpointID()).get();
if (bp) {
- const BreakpointOptions *bp_options = nullptr;
+ BreakpointLocationSP bp_loc_sp;
if (cur_bp_id.GetLocationID() != LLDB_INVALID_BREAK_ID) {
- BreakpointLocationSP bp_loc_sp(
- bp->FindLocationByID(cur_bp_id.GetLocationID()));
- if (bp_loc_sp)
- bp_options = bp_loc_sp->GetOptionsNoCreate();
- else {
+ bp_loc_sp = bp->FindLocationByID(cur_bp_id.GetLocationID());
+ if (!bp_loc_sp)
+ {
result.AppendErrorWithFormat("Invalid breakpoint ID: %u.%u.\n",
cur_bp_id.GetBreakpointID(),
cur_bp_id.GetLocationID());
result.SetStatus(eReturnStatusFailed);
return false;
}
- } else {
- bp_options = bp->GetOptions();
}
- if (bp_options) {
- StreamString id_str;
- BreakpointID::GetCanonicalReference(&id_str,
- cur_bp_id.GetBreakpointID(),
- cur_bp_id.GetLocationID());
- const Baton *baton = bp_options->GetBaton();
- if (baton) {
- result.GetOutputStream().Printf("Breakpoint %s:\n",
- id_str.GetData());
- result.GetOutputStream().IndentMore();
- baton->GetDescription(&result.GetOutputStream(),
- eDescriptionLevelFull);
- result.GetOutputStream().IndentLess();
- } else {
- result.AppendMessageWithFormat(
- "Breakpoint %s does not have an associated command.\n",
- id_str.GetData());
- }
+ StreamString id_str;
+ BreakpointID::GetCanonicalReference(&id_str,
+ cur_bp_id.GetBreakpointID(),
+ cur_bp_id.GetLocationID());
+ const Baton *baton = nullptr;
+ if (bp_loc_sp)
+ baton = bp_loc_sp
+ ->GetOptionsSpecifyingKind(BreakpointOptions::eCallback)
+ ->GetBaton();
+ else
+ baton = bp->GetOptions()->GetBaton();
+
+ if (baton) {
+ result.GetOutputStream().Printf("Breakpoint %s:\n",
+ id_str.GetData());
+ result.GetOutputStream().IndentMore();
+ baton->GetDescription(&result.GetOutputStream(),
+ eDescriptionLevelFull);
+ result.GetOutputStream().IndentLess();
+ } else {
+ result.AppendMessageWithFormat(
+ "Breakpoint %s does not have an associated command.\n",
+ id_str.GetData());
}
- result.SetStatus(eReturnStatusSuccessFinishResult);
- } else {
- result.AppendErrorWithFormat("Invalid breakpoint ID: %u.\n",
- cur_bp_id.GetBreakpointID());
- result.SetStatus(eReturnStatusFailed);
}
+ result.SetStatus(eReturnStatusSuccessFinishResult);
+ } else {
+ result.AppendErrorWithFormat("Invalid breakpoint ID: %u.\n",
+ cur_bp_id.GetBreakpointID());
+ result.SetStatus(eReturnStatusFailed);
}
}
}