lmacken / pyrasite

Inject code into running Python processes

Home Page:http://pyrasite.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pyrasite-shell configuration to work with PID on Cygwin

poszkodowany opened this issue · comments

I have Python 2.7 installed on Cygwin and I want easily drop into a shell and execute commands in my python application, but the tool "pyrasite-shell" is not working properly.

I'm not sure if it sees correctly PID. When I run the below command, dollar sign ($) prompt disappears and I don't get access to the python interpreter who should show such a thing ">>>".
pyrasite-shell <PID>

Short information about this program:
Pyrasite is a library and a set of tools for injecting code into running Python programs.
Requirements: gdb (version 7.3+)
I installed the required package and then I gave the following command:
pip install pyrasite

I launched then the first Cygwin terminal and executed:
python myscript.py

I checked then on the second:

ps aux | grep python
ps aux
top

I received:

I     734     725     734       5680  pty1      197609 13:51:51 /usr/bin/python2.7


      PID    PPID    PGID     WINPID   TTY         UID    STIME COMMAND
      724       1     724       3272  ?         197609 13:51:46 /usr/bin/mintty
      715     714     715       8612  pty0      197609 13:51:43 /usr/bin/bash
      725     724     725       9608  pty1      197609 13:51:46 /usr/bin/bash
      714       1     714      10004  ?         197609 13:51:43 /usr/bin/mintty
I     734     725     734       5680  pty1      197609 13:51:51 /usr/bin/python2.7
      737     715     737       7444  pty0      197609 13:52:53 /usr/bin/ps


  PID UŻYTK.    PR  NI    WIRT    REZ  %CPU  %PAM     CZAS+ S KOMENDA
  714 USR        8   0    7,7m  17,6m   0,0   0,4   0:00.23 S /usr/bin/mintty +
  715 USR        8   0    5,6m   7,7m   0,0   0,2   0:00.06 S  `- -bash
  738 USR        8   0   11,6m  11,8m   6,7   0,3   0:01.96 R      `- top
  724 USR        8   0    7,6m  17,1m   0,0   0,4   0:00.24 S /usr/bin/mintty +
  725 USR        8   0    5,6m   7,7m   0,0   0,2   0:00.06 S  `- -bash
  734 USR        8   0   33,8m  37,4m   0,0   0,9   0:04.65 S      `- python d+

Then:
pyrasite-shell 734
and nothing happens, I can enter any PID and the effect will be the same