summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/ThreadPlanStepOut.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2018-04-30 16:49:04 +0000
committerAdrian Prantl <aprantl@apple.com>2018-04-30 16:49:04 +0000
commit05097246f352eca76207c9ebb08656c88bdf751a (patch)
treebfc4ec8250a939aaf4ade6fc6c528726183e5367 /lldb/source/Target/ThreadPlanStepOut.cpp
parentadd59c052dd6768fd54431e6a3bf045e7f25cb59 (diff)
downloadbcm5719-llvm-05097246f352eca76207c9ebb08656c88bdf751a.tar.gz
bcm5719-llvm-05097246f352eca76207c9ebb08656c88bdf751a.zip
Reflow paragraphs in comments.
This is intended as a clean up after the big clang-format commit (r280751), which unfortunately resulted in many of the comment paragraphs in LLDB being very hard to read. FYI, the script I used was: import textwrap import commands import os import sys import re tmp = "%s.tmp"%sys.argv[1] out = open(tmp, "w+") with open(sys.argv[1], "r") as f: header = "" text = "" comment = re.compile(r'^( *//) ([^ ].*)$') special = re.compile(r'^((([A-Z]+[: ])|([0-9]+ )).*)|(.*;)$') for line in f: match = comment.match(line) if match and not special.match(match.group(2)): # skip intentionally short comments. if not text and len(match.group(2)) < 40: out.write(line) continue if text: text += " " + match.group(2) else: header = match.group(1) text = match.group(2) continue if text: filled = textwrap.wrap(text, width=(78-len(header)), break_long_words=False) for l in filled: out.write(header+" "+l+'\n') text = "" out.write(line) os.rename(tmp, sys.argv[1]) Differential Revision: https://reviews.llvm.org/D46144 llvm-svn: 331197
Diffstat (limited to 'lldb/source/Target/ThreadPlanStepOut.cpp')
-rw-r--r--lldb/source/Target/ThreadPlanStepOut.cpp55
1 files changed, 23 insertions, 32 deletions
diff --git a/lldb/source/Target/ThreadPlanStepOut.cpp b/lldb/source/Target/ThreadPlanStepOut.cpp
index 6b6ed06e9b3..f2db6e4b6f4 100644
--- a/lldb/source/Target/ThreadPlanStepOut.cpp
+++ b/lldb/source/Target/ThreadPlanStepOut.cpp
@@ -63,17 +63,14 @@ ThreadPlanStepOut::ThreadPlanStepOut(
m_step_out_to_id = return_frame_sp->GetStackID();
m_immediate_step_from_id = immediate_return_from_sp->GetStackID();
- // If the frame directly below the one we are returning to is inlined, we have
- // to be
- // a little more careful. It is non-trivial to determine the real "return
- // code address" for
- // an inlined frame, so we have to work our way to that frame and then step
- // out.
+ // If the frame directly below the one we are returning to is inlined, we
+ // have to be a little more careful. It is non-trivial to determine the real
+ // "return code address" for an inlined frame, so we have to work our way to
+ // that frame and then step out.
if (immediate_return_from_sp && immediate_return_from_sp->IsInlined()) {
if (frame_idx > 0) {
// First queue a plan that gets us to this inlined frame, and when we get
- // there we'll queue a second
- // plan that walks us out of this frame.
+ // there we'll queue a second plan that walks us out of this frame.
m_step_out_to_inline_plan_sp.reset(new ThreadPlanStepOut(
m_thread, nullptr, false, stop_others, eVoteNoOpinion, eVoteNoOpinion,
frame_idx - 1, eLazyBoolNo, continue_to_next_branch));
@@ -81,8 +78,8 @@ ThreadPlanStepOut::ThreadPlanStepOut(
->SetShouldStopHereCallbacks(nullptr, nullptr);
m_step_out_to_inline_plan_sp->SetPrivate(true);
} else {
- // If we're already at the inlined frame we're stepping through, then just
- // do that now.
+ // If we're already at the inlined frame we're stepping through, then
+ // just do that now.
QueueInlinedStepPlan(false);
}
} else if (return_frame_sp) {
@@ -217,8 +214,8 @@ bool ThreadPlanStepOut::ValidatePlan(Stream *error) {
}
bool ThreadPlanStepOut::DoPlanExplainsStop(Event *event_ptr) {
- // If the step out plan is done, then we just need to step through the inlined
- // frame.
+ // If the step out plan is done, then we just need to step through the
+ // inlined frame.
if (m_step_out_to_inline_plan_sp) {
return m_step_out_to_inline_plan_sp->MischiefManaged();
} else if (m_step_through_inline_plan_sp) {
@@ -233,15 +230,14 @@ bool ThreadPlanStepOut::DoPlanExplainsStop(Event *event_ptr) {
}
// We don't explain signals or breakpoints (breakpoints that handle stepping
- // in or
- // out will be handled by a child plan.
+ // in or out will be handled by a child plan.
StopInfoSP stop_info_sp = GetPrivateStopInfo();
if (stop_info_sp) {
StopReason reason = stop_info_sp->GetStopReason();
if (reason == eStopReasonBreakpoint) {
- // If this is OUR breakpoint, we're fine, otherwise we don't know why this
- // happened...
+ // If this is OUR breakpoint, we're fine, otherwise we don't know why
+ // this happened...
BreakpointSiteSP site_sp(
m_thread.GetProcess()->GetBreakpointSiteList().FindByID(
stop_info_sp->GetValue()));
@@ -268,11 +264,10 @@ bool ThreadPlanStepOut::DoPlanExplainsStop(Event *event_ptr) {
}
// If there was only one owner, then we're done. But if we also hit
- // some
- // user breakpoint on our way out, we should mark ourselves as done, but
- // also not claim to explain the stop, since it is more important to
- // report
- // the user breakpoint than the step out completion.
+ // some user breakpoint on our way out, we should mark ourselves as
+ // done, but also not claim to explain the stop, since it is more
+ // important to report the user breakpoint than the step out
+ // completion.
if (site_sp->GetNumberOfOwners() == 1)
return true;
@@ -320,9 +315,8 @@ bool ThreadPlanStepOut::ShouldStop(Event *event_ptr) {
done = !(frame_zero_id < m_step_out_to_id);
}
- // The normal step out computations think we are done, so all we need to do is
- // consult the ShouldStopHere,
- // and we are done.
+ // The normal step out computations think we are done, so all we need to do
+ // is consult the ShouldStopHere, and we are done.
if (done) {
if (InvokeShouldStopHereCallback(eFrameCompareOlder)) {
@@ -377,8 +371,7 @@ bool ThreadPlanStepOut::MischiefManaged() {
// I also check the stack depth, since if we've blown past the breakpoint
// for some
// reason and we're now stopping for some other reason altogether, then
- // we're done
- // with this step out operation.
+ // we're done with this step out operation.
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_STEP));
if (log)
@@ -397,10 +390,8 @@ bool ThreadPlanStepOut::MischiefManaged() {
bool ThreadPlanStepOut::QueueInlinedStepPlan(bool queue_now) {
// Now figure out the range of this inlined block, and set up a "step through
- // range"
- // plan for that. If we've been provided with a context, then use the block
- // in that
- // context.
+ // range" plan for that. If we've been provided with a context, then use the
+ // block in that context.
StackFrameSP immediate_return_from_sp(m_thread.GetStackFrameAtIndex(0));
if (!immediate_return_from_sp)
return false;
@@ -477,8 +468,8 @@ void ThreadPlanStepOut::CalculateReturnValue() {
}
bool ThreadPlanStepOut::IsPlanStale() {
- // If we are still lower on the stack than the frame we are returning to, then
- // there's something for us to do. Otherwise, we're stale.
+ // If we are still lower on the stack than the frame we are returning to,
+ // then there's something for us to do. Otherwise, we're stale.
StackID frame_zero_id = m_thread.GetStackFrameAtIndex(0)->GetStackID();
return !(frame_zero_id < m_step_out_to_id);
OpenPOWER on IntegriCloud