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/Platform | |
| 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/Platform')
21 files changed, 302 insertions, 354 deletions
diff --git a/lldb/source/Plugins/Platform/Android/AdbClient.cpp b/lldb/source/Plugins/Platform/Android/AdbClient.cpp index 6e15eb2b1dc..4cd8c645dd7 100644 --- a/lldb/source/Plugins/Platform/Android/AdbClient.cpp +++ b/lldb/source/Plugins/Platform/Android/AdbClient.cpp @@ -165,8 +165,8 @@ Status AdbClient::GetDevices(DeviceIDList &device_list) { for (const auto device : devices) device_list.push_back(device.split('\t').first); - // Force disconnect since ADB closes connection after host:devices - // response is sent. + // Force disconnect since ADB closes connection after host:devices response + // is sent. m_conn.reset(); return error; } diff --git a/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp b/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp index 5b85bcdf7fd..f1ec8029e31 100644 --- a/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp +++ b/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp @@ -83,9 +83,9 @@ PlatformSP PlatformAndroid::CreateInstance(bool force, const ArchSpec *arch) { break; #if defined(__ANDROID__) - // Only accept "unknown" for the vendor if the host is android and - // it "unknown" wasn't specified (it was just returned because it - // was NOT specified_ + // Only accept "unknown" for the vendor if the host is android and it + // "unknown" wasn't specified (it was just returned because it was NOT + // specified_ case llvm::Triple::VendorType::UnknownVendor: create = !arch->TripleVendorWasSpecified(); break; @@ -100,9 +100,9 @@ PlatformSP PlatformAndroid::CreateInstance(bool force, const ArchSpec *arch) { break; #if defined(__ANDROID__) - // Only accept "unknown" for the OS if the host is android and - // it "unknown" wasn't specified (it was just returned because it - // was NOT specified) + // Only accept "unknown" for the OS if the host is android and it + // "unknown" wasn't specified (it was just returned because it was NOT + // specified) case llvm::Triple::OSType::UnknownOS: create = !arch->TripleOSWasSpecified(); break; @@ -222,8 +222,8 @@ Status PlatformAndroid::GetFile(const FileSpec &source, if (strchr(source_file, '\'') != nullptr) return Status("Doesn't support single-quotes in filenames"); - // mode == 0 can signify that adbd cannot access the file - // due security constraints - try "cat ..." as a fallback. + // mode == 0 can signify that adbd cannot access the file due security + // constraints - try "cat ..." as a fallback. AdbClient adb(m_device_id); char cmd[PATH_MAX]; diff --git a/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp b/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp index dbc74833e28..2415da31daf 100644 --- a/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp +++ b/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp @@ -180,9 +180,9 @@ Status PlatformAndroidRemoteGDBServer::MakeConnectURL( static const int kAttempsNum = 5; Status error; - // There is a race possibility that somebody will occupy - // a port while we're in between FindUnusedPort and ForwardPortWithAdb - - // adding the loop to mitigate such problem. + // There is a race possibility that somebody will occupy a port while we're + // in between FindUnusedPort and ForwardPortWithAdb - adding the loop to + // mitigate such problem. for (auto i = 0; i < kAttempsNum; ++i) { uint16_t local_port = 0; error = FindUnusedPort(local_port); @@ -208,10 +208,9 @@ lldb::ProcessSP PlatformAndroidRemoteGDBServer::ConnectProcess( lldb_private::Debugger &debugger, lldb_private::Target *target, lldb_private::Status &error) { // We don't have the pid of the remote gdbserver when it isn't started by us - // but we still want - // to store the list of port forwards we set up in our port forward map. - // Generate a fake pid for - // these cases what won't collide with any other valid pid on android. + // but we still want to store the list of port forwards we set up in our port + // forward map. Generate a fake pid for these cases what won't collide with + // any other valid pid on android. static lldb::pid_t s_remote_gdbserver_fake_pid = 0xffffffffffffffffULL; int remote_port; diff --git a/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp b/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp index 73c7d21f0a0..d19f0fea824 100644 --- a/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp +++ b/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp @@ -32,8 +32,8 @@ #include "lldb/Utility/Status.h" #include "lldb/Utility/StreamString.h" -// Define these constants from FreeBSD mman.h for use when targeting -// remote FreeBSD systems even when host has different values. +// Define these constants from FreeBSD mman.h for use when targeting remote +// FreeBSD systems even when host has different values. #define MAP_PRIVATE 0x0002 #define MAP_ANON 0x1000 @@ -60,9 +60,8 @@ PlatformSP PlatformFreeBSD::CreateInstance(bool force, const ArchSpec *arch) { break; #if defined(__FreeBSD__) - // Only accept "unknown" for the OS if the host is BSD and - // it "unknown" wasn't specified (it was just returned because it - // was NOT specified) + // Only accept "unknown" for the OS if the host is BSD and it "unknown" + // wasn't specified (it was just returned because it was NOT specified) case llvm::Triple::OSType::UnknownOS: create = !arch->TripleOSWasSpecified(); break; @@ -143,7 +142,8 @@ bool PlatformFreeBSD::GetSupportedArchitectureAtIndex(uint32_t idx, arch = hostArch; return arch.IsValid(); } else if (idx == 1) { - // If the default host architecture is 64-bit, look for a 32-bit variant + // If the default host architecture is 64-bit, look for a 32-bit + // variant if (hostArch.IsValid() && hostArch.GetTriple().isArch64Bit()) { arch = HostInfo::GetArchitecture(HostInfo::eArchKind32); return arch.IsValid(); @@ -187,13 +187,10 @@ bool PlatformFreeBSD::GetSupportedArchitectureAtIndex(uint32_t idx, return false; } // Leave the vendor as "llvm::Triple:UnknownVendor" and don't specify the - // vendor by - // calling triple.SetVendorName("unknown") so that it is a "unspecified - // unknown". - // This means when someone calls triple.GetVendorName() it will return an - // empty string - // which indicates that the vendor can be set when two architectures are - // merged + // vendor by calling triple.SetVendorName("unknown") so that it is a + // "unspecified unknown". This means when someone calls + // triple.GetVendorName() it will return an empty string which indicates + // that the vendor can be set when two architectures are merged // Now set the triple into "arch" and return true arch.SetTriple(triple); @@ -286,9 +283,9 @@ lldb::ProcessSP PlatformFreeBSD::Attach(ProcessAttachInfo &attach_info, if (target && error.Success()) { debugger.GetTargetList().SetSelectedTarget(target); - // The freebsd always currently uses the GDB remote debugger plug-in - // so even when debugging locally we are debugging remotely! - // Just like the darwin plugin. + // The freebsd always currently uses the GDB remote debugger plug-in so + // even when debugging locally we are debugging remotely! Just like the + // darwin plugin. process_sp = target->CreateProcess( attach_info.GetListenerForProcess(debugger), "gdb-remote", NULL); diff --git a/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp b/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp index 8186eae0e8c..dbde91d7ab2 100644 --- a/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp +++ b/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp @@ -30,8 +30,8 @@ #include "lldb/Utility/Status.h" #include "lldb/Utility/StreamString.h" -// Define these constants from Linux mman.h for use when targeting -// remote linux systems even when host has different values. +// Define these constants from Linux mman.h for use when targeting remote linux +// systems even when host has different values. #define MAP_PRIVATE 2 #define MAP_ANON 0x20 @@ -58,9 +58,8 @@ PlatformSP PlatformLinux::CreateInstance(bool force, const ArchSpec *arch) { break; #if defined(__linux__) - // Only accept "unknown" for the OS if the host is linux and - // it "unknown" wasn't specified (it was just returned because it - // was NOT specified) + // Only accept "unknown" for the OS if the host is linux and it "unknown" + // wasn't specified (it was just returned because it was NOT specified) case llvm::Triple::OSType::UnknownOS: create = !arch->TripleOSWasSpecified(); break; @@ -142,7 +141,8 @@ bool PlatformLinux::GetSupportedArchitectureAtIndex(uint32_t idx, arch = hostArch; return arch.IsValid(); } else if (idx == 1) { - // If the default host architecture is 64-bit, look for a 32-bit variant + // If the default host architecture is 64-bit, look for a 32-bit + // variant if (hostArch.IsValid() && hostArch.GetTriple().isArch64Bit()) { arch = HostInfo::GetArchitecture(HostInfo::eArchKind32); return arch.IsValid(); @@ -192,13 +192,10 @@ bool PlatformLinux::GetSupportedArchitectureAtIndex(uint32_t idx, return false; } // Leave the vendor as "llvm::Triple:UnknownVendor" and don't specify the - // vendor by - // calling triple.SetVendorName("unknown") so that it is a "unspecified - // unknown". - // This means when someone calls triple.GetVendorName() it will return an - // empty string - // which indicates that the vendor can be set when two architectures are - // merged + // vendor by calling triple.SetVendorName("unknown") so that it is a + // "unspecified unknown". This means when someone calls + // triple.GetVendorName() it will return an empty string which indicates + // that the vendor can be set when two architectures are merged // Now set the triple into "arch" and return true arch.SetTriple(triple); @@ -212,8 +209,8 @@ void PlatformLinux::GetStatus(Stream &strm) { #ifndef LLDB_DISABLE_POSIX // Display local kernel information only when we are running in host mode. - // Otherwise, we would end up printing non-Linux information (when running - // on Mac OS for example). + // Otherwise, we would end up printing non-Linux information (when running on + // Mac OS for example). if (IsHost()) { struct utsname un; @@ -272,8 +269,8 @@ bool PlatformLinux::CanDebugProcess() { } // For local debugging, Linux will override the debug logic to use llgs-launch -// rather than lldb-launch, llgs-attach. This differs from current lldb-launch, -// debugserver-attach approach on MacOSX. +// rather than lldb-launch, llgs-attach. This differs from current lldb- +// launch, debugserver-attach approach on MacOSX. lldb::ProcessSP PlatformLinux::DebugProcess(ProcessLaunchInfo &launch_info, Debugger &debugger, Target *target, // Can be NULL, if NULL create a new @@ -297,8 +294,8 @@ PlatformLinux::DebugProcess(ProcessLaunchInfo &launch_info, Debugger &debugger, launch_info.GetFlags().Set(eLaunchFlagDebug); // We always launch the process we are going to debug in a separate process - // group, since then we can handle ^C interrupts ourselves w/o having to worry - // about the target getting them as well. + // group, since then we can handle ^C interrupts ourselves w/o having to + // worry about the target getting them as well. launch_info.SetLaunchInSeparateProcessGroup(true); // Ensure we have a target. diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.cpp index a216e3839dd..6852097117a 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.cpp @@ -84,8 +84,8 @@ lldb_private::Status PlatformAppleSimulator::LaunchProcess( void PlatformAppleSimulator::GetStatus(Stream &strm) { #if defined(__APPLE__) - // This will get called by subclasses, so just output status on the - // current simulator + // This will get called by subclasses, so just output status on the current + // simulator PlatformAppleSimulator::LoadCoreSimulator(); CoreSimulatorSupport::DeviceSet devices = @@ -183,8 +183,8 @@ lldb::ProcessSP PlatformAppleSimulator::DebugProcess( // Make sure we stop at the entry point launch_info.GetFlags().Set(eLaunchFlagDebug); // We always launch the process we are going to debug in a separate process - // group, since then we can handle ^C interrupts ourselves w/o having to worry - // about the target getting them as well. + // group, since then we can handle ^C interrupts ourselves w/o having to + // worry about the target getting them as well. launch_info.SetLaunchInSeparateProcessGroup(true); error = LaunchProcess(launch_info); @@ -201,10 +201,10 @@ lldb::ProcessSP PlatformAppleSimulator::DebugProcess( // process if this happens. process_sp->SetShouldDetach(false); - // If we didn't have any file actions, the pseudo terminal might - // have been used where the slave side was given as the file to - // open for stdin/out/err after we have already opened the master - // so we can read/write stdin/out/err. + // If we didn't have any file actions, the pseudo terminal might have + // been used where the slave side was given as the file to open for + // stdin/out/err after we have already opened the master so we can + // read/write stdin/out/err. int pty_fd = launch_info.GetPTY().ReleaseMasterFileDescriptor(); if (pty_fd != PseudoTerminal::invalid_fd) { process_sp->SetSTDIOFileDescriptor(pty_fd); diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp index e0558f8b200..2fcd22b0d41 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp @@ -90,9 +90,9 @@ PlatformSP PlatformAppleTVSimulator::CreateInstance(bool force, break; #if defined(__APPLE__) - // Only accept "unknown" for the vendor if the host is Apple and - // it "unknown" wasn't specified (it was just returned because it - // was NOT specified) + // Only accept "unknown" for the vendor if the host is Apple and it + // "unknown" wasn't specified (it was just returned because it was NOT + // specified) case llvm::Triple::UnknownArch: create = !arch->TripleVendorWasSpecified(); break; @@ -107,9 +107,9 @@ PlatformSP PlatformAppleTVSimulator::CreateInstance(bool force, break; #if defined(__APPLE__) - // Only accept "unknown" for the OS if the host is Apple and - // it "unknown" wasn't specified (it was just returned because it - // was NOT specified) + // Only accept "unknown" for the OS if the host is Apple and it + // "unknown" wasn't specified (it was just returned because it was NOT + // specified) case llvm::Triple::UnknownOS: create = !arch->TripleOSWasSpecified(); break; @@ -199,9 +199,9 @@ Status PlatformAppleTVSimulator::ResolveExecutable( return error; exe_module_sp.reset(); } - // No valid architecture was specified or the exact ARM slice wasn't - // found so ask the platform for the architectures that we should be - // using (in the correct order) and see if we can find a match that way + // No valid architecture was specified or the exact ARM slice wasn't found + // so ask the platform for the architectures that we should be using (in + // the correct order) and see if we can find a match that way StreamString arch_names; ArchSpec platform_arch; for (uint32_t idx = 0; GetSupportedArchitectureAtIndex( @@ -293,8 +293,8 @@ const char *PlatformAppleTVSimulator::GetSDKDirectoryAsCString() { m_sdk_directory.assign(1, '\0'); } - // We should have put a single NULL character into m_sdk_directory - // or it should have a valid path if the code gets here + // We should have put a single NULL character into m_sdk_directory or it + // should have a valid path if the code gets here assert(m_sdk_directory.empty() == false); if (m_sdk_directory[0]) return m_sdk_directory.c_str(); @@ -337,10 +337,9 @@ Status PlatformAppleTVSimulator::GetSharedModule( const ModuleSpec &module_spec, lldb_private::Process *process, ModuleSP &module_sp, const FileSpecList *module_search_paths_ptr, ModuleSP *old_module_sp_ptr, bool *did_create_ptr) { - // For AppleTV, the SDK files are all cached locally on the host - // system. So first we ask for the file in the cached SDK, - // then we attempt to get a shared module for the right architecture - // with the right UUID. + // For AppleTV, the SDK files are all cached locally on the host system. So + // first we ask for the file in the cached SDK, then we attempt to get a + // shared module for the right architecture with the right UUID. Status error; ModuleSpec platform_module_spec(module_spec); const FileSpec &platform_file = module_spec.GetFileSpec(); diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp index 9b2608f6862..39bd2dc377d 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp @@ -89,9 +89,9 @@ PlatformSP PlatformAppleWatchSimulator::CreateInstance(bool force, break; #if defined(__APPLE__) - // Only accept "unknown" for the vendor if the host is Apple and - // it "unknown" wasn't specified (it was just returned because it - // was NOT specified) + // Only accept "unknown" for the vendor if the host is Apple and it + // "unknown" wasn't specified (it was just returned because it was NOT + // specified) case llvm::Triple::UnknownArch: create = !arch->TripleVendorWasSpecified(); break; @@ -106,9 +106,9 @@ PlatformSP PlatformAppleWatchSimulator::CreateInstance(bool force, break; #if defined(__APPLE__) - // Only accept "unknown" for the OS if the host is Apple and - // it "unknown" wasn't specified (it was just returned because it - // was NOT specified) + // Only accept "unknown" for the OS if the host is Apple and it + // "unknown" wasn't specified (it was just returned because it was NOT + // specified) case llvm::Triple::UnknownOS: create = !arch->TripleOSWasSpecified(); break; @@ -199,9 +199,9 @@ Status PlatformAppleWatchSimulator::ResolveExecutable( return error; exe_module_sp.reset(); } - // No valid architecture was specified or the exact ARM slice wasn't - // found so ask the platform for the architectures that we should be - // using (in the correct order) and see if we can find a match that way + // No valid architecture was specified or the exact ARM slice wasn't found + // so ask the platform for the architectures that we should be using (in + // the correct order) and see if we can find a match that way StreamString arch_names; ArchSpec platform_arch; for (uint32_t idx = 0; GetSupportedArchitectureAtIndex( @@ -293,8 +293,8 @@ const char *PlatformAppleWatchSimulator::GetSDKDirectoryAsCString() { m_sdk_directory.assign(1, '\0'); } - // We should have put a single NULL character into m_sdk_directory - // or it should have a valid path if the code gets here + // We should have put a single NULL character into m_sdk_directory or it + // should have a valid path if the code gets here assert(m_sdk_directory.empty() == false); if (m_sdk_directory[0]) return m_sdk_directory.c_str(); @@ -337,10 +337,9 @@ Status PlatformAppleWatchSimulator::GetSharedModule( const ModuleSpec &module_spec, lldb_private::Process *process, ModuleSP &module_sp, const FileSpecList *module_search_paths_ptr, ModuleSP *old_module_sp_ptr, bool *did_create_ptr) { - // For AppleWatch, the SDK files are all cached locally on the host - // system. So first we ask for the file in the cached SDK, - // then we attempt to get a shared module for the right architecture - // with the right UUID. + // For AppleWatch, the SDK files are all cached locally on the host system. + // So first we ask for the file in the cached SDK, then we attempt to get a + // shared module for the right architecture with the right UUID. Status error; ModuleSpec platform_module_spec(module_spec); const FileSpec &platform_file = module_spec.GetFileSpec(); diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp index 8e031680214..e6ed57ac716 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp @@ -73,10 +73,9 @@ FileSpecList PlatformDarwin::LocateExecutableScriptingResources( // NB some extensions might be meaningful and should not be stripped - // "this.binary.file" // should not lose ".file" but GetFileNameStrippingExtension() will do - // precisely that. - // Ideally, we should have a per-platform list of extensions (".exe", - // ".app", ".dSYM", ".framework") - // which should be stripped while leaving "this.binary.file" as-is. + // precisely that. Ideally, we should have a per-platform list of + // extensions (".exe", ".app", ".dSYM", ".framework") which should be + // stripped while leaving "this.binary.file" as-is. ScriptInterpreter *script_interpreter = target->GetDebugger().GetCommandInterpreter().GetScriptInterpreter(); @@ -101,14 +100,11 @@ FileSpecList PlatformDarwin::LocateExecutableScriptingResources( // FIXME: for Python, we cannot allow certain characters in // module // filenames we import. Theoretically, different scripting - // languages may - // have different sets of forbidden tokens in filenames, and - // that should - // be dealt with by each ScriptInterpreter. For now, we just - // replace dots - // with underscores, but if we ever support anything other than - // Python - // we will need to rework this + // languages may have different sets of forbidden tokens in + // filenames, and that should be dealt with by each + // ScriptInterpreter. For now, we just replace dots with + // underscores, but if we ever support anything other than + // Python we will need to rework this std::replace(module_basename.begin(), module_basename.end(), '.', '_'); std::replace(module_basename.begin(), module_basename.end(), @@ -125,9 +121,9 @@ FileSpecList PlatformDarwin::LocateExecutableScriptingResources( StreamString path_string; StreamString original_path_string; // for OSX we are going to be in - // .dSYM/Contents/Resources/DWARF/<basename> - // let us go to .dSYM/Contents/Resources/Python/<basename>.py - // and see if the file exists + // .dSYM/Contents/Resources/DWARF/<basename> let us go to + // .dSYM/Contents/Resources/Python/<basename>.py and see if the + // file exists path_string.Printf("%s/../Python/%s.py", symfile_spec.GetDirectory().GetCString(), module_basename.c_str()); @@ -140,9 +136,8 @@ FileSpecList PlatformDarwin::LocateExecutableScriptingResources( true); // if we did some replacements of reserved characters, and a - // file with the untampered name - // exists, then warn the user that the file as-is shall not be - // loaded + // file with the untampered name exists, then warn the user + // that the file as-is shall not be loaded if (feedback_stream) { if (module_basename != original_module_basename && orig_script_fspec.Exists()) { @@ -178,8 +173,8 @@ FileSpecList PlatformDarwin::LocateExecutableScriptingResources( break; } - // If we didn't find the python file, then keep - // stripping the extensions and try again + // If we didn't find the python file, then keep stripping the + // extensions and try again ConstString filename_no_extension( module_spec.GetFileNameStrippingExtension()); if (module_spec.GetFilename() == filename_no_extension) @@ -270,8 +265,8 @@ lldb_private::Status PlatformDarwin::GetSharedModuleWithLocalCache( FileSpec module_cache_spec(cache_path, false); // if rsync is supported, always bring in the file - rsync will be very - // efficient - // when files are the same on the local and remote end of the connection + // efficient when files are the same on the local and remote end of the + // connection if (this->GetSupportsRSync()) { err = BringInRemoteFile(this, module_spec, module_cache_spec); if (err.Fail()) @@ -370,8 +365,8 @@ Status PlatformDarwin::GetSharedModule( module_sp.reset(); if (IsRemote()) { - // If we have a remote platform always, let it try and locate - // the shared module first. + // If we have a remote platform always, let it try and locate the shared + // module first. if (m_remote_platform_sp) { error = m_remote_platform_sp->GetSharedModule( module_spec, process, module_sp, module_search_paths_ptr, @@ -453,8 +448,8 @@ PlatformDarwin::GetSoftwareBreakpointTrapOpcode(Target &target, switch (machine) { case llvm::Triple::aarch64: { // TODO: fix this with actual darwin breakpoint opcode for arm64. - // right now debugging uses the Z packets with GDB remote so this - // is not needed, but the size needs to be correct... + // right now debugging uses the Z packets with GDB remote so this is not + // needed, but the size needs to be correct... static const uint8_t g_arm64_breakpoint_opcode[] = {0xFE, 0xDE, 0xFF, 0xE7}; trap_opcode = g_arm64_breakpoint_opcode; trap_opcode_size = sizeof(g_arm64_breakpoint_opcode); @@ -548,8 +543,8 @@ bool PlatformDarwin::x86GetSupportedArchitectureAtIndex(uint32_t idx, HostInfo::GetArchitecture(HostInfo::eArchKind64)); if (platform_arch.IsExactMatch(platform_arch64)) { // This macosx platform supports both 32 and 64 bit. Since we already - // returned the 64 bit arch for idx == 0, return the 32 bit arch - // for idx == 1 + // returned the 64 bit arch for idx == 0, return the 32 bit arch for + // idx == 1 arch = HostInfo::GetArchitecture(HostInfo::eArchKind32); return arch.IsValid(); } @@ -558,9 +553,9 @@ bool PlatformDarwin::x86GetSupportedArchitectureAtIndex(uint32_t idx, return false; } -// The architecture selection rules for arm processors -// These cpu subtypes have distinct names (e.g. armv7f) but armv7 binaries run -// fine on an armv7f processor. +// The architecture selection rules for arm processors These cpu subtypes have +// distinct names (e.g. armv7f) but armv7 binaries run fine on an armv7f +// processor. bool PlatformDarwin::ARMGetSupportedArchitectureAtIndex(uint32_t idx, ArchSpec &arch) { @@ -1145,7 +1140,8 @@ const char *PlatformDarwin::GetDeveloperDirectory() { if (HostInfo::GetLLDBPath(ePathTypeLLDBShlibDir, temp_file_spec)) { if (temp_file_spec.GetPath(developer_dir_path, sizeof(developer_dir_path))) { - // e.g. /Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework + // e.g. + // /Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework char *shared_frameworks = strstr(developer_dir_path, "/SharedFrameworks/LLDB.framework"); if (shared_frameworks) { @@ -1153,7 +1149,8 @@ const char *PlatformDarwin::GetDeveloperDirectory() { strncat (developer_dir_path, "/Developer", sizeof (developer_dir_path) - 1); // add /Developer on developer_dir_path_valid = true; } else { - // e.g. /Applications/Xcode.app/Contents/Developer/Toolchains/iOS11.2.xctoolchain/System/Library/PrivateFrameworks/LLDB.framework + // e.g. + // /Applications/Xcode.app/Contents/Developer/Toolchains/iOS11.2.xctoolchain/System/Library/PrivateFrameworks/LLDB.framework char *developer_toolchains = strstr(developer_dir_path, "/Contents/Developer/Toolchains/"); if (developer_toolchains) { @@ -1230,8 +1227,8 @@ const char *PlatformDarwin::GetDeveloperDirectory() { m_developer_directory.assign(1, '\0'); } - // We should have put a single NULL character into m_developer_directory - // or it should have a valid path if the code gets here + // We should have put a single NULL character into m_developer_directory or + // it should have a valid path if the code gets here assert(m_developer_directory.empty() == false); if (m_developer_directory[0]) return m_developer_directory.c_str(); @@ -1279,9 +1276,9 @@ PlatformDarwin::GetResumeCountForLaunchInfo(ProcessLaunchInfo &launch_info) { shell_name++; if (strcmp(shell_name, "sh") == 0) { - // /bin/sh re-exec's itself as /bin/bash requiring another resume. - // But it only does this if the COMMAND_MODE environment variable - // is set to "legacy". + // /bin/sh re-exec's itself as /bin/bash requiring another resume. But it + // only does this if the COMMAND_MODE environment variable is set to + // "legacy". if (launch_info.GetEnvironment().lookup("COMMAND_MODE") == "legacy") return 2; return 1; @@ -1333,9 +1330,8 @@ static FileSpec GetXcodeContentsPath() { // First get the program file spec. If lldb.so or LLDB.framework is running // in a program and that program is Xcode, the path returned with be the - // path - // to Xcode.app/Contents/MacOS/Xcode, so this will be the correct Xcode to - // use. + // path to Xcode.app/Contents/MacOS/Xcode, so this will be the correct + // Xcode to use. fspec = HostInfo::GetProgramFileSpec(); if (fspec) { @@ -1679,10 +1675,8 @@ bool PlatformDarwin::GetOSVersion(uint32_t &major, uint32_t &minor, } } // For simulator platforms, do NOT call back through - // Platform::GetOSVersion() - // as it might call Process::GetHostOSVersion() which we don't want as it - // will be - // incorrect + // Platform::GetOSVersion() as it might call Process::GetHostOSVersion() + // which we don't want as it will be incorrect return false; } @@ -1695,8 +1689,8 @@ lldb_private::FileSpec PlatformDarwin::LocateExecutable(const char *basename) { // any executable directories that should be searched. static std::vector<FileSpec> g_executable_dirs; - // Find the global list of directories that we will search for - // executables once so we don't keep doing the work over and over. + // Find the global list of directories that we will search for executables + // once so we don't keep doing the work over and over. static llvm::once_flag g_once_flag; llvm::call_once(g_once_flag, []() { @@ -1730,19 +1724,18 @@ lldb_private::FileSpec PlatformDarwin::LocateExecutable(const char *basename) { lldb_private::Status PlatformDarwin::LaunchProcess(lldb_private::ProcessLaunchInfo &launch_info) { - // Starting in Fall 2016 OSes, NSLog messages only get mirrored to stderr - // if the OS_ACTIVITY_DT_MODE environment variable is set. (It doesn't - // require any specific value; rather, it just needs to exist). - // We will set it here as long as the IDE_DISABLED_OS_ACTIVITY_DT_MODE flag - // is not set. Xcode makes use of IDE_DISABLED_OS_ACTIVITY_DT_MODE to tell + // Starting in Fall 2016 OSes, NSLog messages only get mirrored to stderr if + // the OS_ACTIVITY_DT_MODE environment variable is set. (It doesn't require + // any specific value; rather, it just needs to exist). We will set it here + // as long as the IDE_DISABLED_OS_ACTIVITY_DT_MODE flag is not set. Xcode + // makes use of IDE_DISABLED_OS_ACTIVITY_DT_MODE to tell // LLDB *not* to muck with the OS_ACTIVITY_DT_MODE flag when they // specifically want it unset. const char *disable_env_var = "IDE_DISABLED_OS_ACTIVITY_DT_MODE"; auto &env_vars = launch_info.GetEnvironment(); if (!env_vars.count(disable_env_var)) { - // We want to make sure that OS_ACTIVITY_DT_MODE is set so that - // we get os_log and NSLog messages mirrored to the target process - // stderr. + // We want to make sure that OS_ACTIVITY_DT_MODE is set so that we get + // os_log and NSLog messages mirrored to the target process stderr. env_vars.try_emplace("OS_ACTIVITY_DT_MODE", "enable"); } @@ -1757,15 +1750,16 @@ PlatformDarwin::FindBundleBinaryInExecSearchPaths (const ModuleSpec &module_spec ModuleSP *old_module_sp_ptr, bool *did_create_ptr) { const FileSpec &platform_file = module_spec.GetFileSpec(); - // See if the file is present in any of the module_search_paths_ptr directories. + // See if the file is present in any of the module_search_paths_ptr + // directories. if (!module_sp && module_search_paths_ptr && platform_file) { - // create a vector of all the file / directory names in platform_file - // e.g. this might be + // create a vector of all the file / directory names in platform_file e.g. + // this might be // /System/Library/PrivateFrameworks/UIFoundation.framework/UIFoundation // - // We'll need to look in the module_search_paths_ptr directories for - // both "UIFoundation" and "UIFoundation.framework" -- most likely the - // latter will be the one we find there. + // We'll need to look in the module_search_paths_ptr directories for both + // "UIFoundation" and "UIFoundation.framework" -- most likely the latter + // will be the one we find there. FileSpec platform_pull_apart(platform_file); std::vector<std::string> path_parts; @@ -1784,25 +1778,24 @@ PlatformDarwin::FindBundleBinaryInExecSearchPaths (const ModuleSpec &module_spec Log *log_verbose = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST); if (log_verbose) log_verbose->Printf ("PlatformRemoteDarwinDevice::GetSharedModule searching for binary in search-path %s", module_search_paths_ptr->GetFileSpecAtIndex(i).GetPath().c_str()); - // Create a new FileSpec with this module_search_paths_ptr - // plus just the filename ("UIFoundation"), then the parent - // dir plus filename ("UIFoundation.framework/UIFoundation") - // etc - up to four names (to handle "Foo.framework/Contents/MacOS/Foo") + // Create a new FileSpec with this module_search_paths_ptr plus just the + // filename ("UIFoundation"), then the parent dir plus filename + // ("UIFoundation.framework/UIFoundation") etc - up to four names (to + // handle "Foo.framework/Contents/MacOS/Foo") for (size_t j = 0; j < 4 && j < path_parts_size - 1; ++j) { FileSpec path_to_try(module_search_paths_ptr->GetFileSpecAtIndex(i)); // Add the components backwards. For - // .../PrivateFrameworks/UIFoundation.framework/UIFoundation - // path_parts is + // .../PrivateFrameworks/UIFoundation.framework/UIFoundation path_parts + // is // [0] UIFoundation // [1] UIFoundation.framework // [2] PrivateFrameworks // // and if 'j' is 2, we want to append path_parts[1] and then - // path_parts[0], aka - // 'UIFoundation.framework/UIFoundation', to the module_search_paths_ptr - // path. + // path_parts[0], aka 'UIFoundation.framework/UIFoundation', to the + // module_search_paths_ptr path. for (int k = j; k >= 0; --k) { path_to_try.AppendPathComponent(path_parts[k]); diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp index e5d27fc2894..f411ae59963 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp @@ -92,11 +92,9 @@ PlatformSP PlatformDarwinKernel::CreateInstance(bool force, } // This is a special plugin that we don't want to activate just based on an - // ArchSpec for normal - // userland debugging. It is only useful in kernel debug sessions and the - // DynamicLoaderDarwinPlugin - // (or a user doing 'platform select') will force the creation of this - // Platform plugin. + // ArchSpec for normal userland debugging. It is only useful in kernel debug + // sessions and the DynamicLoaderDarwinPlugin (or a user doing 'platform + // select') will force the creation of this Platform plugin. if (force == false) { if (log) log->Printf("PlatformDarwinKernel::%s() aborting creation of platform " @@ -115,9 +113,8 @@ PlatformSP PlatformDarwinKernel::CreateInstance(bool force, create = true; break; - // Only accept "unknown" for vendor if the host is Apple and - // it "unknown" wasn't specified (it was just returned because it - // was NOT specified) + // Only accept "unknown" for vendor if the host is Apple and it "unknown" + // wasn't specified (it was just returned because it was NOT specified) case llvm::Triple::UnknownArch: create = !arch->TripleVendorWasSpecified(); break; @@ -133,9 +130,8 @@ PlatformSP PlatformDarwinKernel::CreateInstance(bool force, case llvm::Triple::WatchOS: case llvm::Triple::TvOS: break; - // Only accept "vendor" for vendor if the host is Apple and - // it "unknown" wasn't specified (it was just returned because it - // was NOT specified) + // Only accept "vendor" for vendor if the host is Apple and it "unknown" + // wasn't specified (it was just returned because it was NOT specified) case llvm::Triple::UnknownOS: create = !arch->TripleOSWasSpecified(); break; @@ -341,11 +337,9 @@ void PlatformDarwinKernel::GetStatus(Stream &strm) { void PlatformDarwinKernel::CollectKextAndKernelDirectories() { // Differentiate between "ios debug session" and "mac debug session" so we - // don't index - // kext bundles that won't be used in this debug session. If this is an ios - // kext debug - // session, looking in /System/Library/Extensions is a waste of stat()s, for - // example. + // don't index kext bundles that won't be used in this debug session. If + // this is an ios kext debug session, looking in /System/Library/Extensions + // is a waste of stat()s, for example. // DeveloperDirectory is something like // "/Applications/Xcode.app/Contents/Developer" @@ -368,9 +362,8 @@ void PlatformDarwinKernel::CollectKextAndKernelDirectories() { AddSDKSubdirsToSearchPaths("/Volumes/KernelDebugKit"); AddSDKSubdirsToSearchPaths("/AppleInternal/Developer/KDKs"); - // The KDKs distributed from Apple installed on external - // developer systems may be in directories like - // /Library/Developer/KDKs/KDK_10.10_14A298i.kdk + // The KDKs distributed from Apple installed on external developer systems + // may be in directories like /Library/Developer/KDKs/KDK_10.10_14A298i.kdk AddSDKSubdirsToSearchPaths("/Library/Developer/KDKs"); if (m_ios_debug_session != eLazyBoolNo) { @@ -450,9 +443,8 @@ PlatformDarwinKernel::FindKDKandSDKDirectoriesInDirectory( return FileSpec::eEnumerateDirectoryResultNext; } -// Recursively search trough m_search_directories looking for -// kext and kernel binaries, adding files found to the appropriate -// lists. +// Recursively search trough m_search_directories looking for kext and kernel +// binaries, adding files found to the appropriate lists. void PlatformDarwinKernel::SearchForKextsAndKernelsRecursively() { const uint32_t num_dirs = m_search_directories.size(); for (uint32_t i = 0; i < num_dirs; i++) { @@ -476,13 +468,11 @@ void PlatformDarwinKernel::SearchForKextsAndKernelsRecursively() { } } -// We're only doing a filename match here. We won't try opening the file to see -// if it's really -// a kernel or not until we need to find a kernel of a given UUID. There's no -// cheap way to find -// the UUID of a file (or if it's a Mach-O binary at all) without creating a -// whole Module for -// the file and throwing it away if it's not wanted. +// We're only doing a filename match here. We won't try opening the file to +// see if it's really a kernel or not until we need to find a kernel of a given +// UUID. There's no cheap way to find the UUID of a file (or if it's a Mach-O +// binary at all) without creating a whole Module for the file and throwing it +// away if it's not wanted. // // Recurse into any subdirectories found. @@ -650,8 +640,8 @@ bool PlatformDarwinKernel::KextHasdSYMSibling( return false; } -// Given a FileSpec of /dir/dir/mach.development.t7004 -// Return true if a dSYM exists next to it: +// Given a FileSpec of /dir/dir/mach.development.t7004 Return true if a dSYM +// exists next to it: // /dir/dir/mach.development.t7004.dSYM bool PlatformDarwinKernel::KernelHasdSYMSibling(const FileSpec &kernel_binary) { FileSpec kernel_dsym = kernel_binary; @@ -694,8 +684,8 @@ Status PlatformDarwinKernel::GetSharedModule( } } - // Give the generic methods, including possibly calling into - // DebugSymbols framework on macOS systems, a chance. + // Give the generic methods, including possibly calling into DebugSymbols + // framework on macOS systems, a chance. error = PlatformDarwin::GetSharedModule(module_spec, process, module_sp, module_search_paths_ptr, old_module_sp_ptr, did_create_ptr); @@ -749,8 +739,8 @@ Status PlatformDarwinKernel::GetSharedModule( } } - // Give the generic methods, including possibly calling into - // DebugSymbols framework on macOS systems, a chance. + // Give the generic methods, including possibly calling into DebugSymbols + // framework on macOS systems, a chance. error = PlatformDarwin::GetSharedModule(module_spec, process, module_sp, module_search_paths_ptr, old_module_sp_ptr, did_create_ptr); @@ -803,11 +793,9 @@ Status PlatformDarwinKernel::ExamineKextForMatchingUUID( } // First try to create a ModuleSP with the file / arch and see if the UUID - // matches. - // If that fails (this exec file doesn't have the correct uuid), don't call - // GetSharedModule - // (which may call in to the DebugSymbols framework and therefore can be - // slow.) + // matches. If that fails (this exec file doesn't have the correct uuid), + // don't call GetSharedModule (which may call in to the DebugSymbols + // framework and therefore can be slow.) ModuleSP module_sp(new Module(exe_spec)); if (module_sp && module_sp->GetObjectFile() && module_sp->MatchesModuleSpec(exe_spec)) { @@ -851,17 +839,13 @@ void PlatformDarwinKernel::CalculateTrapHandlerSymbolNames() { #else // __APPLE__ -// Since DynamicLoaderDarwinKernel is compiled in for all systems, and relies on -// PlatformDarwinKernel for the plug-in name, we compile just the plug-in name -// in -// here to avoid issues. We are tracking an internal bug to resolve this issue -// by -// either not compiling in DynamicLoaderDarwinKernel for non-apple builds, or to -// make -// PlatformDarwinKernel build on all systems. PlatformDarwinKernel is currently -// not -// compiled on other platforms due to the use of the Mac-specific -// source/Host/macosx/cfcpp utilities. +// Since DynamicLoaderDarwinKernel is compiled in for all systems, and relies +// on PlatformDarwinKernel for the plug-in name, we compile just the plug-in +// name in here to avoid issues. We are tracking an internal bug to resolve +// this issue by either not compiling in DynamicLoaderDarwinKernel for non- +// apple builds, or to make PlatformDarwinKernel build on all systems. +// PlatformDarwinKernel is currently not compiled on other platforms due to the +// use of the Mac-specific source/Host/macosx/cfcpp utilities. lldb_private::ConstString PlatformDarwinKernel::GetPluginNameStatic() { static lldb_private::ConstString g_name("darwin-kernel"); diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp index 43f4d8bbf02..e6311abfc04 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp @@ -91,9 +91,8 @@ PlatformSP PlatformMacOSX::CreateInstance(bool force, const ArchSpec *arch) { break; #if defined(__APPLE__) - // Only accept "unknown" for vendor if the host is Apple and - // it "unknown" wasn't specified (it was just returned because it - // was NOT specified) + // Only accept "unknown" for vendor if the host is Apple and it "unknown" + // wasn't specified (it was just returned because it was NOT specified) case llvm::Triple::UnknownArch: create = !arch->TripleVendorWasSpecified(); break; @@ -109,9 +108,8 @@ PlatformSP PlatformMacOSX::CreateInstance(bool force, const ArchSpec *arch) { case llvm::Triple::MacOSX: break; #if defined(__APPLE__) - // Only accept "vendor" for vendor if the host is Apple and - // it "unknown" wasn't specified (it was just returned because it - // was NOT specified) + // Only accept "vendor" for vendor if the host is Apple and it "unknown" + // wasn't specified (it was just returned because it was NOT specified) case llvm::Triple::UnknownOS: create = !arch->TripleOSWasSpecified(); break; diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.cpp index 1eef643d390..0d6278a5f1a 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.cpp @@ -98,9 +98,9 @@ PlatformSP PlatformRemoteAppleTV::CreateInstance(bool force, break; #if defined(__APPLE__) - // Only accept "unknown" for the vendor if the host is Apple and - // it "unknown" wasn't specified (it was just returned because it - // was NOT specified) + // Only accept "unknown" for the vendor if the host is Apple and it + // "unknown" wasn't specified (it was just returned because it was NOT + // specified) case llvm::Triple::UnknownArch: create = !arch->TripleVendorWasSpecified(); break; diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp index 17ae67bc28d..3260588d09c 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp @@ -93,9 +93,9 @@ PlatformSP PlatformRemoteAppleWatch::CreateInstance(bool force, break; #if defined(__APPLE__) - // Only accept "unknown" for the vendor if the host is Apple and - // it "unknown" wasn't specified (it was just returned because it - // was NOT specified) + // Only accept "unknown" for the vendor if the host is Apple and it + // "unknown" wasn't specified (it was just returned because it was NOT + // specified) case llvm::Triple::UnknownArch: create = !arch->TripleVendorWasSpecified(); break; @@ -123,8 +123,8 @@ PlatformSP PlatformRemoteAppleWatch::CreateInstance(bool force, #if defined(__APPLE__) && \ (defined(__arm__) || defined(__arm64__) || defined(__aarch64__)) - // If lldb is running on a watch, this isn't a RemoteWatch environment; it's a - // local system environment. + // If lldb is running on a watch, this isn't a RemoteWatch environment; it's + // a local system environment. if (force == false) { create = false; } diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp index cb064aad615..01a4c8858c7 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp @@ -97,9 +97,9 @@ Status PlatformRemoteDarwinDevice::ResolveExecutable( return error; exe_module_sp.reset(); } - // No valid architecture was specified or the exact ARM slice wasn't - // found so ask the platform for the architectures that we should be - // using (in the correct order) and see if we can find a match that way + // No valid architecture was specified or the exact ARM slice wasn't found + // so ask the platform for the architectures that we should be using (in + // the correct order) and see if we can find a match that way StreamString arch_names; for (uint32_t idx = 0; GetSupportedArchitectureAtIndex( idx, resolved_module_spec.GetArchitecture()); @@ -183,8 +183,8 @@ bool PlatformRemoteDarwinDevice::UpdateSDKDirectoryInfosIfNeeded() { &builtin_sdk_directory_infos); // Only add SDK directories that have symbols in them, some SDKs only - // contain - // developer disk images and no symbols, so they aren't useful to us. + // contain developer disk images and no symbols, so they aren't useful to + // us. FileSpec sdk_symbols_symlink_fspec; for (const auto &sdk_directory_info : builtin_sdk_directory_infos) { sdk_symbols_symlink_fspec = sdk_directory_info.directory; @@ -244,8 +244,8 @@ PlatformRemoteDarwinDevice::GetSDKDirectoryForCurrentOSVersion() { if (UpdateSDKDirectoryInfosIfNeeded()) { const uint32_t num_sdk_infos = m_sdk_directory_infos.size(); - // Check to see if the user specified a build string. If they did, then - // be sure to match it. + // Check to see if the user specified a build string. If they did, then be + // sure to match it. std::vector<bool> check_sdk_info(num_sdk_infos, true); ConstString build(m_sdk_build); if (build) { @@ -253,8 +253,8 @@ PlatformRemoteDarwinDevice::GetSDKDirectoryForCurrentOSVersion() { check_sdk_info[i] = m_sdk_directory_infos[i].build == build; } - // If we are connected we can find the version of the OS the platform - // us running on and select the right SDK + // If we are connected we can find the version of the OS the platform us + // running on and select the right SDK uint32_t major, minor, update; if (GetOSVersion(major, minor, update)) { if (UpdateSDKDirectoryInfosIfNeeded()) { @@ -366,8 +366,8 @@ const char *PlatformRemoteDarwinDevice::GetDeviceSupportDirectoryForOSVersion() } } // We should have put a single NULL character into - // m_device_support_directory_for_os_version - // or it should have a valid path if the code gets here + // m_device_support_directory_for_os_version or it should have a valid path + // if the code gets here assert(m_device_support_directory_for_os_version.empty() == false); if (m_device_support_directory_for_os_version[0]) return m_device_support_directory_for_os_version.c_str(); @@ -492,10 +492,9 @@ Status PlatformRemoteDarwinDevice::GetSharedModule( const ModuleSpec &module_spec, Process *process, ModuleSP &module_sp, const FileSpecList *module_search_paths_ptr, ModuleSP *old_module_sp_ptr, bool *did_create_ptr) { - // For iOS, the SDK files are all cached locally on the host - // system. So first we ask for the file in the cached SDK, - // then we attempt to get a shared module for the right architecture - // with the right UUID. + // For iOS, the SDK files are all cached locally on the host system. So first + // we ask for the file in the cached SDK, then we attempt to get a shared + // module for the right architecture with the right UUID. const FileSpec &platform_file = module_spec.GetFileSpec(); Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST); @@ -510,8 +509,7 @@ Status PlatformRemoteDarwinDevice::GetSharedModule( const uint32_t num_sdk_infos = m_sdk_directory_infos.size(); // If we are connected we migth be able to correctly deduce the SDK - // directory - // using the OS build. + // directory using the OS build. const uint32_t connected_sdk_idx = GetConnectedSDKIndex(); if (connected_sdk_idx < num_sdk_infos) { LLDB_LOGV(log, "Searching for {0} in sdk path {1}", platform_file, @@ -528,8 +526,8 @@ Status PlatformRemoteDarwinDevice::GetSharedModule( } } - // Try the last SDK index if it is set as most files from an SDK - // will tend to be valid in that same SDK. + // Try the last SDK index if it is set as most files from an SDK will tend + // to be valid in that same SDK. if (m_last_module_sdk_idx < num_sdk_infos) { LLDB_LOGV(log, "Searching for {0} in sdk path {1}", platform_file, m_sdk_directory_infos[m_last_module_sdk_idx].directory); @@ -544,9 +542,9 @@ Status PlatformRemoteDarwinDevice::GetSharedModule( } } - // First try for an exact match of major, minor and update: - // If a particalar SDK version was specified via --version or --build, look - // for a match on disk. + // First try for an exact match of major, minor and update: If a particalar + // SDK version was specified via --version or --build, look for a match on + // disk. const SDKDirectoryInfo *current_sdk_info = GetSDKDirectoryForCurrentOSVersion(); const uint32_t current_sdk_idx = @@ -570,8 +568,7 @@ Status PlatformRemoteDarwinDevice::GetSharedModule( // Second try all SDKs that were found. for (uint32_t sdk_idx = 0; sdk_idx < num_sdk_infos; ++sdk_idx) { if (m_last_module_sdk_idx == sdk_idx) { - // Skip the last module SDK index if we already searched - // it above + // Skip the last module SDK index if we already searched it above continue; } LLDB_LOGV(log, "Searching for {0} in sdk path {1}", platform_file, @@ -582,8 +579,8 @@ Status PlatformRemoteDarwinDevice::GetSharedModule( error = ResolveExecutable(platform_module_spec, module_sp, NULL); if (module_sp) { - // Remember the index of the last SDK that we found a file - // in in case the wrong SDK was selected. + // Remember the index of the last SDK that we found a file in in case + // the wrong SDK was selected. m_last_module_sdk_idx = sdk_idx; error.Clear(); return error; diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp index 5bff792525b..c210271d6fd 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp @@ -88,9 +88,9 @@ PlatformSP PlatformRemoteiOS::CreateInstance(bool force, const ArchSpec *arch) { break; #if defined(__APPLE__) - // Only accept "unknown" for the vendor if the host is Apple and - // it "unknown" wasn't specified (it was just returned because it - // was NOT specified) + // Only accept "unknown" for the vendor if the host is Apple and it + // "unknown" wasn't specified (it was just returned because it was NOT + // specified) case llvm::Triple::UnknownArch: create = !arch->TripleVendorWasSpecified(); break; diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp index ee1f90311e7..9cd294455e2 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp @@ -91,9 +91,9 @@ PlatformSP PlatformiOSSimulator::CreateInstance(bool force, break; #if defined(__APPLE__) - // Only accept "unknown" for the vendor if the host is Apple and - // it "unknown" wasn't specified (it was just returned because it - // was NOT specified) + // Only accept "unknown" for the vendor if the host is Apple and it + // "unknown" wasn't specified (it was just returned because it was NOT + // specified) case llvm::Triple::UnknownArch: create = !arch->TripleVendorWasSpecified(); break; @@ -112,9 +112,9 @@ PlatformSP PlatformiOSSimulator::CreateInstance(bool force, break; #if defined(__APPLE__) - // Only accept "unknown" for the OS if the host is Apple and - // it "unknown" wasn't specified (it was just returned because it - // was NOT specified) + // Only accept "unknown" for the OS if the host is Apple and it + // "unknown" wasn't specified (it was just returned because it was NOT + // specified) case llvm::Triple::UnknownOS: create = !arch->TripleOSWasSpecified(); break; @@ -205,9 +205,9 @@ Status PlatformiOSSimulator::ResolveExecutable( return error; exe_module_sp.reset(); } - // No valid architecture was specified or the exact ARM slice wasn't - // found so ask the platform for the architectures that we should be - // using (in the correct order) and see if we can find a match that way + // No valid architecture was specified or the exact ARM slice wasn't found + // so ask the platform for the architectures that we should be using (in + // the correct order) and see if we can find a match that way StreamString arch_names; ArchSpec platform_arch; for (uint32_t idx = 0; GetSupportedArchitectureAtIndex( @@ -298,8 +298,8 @@ const char *PlatformiOSSimulator::GetSDKDirectoryAsCString() { m_sdk_directory.assign(1, '\0'); } - // We should have put a single NULL character into m_sdk_directory - // or it should have a valid path if the code gets here + // We should have put a single NULL character into m_sdk_directory or it + // should have a valid path if the code gets here assert(m_sdk_directory.empty() == false); if (m_sdk_directory[0]) return m_sdk_directory.c_str(); @@ -342,10 +342,9 @@ Status PlatformiOSSimulator::GetSharedModule( const ModuleSpec &module_spec, Process *process, ModuleSP &module_sp, const FileSpecList *module_search_paths_ptr, ModuleSP *old_module_sp_ptr, bool *did_create_ptr) { - // For iOS, the SDK files are all cached locally on the host - // system. So first we ask for the file in the cached SDK, - // then we attempt to get a shared module for the right architecture - // with the right UUID. + // For iOS, the SDK files are all cached locally on the host system. So first + // we ask for the file in the cached SDK, then we attempt to get a shared + // module for the right architecture with the right UUID. Status error; ModuleSpec platform_module_spec(module_spec); const FileSpec &platform_file = module_spec.GetFileSpec(); @@ -409,14 +408,14 @@ bool PlatformiOSSimulator::GetSupportedArchitectureAtIndex(uint32_t idx, if (arch.IsValid()) { if (idx == 2) arch.GetTriple().setOS(llvm::Triple::IOS); - // 32/64: return "i386-apple-ios" for architecture 2 - // 32/64: return "i386-apple-macosx" for architecture 3 + // 32/64: return "i386-apple-ios" for architecture 2 32/64: return + // "i386-apple-macosx" for architecture 3 return true; } } } else if (idx == 1) { - // This macosx platform supports only 32 bit, so return the *-apple-macosx - // version + // This macosx platform supports only 32 bit, so return the *-apple- + // macosx version arch = platform_arch; return true; } diff --git a/lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp b/lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp index 3c78b46dce6..3aa8ecb4c22 100644 --- a/lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp +++ b/lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp @@ -30,8 +30,8 @@ #include "lldb/Utility/Status.h" #include "lldb/Utility/StreamString.h" -// Define these constants from NetBSD mman.h for use when targeting -// remote netbsd systems even when host has different values. +// Define these constants from NetBSD mman.h for use when targeting remote +// netbsd systems even when host has different values. #define MAP_PRIVATE 0x0002 #define MAP_ANON 0x1000 @@ -134,7 +134,8 @@ bool PlatformNetBSD::GetSupportedArchitectureAtIndex(uint32_t idx, arch = hostArch; return arch.IsValid(); } else if (idx == 1) { - // If the default host architecture is 64-bit, look for a 32-bit variant + // If the default host architecture is 64-bit, look for a 32-bit + // variant if (hostArch.IsValid() && hostArch.GetTriple().isArch64Bit()) { arch = HostInfo::GetArchitecture(HostInfo::eArchKind32); return arch.IsValid(); @@ -160,13 +161,10 @@ bool PlatformNetBSD::GetSupportedArchitectureAtIndex(uint32_t idx, return false; } // Leave the vendor as "llvm::Triple:UnknownVendor" and don't specify the - // vendor by - // calling triple.SetVendorName("unknown") so that it is a "unspecified - // unknown". - // This means when someone calls triple.GetVendorName() it will return an - // empty string - // which indicates that the vendor can be set when two architectures are - // merged + // vendor by calling triple.SetVendorName("unknown") so that it is a + // "unspecified unknown". This means when someone calls + // triple.GetVendorName() it will return an empty string which indicates + // that the vendor can be set when two architectures are merged // Now set the triple into "arch" and return true arch.SetTriple(triple); @@ -240,8 +238,8 @@ bool PlatformNetBSD::CanDebugProcess() { } // For local debugging, NetBSD will override the debug logic to use llgs-launch -// rather than lldb-launch, llgs-attach. This differs from current lldb-launch, -// debugserver-attach approach on MacOSX. +// rather than lldb-launch, llgs-attach. This differs from current lldb- +// launch, debugserver-attach approach on MacOSX. lldb::ProcessSP PlatformNetBSD::DebugProcess(ProcessLaunchInfo &launch_info, Debugger &debugger, Target *target, // Can be NULL, if NULL create a new @@ -265,8 +263,8 @@ PlatformNetBSD::DebugProcess(ProcessLaunchInfo &launch_info, Debugger &debugger, launch_info.GetFlags().Set(eLaunchFlagDebug); // We always launch the process we are going to debug in a separate process - // group, since then we can handle ^C interrupts ourselves w/o having to worry - // about the target getting them as well. + // group, since then we can handle ^C interrupts ourselves w/o having to + // worry about the target getting them as well. launch_info.SetLaunchInSeparateProcessGroup(true); // Ensure we have a target. diff --git a/lldb/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.cpp b/lldb/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.cpp index 050639aba7c..10ca8fbfbdd 100644 --- a/lldb/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.cpp +++ b/lldb/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.cpp @@ -30,8 +30,8 @@ #include "lldb/Utility/Status.h" #include "lldb/Utility/StreamString.h" -// Define these constants from OpenBSD mman.h for use when targeting -// remote openbsd systems even when host has different values. +// Define these constants from OpenBSD mman.h for use when targeting remote +// openbsd systems even when host has different values. #define MAP_PRIVATE 0x0002 #define MAP_ANON 0x1000 @@ -58,9 +58,8 @@ PlatformSP PlatformOpenBSD::CreateInstance(bool force, const ArchSpec *arch) { break; #if defined(__OpenBSD__) - // Only accept "unknown" for the OS if the host is BSD and - // it "unknown" wasn't specified (it was just returned because it - // was NOT specified) + // Only accept "unknown" for the OS if the host is BSD and it "unknown" + // wasn't specified (it was just returned because it was NOT specified) case llvm::Triple::OSType::UnknownOS: create = !arch->TripleOSWasSpecified(); break; @@ -167,13 +166,10 @@ bool PlatformOpenBSD::GetSupportedArchitectureAtIndex(uint32_t idx, return false; } // Leave the vendor as "llvm::Triple:UnknownVendor" and don't specify the - // vendor by - // calling triple.SetVendorName("unknown") so that it is a "unspecified - // unknown". - // This means when someone calls triple.GetVendorName() it will return an - // empty string - // which indicates that the vendor can be set when two architectures are - // merged + // vendor by calling triple.SetVendorName("unknown") so that it is a + // "unspecified unknown". This means when someone calls + // triple.GetVendorName() it will return an empty string which indicates + // that the vendor can be set when two architectures are merged // Now set the triple into "arch" and return true arch.SetTriple(triple); diff --git a/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp b/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp index 41345ec0982..c5b796d850d 100644 --- a/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp +++ b/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp @@ -129,8 +129,8 @@ PlatformPOSIX::ResolveExecutable(const ModuleSpec &module_spec, ModuleSpec resolved_module_spec(module_spec); if (IsHost()) { - // If we have "ls" as the exe_file, resolve the executable location based on - // the current path variables + // If we have "ls" as the exe_file, resolve the executable location based + // on the current path variables if (!resolved_module_spec.GetFileSpec().Exists()) { resolved_module_spec.GetFileSpec().GetPath(exe_path, sizeof(exe_path)); resolved_module_spec.GetFileSpec().SetFile(exe_path, true); @@ -215,9 +215,9 @@ PlatformPOSIX::ResolveExecutable(const ModuleSpec &module_spec, resolved_module_spec.GetArchitecture().GetArchitectureName()); } } else { - // No valid architecture was specified, ask the platform for - // the architectures that we should be using (in the correct order) - // and see if we can find a match that way + // No valid architecture was specified, ask the platform for the + // architectures that we should be using (in the correct order) and see + // if we can find a match that way StreamString arch_names; for (uint32_t idx = 0; GetSupportedArchitectureAtIndex( idx, resolved_module_spec.GetArchitecture()); @@ -524,8 +524,8 @@ lldb_private::Status PlatformPOSIX::GetFile( Host::RunShellCommand(command.GetData(), NULL, &retcode, NULL, NULL, 60); if (retcode == 0) return Status(); - // If we are here, rsync has failed - let's try the slow way before giving - // up + // If we are here, rsync has failed - let's try the slow way before + // giving up } // open src and dst // read/write, read/write, read/write, ... @@ -866,9 +866,8 @@ PlatformPOSIX::DebugProcess(ProcessLaunchInfo &launch_info, Debugger &debugger, if (IsHost()) { // We are going to hand this process off to debugserver which will be in - // charge of setting the exit status. - // We still need to reap it from lldb but if we let the monitor thread also - // set the exit status, we set up a + // charge of setting the exit status. We still need to reap it from lldb + // but if we let the monitor thread also set the exit status, we set up a // race between debugserver & us for who will find out about the debugged // process's death. launch_info.GetFlags().Set(eLaunchFlagDontSetExitStatus); @@ -932,10 +931,11 @@ UtilityFunction * PlatformPOSIX::MakeLoadImageUtilityFunction(ExecutionContext &exe_ctx, Status &error) { - // Remember to prepend this with the prefix from GetLibdlFunctionDeclarations. - // The returned values are all in __lldb_dlopen_result for consistency. - // The wrapper returns a void * but doesn't use it because - // UtilityFunctions don't work with void returns at present. + // Remember to prepend this with the prefix from + // GetLibdlFunctionDeclarations. The returned values are all in + // __lldb_dlopen_result for consistency. The wrapper returns a void * but + // doesn't use it because UtilityFunctions don't work with void returns at + // present. static const char *dlopen_wrapper_code = R"( struct __lldb_dlopen_result { void *image_ptr; @@ -1037,7 +1037,7 @@ uint32_t PlatformPOSIX::DoLoadImage(lldb_private::Process *process, Status utility_error; - // The UtilityFunction is held in the Process. Platforms don't track the + // The UtilityFunction is held in the Process. Platforms don't track the // lifespan of the Targets that use them, we can't put this in the Platform. UtilityFunction *dlopen_utility_func = process->GetLoadImageUtilityFunction(this); @@ -1059,8 +1059,8 @@ uint32_t PlatformPOSIX::DoLoadImage(lldb_private::Process *process, } arguments = do_dlopen_function->GetArgumentValues(); - // Now insert the path we are searching for and the result structure into - // the target. + // Now insert the path we are searching for and the result structure into the + // target. uint32_t permissions = ePermissionsReadable|ePermissionsWritable; size_t path_len = path.size() + 1; lldb::addr_t path_addr = process->AllocateMemory(path_len, @@ -1084,8 +1084,8 @@ uint32_t PlatformPOSIX::DoLoadImage(lldb_private::Process *process, return LLDB_INVALID_IMAGE_TOKEN; } - // Make space for our return structure. It is two pointers big: the token and - // the error string. + // Make space for our return structure. It is two pointers big: the token + // and the error string. const uint32_t addr_size = process->GetAddressByteSize(); lldb::addr_t return_addr = process->CallocateMemory(2*addr_size, permissions, diff --git a/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp b/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp index 6dd5e90b43d..fdbcd37baea 100644 --- a/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp +++ b/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp @@ -237,9 +237,9 @@ Status PlatformWindows::ResolveExecutable( resolved_module_spec.GetArchitecture().GetArchitectureName()); } } else { - // No valid architecture was specified, ask the platform for - // the architectures that we should be using (in the correct order) - // and see if we can find a match that way + // No valid architecture was specified, ask the platform for the + // architectures that we should be using (in the correct order) and see + // if we can find a match that way StreamString arch_names; for (uint32_t idx = 0; GetSupportedArchitectureAtIndex( idx, resolved_module_spec.GetArchitecture()); @@ -413,29 +413,23 @@ ProcessSP PlatformWindows::DebugProcess(ProcessLaunchInfo &launch_info, Debugger &debugger, Target *target, Status &error) { // Windows has special considerations that must be followed when launching or - // attaching to a process. The - // key requirement is that when launching or attaching to a process, you must - // do it from the same the thread - // that will go into a permanent loop which will then receive debug events - // from the process. In particular, - // this means we can't use any of LLDB's generic mechanisms to do it for us, - // because it doesn't have the - // special knowledge required for setting up the background thread or passing - // the right flags. + // attaching to a process. The key requirement is that when launching or + // attaching to a process, you must do it from the same the thread that will + // go into a permanent loop which will then receive debug events from the + // process. In particular, this means we can't use any of LLDB's generic + // mechanisms to do it for us, because it doesn't have the special knowledge + // required for setting up the background thread or passing the right flags. // // Another problem is that that LLDB's standard model for debugging a process - // is to first launch it, have - // it stop at the entry point, and then attach to it. In Windows this doesn't - // quite work, you have to - // specify as an argument to CreateProcess() that you're going to debug the - // process. So we override DebugProcess - // here to handle this. Launch operations go directly to the process plugin, - // and attach operations almost go - // directly to the process plugin (but we hijack the events first). In - // essence, we encapsulate all the logic - // of Launching and Attaching in the process plugin, and - // PlatformWindows::DebugProcess is just a pass-through - // to get to the process plugin. + // is to first launch it, have it stop at the entry point, and then attach to + // it. In Windows this doesn't quite work, you have to specify as an + // argument to CreateProcess() that you're going to debug the process. So we + // override DebugProcess here to handle this. Launch operations go directly + // to the process plugin, and attach operations almost go directly to the + // process plugin (but we hijack the events first). In essence, we + // encapsulate all the logic of Launching and Attaching in the process + // plugin, and PlatformWindows::DebugProcess is just a pass-through to get to + // the process plugin. if (launch_info.GetProcessID() != LLDB_INVALID_PROCESS_ID) { // This is a process attach. Don't need to launch anything. @@ -538,8 +532,8 @@ Status PlatformWindows::GetSharedModule( module_sp.reset(); if (IsRemote()) { - // If we have a remote platform always, let it try and locate - // the shared module first. + // If we have a remote platform always, let it try and locate the shared + // module first. if (m_remote_platform_sp) { error = m_remote_platform_sp->GetSharedModule( module_spec, process, module_sp, module_search_paths_ptr, diff --git a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp index 6369435961b..a67980156f3 100644 --- a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp +++ b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp @@ -118,9 +118,9 @@ Status PlatformRemoteGDBServer::ResolveExecutable( return error; exe_module_sp.reset(); } - // No valid architecture was specified or the exact arch wasn't - // found so ask the platform for the architectures that we should be - // using (in the correct order) and see if we can find a match that way + // No valid architecture was specified or the exact arch wasn't found so + // ask the platform for the architectures that we should be using (in the + // correct order) and see if we can find a match that way StreamString arch_names; for (uint32_t idx = 0; GetSupportedArchitectureAtIndex( idx, resolved_module_spec.GetArchitecture()); @@ -277,8 +277,7 @@ bool PlatformRemoteGDBServer::SetRemoteWorkingDirectory( const FileSpec &working_dir) { if (IsConnected()) { // Clear the working directory it case it doesn't get set correctly. This - // will - // for use to re-read it + // will for use to re-read it Log *log = GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PLATFORM); if (log) log->Printf("PlatformRemoteGDBServer::SetRemoteWorkingDirectory('%s')", @@ -540,9 +539,8 @@ bool PlatformRemoteGDBServer::LaunchGDBServer(lldb::pid_t &pid, bool launch_result = false; if (remote_triple.getVendor() == llvm::Triple::Apple && remote_triple.getOS() == llvm::Triple::IOS) { - // When remote debugging to iOS, we use a USB mux that always talks - // to localhost, so we will need the remote debugserver to accept - // connections + // When remote debugging to iOS, we use a USB mux that always talks to + // localhost, so we will need the remote debugserver to accept connections // only from localhost, no matter what our current hostname is launch_result = m_gdb_client.LaunchGDBServer("127.0.0.1", pid, port, socket_name); @@ -740,8 +738,8 @@ const UnixSignalsSP &PlatformRemoteGDBServer::GetRemoteUnixSignals() { if (m_remote_signals_sp) return m_remote_signals_sp; - // If packet not implemented or JSON failed to parse, - // we'll guess the signal set based on the remote architecture. + // If packet not implemented or JSON failed to parse, we'll guess the signal + // set based on the remote architecture. m_remote_signals_sp = UnixSignals::Create(GetRemoteSystemArchitecture()); StringExtractorGDBRemote response; |

