Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Phil Muldoon <pmuldoon@redhat.com>
To: Paul_Koning@Dell.com
Cc: tromey@redhat.com, gdb-patches@sourceware.org
Subject: Re: [patch] [python] PR python/15461 (gate architecture calls)
Date: Wed, 28 Aug 2013 18:45:00 -0000	[thread overview]
Message-ID: <521E4560.3050407@redhat.com> (raw)
In-Reply-To: <C75A84166056C94F84D238A44AF9F6AD034CBA4D@AUSX10MPC103.AMER.DELL.COM>

On 28/08/13 19:13, Paul_Koning@Dell.com wrote:
> 
> On Aug 28, 2013, at 1:54 PM, Tom Tromey <tromey@redhat.com> wrote:
> 
>> Phil> Something I thought about is not allowing gdb.Architecture to be
>> Phil> instantiated directly, but I could not think of a clean way to do
>> Phil> this.
>>
>> Did you think of any way?
>> It seems like a good thing to prevent.
> 
> Ditto for all the existing types for which direct instantiation doesn't do anything useful.
> 
> I haven't tried this, but judging from the Python docs, if you point the tp_new field of the type object to a function that sets a suitable Python exception, that should do the job.

I was not able to make the tp_new call figure out where it was being
instantiated from.

So I could not tell the difference between:

foo = gdb.selected_frame()

and

foo = gdb.Frame()

There is a way if the class constructor takes arguments (ie, foo =
gdb.Value(2), but that case is valid in any case).

But I only spent a very brief time on it.  I am sure there is a way to
do it.  I will look at it in a little more detail now we think we
should make this happen.

Cheers

Ohil



      reply	other threads:[~2013-08-28 18:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-28 12:04 Phil Muldoon
2013-08-28 14:52 ` Tom Tromey
2013-08-28 15:15   ` Phil Muldoon
2013-08-28 15:54     ` Tom Tromey
2013-08-29 11:15       ` Phil Muldoon
2013-08-29 14:58         ` Tom Tromey
2013-08-30 10:13           ` Phil Muldoon
2013-08-28 17:54 ` Tom Tromey
2013-08-28 18:14   ` Paul_Koning
2013-08-28 18:45     ` Phil Muldoon [this message]

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=521E4560.3050407@redhat.com \
    --to=pmuldoon@redhat.com \
    --cc=Paul_Koning@Dell.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