From de69d52c6b10d3ff5dbf88515dc04146d049f7b5 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Fri, 7 Aug 2009 18:26:19 -0700 Subject: [PATCH] Use dwarf_attr_integrate in various convenience functions. --- NEWS | 5 +++++ configure.ac | 2 +- libdw/ChangeLog | 10 ++++++++++ libdw/dwarf_arrayorder.c | 6 +++--- libdw/dwarf_bitoffset.c | 6 +++--- libdw/dwarf_bitsize.c | 6 +++--- libdw/dwarf_bytesize.c | 6 +++--- libdw/dwarf_decl_file.c | 7 ++++--- libdw/dwarf_decl_line.c | 7 ++++--- libdw/dwarf_srclang.c | 6 +++--- 10 files changed, 39 insertions(+), 22 deletions(-) diff --git a/NEWS b/NEWS index d52e25365..4d08e2b34 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,8 @@ +Version 0.143: + +libdw: Various convenience functions for individual attributes now use + dwarf_attr_integrate to look up indirect inherited attributes. + Version 0.142: libelf: Add elf_getshdrnum alias for elf_getshnum and elf_getshdrstrndx alias diff --git a/configure.ac b/configure.ac index 4d7ec1e69..f5a3c527c 100644 --- a/configure.ac +++ b/configure.ac @@ -16,7 +16,7 @@ dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software Foundation, dnl Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. dnl -AC_INIT([Red Hat elfutils],[0.142],[http://bugzilla.redhat.com/bugzilla/], +AC_INIT([Red Hat elfutils],[0.142.90],[http://bugzilla.redhat.com/bugzilla/], [elfutils]) AC_CONFIG_AUX_DIR([config]) diff --git a/libdw/ChangeLog b/libdw/ChangeLog index 76663eebf..30c848974 100644 --- a/libdw/ChangeLog +++ b/libdw/ChangeLog @@ -1,3 +1,13 @@ +2009-08-07 Roland McGrath + + * dwarf_arrayorder.c: Use dwarf_attr_integrate. + * dwarf_srclang.c: Likewise. + * dwarf_decl_file.c: Likewise. + * dwarf_decl_line.c (__libdw_attr_intval): Likewise. + * dwarf_bytesize.c: Likewise. + * dwarf_bitsize.c: Likewise. + * dwarf_bitoffset.c: Likewise. + 2009-07-22 Roland McGrath * dwarf_frame_cfa.c: Change calling convention. diff --git a/libdw/dwarf_arrayorder.c b/libdw/dwarf_arrayorder.c index 6d5a42d76..359392420 100644 --- a/libdw/dwarf_arrayorder.c +++ b/libdw/dwarf_arrayorder.c @@ -1,5 +1,5 @@ /* Return array order attribute of DIE. - Copyright (C) 2003, 2005 Red Hat, Inc. + Copyright (C) 2003, 2005, 2009 Red Hat, Inc. This file is part of Red Hat elfutils. Written by Ulrich Drepper , 2003. @@ -63,7 +63,7 @@ dwarf_arrayorder (die) Dwarf_Attribute attr_mem; Dwarf_Word value; - return INTUSE(dwarf_formudata) (INTUSE(dwarf_attr) (die, DW_AT_ordering, - &attr_mem), + return INTUSE(dwarf_formudata) (INTUSE(dwarf_attr_integrate) + (die, DW_AT_ordering, &attr_mem), &value) == 0 ? (int) value : -1; } diff --git a/libdw/dwarf_bitoffset.c b/libdw/dwarf_bitoffset.c index 235b7ee62..99d1071f8 100644 --- a/libdw/dwarf_bitoffset.c +++ b/libdw/dwarf_bitoffset.c @@ -1,5 +1,5 @@ /* Return bit offset attribute of DIE. - Copyright (C) 2003, 2005 Red Hat, Inc. + Copyright (C) 2003, 2005, 2009 Red Hat, Inc. This file is part of Red Hat elfutils. Written by Ulrich Drepper , 2003. @@ -63,7 +63,7 @@ dwarf_bitoffset (die) Dwarf_Attribute attr_mem; Dwarf_Word value; - return INTUSE(dwarf_formudata) (INTUSE(dwarf_attr) (die, DW_AT_bit_offset, - &attr_mem), + return INTUSE(dwarf_formudata) (INTUSE(dwarf_attr_integrate) + (die, DW_AT_bit_offset, &attr_mem), &value) == 0 ? (int) value : -1; } diff --git a/libdw/dwarf_bitsize.c b/libdw/dwarf_bitsize.c index 57d7fba06..7cfbc5d62 100644 --- a/libdw/dwarf_bitsize.c +++ b/libdw/dwarf_bitsize.c @@ -1,5 +1,5 @@ /* Return bit size attribute of DIE. - Copyright (C) 2003, 2005 Red Hat, Inc. + Copyright (C) 2003, 2005, 2009 Red Hat, Inc. This file is part of Red Hat elfutils. Written by Ulrich Drepper , 2003. @@ -63,7 +63,7 @@ dwarf_bitsize (die) Dwarf_Attribute attr_mem; Dwarf_Word value; - return INTUSE(dwarf_formudata) (INTUSE(dwarf_attr) (die, DW_AT_bit_size, - &attr_mem), + return INTUSE(dwarf_formudata) (INTUSE(dwarf_attr_integrate) + (die, DW_AT_bit_size, &attr_mem), &value) == 0 ? (int) value : -1; } diff --git a/libdw/dwarf_bytesize.c b/libdw/dwarf_bytesize.c index 635a3c169..536fcd581 100644 --- a/libdw/dwarf_bytesize.c +++ b/libdw/dwarf_bytesize.c @@ -1,5 +1,5 @@ /* Return byte size attribute of DIE. - Copyright (C) 2003, 2005 Red Hat, Inc. + Copyright (C) 2003, 2005, 2009 Red Hat, Inc. This file is part of Red Hat elfutils. Written by Ulrich Drepper , 2003. @@ -63,7 +63,7 @@ dwarf_bytesize (die) Dwarf_Attribute attr_mem; Dwarf_Word value; - return INTUSE(dwarf_formudata) (INTUSE(dwarf_attr) (die, DW_AT_byte_size, - &attr_mem), + return INTUSE(dwarf_formudata) (INTUSE(dwarf_attr_integrate) + (die, DW_AT_byte_size, &attr_mem), &value) == 0 ? (int) value : -1; } diff --git a/libdw/dwarf_decl_file.c b/libdw/dwarf_decl_file.c index b1d62df2c..b5ea27db0 100644 --- a/libdw/dwarf_decl_file.c +++ b/libdw/dwarf_decl_file.c @@ -1,5 +1,5 @@ /* Return file name containing definition of the given function. - Copyright (C) 2005 Red Hat, Inc. + Copyright (C) 2005, 2009 Red Hat, Inc. This file is part of Red Hat elfutils. Written by Ulrich Drepper , 2005. @@ -63,8 +63,9 @@ dwarf_decl_file (Dwarf_Die *die) Dwarf_Attribute attr_mem; Dwarf_Sword idx = 0; - if (INTUSE(dwarf_formsdata) (INTUSE(dwarf_attr) (die, DW_AT_decl_file, - &attr_mem), &idx) != 0) + if (INTUSE(dwarf_formsdata) (INTUSE(dwarf_attr_integrate) + (die, DW_AT_decl_file, &attr_mem), + &idx) != 0) return NULL; /* Zero means no source file information available. */ diff --git a/libdw/dwarf_decl_line.c b/libdw/dwarf_decl_line.c index b4e3c42e9..27abc5044 100644 --- a/libdw/dwarf_decl_line.c +++ b/libdw/dwarf_decl_line.c @@ -1,5 +1,5 @@ /* Get line number of beginning of given function. - Copyright (C) 2005 Red Hat, Inc. + Copyright (C) 2005, 2009 Red Hat, Inc. This file is part of Red Hat elfutils. Written by Ulrich Drepper , 2005. @@ -71,8 +71,9 @@ __libdw_attr_intval (Dwarf_Die *die, int *linep, int attval) Dwarf_Attribute attr_mem; Dwarf_Sword line; - int res = INTUSE(dwarf_formsdata) (INTUSE(dwarf_attr) (die, attval, - &attr_mem), &line); + int res = INTUSE(dwarf_formsdata) (INTUSE(dwarf_attr_integrate) + (die, attval, &attr_mem), + &line); if (res == 0) { assert (line >= 0 && line <= INT_MAX); diff --git a/libdw/dwarf_srclang.c b/libdw/dwarf_srclang.c index 2efa0954d..7d0e90714 100644 --- a/libdw/dwarf_srclang.c +++ b/libdw/dwarf_srclang.c @@ -1,5 +1,5 @@ /* Return source language attribute of DIE. - Copyright (C) 2003, 2005 Red Hat, Inc. + Copyright (C) 2003, 2005, 2009 Red Hat, Inc. This file is part of Red Hat elfutils. Written by Ulrich Drepper , 2003. @@ -63,7 +63,7 @@ dwarf_srclang (die) Dwarf_Attribute attr_mem; Dwarf_Word value; - return INTUSE(dwarf_formudata) (INTUSE(dwarf_attr) (die, DW_AT_language, - &attr_mem), + return INTUSE(dwarf_formudata) (INTUSE(dwarf_attr_integrate) + (die, DW_AT_language, &attr_mem), &value) == 0 ? (int) value : -1; } -- 2.47.2