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/Plugins/OperatingSystem/Python | |
parent | add59c052dd6768fd54431e6a3bf045e7f25cb59 (diff) | |
download | bcm5719-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/Plugins/OperatingSystem/Python')
-rw-r--r-- | lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp index db678608858..d6252c47327 100644 --- a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp +++ b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp @@ -50,8 +50,8 @@ void OperatingSystemPython::Terminate() { OperatingSystem *OperatingSystemPython::CreateInstance(Process *process, bool force) { - // Python OperatingSystem plug-ins must be requested by name, so force must be - // true + // Python OperatingSystem plug-ins must be requested by name, so force must + // be true FileSpec python_os_plugin_spec(process->GetPythonOSPluginPath()); if (python_os_plugin_spec && python_os_plugin_spec.Exists()) { std::unique_ptr<OperatingSystemPython> os_ap( @@ -186,8 +186,8 @@ bool OperatingSystemPython::UpdateThreadList(ThreadList &old_thread_list, const uint32_t num_cores = core_thread_list.GetSize(false); // Make a map so we can keep track of which cores were used from the - // core_thread list. Any real threads/cores that weren't used should - // later be put back into the "new_thread_list". + // core_thread list. Any real threads/cores that weren't used should later be + // put back into the "new_thread_list". std::vector<bool> core_used_map(num_cores, false); if (threads_list) { if (log) { @@ -212,8 +212,7 @@ bool OperatingSystemPython::UpdateThreadList(ThreadList &old_thread_list, // Any real core threads that didn't end up backing a memory thread should // still be in the main thread list, and they should be inserted at the - // beginning - // of the list + // beginning of the list uint32_t insert_idx = 0; for (uint32_t core_idx = 0; core_idx < num_cores; ++core_idx) { if (core_used_map[core_idx] == false) { @@ -254,8 +253,8 @@ ThreadSP OperatingSystemPython::CreateThreadFromThreadInfo( // plug-in generated thread. if (!IsOperatingSystemPluginThread(thread_sp)) { // We have thread ID overlap between the protocol threads and the - // operating system threads, clear the thread so we create an - // operating system thread for this. + // operating system threads, clear the thread so we create an operating + // system thread for this. thread_sp.reset(); } } @@ -328,8 +327,8 @@ OperatingSystemPython::CreateRegisterContextForThread(Thread *thread, reg_ctx_sp.reset(new RegisterContextMemory( *thread, 0, *GetDynamicRegisterInfo(), reg_data_addr)); } else { - // No register data address is provided, query the python plug-in to let - // it make up the data as it sees fit + // No register data address is provided, query the python plug-in to let it + // make up the data as it sees fit if (log) log->Printf("OperatingSystemPython::CreateRegisterContextForThread (tid " "= 0x%" PRIx64 ", 0x%" PRIx64 |