From 55c27e2c54a02aa1cd2f64cb38b5dfd254dcf71e Mon Sep 17 00:00:00 2001
From: Brendan Jackman <brendan.jackman@arm.com>
Date: Wed, 12 Apr 2017 16:30:58 +0100
Subject: [PATCH] AndroidTarget: Fix `ps` when NAME column contains spaces

Targets have been observed where `ps` output contains entries with NAME columns
of the form "[foo bar]". This means the `parts` list is too long and the PsEntry
call reports too many arguments. Since NAME is the rightmost column, just fix
the number of entries we recognise to 8.
---
 devlib/target.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/devlib/target.py b/devlib/target.py
index b6b9d5e..5035758 100644
--- a/devlib/target.py
+++ b/devlib/target.py
@@ -929,7 +929,7 @@ class AndroidTarget(Target):
         lines.next()  # header
         result = []
         for line in lines:
-            parts = line.split()
+            parts = line.split(None, 8)
             if parts:
                 result.append(PsEntry(*(parts[0:1] + map(int, parts[1:5]) + parts[5:])))
         if not kwargs: