vla: changed string length semantic.

This patch changes the semantic of the Dwarf string length
attribute to reflect the standard. This serves as pre-work
to get variable strings in Fortran to work.

2014-05-28  Keven Boell  <keven.boell@intel.com>
            Sanimir Agovic  <sanimir.agovic@intel.com>

	* dwarf2read.c (read_tag_string_type): changed
	semantic of DW_AT_string_length to be able to
	handle Dwarf blocks as well. Support for
	DW_AT_byte_length added to get correct length
	if specified in combination with
	DW_AT_string_length.
	(attr_to_dynamic_prop): added
	functionality to add Dwarf operators to baton
	data attribute. Added post values to baton
	as required by the string evaluation case.
	(read_subrange_type): Adapt caller.
	(set_die_type): Adapt caller.
	(add_post_values_to_baton): New function.
	* dwarf2loc.c (dwarf2_evaluate_property): Evaluate
	post processing dwarf.
	* dwarf2loc.h (struct dwarf2_property_baton): Add
	post dwarf values attribute.

Change-Id: I6edfa005f416cddc8e364d34891b9abf6b44f757
vla: get Fortran dynamic strings working.

This patch enables the correct calculation of dynamic
string length.

Old:
(gdb) p my_dyn_string
$1 = (PTR TO -> ( character*23959136 )) 0x605fc0

(gdb) p *my_dyn_string
Cannot access memory at address 0x605fc0

New:
(gdb) p my_dyn_string
$1 = (PTR TO -> ( character*10 )) 0x605fc0

(gdb) p *my_dyn_string
$2 = 'foo'

2014-05-28  Keven Boell  <keven.boell@intel.com>
            Sanimir Agovic  <sanimir.agovic@intel.com>

	* gdbtypes.c (resolve_dynamic_type): Add
	conditions to support string types.
	(resolve_dynamic_array): Add conditions for dynamic
	strings and create a new string type.
	(is_dynamic_type): Follow pointer if a string type
	was detected, as Fortran strings are represented
	as pointers to strings internally.

Change-Id: I7d54d762a081ce034be37ac3e368bac8111dc4e6
vla: add stride support to fortran arrays.

2014-05-28  Sanimir Agovic  <sanimir.agovic@intel.com>
            Keven Boell  <keven.boell@intel.com>

	* dwarf2read.c (read_subrange_type): Read dynamic
	stride attributes.
	* gdbtypes.c (create_array_type_with_stride): Add
	stride support
	(create_range_type): Add stride parameter.
	(create_static_range_type): Pass default stride
	parameter.
	(resolve_dynamic_range): Evaluate stride baton.
	(resolve_dynamic_type): Adjust data location with
	the value of byte stride.
	* gdbtypes.h (TYPE_BYTE_STRIDE): New macro.
	(TYPE_BYTE_STRIDE_BLOCK): New macro.
	(TYPE_BYTE_STRIDE_LOCLIST): New macro.
	(TYPE_BYTE_STRIDE_KIND): New macro.
	* valarith.c (value_subscripted_rvalue): Use stride.

Change-Id: I3d810c0dc37f9d9fd84dba4c764cdefc52d8501e
vla: add NEWS entry for dynamic array support

2014-06-27  Keven Boell  <keven.boell@intel.com>
            Sanimir Agovic  <sanimir.agovic@intel.com>

	* NEWS: add entry for dynamic array support
	in Fortran.

Change-Id: I0cb3b118e834fca36bc9047d57daf3dd915c11a9
test: basic tests for dynamic array evaluations in Fortran.

Tests ensure that values of Fortran dynamic arrays
can be evaluated correctly in various ways and states.

2014-05-28  Keven Boell  <keven.boell@intel.com>
            Sanimir Agovic  <sanimir.agovic@intel.com>

testsuite/gdb.fortran/:

	* vla.f90: New file.
	* vla-value.exp: New file.

Change-Id: I0229c3b58f72ae89c2ee42d1219e4538cb6bf023
test: evaluate dynamic arrays using Fortran primitives.

Tests ensure that Fortran primitives can be evaluated
correctly when used as a dynamic array.

2014-05-28  Keven Boell  <keven.boell@intel.com>
            Sanimir Agovic  <sanimir.agovic@intel.com>

testsuite/gdb.fortran/:

	* vla-datatypes.f90: New file.
	* vla-datatypes.exp: New file.

Change-Id: I8e82fa3833d77bfd7e9b4bdc40e3f96ce5e72da2
test: dynamic arrays passed to subroutines.

Tests dynamic arrays passed to subroutines and handled
in different ways inside the routine.

