summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/ProcessLaunchInfo.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/ProcessLaunchInfo.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/ProcessLaunchInfo.cpp')
-rw-r--r--lldb/source/Target/ProcessLaunchInfo.cpp35
1 files changed, 16 insertions, 19 deletions
diff --git a/lldb/source/Target/ProcessLaunchInfo.cpp b/lldb/source/Target/ProcessLaunchInfo.cpp
index 284df9fd8b5..60fe26bb60d 100644
--- a/lldb/source/Target/ProcessLaunchInfo.cpp
+++ b/lldb/source/Target/ProcessLaunchInfo.cpp
@@ -210,8 +210,7 @@ void ProcessLaunchInfo::FinalizeFileActions(Target *target,
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
// If nothing for stdin or stdout or stderr was specified, then check the
- // process for any default
- // settings that were set with "settings set"
+ // process for any default settings that were set with "settings set"
if (GetFileActionForFD(STDIN_FILENO) == nullptr ||
GetFileActionForFD(STDOUT_FILENO) == nullptr ||
GetFileActionForFD(STDERR_FILENO) == nullptr) {
@@ -221,8 +220,8 @@ void ProcessLaunchInfo::FinalizeFileActions(Target *target,
__FUNCTION__);
if (m_flags.Test(eLaunchFlagLaunchInTTY)) {
- // Do nothing, if we are launching in a remote terminal
- // no file actions should be done at all.
+ // Do nothing, if we are launching in a remote terminal no file actions
+ // should be done at all.
return;
}
@@ -235,16 +234,15 @@ void ProcessLaunchInfo::FinalizeFileActions(Target *target,
AppendSuppressFileAction(STDOUT_FILENO, false, true);
AppendSuppressFileAction(STDERR_FILENO, false, true);
} else {
- // Check for any values that might have gotten set with any of:
- // (lldb) settings set target.input-path
- // (lldb) settings set target.output-path
+ // Check for any values that might have gotten set with any of: (lldb)
+ // settings set target.input-path (lldb) settings set target.output-path
// (lldb) settings set target.error-path
FileSpec in_file_spec;
FileSpec out_file_spec;
FileSpec err_file_spec;
if (target) {
- // Only override with the target settings if we don't already have
- // an action for in, out or error
+ // Only override with the target settings if we don't already have an
+ // action for in, out or error
if (GetFileActionForFD(STDIN_FILENO) == nullptr)
in_file_spec = target->GetStandardInputPath();
if (GetFileActionForFD(STDOUT_FILENO) == nullptr)
@@ -295,9 +293,9 @@ void ProcessLaunchInfo::FinalizeFileActions(Target *target,
int open_flags = O_RDWR | O_NOCTTY;
#if !defined(_WIN32)
- // We really shouldn't be specifying platform specific flags
- // that are intended for a system call in generic code. But
- // this will have to do for now.
+ // We really shouldn't be specifying platform specific flags that are
+ // intended for a system call in generic code. But this will have to
+ // do for now.
open_flags |= O_CLOEXEC;
#endif
if (m_pty->OpenFirstAvailableMaster(open_flags, nullptr, 0)) {
@@ -351,14 +349,13 @@ bool ProcessLaunchInfo::ConvertArgumentsForLaunchingInShell(
StreamString shell_command;
if (will_debug) {
- // Add a modified PATH environment variable in case argv[0]
- // is a relative path.
+ // Add a modified PATH environment variable in case argv[0] is a
+ // relative path.
const char *argv0 = argv[0];
FileSpec arg_spec(argv0, false);
if (arg_spec.IsRelative()) {
- // We have a relative path to our executable which may not work if
- // we just try to run "a.out" (without it being converted to
- // "./a.out")
+ // We have a relative path to our executable which may not work if we
+ // just try to run "a.out" (without it being converted to "./a.out")
FileSpec working_dir = GetWorkingDirectory();
// Be sure to put quotes around PATH's value in case any paths have
// spaces...
@@ -410,8 +407,8 @@ bool ProcessLaunchInfo::ConvertArgumentsForLaunchingInShell(
}
if (first_arg_is_full_shell_command) {
- // There should only be one argument that is the shell command itself to
- // be used as is
+ // There should only be one argument that is the shell command itself
+ // to be used as is
if (argv[0] && !argv[1])
shell_command.Printf("%s", argv[0]);
else
OpenPOWER on IntegriCloud