[lldb-dev] PATCH for REVIEW: Fix [Bug 14806] platform status command prints less information on Linux than on Mac OS X

Matthew Sorrels sorrels.m at gmail.com
Wed May 15 17:01:48 PDT 2013


I've expanded PlatformLinux::GetStatus to work more like the Mac version
(by calling Platform::GetStatus and then adding in the fields from uname in
the same format).  I've also fixed the test case for this to no longer
expect failure.

Here's the new output:

(lldb) platform status
  Platform: host
    Triple: x86_64--linux-gnu
OS Version: 3.2.0
  Hostname: localhost
    Kernel: Linux
   Release: 3.2.0-41-generic
   Version: #66-Ubuntu SMP Thu Apr 25 03:27:11 UTC 2013


Index: test/functionalities/platform/TestPlatformCommand.py
===================================================================
--- test/functionalities/platform/TestPlatformCommand.py    (revision
181914)
+++ test/functionalities/platform/TestPlatformCommand.py    (working copy)
@@ -27,7 +27,6 @@
         self.expect("platform process info", error=True,
             substrs = ['one or more process id(s) must be specified'])

-    @expectedFailureLinux # due to llvm.org/pr14806 -- "platform status"
prints more information on Mac OS X than on Linux
     def test_status(self):
         self.expect("platform status",
             substrs = ['Platform', 'Triple', 'OS Version', 'Kernel',
'Hostname'])
Index: source/Plugins/Platform/Linux/PlatformLinux.cpp
===================================================================
--- source/Plugins/Platform/Linux/PlatformLinux.cpp    (revision 181914)
+++ source/Plugins/Platform/Linux/PlatformLinux.cpp    (working copy)
@@ -336,12 +336,14 @@
 {
     struct utsname un;

-    if (uname(&un)) {
-        strm << "Linux";
-        return;
-    }
+    Platform::GetStatus(strm);

-    strm << un.sysname << ' ' << un.release << ' ' << un.version << '\n';
+    if (uname(&un))
+        return;
+
+    strm.Printf ("    Kernel: %s\n", un.sysname);
+    strm.Printf ("   Release: %s\n", un.release);
+    strm.Printf ("   Version: %s\n", un.version);
 }

 size_t
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20130515/adb509b1/attachment.html>


More information about the lldb-dev mailing list