This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]