This is the mail archive of the gdb-patches@sourceware.org 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


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


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