Writting a debugger is fun :D

This commit is contained in:
Clement Rouault
2016-01-22 18:19:00 +01:00
parent f6f206b842
commit 99788d0368
8 changed files with 173 additions and 46 deletions
+5
View File
@@ -18,3 +18,8 @@ def swallow_ctypes_copy(ctypes_object):
new_copy = type(ctypes_object)()
ctypes.memmove(ctypes.byref(new_copy), ctypes.byref(ctypes_object), ctypes.sizeof(new_copy))
return new_copy
# type replacement based on name
def transform_ctypes_fields(struct, replacement):
return [(name, replacement.get(name, type)) for name, type in struct._fields_]