From: Christoph Mathys <eraserix@gmail.com>
To: gdb@sourceware.org
Subject: Re: passing gdb.Value pointers to ctypes function calls
Date: Wed, 13 Apr 2011 07:22:00 -0000 [thread overview]
Message-ID: <BANLkTi=tgk6ZHT_nu6dYtz-ZxLow36wZUQ@mail.gmail.com> (raw)
In-Reply-To: <m3aafv8909.fsf@redhat.com>
On Tue, Apr 12, 2011 at 11:17 PM, Phil Muldoon <pmuldoon@redhat.com> wrote:
> Christoph Mathys <eraserix@gmail.com> writes:
>
>> 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?
I don't mind filing a bug report, but I'm not sure what else gdb
should do considering what I'm doing: Accessing possibly invalid
memory inside gdb itself. The code below is what I think happens in my
script. The difference is that I have a more complicated way of
getting the wrong pointer and call a different C function.
This is in crash.py:
from ctypes import *
ptr = c_void_p(1)
libc = CDLL('libc.so.6')
libc.printf('%s\n', ptr)
Fire up gdb and do: python execfile('crash.py'). For me, this crashes
gdb, but this is somewhat expected.
> 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.
It was suggested that what I'm trying to do can't work. gdb lives in
another address space than my inferior, so pointers from my inferior
don't make sense to a library loaded into gdbs address space.
Christoph
next prev parent reply other threads:[~2011-04-13 7:22 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
2011-04-13 7:22 ` Christoph Mathys [this message]
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='BANLkTi=tgk6ZHT_nu6dYtz-ZxLow36wZUQ@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