diff --git a/lldb/source/Target/StopInfo.cpp b/lldb/source/Target/StopInfo.cpp index 19f89b8246926..ddf8c62e969ed 100644 --- a/lldb/source/Target/StopInfo.cpp +++ b/lldb/source/Target/StopInfo.cpp @@ -851,8 +851,9 @@ class StopInfoWatchpoint : public StopInfo { // We have to step over the watchpoint before we know what to do: StopInfoWatchpointSP me_as_siwp_sp = std::static_pointer_cast(shared_from_this()); - ThreadPlanSP step_over_wp_sp(new ThreadPlanStepOverWatchpoint( - *(thread_sp.get()), me_as_siwp_sp, wp_sp)); + ThreadPlanSP step_over_wp_sp = + std::make_shared(*(thread_sp.get()), + me_as_siwp_sp, wp_sp); // When this plan is done we want to stop, so set this as a Controlling // plan. step_over_wp_sp->SetIsControllingPlan(true); @@ -1475,13 +1476,13 @@ StopInfoSP StopInfo::CreateStopReasonWithBreakpointSiteID(Thread &thread, break_id_t break_id) { thread.SetThreadHitBreakpointSite(); - return StopInfoSP(new StopInfoBreakpoint(thread, break_id)); + return std::make_shared(thread, break_id); } StopInfoSP StopInfo::CreateStopReasonWithBreakpointSiteID(Thread &thread, break_id_t break_id, bool should_stop) { - return StopInfoSP(new StopInfoBreakpoint(thread, break_id, should_stop)); + return std::make_shared(thread, break_id, should_stop); } // LWP_TODO: We'll need a CreateStopReasonWithWatchpointResourceID akin @@ -1489,67 +1490,67 @@ StopInfoSP StopInfo::CreateStopReasonWithBreakpointSiteID(Thread &thread, StopInfoSP StopInfo::CreateStopReasonWithWatchpointID(Thread &thread, break_id_t watch_id, bool silently_continue) { - return StopInfoSP( - new StopInfoWatchpoint(thread, watch_id, silently_continue)); + return std::make_shared(thread, watch_id, + silently_continue); } StopInfoSP StopInfo::CreateStopReasonWithSignal(Thread &thread, int signo, const char *description, std::optional code) { thread.GetProcess()->GetUnixSignals()->IncrementSignalHitCount(signo); - return StopInfoSP(new StopInfoUnixSignal(thread, signo, description, code)); + return std::make_shared(thread, signo, description, code); } StopInfoSP StopInfo::CreateStopReasonWithInterrupt(Thread &thread, int signo, const char *description) { - return StopInfoSP(new StopInfoInterrupt(thread, signo, description)); + return std::make_shared(thread, signo, description); } StopInfoSP StopInfo::CreateStopReasonToTrace(Thread &thread) { - return StopInfoSP(new StopInfoTrace(thread)); + return std::make_shared(thread); } StopInfoSP StopInfo::CreateStopReasonWithPlan( ThreadPlanSP &plan_sp, ValueObjectSP return_valobj_sp, ExpressionVariableSP expression_variable_sp) { - return StopInfoSP(new StopInfoThreadPlan(plan_sp, return_valobj_sp, - expression_variable_sp)); + return std::make_shared(plan_sp, return_valobj_sp, + expression_variable_sp); } StopInfoSP StopInfo::CreateStopReasonWithException(Thread &thread, const char *description) { - return StopInfoSP(new StopInfoException(thread, description)); + return std::make_shared(thread, description); } StopInfoSP StopInfo::CreateStopReasonProcessorTrace(Thread &thread, const char *description) { - return StopInfoSP(new StopInfoProcessorTrace(thread, description)); + return std::make_shared(thread, description); } StopInfoSP StopInfo::CreateStopReasonHistoryBoundary(Thread &thread, const char *description) { - return StopInfoSP(new StopInfoHistoryBoundary(thread, description)); + return std::make_shared(thread, description); } StopInfoSP StopInfo::CreateStopReasonWithExec(Thread &thread) { - return StopInfoSP(new StopInfoExec(thread)); + return std::make_shared(thread); } StopInfoSP StopInfo::CreateStopReasonFork(Thread &thread, lldb::pid_t child_pid, lldb::tid_t child_tid) { - return StopInfoSP(new StopInfoFork(thread, child_pid, child_tid)); + return std::make_shared(thread, child_pid, child_tid); } StopInfoSP StopInfo::CreateStopReasonVFork(Thread &thread, lldb::pid_t child_pid, lldb::tid_t child_tid) { - return StopInfoSP(new StopInfoVFork(thread, child_pid, child_tid)); + return std::make_shared(thread, child_pid, child_tid); } StopInfoSP StopInfo::CreateStopReasonVForkDone(Thread &thread) { - return StopInfoSP(new StopInfoVForkDone(thread)); + return std::make_shared(thread); } ValueObjectSP StopInfo::GetReturnValueObject(StopInfoSP &stop_info_sp) {