mirror of
https://github.com/ARM-software/devlib.git
synced 2025-03-03 16:57:51 +00:00
AndroidTarget: fix ps()
ps() splits the output on whiestspace into fields; always expecting nine. In some cases, wchan field may be blank, resulting in only eight chunks after the split. Detect that case and insert and empty entry at the appropriate index.
This commit is contained in:
parent
96693a3035
commit
109fcc6deb
@ -1024,8 +1024,12 @@ class AndroidTarget(Target):
|
||||
result = []
|
||||
for line in lines:
|
||||
parts = line.split(None, 8)
|
||||
if parts:
|
||||
result.append(PsEntry(*(parts[0:1] + map(int, parts[1:5]) + parts[5:])))
|
||||
if not parts:
|
||||
continue
|
||||
if len(parts) == 8:
|
||||
# wchan was blank; insert an empty field where it should be.
|
||||
parts.insert(5, '')
|
||||
result.append(PsEntry(*(parts[0:1] + map(int, parts[1:5]) + parts[5:])))
|
||||
if not kwargs:
|
||||
return result
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user