Hacker GitHub

← All repos

lmacken/pyrasite

View on GitHub ↗ ★ 2,876 Python

Inject code into running Python processes

9 mentions on Hacker News by 9 people: 1 story, 8 comments · first 2012-02-16 · latest 2020-11-02

Mentions per year 9 mentions · busiest year 2014 (3)
20082026
  1. …be extremely surprised if tooling did not exist to perform similar debugging tasks with it. 1. https://github.com/lmacken/pyrasite
    comment by zbentley · 2020-11-02 · in Extreme Debugging
  2. Sibling comment suggests Pyrasite for this: https://github.com/lmacken/pyrasite
    comment by jessedhillon · 2020-06-02 · in Guide to Python Debugging
  3. See this file: https://github.com/lmacken/pyrasite/blob/develop/pyrasite/in... It uses GDB to attach to the process. And then evaluates the code inside the process using GDB.
  4. As a curiosity/hack you can almost get there with pyrasite ( https://github.com/lmacken/pyrasite ) and def newfn(): ... oldfn.__code__ = newfn.__code__ del newfn There's a difficulty with __globals__ and __closures__ but I found the patch…
    comment by hardenedapple · 2017-07-29 · in Common Lisp Runtime Redefinition (2002)
  5. For Python, you can just use Pyrasite ( https://github.com/lmacken/pyrasite ) and inject a script which prints a stack trace for all threads. I've done this to debug OpenStack in the past and it worked very well. There are many similar…
    comment by eeZi · 2016-06-12 · in How to spy on a Ruby program
  6. Just read this file: https://github.com/lmacken/pyrasite/blob/develop/pyrasite/in... it's rather straightforward.
  7. …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]…
  8. This is probably the most featured / well known one: https://github.com/lmacken/pyrasite
  9. ▲ 2
    Inject code into a running Python process
    story by Mizza · 2012-02-16 · 0 comments