aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2020-01-31 14:23:56 -0800
committerJonas Devlieghere <jonas@devlieghere.com>2020-01-31 14:36:39 -0800
commitd3bdd51f70449435443b3e8ff254cba49d4aba80 (patch)
treedc751a3d6116adc957319d4e824488b84d0cf145
parentc0f475f2e3c3304fb7fc116fdab7871f1d903810 (diff)
downloadllvm-d3bdd51f70449435443b3e8ff254cba49d4aba80.zip
llvm-d3bdd51f70449435443b3e8ff254cba49d4aba80.tar.gz
llvm-d3bdd51f70449435443b3e8ff254cba49d4aba80.tar.bz2
[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.
-rw-r--r--lldb/packages/Python/lldbsuite/test/commands/platform/basic/TestPlatformCommand.py3
-rw-r--r--lldb/source/Target/Platform.cpp6
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 ab45b22..9c16da8 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 0ad3f36..3739ccd 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) {