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]

dead code in varobj.c:c_value_of_variable ?


Hello,

I noticed that c_value_of_variable is really only called via
the "value_of_variable" varobj callback, which is only called
from my_value_of_variable. And the code in my_value_of_variable
is:

        if (var->pretty_printer)
          return value_get_print_value (var->value, var->format, var);
        return (*var->root->lang->value_of_variable) (var, format);

And therefore, it seems to me that the following code in
c_value_of_variable is dead:

  /* If we have a custom formatter, return whatever string it has
     produced.  */
  if (var->pretty_printer && var->print_value)
    return xstrdup (var->print_value);

If we reach this function var->pretty_printer should always be false.

Purely at the design level, this kind of makes sense to me, since
I would expect the pretty-printer to be language-independent and
always override whatever the language might want to do....

-- 
Joel


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