From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: tromey@redhat.com
Cc: gdb-patches@sourceware.org
Subject: Re: [01/15] Introduce get_current_arch () function
Date: Wed, 10 Jun 2009 15:36:00 -0000 [thread overview]
Message-ID: <200906101536.n5AFaEDM000676@d12av02.megacenter.de.ibm.com> (raw)
In-Reply-To: <m3iqj5l4on.fsf@fleche.redhat.com> from "Tom Tromey" at Jun 09, 2009 11:04:08 AM
Tom Tromey wrote:
> >>>>> "Ulrich" == Ulrich Weigand <uweigand@de.ibm.com> writes:
>
> Ulrich> printf_command (char *arg, int from_tty)
> Ulrich> {
> Ulrich> + struct gdbarch *gdbarch = get_current_arch ();
>
> I think that perhaps the printf command should use the arch from the
> values it is trying to print.
>
> Ulrich> struct type *wctype = lookup_typename (current_language,
> Ulrich> - current_gdbarch,
> Ulrich> + gdbarch,
> Ulrich> "wchar_t", NULL, 0);
>
> E.g., here it could use the architecture from val_args[i].
>
> The benefit here would be that you could print out two wide strings,
> each from a different architecture, using a single printf. This seems
> like a reasonable thing to want to do.
There wouldn't really be much of a difference today, as the architecture
of val_args[i] is the architecture of the expression from which it was
evaluated, which is likewise get_current_arch ().
However, you're right that it would be more straightforward to use the
value arch here, in case we might later decide to allow evaluation of
an expression to return values in a different arch.
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com
next prev parent reply other threads:[~2009-06-10 15:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-09 15:15 Ulrich Weigand
2009-06-09 17:04 ` Tom Tromey
2009-06-10 15:36 ` Ulrich Weigand [this message]
2009-06-10 16:40 ` Tom Tromey
2009-06-10 18:14 ` Ulrich Weigand
2009-07-02 17:04 ` Ulrich Weigand
2009-06-10 16:49 ` Pedro Alves
2009-06-10 18:27 ` Ulrich Weigand
2009-06-10 19:23 ` Pedro Alves
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=200906101536.n5AFaEDM000676@d12av02.megacenter.de.ibm.com \
--to=uweigand@de.ibm.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