[Lldb-commits] [lldb] r155162 - in /lldb/branches/lldb-platform-work: include/lldb/Target/Platform.h source/Plugins/Platform/POSIX/PlatformPOSIX.cpp source/Plugins/Platform/POSIX/PlatformPOSIX.h source/Target/Platform.cpp
Enrico Granata
egranata at apple.com
Thu Apr 19 15:18:43 PDT 2012
Author: enrico
Date: Thu Apr 19 17:18:43 2012
New Revision: 155162
URL: http://llvm.org/viewvc/llvm-project?rev=155162&view=rev
Log:
Cleanup in the way we show status information for connected platforms
Modified:
lldb/branches/lldb-platform-work/include/lldb/Target/Platform.h
lldb/branches/lldb-platform-work/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
lldb/branches/lldb-platform-work/source/Plugins/Platform/POSIX/PlatformPOSIX.h
lldb/branches/lldb-platform-work/source/Target/Platform.cpp
Modified: lldb/branches/lldb-platform-work/include/lldb/Target/Platform.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/Platform.h?rev=155162&r1=155161&r2=155162&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/Platform.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/Platform.h Thu Apr 19 17:18:43 2012
@@ -593,6 +593,12 @@
virtual const char*
GetLocalCacheDirectory ();
+
+ virtual std::string
+ GetPlatformSpecificConnectionInformation()
+ {
+ return "";
+ }
protected:
bool m_is_host;
Modified: lldb/branches/lldb-platform-work/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp?rev=155162&r1=155161&r2=155162&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp Thu Apr 19 17:18:43 2012
@@ -398,3 +398,27 @@
}
return Platform::GetFile(source,destination);
}
+
+std::string
+PlatformPOSIX::GetPlatformSpecificConnectionInformation()
+{
+ StreamString stream;
+ if (GetSupportsRSync())
+ {
+ stream.PutCString("rsync");
+ if (GetRSyncOpts() && *GetRSyncOpts())
+ stream.Printf(", options: '%s' ",GetRSyncOpts());
+ }
+ if (GetSupportsSSH())
+ {
+ stream.PutCString("ssh");
+ if (GetSSHOpts() && *GetSSHOpts())
+ stream.Printf(", options: '%s' ",GetSSHOpts());
+ }
+ if (GetLocalCacheDirectory() && *GetLocalCacheDirectory())
+ stream.Printf("cache dir: %s",GetLocalCacheDirectory());
+ if (stream.GetSize())
+ return stream.GetData();
+ else
+ return "";
+}
Modified: lldb/branches/lldb-platform-work/source/Plugins/Platform/POSIX/PlatformPOSIX.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Platform/POSIX/PlatformPOSIX.h?rev=155162&r1=155161&r2=155162&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/Platform/POSIX/PlatformPOSIX.h (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/Platform/POSIX/PlatformPOSIX.h Thu Apr 19 17:18:43 2012
@@ -72,6 +72,9 @@
virtual bool
GetFileExists (const lldb_private::FileSpec& file_spec);
+
+ virtual std::string
+ GetPlatformSpecificConnectionInformation();
protected:
std::auto_ptr<lldb_private::OptionGroupOptions> m_options;
Modified: lldb/branches/lldb-platform-work/source/Target/Platform.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Target/Platform.cpp?rev=155162&r1=155161&r2=155162&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Target/Platform.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Target/Platform.cpp Thu Apr 19 17:18:43 2012
@@ -262,15 +262,10 @@
if (!IsConnected())
return;
- // The platform is connected, dump the rsync and ssh options, too.
- strm.Printf("With rsync: %s", GetSupportsRSync() ? "yes" : "no");
- if (GetSupportsRSync())
- {
- strm.Printf(" (option: %s", (GetRSyncOpts() && strlen(GetRSyncOpts()) != 0) ? GetRSyncOpts() : "none");
- strm.Printf(", ignore hostname: %s)", GetIgnoresRemoteHostname() ? "yes" : "no");
- }
- strm.Printf("\n");
- strm.Printf(" With ssh: %s\n", GetSupportsSSH() ? "yes" : "no");
+ std::string specific_info(GetPlatformSpecificConnectionInformation());
+
+ if (specific_info.empty() == false)
+ strm.Printf("Platform-specific connection: %s\n", specific_info.c_str());
}
More information about the lldb-commits
mailing list