summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChaoren Lin <chaorenl@google.com>2015-07-06 18:56:04 +0000
committerChaoren Lin <chaorenl@google.com>2015-07-06 18:56:04 +0000
commitbfa848cfa1f61d97b23de27cef65df604bb0b9c2 (patch)
treea1acaccf57835e12230ef71070b9d82da96d070d
parentadce68ee8874444bf5f329564d289c61f1abbd4d (diff)
downloadbcm5719-llvm-bfa848cfa1f61d97b23de27cef65df604bb0b9c2.tar.gz
bcm5719-llvm-bfa848cfa1f61d97b23de27cef65df604bb0b9c2.zip
Use /proc/$$/stat instead of $PPID.
Summary: $PPID is not available on old shells. Reviewers: tberghammer, ovyalov Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D10968 llvm-svn: 241486
-rw-r--r--lldb/test/tools/lldb-server/gdbremote_testcase.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/lldb/test/tools/lldb-server/gdbremote_testcase.py b/lldb/test/tools/lldb-server/gdbremote_testcase.py
index c81dd101319..c3a1cca4068 100644
--- a/lldb/test/tools/lldb-server/gdbremote_testcase.py
+++ b/lldb/test/tools/lldb-server/gdbremote_testcase.py
@@ -158,7 +158,10 @@ class GdbRemoteTestCaseBase(TestBase):
# Remote platforms don't support named pipe based port negotiation
use_named_pipe = False
- pid = run_shell_cmd("echo $PPID")
+ # Grab the ppid from /proc/[shell pid]/stat
+ shell_stat = run_shell_cmd("cat /proc/$$/stat")
+ # [pid] ([executable]) [state] [*ppid*]
+ pid = re.match(r"^\d+ \(.+\) . (\d+)", shell_stat).group(1)
ls_output = run_shell_cmd("ls -l /proc/%s/exe" % pid)
exe = ls_output.split()[-1]
OpenPOWER on IntegriCloud