在尝试使用Python开发gdb
插件时,我在尝试直接获取变量类型时遇到以下错误。
(gdb) p appendLock->owner
$2 = (Arachne::ThreadContext *) 0x7ff620001a40
(gdb) whatis appendLock->owner
Attempt to take address of value not located in memory.
(gdb) ptype appendLock->owner
Attempt to take address of value not located in memory.
是否有针对此问题的解决方法,以便可以直接获取变量的类型?
答案 0 :(得分:1)
似乎可以使用Python API直接解决此问题。
(gdb) python print gdb.parse_and_eval("appendLock->owner").type
Arachne::ThreadContext *