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 bb461b532bf8e0a9e348b3fbb4dfcb2ae481a687
Author: buxiasen <[email protected]>
AuthorDate: Mon Sep 23 22:34:03 2024 +0800

    nuttxgdb: fix container_of pointer offset calc problem
    
    Signed-off-by: buxiasen <[email protected]>
---
 tools/gdb/nuttxgdb/utils.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/gdb/nuttxgdb/utils.py b/tools/gdb/nuttxgdb/utils.py
index 81c44f6159..e40070e2e4 100644
--- a/tools/gdb/nuttxgdb/utils.py
+++ b/tools/gdb/nuttxgdb/utils.py
@@ -96,7 +96,9 @@ def offset_of(typeobj: gdb.Type, field: str) -> Union[int, 
None]:
 
 def container_of(ptr: gdb.Value, typeobj: gdb.Type, member: str) -> gdb.Value:
     """Return pointer to containing data structure"""
-    return gdb.Value(ptr.address - offset_of(typeobj, 
member)).cast(typeobj.pointer())
+    return gdb.Value(int(ptr.address) - offset_of(typeobj, member)).cast(
+        typeobj.pointer()
+    )
 
 
 class ContainerOf(gdb.Function):

Reply via email to