gdb: Forward VALUE_LVAL when avoiding side effects for STRUCTOP_STRUCT
authorAndrew Burgess <andrew.burgess@embecosm.com>
Tue, 24 May 2016 15:53:58 +0000 (16:53 +0100)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Fri, 27 May 2016 12:07:15 +0000 (13:07 +0100)
When evaluating an expression with EVAL_AVOID_SIDE_EFFECTS if the value
we return is forced to be of type not_lval then GDB will be unable to
take the address of the returned value.

Instead, we should properly initialise the LVAL of the returned value.

This commit builds on two previous commits 2520f728b710 (Forward
VALUE_LVAL when avoiding side effects for STRUCTOP_STRUCT) and
ac775bf4d35b (gdb: Forward VALUE_LVAL when avoiding side effects for
STRUCTOP_PTR), which in turn build on ac1ca910d74d (Fixes for PR
exp/15364).

This commit is currently untested due to my lack of access to an OpenCL
compiler, however, if follows the same pattern as the first two commits
mentioned above and so I believe that it is correct.

gdb/ChangeLog:

* opencl-lang.c (evaluate_subexp_opencl): If
EVAL_AVOID_SIDE_EFFECTS mode, forward the VALUE_LVAL attribute to
the returned value in the STRUCTOP_STRUCT case.

gdb/ChangeLog
gdb/opencl-lang.c

index 6884c2db3b8c0fa1cb66a70cf945c95c78668898..14da5647739bafb6f765470dad36ea9b9a7c9fc2 100644 (file)
@@ -1,3 +1,9 @@
+2016-05-27  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+       * opencl-lang.c (evaluate_subexp_opencl): If
+       EVAL_AVOID_SIDE_EFFECTS mode, forward the VALUE_LVAL attribute to
+       the returned value in the STRUCTOP_STRUCT case.
+
 2016-05-27  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * eval.c (evaluate_subexp_standard): If EVAL_AVOID_SIDE_EFFECTS
index 779973579049e3cfb73fc4c6e60ec1798dfb3414..767d3bc73e0236dbb2f512a5dce466ae77317fe6 100644 (file)
@@ -984,7 +984,7 @@ Cannot perform conditional operation on vectors with different sizes"));
                                                "structure");
 
            if (noside == EVAL_AVOID_SIDE_EFFECTS)
-             v = value_zero (value_type (v), not_lval);
+             v = value_zero (value_type (v), VALUE_LVAL (v));
            return v;
          }
       }
This page took 0.028686 seconds and 4 git commands to generate.