From: Roland McGrath Date: Wed, 6 Jan 2010 06:53:31 +0000 (-0800) Subject: Add dwarf_aggregate_size helper function to libdw. X-Git-Tag: elfutils-0.144~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ebc5c885e696cdc4961916113c50e1396d8d3d48;p=platform%2Fupstream%2Felfutils.git Add dwarf_aggregate_size helper function to libdw. --- diff --git a/NEWS b/NEWS index 5680b15..24aa18b 100644 --- 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. diff --git a/libdw/ChangeLog b/libdw/ChangeLog index bbbebfe..0afa850 100644 --- a/libdw/ChangeLog +++ b/libdw/ChangeLog @@ -1,5 +1,14 @@ 2010-01-05 Roland McGrath + * 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. diff --git a/libdw/Makefile.am b/libdw/Makefile.am index 4d041cf..23896fa 100644 --- a/libdw/Makefile.am +++ b/libdw/Makefile.am @@ -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 diff --git a/libdw/dwarf_srclang.c b/libdw/dwarf_srclang.c index f1ff954..305ffcd 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, 2009 Red Hat, Inc. + Copyright (C) 2003-2010 Red Hat, Inc. This file is part of Red Hat elfutils. Written by Ulrich Drepper , 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) diff --git a/libdw/libdw.h b/libdw/libdw.h index 7602e61..94320c7 100644 --- a/libdw/libdw.h +++ b/libdw/libdw.h @@ -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, diff --git a/libdw/libdw.map b/libdw/libdw.map index b39db48..8eaeacd 100644 --- a/libdw/libdw.map +++ b/libdw/libdw.map @@ -227,3 +227,8 @@ ELFUTILS_0.143 { dwarf_srclang; } ELFUTILS_0.142; + +ELFUTILS_0.144 { + global: + dwarf_aggregate_size; +} ELFUTILS_0.143; diff --git a/libdw/libdwP.h b/libdw/libdwP.h index 0284580..248a58d 100644 --- a/libdw/libdwP.h +++ b/libdw/libdwP.h @@ -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 , 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 */