From: Phil Muldoon <pmuldoon@redhat.com>
To: Doug Evans <dje@google.com>
Cc: tromey@redhat.com, gdb-patches ml <gdb-patches@sourceware.org>
Subject: Re: [python][patch] Inferior and Thread information support.
Date: Fri, 18 Jun 2010 15:47:00 -0000 [thread overview]
Message-ID: <4C1B94F9.4010403@redhat.com> (raw)
In-Reply-To: <AANLkTikYKWCnUChWt5DbmBfzaI6lI4bVLROFRe9l3Nz8@mail.gmail.com>
On 06/18/2010 03:21 PM, Doug Evans wrote:
> I think search_memory should take just the same type of parameter for
> the search pattern that write_memory takes: a byte array (etc.). Keep
> the API simple and let the caller do the conversion to a byte array
> (or buffer protocol).
> We could provide utilities to convert to/from byte arrays (then
> write_memory can use them too!) but Python probably has them already.
> Then you can punt on the `size' parameter completely.
I'm not sure that conversion from a Python type to a buffer object are
that transparent. For instance there seems to be no straightforward
way to represent 3.141 as a sequence of bytes backed by a buffer in
Python (or accessible via the buffer interface rather). Maybe there
is, I'm certainly not a Python language expert. I hope someone can
prove me wrong!
Right now with the existing code, we take 3.141 as a gdb.value and
convert that to bytes via value_contents. Your suggestions would
certainly make the existing code simpler (and my porting task a little
easier ;), but I can't help thinking that it would be just making the
user jump through extra hoops just for API pureness. I strive for
that, it's a good thing; it just strikes me a little too much in this
case. OTOH we could just make add_value_pattern available via the API
and have the user manually do the conversion "the GDB way".
>
> You also want to document what the result is.
Sure, will do.
Cheers,
Phil
next prev parent reply other threads:[~2010-06-18 15:47 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-24 13:36 Phil Muldoon
2010-05-24 18:06 ` Eli Zaretskii
2010-06-10 18:40 ` Tom Tromey
2010-06-14 12:42 ` Phil Muldoon
2010-06-15 15:24 ` Pedro Alves
2010-06-15 18:11 ` Tom Tromey
2010-06-15 18:24 ` Pedro Alves
2010-06-15 19:58 ` Phil Muldoon
2010-06-15 20:36 ` Pedro Alves
2010-06-18 6:49 ` Phil Muldoon
2010-06-18 14:21 ` Doug Evans
2010-06-18 15:47 ` Phil Muldoon [this message]
2010-06-18 17:59 ` Tom Tromey
2010-06-18 20:10 ` Phil Muldoon
2010-06-25 20:41 ` Tom Tromey
2010-06-18 18:04 ` Tom Tromey
2010-06-22 10:32 ` Phil Muldoon
2010-06-25 20:38 ` Tom Tromey
2010-06-28 9:22 ` Phil Muldoon
2010-06-28 19:51 ` Tom Tromey
2010-06-28 21:35 ` Phil Muldoon
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=4C1B94F9.4010403@redhat.com \
--to=pmuldoon@redhat.com \
--cc=dje@google.com \
--cc=gdb-patches@sourceware.org \
--cc=tromey@redhat.com \
/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).