Re:Pyrasite: Tools for injecting code into running Python pr...
by matthewmacleod on Monday August 11, 2014 @04:38AM
(#8162475)
It basically uses GDB to call eval inside a running Python VM. Pretty simple, but quite useful from time to time.
[ Parent
| on HN ]
Re:Pyrasite: Tools for injecting code into running Python pr...
by BozeWolf on Monday August 11, 2014 @04:39AM
(#8162478)
But how does it get into that running Python VM?
Re:Pyrasite: Tools for injecting code into running Python pr...
by coolj on Monday August 11, 2014 @05:39AM
(#8162616)
GDB uses a system call(s) to attach to the running process[1], and python exposes an API that lets you evaluate code in the current VM context[2]. Specifically, https://github.com/lmacken/pyrasite/blob/develop/pyrasite/in...
[1] http://aosabook.org/en/gdb.html [2] https://docs.python.org/2/c-api/veryhigh.html