diff options
author | Adrian Prantl <aprantl@apple.com> | 2018-04-30 16:49:04 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2018-04-30 16:49:04 +0000 |
commit | 05097246f352eca76207c9ebb08656c88bdf751a (patch) | |
tree | bfc4ec8250a939aaf4ade6fc6c528726183e5367 /lldb/source/Target/ThreadPlanStepRange.cpp | |
parent | add59c052dd6768fd54431e6a3bf045e7f25cb59 (diff) | |
download | llvm-05097246f352eca76207c9ebb08656c88bdf751a.zip llvm-05097246f352eca76207c9ebb08656c88bdf751a.tar.gz llvm-05097246f352eca76207c9ebb08656c88bdf751a.tar.bz2 |
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/ThreadPlanStepRange.cpp')
-rw-r--r-- | lldb/source/Target/ThreadPlanStepRange.cpp | 47 |
1 files changed, 21 insertions, 26 deletions
diff --git a/lldb/source/Target/ThreadPlanStepRange.cpp b/lldb/source/Target/ThreadPlanStepRange.cpp index 09e606f..5a71119 100644 --- a/lldb/source/Target/ThreadPlanStepRange.cpp +++ b/lldb/source/Target/ThreadPlanStepRange.cpp @@ -31,8 +31,8 @@ using namespace lldb; using namespace lldb_private; //---------------------------------------------------------------------- -// ThreadPlanStepRange: Step through a stack range, either stepping over or into -// based on the value of \a type. +// ThreadPlanStepRange: Step through a stack range, either stepping over or +// into based on the value of \a type. //---------------------------------------------------------------------- ThreadPlanStepRange::ThreadPlanStepRange(ThreadPlanKind kind, const char *name, @@ -74,15 +74,14 @@ Vote ThreadPlanStepRange::ShouldReportStop(Event *event_ptr) { } void ThreadPlanStepRange::AddRange(const AddressRange &new_range) { - // For now I'm just adding the ranges. At some point we may want to - // condense the ranges if they overlap, though I don't think it is likely - // to be very important. + // For now I'm just adding the ranges. At some point we may want to condense + // the ranges if they overlap, though I don't think it is likely to be very + // important. m_address_ranges.push_back(new_range); // Fill the slot for this address range with an empty DisassemblerSP in the - // instruction ranges. I want the - // indices to match, but I don't want to do the work to disassemble this range - // if I don't step into it. + // instruction ranges. I want the indices to match, but I don't want to do + // the work to disassemble this range if I don't step into it. m_instruction_ranges.push_back(DisassemblerSP()); } @@ -158,12 +157,11 @@ bool ThreadPlanStepRange::InRange() { } else if (new_context.line_entry.range.GetBaseAddress().GetLoadAddress( m_thread.CalculateTarget().get()) != pc_load_addr) { // Another thing that sometimes happens here is that we step out of - // one line into the MIDDLE of another - // line. So far I mostly see this due to bugs in the debug - // information. - // But we probably don't want to be in the middle of a line range, so - // in that case reset the stepping - // range to the line we've stepped into the middle of and continue. + // one line into the MIDDLE of another line. So far I mostly see + // this due to bugs in the debug information. But we probably don't + // want to be in the middle of a line range, so in that case reset + // the stepping range to the line we've stepped into the middle of + // and continue. m_addr_context = new_context; m_address_ranges.clear(); AddRange(m_addr_context.line_entry.range); @@ -260,9 +258,8 @@ InstructionList *ThreadPlanStepRange::GetInstructionsForAddress( return nullptr; else { // Find where we are in the instruction list as well. If we aren't at - // an instruction, - // return nullptr. In this case, we're probably lost, and shouldn't try - // to do anything fancy. + // an instruction, return nullptr. In this case, we're probably lost, + // and shouldn't try to do anything fancy. insn_offset = m_instruction_ranges[i] @@ -297,8 +294,7 @@ bool ThreadPlanStepRange::SetNextBranchBreakpoint() { Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_STEP)); // Stepping through ranges using breakpoints doesn't work yet, but with this - // off we fall back to instruction - // single stepping. + // off we fall back to instruction single stepping. if (!m_use_fast_step) return false; @@ -383,9 +379,8 @@ bool ThreadPlanStepRange::NextRangeBreakpointExplainsStop( size_t num_owners = bp_site_sp->GetNumberOfOwners(); bool explains_stop = true; // If all the owners are internal, then we are probably just stepping over - // this range from multiple threads, - // or multiple frames, so we want to continue. If one is not internal, then - // we should not explain the stop, + // this range from multiple threads, or multiple frames, so we want to + // continue. If one is not internal, then we should not explain the stop, // and let the user breakpoint handle the stop. for (size_t i = 0; i < num_owners; i++) { if (!bp_site_sp->GetOwnerAtIndex(i)->GetBreakpoint().IsInternal()) { @@ -418,8 +413,8 @@ bool ThreadPlanStepRange::MischiefManaged() { // I do this check first because we might have stepped somewhere that will // fool InRange into // thinking it needs to step past the end of that line. This happens, for - // instance, when stepping - // over inlined code that is in the middle of the current line. + // instance, when stepping over inlined code that is in the middle of the + // current line. if (!m_no_more_plans) return false; @@ -457,8 +452,8 @@ bool ThreadPlanStepRange::IsPlanStale() { } return true; } else if (frame_order == eFrameCompareEqual && InSymbol()) { - // If we are not in a place we should step through, we've gotten stale. - // One tricky bit here is that some stubs don't push a frame, so we should. + // If we are not in a place we should step through, we've gotten stale. One + // tricky bit here is that some stubs don't push a frame, so we should. // check that we are in the same symbol. if (!InRange()) { // Set plan Complete when we reach next instruction just after the range |