Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Siva Chandra <sivachandra@google.com>
To: Tom Tromey <tromey@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFC] Fix for gdb.parameter('architecture') returning empty string
Date: Fri, 02 Nov 2012 18:45:00 -0000	[thread overview]
Message-ID: <CAGyQ6gxnp+2_yLGiqj7x9ctQ-HTBmMNPU=nRUC5y2UBYWfwbgQ@mail.gmail.com> (raw)
In-Reply-To: <87r4ocosah.fsf@fleche.redhat.com>

On Fri, Nov 2, 2012 at 9:58 AM, Tom Tromey <tromey@redhat.com> wrote:

> Siva> I do not understand this completely. In my patch, show_architecture
> Siva> only prints 'architecture_string'. Hence,
> Siva> gdb.parameter('architecture') and "show architecture" should always
> Siva> show the same result. Did I miss something?
>
> Ok, I see.  Your patch removes the call to get_current_arch.
> I missed that somehow before, sorry about that.
>
> I think this just means that "show architecture" will now show incorrect
> results, though.

This is for my understanding: Can you give an example where this can
give incorrect results. Is it only for the case when the arch can
change from frame to frame? I have tested for all cases that I could
think of and it seems fine.

> BTW, what is it you are using this for?  I think in many cases it is
> preferable for us to expose more API directly rather than rely on CLI
> settings.  E.g., if your code needs the architecture, find a way to
> intelligently expose gdbarch on frames, types, etc.

For now, I have been using gdb.execute("show architecture",
to_string=True) and getting the value from the resulting string. I am
trying to tidy that up by using gdb.parameter(...). And, for my work,
exposing arch from frames will work as I need the arch during an
active frame only. I see two items here then:

1. Fix gdb.parameter by the way of using methods on CLI objects.
2. Expose current frame arch through the gdb.Frame class.

Do they seem reasonable?

Thanks,
Siva Chandra


  reply	other threads:[~2012-11-02 18:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-13 23:43 Siva Chandra
2012-10-14  7:53 ` Andreas Schwab
2012-10-14  8:37   ` Siva Chandra
2012-10-22  7:16     ` Siva Chandra
2012-11-01 20:19 ` Tom Tromey
2012-11-02 13:44   ` Siva Chandra
2012-11-02 16:59     ` Tom Tromey
2012-11-02 18:45       ` Siva Chandra [this message]
2012-11-02 19:52         ` Tom Tromey
2012-11-05 10:39         ` 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='CAGyQ6gxnp+2_yLGiqj7x9ctQ-HTBmMNPU=nRUC5y2UBYWfwbgQ@mail.gmail.com' \
    --to=sivachandra@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