This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
gdb and binutils branch master updated. 58a84dcf29b735ee776536b4c51ba90b51612b71
- From: sagovic at sourceware dot org
- To: gdb-cvs at sourceware dot org
- Date: 11 Apr 2014 12:49:00 -0000
- Subject: gdb and binutils branch master updated. 58a84dcf29b735ee776536b4c51ba90b51612b71
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gdb and binutils".
The branch, master has been updated
via 58a84dcf29b735ee776536b4c51ba90b51612b71 (commit)
via c8655f75e2f0fada311be193e3090087a77ec802 (commit)
via 024e13b46f9c33d151ae82fd9d64c53092fd9313 (commit)
via 1a237e0ee53bbdee97d72d794b5b42e774cc81c0 (commit)
via 504f34326e5ae7c78ebfcdd6ed03c7403b42048b (commit)
via 3bce82377f683870cc89925ff43aefb7dcce4a77 (commit)
via 92b09522dc5a93ba4bda3c1c0b3c58264e357c8a (commit)
via e1969afbd454c09c3aad1990305715f70bc47c3c (commit)
via b86138fb0484f42db6cb83abed1e3d0ad2ec4eac (commit)
via bcd629a44fff61527430f353cf77e20fe3afc395 (commit)
via 04b19544ef6a97b62b2cc4a3170b900e046ab185 (commit)
via 26cb189f8b46dbe7b2d485525329a8919005ca8a (commit)
via 37c1ab67a35025d37d42c449deab5f254f9f59da (commit)
via 729efb13174d6522fba4aa7ab273e7f25a253c47 (commit)
via 0c9c3474029f5250b428274eaf63f7a349c6fc5f (commit)
from 85cf705b9d4c2082e5c4a41126bf773ff435d3d2 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=58a84dcf29b735ee776536b4c51ba90b51612b71
commit 58a84dcf29b735ee776536b4c51ba90b51612b71
Author: Sanimir Agovic <sanimir.agovic@intel.com>
Date: Fri Nov 15 12:48:00 2013 +0000
test: add mi vla test
testsuite/gdb.mi/
* mi-vla-c99.exp: New file.
* vla.c: New file.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=c8655f75e2f0fada311be193e3090087a77ec802
commit c8655f75e2f0fada311be193e3090087a77ec802
Author: Sanimir Agovic <sanimir.agovic@intel.com>
Date: Fri Nov 15 12:47:47 2013 +0000
test: basic c99 vla tests for C primitives
gdb/testsuite:
* gdb.base/vla-datatypes.c: New file.
* gdb.base/vla-datatypes.exp: New file.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=024e13b46f9c33d151ae82fd9d64c53092fd9313
commit 024e13b46f9c33d151ae82fd9d64c53092fd9313
Author: Sanimir Agovic <sanimir.agovic@intel.com>
Date: Fri Nov 15 12:47:44 2013 +0000
test: evaluate pointers to C99 vla correctly.
gdb/testsuite:
* gdb.base/vla-ptr.c: New file.
* gdb.base/vla-ptr.exp: New file.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=1a237e0ee53bbdee97d72d794b5b42e774cc81c0
commit 1a237e0ee53bbdee97d72d794b5b42e774cc81c0
Author: Sanimir Agovic <sanimir.agovic@intel.com>
Date: Fri Nov 15 12:47:32 2013 +0000
test: multi-dimensional c99 vla.
gdb/testsuite:
* gdb.base/vla-multi.c: New file.
* gdb.base/vla-multi.exp: New file.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=504f34326e5ae7c78ebfcdd6ed03c7403b42048b
commit 504f34326e5ae7c78ebfcdd6ed03c7403b42048b
Author: Sanimir Agovic <sanimir.agovic@intel.com>
Date: Tue Nov 26 14:47:16 2013 +0000
test: cover subranges with present DW_AT_count attribute
The dwarf attribute DW_AT_count specifies the elements of a subrange.
This test covers subranges with present count but absent upper bound
attribute, both with static and dynamic attribute values.
testsuite:
* gdb.dwarf2/count.exp: New file.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=3bce82377f683870cc89925ff43aefb7dcce4a77
commit 3bce82377f683870cc89925ff43aefb7dcce4a77
Author: Sanimir Agovic <sanimir.agovic@intel.com>
Date: Wed Feb 5 16:22:08 2014 +0000
vla: evaluate operand of sizeof if its type is a vla
The c99 standard in "6.5.3.4 The sizeof operator" states:
If the type of the operand is a variable length array type, the operand
is evaluated;[...]
This patch mirrors the following c99 semantic in gdb:
1| int vla[n][m];
2| int i = 1;
3| sizeof(vla[i++][0]); // No sideffect
4| assert (i == 1);
5| sizeof(vla[i++]); // With sideffect
6| assert (i == 2);
Note: ptype/whatsis still do not allow any sideeffects.
This patch was motivated by:
https://sourceware.org/ml/gdb-patches/2014-01/msg00732.html
* eval.c (evaluate_subexp_for_sizeof): Add enum noside argument.
(evaluate_subexp_standard): Pass noside argument.
(evaluate_subexp_for_sizeof) <BINOP_SUBSCRIPT>: Handle subscript case
if noside equals EVAL_NORMAL. If the subscript yields a vla type
re-evaluate subscript operation with EVAL_NORMAL to enable sideffects.
* gdbtypes.c (resolve_dynamic_bounds): Mark bound as evaluated.
* gdbtypes.h (enum range_flags): Add RANGE_EVALUATED case.
testsuite/gdb.base/
* vla-sideeffect.c: New file.
* vla-sideeffect.exp: New file.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=92b09522dc5a93ba4bda3c1c0b3c58264e357c8a
commit 92b09522dc5a93ba4bda3c1c0b3c58264e357c8a
Author: Sanimir Agovic <sanimir.agovic@intel.com>
Date: Tue Nov 26 14:35:43 2013 +0000
vla: resolve dynamic bounds if value contents is a constant byte-sequence
A variable location might be a constant value and therefore no inferior memory
access is needed to read the content. In this case try to resolve the type
bounds.
* findvar.c (default_read_var_value): Resolve dynamic bounds if location
points to a constant blob.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e1969afbd454c09c3aad1990305715f70bc47c3c
commit e1969afbd454c09c3aad1990305715f70bc47c3c
Author: Sanimir Agovic <sanimir.agovic@intel.com>
Date: Tue Nov 19 12:54:24 2013 +0000
vla: support for DW_AT_count
This patch adds support for DW_AT_count as requested in the code review:
https://sourceware.org/ml/gdb-patches/2013-11/msg00200.html
* dwarf2read.c (read_subrange_type): Convert DW_AT_count to a dynamic
property and store it as the high bound and flag the range accordingly.
* gdbtypes.c (resolve_dynamic_bounds): If range is flagged as
RANGE_UPPER_BOUND_IS_COUNT assign low + high - 1 as the new high bound.
* gdbtypes.h (enum range_flags): New enum.
(struct range_bounds): Add flags member.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=b86138fb0484f42db6cb83abed1e3d0ad2ec4eac
commit b86138fb0484f42db6cb83abed1e3d0ad2ec4eac
Author: Sanimir Agovic <sanimir.agovic@intel.com>
Date: Thu Nov 14 09:55:52 2013 +0000
vla: print "variable length" for unresolved dynamic bounds
1| void foo (size_t n) {
2| int vla[n];
3| }
Given the following expression
(gdb) ptype &vla
Gdb evaluates the expression with EVAL_AVOID_SIDE_EFFECTS and thus
does not resolve the bounds information and misinterprets the high
bound as a constant. The current output is:
type = int (*)[1289346]
this patch deals with this case and prints:
type = int (*)[variable length]
instead.
* c-typeprint.c (c_type_print_varspec_suffix): Added
check for not yet resolved high bound. If unresolved, print
"variable length" string to the console instead of random
length.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=bcd629a44fff61527430f353cf77e20fe3afc395
commit bcd629a44fff61527430f353cf77e20fe3afc395
Author: Sanimir Agovic <sanimir.agovic@intel.com>
Date: Mon Oct 14 08:36:13 2013 +0100
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.
* ada-lang.c (ada_value_primitive_packed_val): Re-fetch type from value.
(ada_template_to_fixed_record_type_1): Likewise.
(ada_to_fixed_type_1): Likewise.
* cp-valprint.c (cp_print_value_fields_rtti): Likewise.
(cp_print_value): Likewise.
* d-valprint.c (dynamic_array_type): Likewise.
* eval.c (evaluate_subexp_with_coercion): Likewise.
* findvar.c (address_of_variable): Likewise.
* jv-valprint.c (java_value_print): Likewise.
* valops.c (value_ind): Likewise.
* value.c (coerce_ref): Likewise.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=04b19544ef6a97b62b2cc4a3170b900e046ab185
commit 04b19544ef6a97b62b2cc4a3170b900e046ab185
Author: Sanimir Agovic <sanimir.agovic@intel.com>
Date: Sat Oct 12 12:36:16 2013 +0100
vla: enable sizeof operator for indirection
This patch enables the sizeof operator for indirections:
1| void foo (size_t n) {
2| int vla[n];
3| int *vla_ptr = &vla;
4| }
(gdb) p sizeof(*vla_ptr)
yields sizeof (size_t) * n.
* eval.c (evaluate_subexp_for_sizeof) <UNOP_IND>: Create an indirect
value and retrieve the dynamic type size.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=26cb189f8b46dbe7b2d485525329a8919005ca8a
commit 26cb189f8b46dbe7b2d485525329a8919005ca8a
Author: Sanimir Agovic <sanimir.agovic@intel.com>
Date: Wed Oct 9 15:28:22 2013 +0100
vla: enable sizeof operator to work with variable length arrays
In C99 the sizeof operator computes the size of a variable length array
at runtime (6.5.3.4 The sizeof operator). This patch reflects the semantic
change in the debugger.
We now are able to get the size of a vla:
1| void foo (size_t n) {
2| int vla[n];
3| }
(gdb) p sizeof(vla)
yields N * sizeof(int).
* eval.c (evaluate_subexp_for_sizeof) <OP_VAR_VALUE>: If the type
passed to sizeof is dynamic evaluate the argument to compute the length.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=37c1ab67a35025d37d42c449deab5f254f9f59da
commit 37c1ab67a35025d37d42c449deab5f254f9f59da
Author: Sanimir Agovic <sanimir.agovic@intel.com>
Date: Wed Oct 9 15:28:22 2013 +0100
type: add c99 variable length array support
The dwarf standard allow certain attributes to be expressed as dwarf
expressions rather than constants. For instance upper-/lowerbound attributes.
In case of a c99 variable length array the upperbound is a dynamic attribute.
With this change c99 vla behave the same as with static arrays.
1| void foo (size_t n) {
2| int ary[n];
3| memset(ary, 0, sizeof(ary));
4| }
(gdb) print ary
$1 = {0 <repeats 42 times>}
* dwarf2loc.c (dwarf2_locexpr_baton_eval): New function.
(dwarf2_evaluate_property): New function.
* dwarf2loc.h (dwarf2_evaluate_property): New function prototype.
* dwarf2read.c (attr_to_dynamic_prop): New function.
(read_subrange_type): Use attr_to_dynamic_prop to read high bound
attribute.
* gdbtypes.c: Include dwarf2loc.h.
(is_dynamic_type): New function.
(resolve_dynamic_type): New function.
(resolve_dynamic_bounds): New function.
(get_type_length): New function.
(check_typedef): Use get_type_length to compute type length.
* gdbtypes.h (TYPE_HIGH_BOUND_KIND): New macro.
(TYPE_LOW_BOUND_KIND): New macro.
(is_dynamic_type): New function prototype.
* value.c (value_from_contents_and_address): Call resolve_dynamic_type
to resolve dynamic properties of the type. Update comment.
* valops.c (get_value_at, value_at, value_at_lazy): Update comment.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=729efb13174d6522fba4aa7ab273e7f25a253c47
commit 729efb13174d6522fba4aa7ab273e7f25a253c47
Author: Sanimir Agovic <sanimir.agovic@intel.com>
Date: Tue Oct 8 15:04:49 2013 +0100
vla: introduce new bound type abstraction adapt uses
The rational behind this patch is to get started to implement the feature
described in dwarf4 standard (2.19) Static and Dynamic Values of Attributes.
It adds new BOUND_PROP to store either a constant, exprloc, or reference to
describe an upper-/lower bound of a subrange. Other than that no new features
are introduced.
* dwarf2read.c (read_subrange_type): Use struct bound_prop for
declaring high/low bounds and change uses accordingly. Call
create_range_type instead of create_static_range_type.
* gdbtypes.c (create_range_type): New function.
(create_range_type): Convert bounds into struct bound_prop and pass
them to create_range_type.
* gdbtypes.h (struct bound_prop): New struct.
(create_range_type): New function prototype.
(struct range_bounds): Use struct bound_prop instead of LONGEST for
high/low bounds. Remove low_undefined/high_undefined and adapt all uses.
(TYPE_LOW_BOUND,TYPE_HIGH_BOUND): Adapt macros to refer to the static
part of the bound.
* parse.c (follow_types): Set high bound kind to BOUND_UNDEFINED.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=0c9c3474029f5250b428274eaf63f7a349c6fc5f
commit 0c9c3474029f5250b428274eaf63f7a349c6fc5f
Author: Sanimir Agovic <sanimir.agovic@intel.com>
Date: Thu Dec 19 08:31:17 2013 +0000
refactoring: rename create_range_type to create_static_range_type
* gdbtypes.c (create_static_range_type): Renamed from create_range_type.
* gdbtypes.h (create_static_range_type): Renamed from create_range_type.
* ada-lang.c: All uses of create_range_type updated.
* coffread.c: All uses of create_range_type updated.
* dwarf2read.c: All uses of create_range_type updated.
* f-exp.y: All uses of create_range_type updated.
* m2-valprint.c: All uses of create_range_type updated.
* mdebugread.c: All uses of create_range_type updated.
* stabsread.c: All uses of create_range_type updated.
* valops.c: All uses of create_range_type updated.
* valprint.c: All uses of create_range_type updated.
-----------------------------------------------------------------------
Summary of changes:
gdb/ChangeLog | 106 ++++++++++++
gdb/ada-lang.c | 44 +++--
gdb/c-typeprint.c | 6 +-
gdb/coffread.c | 6 +-
gdb/cp-valprint.c | 2 +
gdb/d-valprint.c | 1 +
gdb/dwarf2loc.c | 119 +++++++++++++
gdb/dwarf2loc.h | 28 +++
gdb/dwarf2read.c | 159 ++++++++++++------
gdb/eval.c | 54 ++++++-
gdb/f-exp.y | 9 +-
gdb/findvar.c | 12 ++-
gdb/gdbtypes.c | 264 +++++++++++++++++++++--------
gdb/gdbtypes.h | 78 +++++++--
gdb/jv-valprint.c | 1 +
gdb/m2-valprint.c | 2 +-
gdb/mdebugread.c | 4 +-
gdb/parse.c | 3 +-
gdb/stabsread.c | 11 +-
gdb/testsuite/ChangeLog | 29 +++
gdb/testsuite/gdb.base/vla-datatypes.c | 86 ++++++++++
gdb/testsuite/gdb.base/vla-datatypes.exp | 139 +++++++++++++++
gdb/testsuite/gdb.base/vla-multi.c | 48 ++++++
gdb/testsuite/gdb.base/vla-multi.exp | 41 +++++
gdb/testsuite/gdb.base/vla-ptr.c | 58 +++++++
gdb/testsuite/gdb.base/vla-ptr.exp | 41 +++++
gdb/testsuite/gdb.base/vla-sideeffect.c | 42 +++++
gdb/testsuite/gdb.base/vla-sideeffect.exp | 89 ++++++++++
gdb/testsuite/gdb.dwarf2/count.exp | 125 ++++++++++++++
gdb/testsuite/gdb.mi/mi-vla-c99.exp | 82 +++++++++
gdb/testsuite/gdb.mi/vla.c | 37 ++++
gdb/valops.c | 35 +++--
gdb/valprint.c | 2 +-
gdb/value.c | 20 ++-
34 files changed, 1594 insertions(+), 189 deletions(-)
create mode 100644 gdb/testsuite/gdb.base/vla-datatypes.c
create mode 100644 gdb/testsuite/gdb.base/vla-datatypes.exp
create mode 100644 gdb/testsuite/gdb.base/vla-multi.c
create mode 100644 gdb/testsuite/gdb.base/vla-multi.exp
create mode 100644 gdb/testsuite/gdb.base/vla-ptr.c
create mode 100644 gdb/testsuite/gdb.base/vla-ptr.exp
create mode 100644 gdb/testsuite/gdb.base/vla-sideeffect.c
create mode 100644 gdb/testsuite/gdb.base/vla-sideeffect.exp
create mode 100644 gdb/testsuite/gdb.dwarf2/count.exp
create mode 100644 gdb/testsuite/gdb.mi/mi-vla-c99.exp
create mode 100644 gdb/testsuite/gdb.mi/vla.c
hooks/post-receive
--
gdb and binutils