Pierre-Marie de Rodat
2520f728b7
Forward VALUE_LVAL when avoiding side effects for STRUCTOP_STRUCT
...
Assume foo_array is a pointer to a C structure. GDB must evaluate the
following expression properly, but it does not currently:
(gdb) print 1 && &foo_array[1].a
Attempt to take address of value not located in memory.
The problem is that in EVAL_AVOID_SIDE_EFFECTS mode,
eval.c:evaluate_subexp_standard always returns a not_lval value as the
result for a STRUCTOP_STRUCT operation. As a consequence, the rest of
the code believes that one cannot take the address of the returned
value.
This patch fixes STRUCTOP_STRUCT handling so that the VALUE_LVAL
attribute for the returned value is properly initialized. After this
change, the above session becomes:
(gdb) print 1 && &foo_array[1].a
$1 = 1
gdb/ChangeLog:
* eval.c (evaluate_subexp_standard) <STRUCTOP_STRUCT>: If
EVAL_AVOID_SIDE_EFFECTS mode, forward the VALUE_LVAL attribute
to the returned value.
gdb/testsuite/ChangeLog:
* gdb.base/nested-addr.c: New file.
* gdb.base/nested-addr.exp: New testcase.
Tested on x86_64-linux, no regression.
2015-10-12 12:22:10 +02:00
..
2015-05-13 09:26:54 -04:00
2015-10-09 12:56:26 +01:00
2015-07-31 20:06:24 +01:00
2015-07-31 20:06:24 +01:00
2015-07-31 20:06:24 +01:00
2015-07-31 20:06:24 +01:00
2015-07-29 17:00:40 -04:00
2015-08-03 11:09:32 -07:00
2015-04-29 12:09:40 -03:00
2015-04-30 10:08:10 +01:00
2015-07-31 20:06:24 +01:00
2015-04-02 13:38:29 +01:00
2015-07-29 11:09:45 +01:00
2015-08-24 15:53:00 +01:00
2015-07-29 11:09:45 +01:00
2015-08-24 15:53:00 +01:00
2015-07-29 11:09:36 +01:00
2015-07-29 11:09:36 +01:00
2015-07-29 11:09:45 +01:00
2015-08-24 15:53:00 +01:00
2015-09-15 13:21:28 -07:00
2015-07-29 11:09:45 +01:00
2015-07-29 11:09:39 +01:00
2015-03-18 10:47:45 +00:00
2015-07-24 16:46:49 -04:00
2015-08-12 12:32:16 -04:00
2015-08-07 17:23:55 +01:00
2015-08-10 12:23:09 -07:00
2015-05-08 12:37:48 +01:00
2015-05-08 13:19:19 -04:00
2015-08-24 15:53:00 +01:00
2015-08-14 21:45:54 -07:00
2015-08-14 21:45:54 -07:00
2015-08-14 21:45:54 -07:00
2015-08-14 21:45:54 -07:00
2015-07-07 16:58:19 +01:00
2015-08-11 17:09:35 -07:00
2015-07-29 11:09:45 +01:00
2015-07-29 11:09:39 +01:00
2015-08-12 13:19:34 -07:00
2015-08-12 13:19:34 -07:00
2015-08-12 13:19:34 -07:00
2015-08-12 13:19:34 -07:00
2015-08-12 13:19:34 -07:00
2015-09-18 12:21:06 -07:00
2015-04-24 22:49:59 +01:00
2015-07-29 11:09:45 +01:00
2015-07-29 11:09:42 +01:00
2015-07-07 16:58:20 +01:00
2015-08-26 13:38:40 -07:00
2015-08-26 13:38:40 -07:00
2015-09-11 11:12:46 -07:00
2015-09-11 11:12:46 -07:00
2015-03-04 14:53:14 +01:00
2015-09-11 11:12:46 -07:00
2015-08-24 15:53:00 +01:00
2015-09-28 13:27:28 -07:00
2015-07-27 12:44:12 -04:00
2015-08-12 11:43:16 -04:00
2015-08-12 11:43:16 -04:00
2015-09-18 09:05:37 -07:00
2015-06-17 11:17:07 +02:00
2015-08-24 15:37:40 +02:00
2015-08-11 17:09:36 -07:00
2015-06-26 11:05:56 -04:00
2015-09-14 15:45:14 +01:00
2015-09-14 15:45:14 +01:00
2015-07-29 11:09:46 +01:00
2015-08-15 13:32:47 -04:00
2015-08-15 13:32:47 -04:00
2015-07-14 10:55:05 +01:00
2015-07-14 10:55:05 +01:00
2015-07-29 16:24:53 +01:00
2015-10-12 12:22:10 +02:00
2015-10-12 12:22:10 +02:00
2015-08-25 08:13:28 -04:00
2015-08-25 08:13:28 -04:00
2015-08-25 08:13:28 -04:00
2015-08-25 08:13:28 -04:00
2015-08-25 08:13:28 -04:00
2015-08-25 08:13:28 -04:00
2015-09-11 11:12:46 -07:00
2015-07-15 14:33:32 +01:00
2015-08-12 11:43:16 -04:00
2015-04-30 09:55:06 +01:00
2015-07-29 11:09:37 +01:00
2015-08-26 20:50:43 -04:00
2015-08-26 20:50:43 -04:00
2015-07-29 11:09:45 +01:00
2015-09-09 11:00:55 -07:00
2015-06-15 12:10:55 +01:00
2015-07-29 11:09:45 +01:00
2015-07-29 11:09:45 +01:00
2015-07-15 08:34:09 -07:00
2015-07-15 08:34:09 -07:00
2015-07-29 11:09:36 +01:00
2015-07-29 11:09:36 +01:00
2015-06-24 14:53:03 +01:00
2015-06-24 14:53:03 +01:00
2015-07-15 08:34:09 -07:00
2015-07-15 08:34:09 -07:00
2015-07-29 11:09:45 +01:00
2015-07-29 11:09:45 +01:00
2015-07-31 20:06:24 +01:00
2015-04-10 10:07:02 +01:00
2015-05-20 21:57:20 +02:00
2015-07-29 11:09:36 +01:00
2015-07-29 11:09:36 +01:00
2015-08-07 17:26:21 +01:00
2015-08-07 17:26:21 +01:00
2015-08-06 23:38:51 +01:00
2015-07-29 11:09:45 +01:00
2015-07-29 11:09:45 +01:00
2015-05-08 12:50:47 +02:00
2015-04-29 12:22:24 -03:00
2015-04-10 16:23:13 +01:00
2015-04-15 12:46:58 +01:00
2015-07-24 15:32:45 -07:00