From d3bdd51f70449435443b3e8ff254cba49d4aba80 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Fri, 31 Jan 2020 14:23:56 -0800 Subject: [PATCH] [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. --- .../lldbsuite/test/commands/platform/basic/TestPlatformCommand.py | 3 ++- lldb/source/Target/Platform.cpp | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) 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 ab45b221c94..9c16da8ad00 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 @@ class PlatformCommandTestCase(TestBase): '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 0ad3f36266c..3739ccd7edc 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) { -- 2.11.0