From: Sanimir Agovic <sanimir.agovic@intel.com>
To: brobecker@adacore.com
Cc: gdb-patches@sourceware.org, tromey@redhat.com
Subject: [PATCH v6 00/15] Please have a final look
Date: Thu, 10 Apr 2014 12:42:00 -0000 [thread overview]
Message-ID: <1397133617-26681-1-git-send-email-sanimir.agovic@intel.com> (raw)
Hello,
this patch series (v6) add C99 variable length support to gdb.
Current status
==============
TYPE_CODE_PTR types are not considered as being dynamic, otherwise all issues
are addressed mentioned by Joel:
#03 | type: add c99 variable length array support
Minor adjustments like usage of bitfields and dealing with LOC_CONST values:
#09 | vla: resolve dynamic bounds if value contents is a constant byte-seq
#08 | vla: support for DW_AT_count
#10 | vla: evaluate operand of sizeof if its type is a vla
Pre-approved with minor adjustments:
#01 | refactoring: rename create_range_type to create_static_range_type
#02 | vla: introduce new bound type abstraction adapt uses
#04 | vla: enable sizeof operator to work with variable length arrays
#05 | vla: enable sizeof operator for indirection
#06 | vla: update type from newly created value
#07 | vla: print "variable length" for unresolved dynamic bounds
#11 | test: cover subranges with present DW_AT_count attribute
#12 | test: multi-dimensional c99 vla
#13 | test: evaluate pointers to C99 vla correctly
#14 | test: basic c99 vla tests for C primitives
#15 | test: add mi vla test
Some technical background
=========================
Dwarf allows certain attributes e.g upper/lower bound to be computed
dynamically. To support this feature with the current gdb type-system types
are "normalized". This means types with dynamic properties are converted
to types with static properties.
To convert a type with dynamic properties into one with static properties
access to inferior memory is needed. Therefore we hooked into the following
value constructors value_at/value_at_lazy/value_from_contents_and_address
as they require an inferior address in addition to a type to instantiate
a value. If the passed type has dynamic properties we resolve the bounds
and thus the type is modified, not in place but rather by a new copy.
Given the following code snippet:
struct value *val = value_at (my_vla_type, at_address);
Before this was always true:
TYPE_LENGTH (value_type (val)) == TYPE_LENGTH (my_vla_type)
This is not the case after applying this patch series. Type normalization
is done in the mentioned value constructors and might change the value type.
Some documentation, examples as well as a github branch with support for c99
and Fortran variable length arrays is availabel at http://intel-gdb.github.io/
-Sanimir & Keven
Sanimir Agovic (15):
refactoring: rename create_range_type to create_static_range_type
vla: introduce new bound type abstraction adapt uses
type: add c99 variable length array support
vla: enable sizeof operator to work with variable length arrays
vla: enable sizeof operator for indirection
vla: update type from newly created value
vla: print "variable length" for unresolved dynamic bounds
vla: support for DW_AT_count
vla: resolve dynamic bounds if value contents is a constant
byte-sequence
vla: evaluate operand of sizeof if its type is a vla
test: cover subranges with present DW_AT_count attribute
test: multi-dimensional c99 vla.
test: evaluate pointers to C99 vla correctly.
test: basic c99 vla tests for C primitives
test: add mi vla test
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 | 8 +-
gdb/gdbtypes.c | 254 ++++++++++++++++++++++--------
gdb/gdbtypes.h | 76 +++++++--
gdb/jv-valprint.c | 1 +
gdb/m2-valprint.c | 2 +-
gdb/mdebugread.c | 4 +-
gdb/parse.c | 3 +-
gdb/stabsread.c | 11 +-
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 ++-
32 files changed, 1447 insertions(+), 185 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
--
1.8.4.2
next reply other threads:[~2014-04-10 12:42 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-10 12:42 Sanimir Agovic [this message]
2014-04-10 12:42 ` [PATCH v6 01/15] refactoring: rename create_range_type to create_static_range_type Sanimir Agovic
2014-04-10 12:43 ` [PATCH v6 02/15] vla: introduce new bound type abstraction adapt uses Sanimir Agovic
2014-04-10 12:44 ` [PATCH v6 03/15] type: add c99 variable length array support Sanimir Agovic
2014-04-10 14:21 ` Joel Brobecker
2014-04-10 12:44 ` [PATCH v6 04/15] vla: enable sizeof operator to work with variable length arrays Sanimir Agovic
2014-04-10 12:45 ` [PATCH v6 05/15] vla: enable sizeof operator for indirection Sanimir Agovic
2014-04-10 12:46 ` [PATCH v6 06/15] vla: update type from newly created value Sanimir Agovic
2014-04-10 12:47 ` [PATCH v6 07/15] vla: print "variable length" for unresolved dynamic bounds Sanimir Agovic
2014-04-10 12:48 ` [PATCH v6 09/15] vla: resolve dynamic bounds if value contents is a constant byte-sequence Sanimir Agovic
2014-04-10 14:22 ` Joel Brobecker
2014-04-10 12:48 ` [PATCH v6 08/15] vla: support for DW_AT_count Sanimir Agovic
2014-04-10 12:49 ` [PATCH v6 10/15] vla: evaluate operand of sizeof if its type is a vla Sanimir Agovic
2014-04-10 14:31 ` Joel Brobecker
2014-04-10 12:49 ` [PATCH v6 11/15] test: cover subranges with present DW_AT_count attribute Sanimir Agovic
2014-04-10 12:50 ` [PATCH v6 12/15] test: multi-dimensional c99 vla Sanimir Agovic
2014-04-10 12:51 ` [PATCH v6 13/15] test: evaluate pointers to C99 vla correctly Sanimir Agovic
2014-04-10 12:52 ` [PATCH v6 14/15] test: basic c99 vla tests for C primitives Sanimir Agovic
2014-04-10 12:53 ` [PATCH v6 15/15] test: add mi vla test Sanimir Agovic
2014-04-10 14:39 ` [PATCH v6 00/15] Please have a final look Joel Brobecker
2014-04-10 14:46 ` Joel Brobecker
2014-04-22 15:33 ` Agovic, Sanimir
2014-04-22 16:58 ` Eli Zaretskii
2014-04-11 12:50 ` Agovic, Sanimir
2014-04-11 20:03 ` Keith Seitz
2014-04-11 20:27 ` Joel Brobecker
2014-04-11 20:33 ` Keith Seitz
2014-04-11 21:13 ` Joel Brobecker
2014-04-11 21:19 ` Keith Seitz
2014-04-11 22:33 ` Joel Brobecker
2014-04-14 8:34 ` Agovic, Sanimir
2014-04-14 17:13 ` [vla v7 pushed] " Joel Brobecker
2014-04-14 17:13 ` [PATCH 06/12] vla: support for DW_AT_count Joel Brobecker
2014-04-14 17:13 ` [PATCH 08/12] vla: evaluate operand of sizeof if its type is a vla Joel Brobecker
2014-04-14 17:13 ` [PATCH 02/12] vla: enable sizeof operator to work with variable length arrays Joel Brobecker
2014-04-14 17:13 ` [PATCH 01/12] type: add c99 variable length array support Joel Brobecker
2014-04-18 19:06 ` Joel Brobecker
2014-04-14 17:13 ` [PATCH 04/12] vla: update type from newly created value Joel Brobecker
2014-04-14 17:13 ` [PATCH 07/12] vla: resolve dynamic bounds if value contents is a constant byte-sequence Joel Brobecker
2014-04-14 17:13 ` [PATCH 03/12] vla: enable sizeof operator for indirection Joel Brobecker
2014-04-14 17:13 ` [PATCH 05/12] vla: print "variable length" for unresolved dynamic bounds Joel Brobecker
2014-04-14 17:14 ` [PATCH 12/12] test: add mi vla test Joel Brobecker
2014-04-14 17:14 ` [PATCH 09/12] test: cover subranges with present DW_AT_count attribute Joel Brobecker
2014-04-14 17:14 ` [PATCH 10/12] test: evaluate pointers to C99 vla correctly Joel Brobecker
2014-04-14 17:14 ` [PATCH 11/12] test: basic c99 vla tests for C primitives Joel Brobecker
2014-04-14 17:36 ` [vla v7 pushed] Re: [PATCH v6 00/15] Please have a final look Agovic, Sanimir
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1397133617-26681-1-git-send-email-sanimir.agovic@intel.com \
--to=sanimir.agovic@intel.com \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=tromey@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox