[Lldb-commits] [PATCH] D10968: Use /proc/$$/stat instead of $PPID.

Chaoren Lin chaorenl at google.com
Mon Jul 6 11:08:16 PDT 2015


chaoren added reviewers: ovyalov, tberghammer.
chaoren added a subscriber: lldb-commits.

$PPID is not available on old shells.

http://reviews.llvm.org/D10968

Files:
  test/tools/lldb-server/gdbremote_testcase.py

Index: test/tools/lldb-server/gdbremote_testcase.py
===================================================================
--- test/tools/lldb-server/gdbremote_testcase.py
+++ test/tools/lldb-server/gdbremote_testcase.py
@@ -158,7 +158,8 @@
             # Remote platforms don't support named pipe based port negotiation
             use_named_pipe = False
 
-            pid = run_shell_cmd("echo $PPID")
+            shell_stat = run_shell_cmd("cat /proc/$$/stat")
+            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]
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D10968.29107.patch
Type: text/x-patch
Size: 647 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150706/67b330f2/attachment.bin>


More information about the lldb-commits mailing list