This is the mail archive of the gdb@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: RE: -var-update using formatted value


 >     Update stored value when format changes.
 >     
 >     	* varobj.c (varobj_set_display_format): Recomputed
 >     	print_value.
 >     	(c_value_of_variable): Return print_value.
 > 
 > diff --git a/gdb/varobj.c b/gdb/varobj.c
 > index d078bef..b0eb11a 100644
 > --- a/gdb/varobj.c
 > +++ b/gdb/varobj.c
 > @@ -677,6 +677,13 @@ varobj_set_display_format (struct varobj *var,
 >        var->format = variable_default_display (var);
 >      }
 >  
 > +  if (varobj_value_is_changeable_p (var) 
 > +      && var->value && !value_lazy (var->value))
 > +    {
 > +      free (var->print_value);
 > +      var->print_value = value_get_print_value (var->value, var->format);
 > +    }
 > +
 >    return var->format;
 >  }
 >
 > @@ -2260,7 +2267,7 @@ c_value_of_variable (struct varobj *var)
 >  
 >  	    gdb_assert (varobj_value_is_changeable_p (var));
 >  	    gdb_assert (!value_lazy (var->value));
 > -	    return value_get_print_value (var->value, var->format);
 > +	    return strdup (var->print_value);
 >  	  }
 >        }
 >      }

I don't like this change.  If I change the format to hexadecimal, 11 -> 0xb
say, the display should change, so I would like GDB to report it through
-var-update.

-- 
Nick                                           http://www.inet.net.nz/~nickrob


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