This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
gdb and binutils branch master updated. cac0dc8f4b0688771a4ab8a4012fceb1323167f1
- From: brobecke at sourceware dot org
- To: gdb-cvs at sourceware dot org
- Date: 28 Apr 2014 19:48:42 -0000
- Subject: gdb and binutils branch master updated. cac0dc8f4b0688771a4ab8a4012fceb1323167f1
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 cac0dc8f4b0688771a4ab8a4012fceb1323167f1 (commit)
via 11c1ba785203f7f121324fa9727c2adbbc2119c2 (commit)
via 8739bc53cd91cc38287432b1fb880be327c9435c (commit)
via 6f8a3220a931ac052fedd75539058bd8aa97b3a8 (commit)
from 4d072ce478ebb605b2f0ca326c7c3168d4ee5989 (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=cac0dc8f4b0688771a4ab8a4012fceb1323167f1
commit cac0dc8f4b0688771a4ab8a4012fceb1323167f1
Author: Joel Brobecker <brobecker@adacore.com>
Date: Sat Apr 19 22:19:02 2014 -0700
Add gdb.ada/dyn_arrayidx testcase.
This add a testcases that verifies correct handling of dynamicity
for lower bounds of arrays.
gdb/testsuite/ChangeLog:
* gdb.ada/dyn_arrayidx: New testcase.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=11c1ba785203f7f121324fa9727c2adbbc2119c2
commit 11c1ba785203f7f121324fa9727c2adbbc2119c2
Author: Joel Brobecker <brobecker@adacore.com>
Date: Sat Apr 19 20:41:56 2014 -0700
dwarf2read.c::read_subrange_type: Handle dynamic lower bounds
Currently, read_subrange_type handles dynamicity only in the case of
the upper bound, and assumes that the lower bound is always static.
That's rooted in the fact that dynamicity was added to support C99
variable-length arrays, where the lower bound is always zero, and
therefore never dynamic. But the lower bound can, in fact, be dynamic
in other languages such as Ada.
Consider for instance the following declaration in Ada...
type Array_Type is array (L .. U) of Natural;
... where L and U are parameters of the function where the declaration
above was made, and whose value are 5 and 10. Currently, the debugger
is able to print the value of the upper bound correctly, but not the
lower bound:
(gdb) ptype array_type
type = array (1 .. 10) of natural
After this patch, the debugger now prints:
(gdb) ptype array_type
type = array (5 .. 10) of natural
gdb/ChangeLog:
* dwarf2read.c (read_subrange_type): Handle dynamic
DW_AT_lower_bound attributes.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=8739bc53cd91cc38287432b1fb880be327c9435c
commit 8739bc53cd91cc38287432b1fb880be327c9435c
Author: Joel Brobecker <brobecker@adacore.com>
Date: Sat Apr 19 09:55:14 2014 -0700
Improve Ada dynamic range type handling.
Consider the following declaration in Ada...
type Array_Type is array (L .. U) of Natural;
... where L and U are parameters of the function where the declaration
above was made. At the moment, GDB relies on descriptive types in order
to properly decode the array bounds. For instance, if L was 5, and U
was 10, we would see the following:
(gdb) ptype array_type
type = array (5 .. 10) of natural
(gdb) maintenance set ada ignore-descriptive-types
(gdb) ptype array_type
type = array (1 .. 28544912) of natural
This patch enhances ada_discrete_type_{high,low}_bound to resolve
any dynamicity. This is sufficient to fix the case of the upper bound.
For the lower bound, the dwarf2read module does not handle dynamic
lower bounds yet, but once it does, the lower bound should be correctly
handled as well [1].
gdb/ChangeLog:
* ada-lang.c (ada_discrete_type_high_bound): Resolve the type's
dynamic bounds before computing its upper bound.
(ada_discrete_type_low_bound): Same as above with the lower bound.
[1]: The reason why we do not enhance dwarf2read to handle dynamic
lower bounds ahead of this patch is because it unveils some latent
issues such as this one.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6f8a3220a931ac052fedd75539058bd8aa97b3a8
commit 6f8a3220a931ac052fedd75539058bd8aa97b3a8
Author: Joel Brobecker <brobecker@adacore.com>
Date: Sat Apr 19 09:40:53 2014 -0700
Enhance dwarfread.c::resolve_dynamic_type to resolve dynamic ranges
This change breaks down the resolve_dynamic_bounds function which
works only on arrays and its index range types into two functions,
one that resolves range types, and one that resolves arrays (using
the new routine to resolve the array's index range type). The
is_dynamic_type and resolve_dynamic_type function are then re-organized
to handle range types as well.
One small change worth mentioning is the fact that, now that range
types are resolved on their own (rather than in the limited context
of array index types), the resolved range types are created from
a copy of the dynamic range type, rather than from scratch (first
parameter of create_range_type). This allows us to preserve as many
original properties in the resolved type as possible (Eg. the type's
name).
This is preparation work that will help better support dynamic range
types for languages that allow the declaration of such types (Eg. Ada).
gdb/ChangeLog:
* dwarf2read.c (is_dynamic_type): Return true for dynamic
range types. Adjust the array handling implementation to
take advantage of this change.
(resolve_dynamic_range): New function, mostly extracted from
resolve_dynamic_bounds.
(resolve_dynamic_array): New function, mostly extracted from
resolve_dynamic_bounds.
(resolve_dynamic_bounds): Delete.
(resolve_dynamic_type): Reimplement. Add handling of
TYPE_CODE_RANGE types.
-----------------------------------------------------------------------
Summary of changes:
gdb/ChangeLog | 24 ++++++
gdb/ada-lang.c | 2 +
gdb/dwarf2read.c | 6 +-
gdb/gdbtypes.c | 113 ++++++++++++++++-----------
gdb/testsuite/ChangeLog | 4 +
gdb/testsuite/gdb.ada/dyn_arrayidx.exp | 36 +++++++++
gdb/testsuite/gdb.ada/dyn_arrayidx/foo.adb | 32 ++++++++
7 files changed, 166 insertions(+), 51 deletions(-)
create mode 100644 gdb/testsuite/gdb.ada/dyn_arrayidx.exp
create mode 100644 gdb/testsuite/gdb.ada/dyn_arrayidx/foo.adb
hooks/post-receive
--
gdb and binutils