Fix unit tests (#1685)

This commit is contained in:
Gulshan Singh 2023-04-23 22:04:53 -07:00 committed by GitHub
parent 4fde3e898c
commit 7720b81cc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 1 deletions

View File

@ -1,3 +1,4 @@
import struct
import types
@ -6,4 +7,12 @@ class Amd64Arch(types.ModuleType):
super(Amd64Arch, self).__init__(module_name)
self.ptrsize = 8
self.ptrmask = (1 << 8 * self.ptrsize) - 1
self.endian = "little"
self.fmt = "<Q"
def pack(self, integer: int) -> bytes:
return struct.pack(self.fmt, integer & self.ptrmask)
def unpack(self, data: bytes) -> int:
return struct.unpack(self.fmt, data)[0]

View File

@ -11,7 +11,10 @@ class Config(types.ModuleType):
return wrapper
def add_param(self, *args):
def add_param(self, *args, **kwargs):
pass
def add_param_obj(self, *args, **kwargs):
pass
def init_params(self):

View File

@ -10,3 +10,5 @@ import gdb
gdb.PARAM_BOOLEAN = 0
gdb.PARAM_ZINTEGER = 4
gdb.PARAM_STRING = 8
gdb.VERSION = "8.3.1"