This is the mail archive of the
mailing list for the GDB project.
Re: [01/15] Introduce get_current_arch () function
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: pedro at codesourcery dot com (Pedro Alves)
- Cc: gdb-patches at sourceware dot org, tromey at redhat dot com
- Date: Wed, 10 Jun 2009 20:26:04 +0200 (CEST)
- Subject: Re: [01/15] Introduce get_current_arch () function
Pedro Alves wrote:
> I haven't actually studied the patch set, so sorry if this sounds
> way off, but Tom's remark made me wonder how does this interact with
> re-printing values from the history ($1, $2, $nnn) or convenience
> variables? As in, what would be the arch used to print $nnn? Should it
> be the current arch, or the arch that was used when the value was produced? A
> simple example where it can be a different arch is if you debug
> inferior/target foo, print something, kill/disconnect, debug
> inferior/target 2, reprint value from history.
Typically, the architecture is consulted to retrieve properties the
value inherently has, so using the arch used at value creation seems
correct. However, I'm sure there will be places where using a value
from one arch in the context of another current arch may not work
quite as expected yet ... I didn't attempt to address all these
issues with the current patch series yet.
> I see from the hunk above that the language used is always the
> current language, so it may be right to always use the current arch...
Actually, I'm not sure using the current language is correct
here either ... (In this particular piece of code, it doesn't
seem to matter either way right now, because lookup_typename
only depends on lang/arch when searching for primitive types,
which wchar_t isn't.)
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE