os.dup2(1,3)
os.dup2(2,1)
+class Error(Exception): pass
+
class Donor():
def __init__(d, pid, debug=None):
d.pid = pid
def _eval_integer(d, expr):
try:
l = d._sp.stdout.readline()
+ if not len(l): raise Error('gdb process donor python repl quit')
if l != b'!\n': raise RuntimeError("indonor said %s" % repr(l))
d._sp.stdin.write(expr.encode('utf-8') + b'\n')
d._sp.stdin.flush()