2014-05-28  Keven Boell  <keven.boell@intel.com>
            Sanimir Agovic  <sanimir.agovic@intel.com>

testsuite/gdb.fortran/:

	* vla-sub.f90: New file.
	* vla-ptype-sub.exp: New file.
	* vla-value-sub-arbitrary.exp: New file.
	* vla-value-sub-finish.exp: New file.
	* vla-value-sub.exp: New file.

Change-Id: I76db950fbacbf15b1f5e887bfd164eb8f85c55d1
test: correct ptype of dynamic arrays in Fortran.

Tests ensure that the ptype of dynamic arrays in
Fortran can be printed in GDB correctly.

2014-05-28  Keven Boell  <keven.boell@intel.com>
            Sanimir Agovic  <sanimir.agovic@intel.com>

testsuite/gdb.fortran/:

	* vla-ptype.exp: New file.

Change-Id: I508a0537be7cac5739a263788be89b18e84d8f8f
test: evaluating allocation/association status

Tests ensure that dynamic arrays in different states
(allocated/associated) can be evaluated.

2014-05-28  Keven Boell  <keven.boell@intel.com>
            Sanimir Agovic  <sanimir.agovic@intel.com>

testsuite/gdb.fortran/:

	* vla-alloc-assoc.exp: New file.

Change-Id: I6950473c3f1724ebf5c7b037706186b2cd6af5f0
test: dynamic arrays passed to functions.

Tests for dynamic arrays passed to functions
and returned from functions.

2014-05-28  Keven Boell  <keven.boell@intel.com>
            Sanimir Agovic  <sanimir.agovic@intel.com>

testsuite/gdb.fortran/:

	* vla-func.f90: New file.
	* vla-func.exp: New file.

Change-Id: Ic3eb212f35f599e4c10a284c23125491653b17df
test: accessing dynamic array history values.

Tests if the history values of dynamic arrays can be
accessed and printed again with the correct values.

2014-05-28  Keven Boell  <keven.boell@intel.com>
            Sanimir Agovic  <sanimir.agovic@intel.com>

testsuite/gdb.fortran/:

	* vla-history.exp: New file.

Change-Id: Ib6d2d30272aefc24b6db5fa0633fe72274390e91
test: dynamic string evaluations.

Tests various dynamic string evaluations. Dynamic strings
will be handled internally the same way as dynamic arrays.

2014-05-28  Keven Boell  <keven.boell@intel.com>
            Sanimir Agovic  <sanimir.agovic@intel.com>

testsuite/gdb.fortran/:

	* vla-strings.f90: New file.
	* vla-strings.exp: New file.

Change-Id: Ib2f3dded2fbc5f0a9684050c5cfa22a450e18358
test: basic MI test for the dynamic array support.

Tests dynamic array evaluations using MI protocol.

2014-05-28  Keven Boell  <keven.boell@intel.com>
            Sanimir Agovic  <sanimir.agovic@intel.com>

testsuite/gdb.mi/:

	* mi-vla-fortran.exp: New file.
	* vla.f90: New file.

Change-Id: I37caa85b1498478f5eff0f52d3fd431388aaab6f
test: test sizeof for dynamic fortran arrays.

Tests sizeof output of dynamic arrays in various states.

2014-05-28  Keven Boell  <keven.boell@intel.com>
            Sanimir Agovic  <sanimir.agovic@intel.com>

testsuite/gdb.fortran/:

	* vla-sizeof.exp: New file.

Change-Id: I68d81d03ff2daa32ab87d2750873652d684e7389
test: stride support for dynamic arrays.

Tests the usage of stride values in dynamic arrays.

2014-05-28  Sanimir Agovic  <sanimir.agovic@intel.com>
            Keven Boell  <keven.boell@intel.com>

testsuite/gdb.fortran/:

	* vla-stride.exp: New file.
	* vla-stride.f90: New file.

Change-Id: Ic4f68cf97046cc9f5f3664fe4c12d2b7528c22ee
vla: fix typedef vla in C99

Fixes wrong evaluation of typedef VLA in C.

E.g.
typedef char array_t[size];
array_t array;

Before:
(gdb) p array[0]
$1 = -127

After:
(gdb) p array[1]
$1 = 1

2014-06-30  Keven Boell  <keven.boell@intel.com>
            Sanimir Agovic  <sanimir.agovic@intel.com>

	* value.c (coerce_ref): Fetch lazy value in case
	of an VLA.

Change-Id: I8ef21243bec2c1f48c73c66d22b7ed8cd2290d52