]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Add dwarf_aggregate_size helper function to libdw.
authorRoland McGrath <roland@redhat.com>
Wed, 6 Jan 2010 06:53:31 +0000 (22:53 -0800)
committerRoland McGrath <roland@redhat.com>
Wed, 6 Jan 2010 06:53:31 +0000 (22:53 -0800)
NEWS
libdw/ChangeLog
libdw/Makefile.am
libdw/dwarf_srclang.c
libdw/libdw.h
libdw/libdw.map
libdw/libdwP.h

diff --git a/NEWS b/NEWS
index 5680b1591c1c2da384648dd073972bf714ae428b..24aa18ba9981d0497be29fb6f93d5d0b33bec9d1 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
 Version 0.144:
 
+libdw: New function dwarf_aggregate_size for computing (constant) type
+       sizes, including array_type cases with nontrivial calculation.
+
 readelf: Don't give errors for missing info under -a.
         Handle Linux "VMCOREINFO" notes under -n.
 
index bbbebfe2727e7386674c86e12b071669e945df8d..0afa850704fca44647d75b41d3ad6823ee05812f 100644 (file)
@@ -1,5 +1,14 @@
 2010-01-05  Roland McGrath  <roland@redhat.com>
 
+       * dwarf_aggregate_size.c: New file.
+       * Makefile.am (libdw_a_SOURCES): Add it.
+       * libdw.h: Declare it.
+       * libdwP.h: Add INTDECL.
+       * libdw.map (ELFUTILS_0.144): New set.  Add dwarf_aggregate_size.
+
+       * dwarf_srclang.c: Add INTDEF.
+       * libdwP.h: Add INTDECL.
+
        * dwarf.h: Add some more DW_AT_GNU_* types from gcc.
 
        * dwarf.h: Add DW_AT_GNU_vector, DW_AT_GNU_template_name.
index 4d041cf736beeaf364f2011c55560ab04a700e58..23896fa697897c00bc821551e893c49bc69d1905 100644 (file)
@@ -1,6 +1,6 @@
 ## Process this file with automake to create Makefile.in
 ##
-## Copyright (C) 2002-2009 Red Hat, Inc.
+## Copyright (C) 2002-2010 Red Hat, Inc.
 ## This file is part of Red Hat elfutils.
 ##
 ## Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -88,7 +88,8 @@ libdw_a_SOURCES = dwarf_begin.c dwarf_begin_elf.c dwarf_end.c dwarf_getelf.c \
                  cie.c fde.c cfi.c frame-cache.c \
                  dwarf_frame_info.c dwarf_frame_cfa.c dwarf_frame_register.c \
                  dwarf_cfi_addrframe.c \
-                 dwarf_getcfi.c dwarf_getcfi_elf.c dwarf_cfi_end.c
+                 dwarf_getcfi.c dwarf_getcfi_elf.c dwarf_cfi_end.c \
+                 dwarf_aggregate_size.c
 
 if MAINTAINER_MODE
 BUILT_SOURCES = $(srcdir)/known-dwarf.h
index f1ff954c858feed4d81cb1cbb762b2b6cc4094a8..305ffcd08934fdcb6cb9b564bc94c91f66a15a78 100644 (file)
@@ -1,5 +1,5 @@
 /* Return source language attribute of DIE.
-   Copyright (C) 2003, 2005, 2009 Red Hat, Inc.
+   Copyright (C) 2003-2010 Red Hat, Inc.
    This file is part of Red Hat elfutils.
    Written by Ulrich Drepper <drepper@redhat.com>, 2003.
 
@@ -67,5 +67,6 @@ dwarf_srclang (die)
                                  (die, DW_AT_language, &attr_mem),
                                  &value) == 0 ? (int) value : -1;
 }
+INTDEF (dwarf_srclang)
 OLD_VERSION (dwarf_srclang, ELFUTILS_0.122)
 NEW_VERSION (dwarf_srclang, ELFUTILS_0.143)
index 7602e611dfb577426ff3203d76f597679d7bbd78..94320c7bfd7f1e4b1f1b14013110ea452a1dddf8 100644 (file)
@@ -1,5 +1,5 @@
 /* Interfaces for libdw.
-   Copyright (C) 2002-2009 Red Hat, Inc.
+   Copyright (C) 2002-2010 Red Hat, Inc.
    This file is part of Red Hat elfutils.
 
    Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -362,7 +362,7 @@ extern int dwarf_child (Dwarf_Die *die, Dwarf_Die *result)
    Returns 1 if no sibling could be found and, if RESULT is not
    the same as DIE, it sets RESULT->addr to the address of the
    (non-sibling) DIE that follows this one, or NULL if this DIE
-   was the last one in the cokmpilation unit.  */
+   was the last one in the compilation unit.  */
 extern int dwarf_siblingof (Dwarf_Die *die, Dwarf_Die *result)
      __nonnull_attribute__ (2);
 
@@ -632,6 +632,11 @@ extern int dwarf_getlocation_implicit_value (Dwarf_Attribute *attr,
   __nonnull_attribute__ (2, 3);
 
 
+/* Compute the byte-size of a type DIE according to DWARF rules.
+   For most types, this is just DW_AT_byte_size.
+   For DW_TAG_array_type it can apply much more complex rules.  */
+extern int dwarf_aggregate_size (Dwarf_Die *die, Dwarf_Word *size);
+
 
 /* Return scope DIEs containing PC address.
    Sets *SCOPES to a malloc'd array of Dwarf_Die structures,
index b39db4816a6796faa1b4f6c6f78bb244feb757c5..8eaeacd5f8419b547bc7db51083dca549a07b8a1 100644 (file)
@@ -227,3 +227,8 @@ ELFUTILS_0.143 {
     dwarf_srclang;
 
 } ELFUTILS_0.142;
+
+ELFUTILS_0.144 {
+  global:
+    dwarf_aggregate_size;
+} ELFUTILS_0.143;
index 0284580f8351b8541028733c7ebede200555f6ab..248a58d55b1e6bb0c602b12ea4e8dcc7c2d77799 100644 (file)
@@ -1,5 +1,5 @@
 /* Internal definitions for libdwarf.
-   Copyright (C) 2002-2009 Red Hat, Inc.
+   Copyright (C) 2002-2010 Red Hat, Inc.
    This file is part of Red Hat elfutils.
    Written by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -595,6 +595,7 @@ unsigned char * __libdw_formptr (Dwarf_Attribute *attr, int sec_index,
 
 
 /* Aliases to avoid PLTs.  */
+INTDECL (dwarf_aggregate_size)
 INTDECL (dwarf_attr)
 INTDECL (dwarf_attr_integrate)
 INTDECL (dwarf_begin_elf)
@@ -624,6 +625,7 @@ INTDECL (dwarf_nextcu)
 INTDECL (dwarf_offdie)
 INTDECL (dwarf_ranges)
 INTDECL (dwarf_siblingof)
+INTDECL (dwarf_srclang)
 INTDECL (dwarf_tag)
 
 #endif /* libdwP.h */