gdb: add sizeof helper
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
This commit is contained in:
parent
84c66505aa
commit
6949ff6a7d
1 changed files with 6 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue