summaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/SymbolVendor
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
commit5b115243f9baf8c0391d6a4fa3e124210fe6fc08 (patch)
treed56d0b9e9b8dbd1e677a1179de734435de27aba8 /lldb/source/Plugins/SymbolVendor
parent240e067c54a85744a758393d45a15043b88484b5 (diff)
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
Diffstat (limited to 'lldb/source/Plugins/SymbolVendor')
-rw-r--r--lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp14
-rw-r--r--lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp48
2 files changed, 30 insertions, 32 deletions
diff --git a/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp b/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
index d2fadd833bb..d2451096687 100644
--- a/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
+++ b/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
@@ -57,9 +57,9 @@ const char *SymbolVendorELF::GetPluginDescriptionStatic() {
//----------------------------------------------------------------------
// CreateInstance
//
-// Platforms can register a callback to use when creating symbol
-// vendors to allow for complex debug information file setups, and to
-// also allow for finding separate debug information files.
+// Platforms can register a callback to use when creating symbol vendors to
+// allow for complex debug information file setups, and to also allow for
+// finding separate debug information files.
//----------------------------------------------------------------------
SymbolVendor *
SymbolVendorELF::CreateInstance(const lldb::ModuleSP &module_sp,
@@ -112,11 +112,9 @@ SymbolVendorELF::CreateInstance(const lldb::ModuleSP &module_sp,
module_sp, &dsym_fspec, 0, dsym_fspec.GetByteSize(),
dsym_file_data_sp, dsym_file_data_offset);
if (dsym_objfile_sp) {
- // This objfile is for debugging purposes. Sadly, ObjectFileELF won't be
- // able
- // to figure this out consistently as the symbol file may not have
- // stripped the
- // code sections, etc.
+ // This objfile is for debugging purposes. Sadly, ObjectFileELF won't
+ // be able to figure this out consistently as the symbol file may not
+ // have stripped the code sections, etc.
dsym_objfile_sp->SetType(ObjectFile::eTypeDebugInfo);
SymbolVendorELF *symbol_vendor = new SymbolVendorELF(module_sp);
diff --git a/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp b/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
index 22a9195f8b4..ec8516b39f6 100644
--- a/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
+++ b/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
@@ -94,9 +94,9 @@ const char *SymbolVendorMacOSX::GetPluginDescriptionStatic() {
//----------------------------------------------------------------------
// CreateInstance
//
-// Platforms can register a callback to use when creating symbol
-// vendors to allow for complex debug information file setups, and to
-// also allow for finding separate debug information files.
+// Platforms can register a callback to use when creating symbol vendors to
+// allow for complex debug information file setups, and to also allow for
+// finding separate debug information files.
//----------------------------------------------------------------------
SymbolVendor *
SymbolVendorMacOSX::CreateInstance(const lldb::ModuleSP &module_sp,
@@ -130,14 +130,14 @@ SymbolVendorMacOSX::CreateInstance(const lldb::ModuleSP &module_sp,
"SymbolVendorMacOSX::CreateInstance (module = %s) locate dSYM",
module_sp->GetFileSpec().GetPath().c_str());
- // First check to see if the module has a symbol file in mind already.
- // If it does, then we MUST use that.
+ // First check to see if the module has a symbol file in mind already. If
+ // it does, then we MUST use that.
FileSpec dsym_fspec(module_sp->GetSymbolFileFileSpec());
ObjectFileSP dsym_objfile_sp;
if (!dsym_fspec) {
- // No symbol file was specified in the module, lets try and find
- // one ourselves.
+ // No symbol file was specified in the module, lets try and find one
+ // ourselves.
FileSpec file_spec = obj_file->GetFileSpec();
if (!file_spec)
file_spec = module_sp->GetFileSpec();
@@ -180,8 +180,7 @@ SymbolVendorMacOSX::CreateInstance(const lldb::ModuleSP &module_sp,
std::string DBGSourcePath;
// DBGSourcePathRemapping is a dictionary in the plist
- // with
- // keys which are DBGBuildSourcePath file paths and
+ // with keys which are DBGBuildSourcePath file paths and
// values which are DBGSourcePath file paths
StructuredData::ObjectSP plist_sp =
@@ -194,16 +193,15 @@ SymbolVendorMacOSX::CreateInstance(const lldb::ModuleSP &module_sp,
->GetAsDictionary()) {
// In an early version of DBGSourcePathRemapping, the
- // DBGSourcePath
- // values were incorrect. If we have a newer style
- // DBGSourcePathRemapping, there will be a DBGVersion
- // key in the plist with version 2 or higher.
+ // DBGSourcePath values were incorrect. If we have a
+ // newer style DBGSourcePathRemapping, there will be a
+ // DBGVersion key in the plist with version 2 or
+ // higher.
//
// If this is an old style DBGSourcePathRemapping,
- // ignore the
- // value half of the key-value remappings and use reuse
- // the original
- // gloal DBGSourcePath string.
+ // ignore the value half of the key-value remappings
+ // and use reuse the original gloal DBGSourcePath
+ // string.
bool new_style_source_remapping_dictionary = false;
bool do_truncate_remapping_names = false;
std::string original_DBGSourcePath_value =
@@ -253,10 +251,12 @@ SymbolVendorMacOSX::CreateInstance(const lldb::ModuleSP &module_sp,
}
module_sp->GetSourceMappingList().Append(
key, ConstString(DBGSourcePath), true);
- // With version 2 of DBGSourcePathRemapping, we can chop off the
- // last two filename parts from the source remapping and get a
- // more general source remapping that still works. Add this as
- // another option in addition to the full source path remap.
+ // With version 2 of DBGSourcePathRemapping, we
+ // can chop off the last two filename parts
+ // from the source remapping and get a more
+ // general source remapping that still works.
+ // Add this as another option in addition to
+ // the full source path remap.
if (do_truncate_remapping_names) {
FileSpec build_path(key.AsCString(), false);
FileSpec source_path(DBGSourcePath.c_str(), false);
@@ -303,9 +303,9 @@ SymbolVendorMacOSX::CreateInstance(const lldb::ModuleSP &module_sp,
}
}
- // Just create our symbol vendor using the current objfile as this is either
- // an executable with no dSYM (that we could locate), an executable with
- // a dSYM that has a UUID that doesn't match.
+ // Just create our symbol vendor using the current objfile as this is
+ // either an executable with no dSYM (that we could locate), an executable
+ // with a dSYM that has a UUID that doesn't match.
symbol_vendor->AddSymbolFileRepresentation(obj_file->shared_from_this());
}
return symbol_vendor;