Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Christoph Mathys <eraserix@gmail.com>
To: gdb@sourceware.org
Subject: passing gdb.Value pointers to ctypes function calls
Date: Tue, 12 Apr 2011 09:44:00 -0000	[thread overview]
Message-ID: <BANLkTimYpcNe63aXb7rabE-ziWaDrXN+kA@mail.gmail.com> (raw)

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


             reply	other threads:[~2011-04-12  9:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-12  9:44 Christoph Mathys [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BANLkTimYpcNe63aXb7rabE-ziWaDrXN+kA@mail.gmail.com \
    --to=eraserix@gmail.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox