[patch] fix pre-/post- in-/decrement

Ken Werner ken@linux.vnet.ibm.com
Thu Oct 7 12:38:00 GMT 2010


On Monday, October 04, 2010 9:46:50 pm Ken Werner wrote:
> The attached patch introduces a new function called value_non_lval that
> returns a non-lval version of the given value. This function is called
> prior the simple assignment, compound assignment and pre/postfix routines
> return. Any comments are appreciated.

I overlooked that in case of C++ the various assignment, pre-increment and  
pre-decrement operators return lvalues while they return non-lvalues for C.
I've updated the patch to respect this. 
The patch also depends on non-lazy return values:
http://sourceware.org/ml/gdb-patches/2010-10/msg00082.html since calls of 
value_non_lval may trigger unnecessary reads from the target as mentioned 
here:
http://sourceware.org/ml/gdb-patches/2010-10/msg00030.html .
Tested on i686-*-linux-gnu with no regressions.

Regards
Ken
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pre_post_in_decrement.patch
Type: text/x-patch
Size: 5860 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20101007/9073682b/attachment.bin>


More information about the Gdb-patches mailing list