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

Malea, Daniel daniel.malea at intel.com
Thu May 16 10:55:09 PDT 2013


Hi Matthew, welcome to LLDB!

I tried it out, and it looked good, so I committed in r182030.

Keep the fixes coming :)

Dan

From: Matthew Sorrels <sorrels.m at gmail.com<mailto:sorrels.m at gmail.com>>
Date: Wednesday, 15 May, 2013 8:01 PM
To: "lldb-dev at cs.uiuc.edu<mailto:lldb-dev at cs.uiuc.edu>" <lldb-dev at cs.uiuc.edu<mailto:lldb-dev at cs.uiuc.edu>>
Subject: [lldb-dev] PATCH for REVIEW: Fix [Bug 14806] platform status command prints less information on Linux than on Mac OS X

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<http://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





More information about the lldb-dev mailing list