m1n1.constructutils: Add ZPadding type

Like Padding, but actually asserts that the contents are zeroed.

Signed-off-by: Asahi Lina <lina@asahilina.net>
This commit is contained in:
Asahi Lina 2022-08-17 12:49:32 +09:00
parent 9aaac03907
commit da40a6d843

View file

@ -11,6 +11,9 @@ g_struct_trace = set()
g_struct_addrmap = {}
g_depth = 0
def ZPadding(size):
return Const(bytes(size), Bytes(size))
def recusive_reload(obj, token=None):
global g_depth
@ -659,4 +662,4 @@ def show_struct_trace(log=print):
for addr, desc in sorted(list(g_struct_trace)):
log(f"{addr:>#18x}: {desc}")
__all__ = ["ConstructClass", "ConstructValueClass", "Dec", "ROPointer", "show_struct_trace"]
__all__ = ["ConstructClass", "ConstructValueClass", "Dec", "ROPointer", "show_struct_trace", "ZPadding"]