This is an automated email from the ASF dual-hosted git repository. xiaoxiang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 6949ff6a7d6be761c109c580632001b1ee8d6fb5 Author: Xu Xingliang <[email protected]> AuthorDate: Mon Oct 21 15:13:21 2024 +0800 gdb: add sizeof helper Signed-off-by: Xu Xingliang <[email protected]> --- tools/gdb/nuttxgdb/utils.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/gdb/nuttxgdb/utils.py b/tools/gdb/nuttxgdb/utils.py index 3a97a23330..144282d3a3 100644 --- a/tools/gdb/nuttxgdb/utils.py +++ b/tools/gdb/nuttxgdb/utils.py @@ -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
