Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
-class DonorImplementation():
+class DonorImplementation(preloaded=False):
def __init__(self):
# works on the current gdb.Inferior
# ideally should be reused if the same process is targetd
self._open = None
self._sym = None
def __init__(self):
# works on the current gdb.Inferior
# ideally should be reused if the same process is targetd
self._open = None
self._sym = None
+ if preloaded:
+ self._sym = 'fishdescriptor_donate'
def _func(self, functype, funcname, realargs):
expr = '((%s) %s) %s' % (functype, funcname, realargs)
def _func(self, functype, funcname, realargs):
expr = '((%s) %s) %s' % (functype, funcname, realargs)
def _dlsym(self):
if self._sym is not None: return
def _dlsym(self):
if self._sym is not None: return
self._sym = self._dlfunc('void* (*)(void*, const char*)'
'dlsym',
'(%s, "fishdescriptor_donate")' % self._open)
def donate(self, path, fds):
self._sym = self._dlfunc('void* (*)(void*, const char*)'
'dlsym',
'(%s, "fishdescriptor_donate")' % self._open)
def donate(self, path, fds):
self._dlsym()
r = self._func('int (*)(const char*, const int*)',
self._sym,
self._dlsym()
r = self._func('int (*)(const char*, const int*)',
self._sym,