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

Greg Clayton gclayton at apple.com
Wed May 15 17:07:57 PDT 2013


Looks fine to me. 
On May 15, 2013, at 5:01 PM, Matthew Sorrels <sorrels.m at gmail.com> wrote:

> 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
> 
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev




More information about the lldb-dev mailing list