public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* passing gdb.Value pointers to ctypes function calls
@ 2011-04-12  9:44 Christoph Mathys
  2011-04-12 21:17 ` Phil Muldoon
  2011-04-13 14:26 ` Tom Tromey
  0 siblings, 2 replies; 5+ messages in thread
From: Christoph Mathys @ 2011-04-12  9:44 UTC (permalink / raw)
  To: gdb

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-04-13 14:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-12  9:44 passing gdb.Value pointers to ctypes function calls Christoph Mathys
2011-04-12 21:17 ` Phil Muldoon
2011-04-13  7:22   ` Christoph Mathys
2011-04-13 14:27   ` Tom Tromey
2011-04-13 14:26 ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).