From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============4045478324923006027==" MIME-Version: 1.0 From: Mark Wielaard To: elfutils-devel@lists.fedorahosted.org Subject: [PATCH] dwarf.h: Add DW_LANG_C11, DW_LANG_C_plus_plus_11 and DW_LANG_C_plus_plus_14. Date: Mon, 24 Nov 2014 22:17:51 +0100 Message-ID: <1416863871-16414-1-git-send-email-mjw@redhat.com> --===============4045478324923006027== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable The following patch is needed to recognize the new DW_LANG constants that GCC 5 might emit as implemented by this GCC patch: https://gcc.gnu.org/ml/gcc-patches/2014-11/msg02852.html Also added to https://fedorahosted.org/elfutils/wiki/DwarfExtensions GCC 5 can emit these new DWARFv5 draft language constants. Handle them in dwarf_aggregate_size and dwarf_getfuncs. Also handle DW_LANG_Go in dwarf_aggregate_size (lower bound for array is zero for Go). Signed-off-by: Mark Wielaard --- libdw/ChangeLog | 11 +++++++++++ libdw/dwarf.h | 4 ++++ libdw/dwarf_aggregate_size.c | 4 ++++ libdw/dwarf_getfuncs.c | 3 ++- 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/libdw/ChangeLog b/libdw/ChangeLog index 58736a6..ea9dca1 100644 --- a/libdw/ChangeLog +++ b/libdw/ChangeLog @@ -1,3 +1,14 @@ +2014-11-24 Mark Wielaard + + * dwarf.h (DW_LANG_C_plus_plus_11): Added. + (DW_LANG_C11): Likewise. + (DW_LANG_C_plus_plus_14): Likewise. + * dwarf_aggregate_size.c (array_size): Handle DW_LANG_C11, + DW_LANG_C_plus_plus_11, DW_LANG_C_plus_plus_14 and DW_LANG_Go + lower bound. + * dwarf_getfuncs.c (dwarf_getfuncs): Set c_cu to true for + DW_LANG_C11. + 2014-11-11 Mark Wielaard = * dwarf_getsrclines.c (read_srclines): Do address_size comparison diff --git a/libdw/dwarf.h b/libdw/dwarf.h index d03cf5c..3a97ccb 100644 --- a/libdw/dwarf.h +++ b/libdw/dwarf.h @@ -583,6 +583,10 @@ enum DW_LANG_D =3D 0x0013, /* D */ DW_LANG_Python =3D 0x0014, /* Python */ DW_LANG_Go =3D 0x0016, /* Go */ + DW_LANG_C_plus_plus_11 =3D 0x001a, /* ISO C++:2011 */ + DW_LANG_C11 =3D 0x001d, /* ISO C:2011 */ + DW_LANG_C_plus_plus_14 =3D 0x0021, /* ISO C++:2014 */ + = DW_LANG_lo_user =3D 0x8000, DW_LANG_Mips_Assembler =3D 0x8001, /* Assembler */ diff --git a/libdw/dwarf_aggregate_size.c b/libdw/dwarf_aggregate_size.c index 1666e24..667c274 100644 --- a/libdw/dwarf_aggregate_size.c +++ b/libdw/dwarf_aggregate_size.c @@ -103,12 +103,16 @@ array_size (Dwarf_Die *die, Dwarf_Word *size, case DW_LANG_C: case DW_LANG_C89: case DW_LANG_C99: + case DW_LANG_C11: case DW_LANG_C_plus_plus: + case DW_LANG_C_plus_plus_11: + case DW_LANG_C_plus_plus_14: case DW_LANG_ObjC: case DW_LANG_ObjC_plus_plus: case DW_LANG_Java: case DW_LANG_D: case DW_LANG_UPC: + case DW_LANG_Go: lower =3D 0; break; = diff --git a/libdw/dwarf_getfuncs.c b/libdw/dwarf_getfuncs.c index 82894c9..f79b0a7 100644 --- a/libdw/dwarf_getfuncs.c +++ b/libdw/dwarf_getfuncs.c @@ -103,7 +103,8 @@ dwarf_getfuncs (Dwarf_Die *cudie, int (*callback) (Dwar= f_Die *, void *), int lang =3D INTUSE(dwarf_srclang) (cudie); bool c_cu =3D (lang =3D=3D DW_LANG_C89 || lang =3D=3D DW_LANG_C - || lang =3D=3D DW_LANG_C99); + || lang =3D=3D DW_LANG_C99 + || lang =3D=3D DW_LANG_C11); = struct visitor_info v =3D { callback, arg, (void *) offset, NULL, c_cu }; struct Dwarf_Die_Chain chain =3D { .die =3D CUDIE (cudie->cu), -- = 1.9.3 --===============4045478324923006027==--