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] Fix verification of changed values for big values.


>>>>> "Thiago" == Thiago Jung Bauermann <bauerman@br.ibm.com> writes:

Thiago> Right now, GDB calls value_equal when comparing the old and new values
Thiago> of a watchpoint. IMO this is not correct, since that function will call
Thiago> coerce_array and effectively just compare the addresses of arrays being
Thiago> watched.

Thiago> This patch introduces a new value comparison function which works in the
Thiago> mentioned case, and a testcase which fails without the patch and passes
Thiago> with it. Ok to commit?

This makes sense to me.

Thiago> +  return TYPE_CODE (type1) == TYPE_CODE (type2)
Thiago> +    && TYPE_LENGTH (type1) == TYPE_LENGTH (type2)
Thiago> +    && memcmp (value_contents (arg1), value_contents (arg2),
Thiago> +	       TYPE_LENGTH (type1)) == 0;

A style nit: multi-line expressions should be wrapped in parens, and
the continuation lines here should be indented more deeply.

Also, I think value_equal_watchpoint should be in one of the
value-related files.  My reasoning is that I've occasionally run
across code duplication because some function like this was defined in
an obscure place.

Tom


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