vla: allow side effects for subscripts in the sizeof operator

C99 requires the sizeof operator to be evaluated at runtime to retrieve
the size of the vla, reflect this behavior in gdb.

1| void foo (size_t n, int vla[n][n]) {
2| }

(gdb) p sizeof(vla[0])

yields N.

2013-10-18  Sanimir Agovic  <sanimir.agovic@intel.com>
            Keven Boell  <keven.boell@intel.com>

	* eval.c (evaluate_subexp_for_sizeof): Allow side effects for
	argument to sizeof.

Change-Id: I945e8a259e850cc0470faa742a0d2191122ef37b
vla: update type from newly created value

Constructing a value based on a type and address might change the type
of the newly constructed value. Thus re-fetch type via value_type to ensure
we have the correct type at hand.

2013-10-18  Sanimir Agovic  <sanimir.agovic@intel.com>
            Keven Boell  <keven.boell@intel.com>

	* valops.c (value_ind): Re-fetch type from value.
	* value.c (coerce_ref): Re-fetch type from value.

Change-Id: Ice9ae63215f637c4b99babf0f108e7b5b58988cd
dwarf: add DW_OP_push_object_address support to dwarf expression

Added a field to hold the address of a variable length array
object to the baton struct in dwarfloc. With DW_OP_push_obj-
ect_address, a callback function is invoked which returns
the address of the object.

2013-10-22  Sanimir Agovic  <sanimir.agovic@intel.com>

	* dwarf2expr.c (execute_stack_op): Added case for
	DW_OP_push_object_address opcode which returns the VLA
	object address.
	* dwarf2expr.h (get_object_addr): Added function pointer
	which returns the VLA objects' CORE_ADDR.
	* dwarf2loc.c (dwarf_expr_get_obj_addr): Implemented
	callback function for DW_OP_push_object_address and
	added function to virtual method table.
	* dwarf2loc.h (dwarf2_locexpr_baton): Added field to hold
	the address of our object.
	* dwarf2read.c (dwarf_fetch_die_loc_sect_off): Implemented
	value assignment to new field in dwarf2_loc_expr_baton.
	(dwarf2_read_obj_addr): Function implemented
	which returns an object address, if available.
	* dwarf2loc.c (dwarf_expr_get_addr_index):
	Replace struct dwarf2_locexpr_baton with struct
	dwarf_expr_baton.
	(dwarf2_evaluate_loc_desc_full): Initialize obj_address
	to be 0 to not have random values in it.
	* dwarf2loc.h (dwarf2_read_obj_addr): Remove not needed
	wrapper function prototype.
	(struct dwarf_expr_baton): Remove obj_address field.
	* dwarf2read.c: remove not needed wrapper function to get
	obj_address out of baton.
vla: add icc c99 vla support

This patch deals with icc specific dwarf vla entities.

2013-10-22  Sanimir Agovic  <sanimir.agovic@intel.com>

	* dwarf2read.c (set_die_type): Parse and save DW_AT_data_location
	attribute.
	* gdbtypes.c (resolve_dynamic_bounds): Evaluate data location baton
	if present and save its value.
	* gdbtypes.h (struct main_type): Add flag_data_location_is_address
	bitflag and union data_location.
	(TYPE_DATA_LOCATION_BATON): New macro.
	(TYPE_DATA_LOCATION_ADDR): New macro.
	(TYPE_DATA_LOCATION_IS_ADDRESS): New macro.
	* value.c: Include dwarf2loc.h.
	(value_fetch_lazy): Use data location addres to read value from
	memory.

Change-Id: I582d709ca6fa50ca216d2bbd49ccaea36d432f16
Print "dynamic length" string when printing the type of a c VLA

gdb/

2013-08-30  Keven Boell  <keven.boell@intel.com>

	* c-typeprint.c (c_type_print_varspec_suffix): Added
	check for non existing const high bound. If so, print
	"dyanmic length" string to the console instead of
	random length.

Change-Id: I238616814d0baae07b68f80fd61e664b5fbfc4d0
Signed-off-by: Keven Boell <keven.boell@intel.com>
test: evaluate pointers to C99 vla correctly.

2013-10-18  Keven Boell  <keven.boell@intel.com>

gdb/testsuite:
	* gdb.base/vla-ptr.c: New. Test source file
	for testing pointers to VLA's in C.
	* gdb.base/vla-ptr.exp: New. Tests ensure that
	the evaluation of pointers to VLA's work
	correctly in C.

Change-Id: I12695184edc0d9621d658615ea48d783649f813d
Signed-off-by: Keven Boell <keven.boell@intel.com>
test: multi-dimensional c99 vla.

2013-10-18  Keven Boell  <keven.boell@intel.com>
            Sanimir Agovic  <sanimir.agovic@intel.com>

gdb/testsuite:
	* gdb.base/vla-multi.c: New. Test source file
	for testing multi-dimensional VLA's in C.
	* gdb.base/vla-multi.exp: New. Tests ensure
	that multi-dimensional VLA's can be evaluated
	correctly in C.

Change-Id: I2fd81dc113f20eafed363e7a5a0b0a5a6ce155bc
Signed-off-by: Keven Boell <keven.boell@intel.com>
test: basic c99 vla tests

2013-10-18  Keven Boell  <keven.boell@intel.com>

gdb/testsuite:
	* gdb.base/vla-datatypes.c: New. Test source file
	for VLA datatype checks.
	* gdb.base/vla-datatypes.exp: New. Tests ensure that
	a VLA in C can be evaluated correctly with standard
	C types.

Change-Id: I0517c095522f242deeb00a0f1db31f730dbff228
Signed-off-by: Keven Boell <keven.boell@intel.com>
test: add mi vla test

2013-10-18  Keven Boell  <keven.boell@intel.com>

testsuite/gdb.mi/

	* mi-vla-c99.exp: New file.
	* vla.c: New file.

Change-Id: I9827c8b80b3ba33e2ea7a376bc725154e4ece4c6