[Lldb-commits] [lldb] d3bdd51 - [lldb/Platform] Always print Kernel last

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Fri Jan 31 14:44:37 PST 2020


Author: Jonas Devlieghere
Date: 2020-01-31T14:36:39-08:00
New Revision: d3bdd51f70449435443b3e8ff254cba49d4aba80

URL: https://github.com/llvm/llvm-project/commit/d3bdd51f70449435443b3e8ff254cba49d4aba80
DIFF: https://github.com/llvm/llvm-project/commit/d3bdd51f70449435443b3e8ff254cba49d4aba80.diff

LOG: [lldb/Platform] Always print Kernel last

Specializations of the Platform class print the kernel after calling the
super method. By printing the kernel at the end in the super class, we
guarantee the order is the same on different platforms.

Added: 
    

Modified: 
    lldb/packages/Python/lldbsuite/test/commands/platform/basic/TestPlatformCommand.py
    lldb/source/Target/Platform.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/packages/Python/lldbsuite/test/commands/platform/basic/TestPlatformCommand.py b/lldb/packages/Python/lldbsuite/test/commands/platform/basic/TestPlatformCommand.py
index ab45b221c94d..9c16da8ad005 100644
--- a/lldb/packages/Python/lldbsuite/test/commands/platform/basic/TestPlatformCommand.py
+++ b/lldb/packages/Python/lldbsuite/test/commands/platform/basic/TestPlatformCommand.py
@@ -42,8 +42,9 @@ def test_status(self):
                 'Platform',
                 'Triple',
                 'OS Version',
+                'Hostname',
                 'Kernel',
-                'Hostname'])
+            ])
 
     @expectedFailureAll(oslist=["windows"])
     @no_debug_info_test

diff  --git a/lldb/source/Target/Platform.cpp b/lldb/source/Target/Platform.cpp
index 0ad3f36266c3..3739ccd7edc6 100644
--- a/lldb/source/Target/Platform.cpp
+++ b/lldb/source/Target/Platform.cpp
@@ -421,9 +421,6 @@ void Platform::GetStatus(Stream &strm) {
     strm.EOL();
   }
 
-  if (GetOSKernelDescription(s))
-    strm.Printf("    Kernel: %s\n", s.c_str());
-
   if (IsHost()) {
     strm.Printf("  Hostname: %s\n", GetHostname());
   } else {
@@ -443,6 +440,9 @@ void Platform::GetStatus(Stream &strm) {
 
   if (!specific_info.empty())
     strm.Printf("Platform-specific connection: %s\n", specific_info.c_str());
+
+  if (GetOSKernelDescription(s))
+    strm.Printf("    Kernel: %s\n", s.c_str());
 }
 
 llvm::VersionTuple Platform::GetOSVersion(Process *process) {


        


More information about the lldb-commits mailing list