mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 09:49:21 +08:00
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
|
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
|
# Machine Specific Helper Functions
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue