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: RFC: MI - Detecting change of string contents with variable objects


On Friday 22 December 2006 01:23, Nick Roberts wrote:
>  > Why do you need the value_get_print_value function? I think that the right
>  > semantic of -var-update is that it returns all such variable objects for
>  > which the -var-evaluate-expression will return different value before and
>  > after -var-update. -var-evaluate-expression is the only way to get a value
>  > of varobj, so we should be using that, not some similar but different
>  > function.
>  > 
>  > In order words, why can't you just call varobj_get_value instead of
>  > introducing and calling a new function? 
> 
> Because -var-evaluate-expression uses varobj_get_value so they will always
> return the same value?

Then, there are two solutions:

1. Make c_value_of_variable and friends accept struct value as opposed to taking
struct varobj.
2. Extra the part of c_value_of_variable that you've based your function on
into a separate function. Make both c_value_of_variable and install_new_value
call the new function.

I'm not sure which approach you find better, but I don't think copy-pasting is a solution
to anything.

- Volodya


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