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: [PATCH 2/2] Remove parameter valaddr from la_val_print


Yao Qi wrote:

> Nowadays, we pass both val and return value of
> value_contents_for_printing (val) to la_val_print.  The latter is
> unnecessary.  This patch removes the second parameter of la_val_print,
> and get valaddr in each language's implementation by calling
> value_contents_for_printing_const.  This change makes a little
> difference, because value_contents_for_printing calls value_fetch_lazy
> additionally, so I call value_fetch_lazy in the caller of val_print
> if needed.

Can you explain why all those value_fetch_lazy calls are needed?
Did you add them only to keep the behavior the same as currently,
or does printing not work correctly if they are omitted?

I think we should *avoid* those calls as far as possible, since
they will cause data to be read from the target, which may in fact
not be necessary for this particular print operation (e.g. if only
a subobject is printed).

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  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]