nuttxgdb: fix container_of pointer offset calc problem
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
This commit is contained in:
parent
b296b1debe
commit
bb461b532b
1 changed files with 3 additions and 1 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue