gdb: add sizeof helper

Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
This commit is contained in:
Xu Xingliang 2024-10-21 15:13:21 +08:00 committed by Xiang Xiao
parent 84c66505aa
commit 6949ff6a7d

View file

@ -339,6 +339,12 @@ def nitems(array):
return array_size
def sizeof(t: Union[str, gdb.Type]):
if type(t) is str:
t = gdb.lookup_type(t)
return t.sizeof
# Machine Specific Helper Functions