This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
passing gdb.Value pointers to ctypes function calls
- From: Christoph Mathys <eraserix at gmail dot com>
- To: gdb at sourceware dot org
- Date: Tue, 12 Apr 2011 11:44:22 +0200
- Subject: 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