mirror of
https://github.com/intel/llvm.git
synced 2026-01-17 23:45:25 +08:00
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
This commit is contained in:
@@ -56,8 +56,7 @@ bool ThreadPlanCallFunction::ConstructorSetup(
|
||||
|
||||
m_function_sp = thread.GetRegisterContext()->GetSP() - abi->GetRedZoneSize();
|
||||
// If we can't read memory at the point of the process where we are planning
|
||||
// to put our function, we're
|
||||
// not going to get any further...
|
||||
// to put our function, we're not going to get any further...
|
||||
Status error;
|
||||
process_sp->ReadUnsignedIntegerFromMemory(m_function_sp, 4, 0, error);
|
||||
if (!error.Success()) {
|
||||
@@ -278,9 +277,8 @@ bool ThreadPlanCallFunction::DoPlanExplainsStop(Event *event_ptr) {
|
||||
LIBLLDB_LOG_PROCESS));
|
||||
m_real_stop_info_sp = GetPrivateStopInfo();
|
||||
|
||||
// If our subplan knows why we stopped, even if it's done (which would forward
|
||||
// the question to us)
|
||||
// we answer yes.
|
||||
// If our subplan knows why we stopped, even if it's done (which would
|
||||
// forward the question to us) we answer yes.
|
||||
if (m_subplan_sp && m_subplan_sp->PlanExplainsStop(event_ptr)) {
|
||||
SetPlanComplete();
|
||||
return true;
|
||||
@@ -302,8 +300,8 @@ bool ThreadPlanCallFunction::DoPlanExplainsStop(Event *event_ptr) {
|
||||
return true;
|
||||
|
||||
// One more quirk here. If this event was from Halt interrupting the target,
|
||||
// then we should not consider
|
||||
// ourselves complete. Return true to acknowledge the stop.
|
||||
// then we should not consider ourselves complete. Return true to
|
||||
// acknowledge the stop.
|
||||
if (Process::ProcessEventData::GetInterruptedFromEvent(event_ptr)) {
|
||||
if (log)
|
||||
log->Printf("ThreadPlanCallFunction::PlanExplainsStop: The event is an "
|
||||
@@ -312,8 +310,8 @@ bool ThreadPlanCallFunction::DoPlanExplainsStop(Event *event_ptr) {
|
||||
}
|
||||
// We control breakpoints separately from other "stop reasons." So first,
|
||||
// check the case where we stopped for an internal breakpoint, in that case,
|
||||
// continue on.
|
||||
// If it is not an internal breakpoint, consult m_ignore_breakpoints.
|
||||
// continue on. If it is not an internal breakpoint, consult
|
||||
// m_ignore_breakpoints.
|
||||
|
||||
if (stop_reason == eStopReasonBreakpoint) {
|
||||
ProcessSP process_sp(m_thread.CalculateProcess());
|
||||
@@ -364,15 +362,13 @@ bool ThreadPlanCallFunction::DoPlanExplainsStop(Event *event_ptr) {
|
||||
// should be propagated up the stack.
|
||||
return false;
|
||||
} else {
|
||||
// If the subplan is running, any crashes are attributable to us.
|
||||
// If we want to discard the plan, then we say we explain the stop
|
||||
// but if we are going to be discarded, let whoever is above us
|
||||
// explain the stop.
|
||||
// But don't discard the plan if the stop would restart itself (for instance
|
||||
// if it is a
|
||||
// signal that is set not to stop. Check that here first. We just say we
|
||||
// explain the stop
|
||||
// but aren't done and everything will continue on from there.
|
||||
// If the subplan is running, any crashes are attributable to us. If we
|
||||
// want to discard the plan, then we say we explain the stop but if we are
|
||||
// going to be discarded, let whoever is above us explain the stop. But
|
||||
// don't discard the plan if the stop would restart itself (for instance if
|
||||
// it is a signal that is set not to stop. Check that here first. We just
|
||||
// say we explain the stop but aren't done and everything will continue on
|
||||
// from there.
|
||||
|
||||
if (m_real_stop_info_sp &&
|
||||
m_real_stop_info_sp->ShouldStopSynchronous(event_ptr)) {
|
||||
@@ -385,8 +381,8 @@ bool ThreadPlanCallFunction::DoPlanExplainsStop(Event *event_ptr) {
|
||||
|
||||
bool ThreadPlanCallFunction::ShouldStop(Event *event_ptr) {
|
||||
// We do some computation in DoPlanExplainsStop that may or may not set the
|
||||
// plan as complete.
|
||||
// We need to do that here to make sure our state is correct.
|
||||
// plan as complete. We need to do that here to make sure our state is
|
||||
// correct.
|
||||
DoPlanExplainsStop(event_ptr);
|
||||
|
||||
if (IsPlanComplete()) {
|
||||
@@ -405,9 +401,8 @@ void ThreadPlanCallFunction::DidPush() {
|
||||
//#define SINGLE_STEP_EXPRESSIONS
|
||||
|
||||
// Now set the thread state to "no reason" so we don't run with whatever
|
||||
// signal was outstanding...
|
||||
// Wait till the plan is pushed so we aren't changing the stop info till we're
|
||||
// about to run.
|
||||
// signal was outstanding... Wait till the plan is pushed so we aren't
|
||||
// changing the stop info till we're about to run.
|
||||
|
||||
GetThread().SetStopInfoToNothing();
|
||||
|
||||
@@ -483,10 +478,9 @@ bool ThreadPlanCallFunction::BreakpointsExplainStop() {
|
||||
|
||||
SetPlanComplete(false);
|
||||
|
||||
// If the user has set the ObjC language breakpoint, it would normally get
|
||||
// priority over our internal
|
||||
// catcher breakpoint, but in this case we can't let that happen, so force
|
||||
// the ShouldStop here.
|
||||
// If the user has set the ObjC language breakpoint, it would normally
|
||||
// get priority over our internal catcher breakpoint, but in this case we
|
||||
// can't let that happen, so force the ShouldStop here.
|
||||
stop_info_sp->OverrideShouldStop(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user