From: Phil Muldoon <pmuldoon@redhat.com>
To: Christoph Mathys <eraserix@gmail.com>
Cc: gdb@sourceware.org
Subject: Re: passing gdb.Value pointers to ctypes function calls
Date: Tue, 12 Apr 2011 21:17:00 -0000 [thread overview]
Message-ID: <m3aafv8909.fsf@redhat.com> (raw)
In-Reply-To: <BANLkTimYpcNe63aXb7rabE-ziWaDrXN+kA@mail.gmail.com> (Christoph Mathys's message of "Tue, 12 Apr 2011 11:44:22 +0200")
Christoph Mathys <eraserix@gmail.com> writes:
> 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.
If GDB ever crashes it is a bug. Can you file a bug for this?
> 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.
It should, but without more concrete information it is difficult to
diagnose the issue. I am concerned about the GDB crash though, that
should be fixed.
Cheers,
Phil
next prev parent reply other threads:[~2011-04-12 21:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-12 9:44 Christoph Mathys
2011-04-12 21:17 ` Phil Muldoon [this message]
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=m3aafv8909.fsf@redhat.com \
--to=pmuldoon@redhat.com \
--cc=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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).