mirror of
https://github.com/intel/llvm.git
synced 2026-01-17 06:40:01 +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:
@@ -180,18 +180,18 @@ protected:
|
||||
llvm::StringRef target_settings_argv0 = target->GetArg0();
|
||||
|
||||
// Determine whether we will disable ASLR or leave it in the default state
|
||||
// (i.e. enabled if the platform supports it).
|
||||
// First check if the process launch options explicitly turn on/off
|
||||
// (i.e. enabled if the platform supports it). First check if the process
|
||||
// launch options explicitly turn on/off
|
||||
// disabling ASLR. If so, use that setting;
|
||||
// otherwise, use the 'settings target.disable-aslr' setting.
|
||||
bool disable_aslr = false;
|
||||
if (m_options.disable_aslr != eLazyBoolCalculate) {
|
||||
// The user specified an explicit setting on the process launch line. Use
|
||||
// it.
|
||||
// The user specified an explicit setting on the process launch line.
|
||||
// Use it.
|
||||
disable_aslr = (m_options.disable_aslr == eLazyBoolYes);
|
||||
} else {
|
||||
// The user did not explicitly specify whether to disable ASLR. Fall back
|
||||
// to the target.disable-aslr setting.
|
||||
// The user did not explicitly specify whether to disable ASLR. Fall
|
||||
// back to the target.disable-aslr setting.
|
||||
disable_aslr = target->GetDisableASLR();
|
||||
}
|
||||
|
||||
@@ -234,10 +234,9 @@ protected:
|
||||
ProcessSP process_sp(target->GetProcessSP());
|
||||
if (process_sp) {
|
||||
// There is a race condition where this thread will return up the call
|
||||
// stack to the main command
|
||||
// handler and show an (lldb) prompt before HandlePrivateEvent (from
|
||||
// PrivateStateThread) has
|
||||
// a chance to call PushProcessIOHandler().
|
||||
// stack to the main command handler and show an (lldb) prompt before
|
||||
// HandlePrivateEvent (from PrivateStateThread) has a chance to call
|
||||
// PushProcessIOHandler().
|
||||
process_sp->SyncIOHandler(0, 2000);
|
||||
|
||||
llvm::StringRef data = stream.GetString();
|
||||
@@ -401,8 +400,7 @@ public:
|
||||
// Are we in the name?
|
||||
|
||||
// Look to see if there is a -P argument provided, and if so use that
|
||||
// plugin, otherwise
|
||||
// use the default plugin.
|
||||
// plugin, otherwise use the default plugin.
|
||||
|
||||
const char *partial_name = nullptr;
|
||||
partial_name = input.GetArgumentAtIndex(opt_arg_pos);
|
||||
@@ -453,10 +451,9 @@ protected:
|
||||
|
||||
Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get();
|
||||
// N.B. The attach should be synchronous. It doesn't help much to get the
|
||||
// prompt back between initiating the attach
|
||||
// and the target actually stopping. So even if the interpreter is set to
|
||||
// be asynchronous, we wait for the stop
|
||||
// ourselves here.
|
||||
// prompt back between initiating the attach and the target actually
|
||||
// stopping. So even if the interpreter is set to be asynchronous, we wait
|
||||
// for the stop ourselves here.
|
||||
|
||||
StateType state = eStateInvalid;
|
||||
Process *process = m_exe_ctx.GetProcessPtr();
|
||||
@@ -482,9 +479,8 @@ protected:
|
||||
}
|
||||
|
||||
// Record the old executable module, we want to issue a warning if the
|
||||
// process of attaching changed the
|
||||
// current executable (like somebody said "file foo" then attached to a PID
|
||||
// whose executable was bar.)
|
||||
// process of attaching changed the current executable (like somebody said
|
||||
// "file foo" then attached to a PID whose executable was bar.)
|
||||
|
||||
ModuleSP old_exec_module_sp = target->GetExecutableModule();
|
||||
ArchSpec old_arch_spec = target->GetArchitecture();
|
||||
@@ -553,8 +549,8 @@ protected:
|
||||
target->GetArchitecture().GetTriple().getTriple().c_str());
|
||||
}
|
||||
|
||||
// This supports the use-case scenario of immediately continuing the process
|
||||
// once attached.
|
||||
// This supports the use-case scenario of immediately continuing the
|
||||
// process once attached.
|
||||
if (m_options.attach_info.GetContinueOnceAttached())
|
||||
m_interpreter.HandleCommand("process continue", eLazyBoolNo, result);
|
||||
|
||||
@@ -692,10 +688,9 @@ protected:
|
||||
|
||||
if (error.Success()) {
|
||||
// There is a race condition where this thread will return up the call
|
||||
// stack to the main command
|
||||
// handler and show an (lldb) prompt before HandlePrivateEvent (from
|
||||
// PrivateStateThread) has
|
||||
// a chance to call PushProcessIOHandler().
|
||||
// stack to the main command handler and show an (lldb) prompt before
|
||||
// HandlePrivateEvent (from PrivateStateThread) has a chance to call
|
||||
// PushProcessIOHandler().
|
||||
process->SyncIOHandler(iohandler_id, 2000);
|
||||
|
||||
result.AppendMessageWithFormat("Process %" PRIu64 " resuming\n",
|
||||
@@ -1560,8 +1555,7 @@ protected:
|
||||
int32_t signo = signals_sp->GetSignalNumberFromName(arg.c_str());
|
||||
if (signo != LLDB_INVALID_SIGNAL_NUMBER) {
|
||||
// Casting the actions as bools here should be okay, because
|
||||
// VerifyCommandOptionValue guarantees
|
||||
// the value is either 0 or 1.
|
||||
// VerifyCommandOptionValue guarantees the value is either 0 or 1.
|
||||
if (stop_action != -1)
|
||||
signals_sp->SetShouldStop(signo, stop_action);
|
||||
if (pass_action != -1) {
|
||||
|
||||
Reference in New Issue
Block a user