This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

passing gdb.Value pointers to ctypes function calls


Hello!

I'm trying to write a pretty printer for gdb 7.2 using python, to be
concrete I would like to print an Xml node (libxml2) as text. I've
managed to get the pointers to node and document. Now I'm trying to
call libxml using ctypes module, passing the pointer values as
c_void_p. But gdb keeps crashing on me. Is this supposed to work at
all? I allocate some buffer, pass it to libxml functions along with
some addresses I obtain from the debugged process using gdb, and as a
result I expect the string representation of the node in the buffer.

For converting between gdb.Value and ctypes usable stuff I use something like:
ptr = int(str(gdbValNode), 16)
c_void_p(ptr)

I'm attached to the running process. But as far as I understand, this
should work on the running process as well as the core file.

Thanks for insight!
Christoph


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]