diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | libdw/ChangeLog | 7 | ||||
-rw-r--r-- | libdw/Makefile.am | 5 | ||||
-rw-r--r-- | libdw/dwarf_cu_die.c | 68 | ||||
-rw-r--r-- | libdw/libdw.h | 17 | ||||
-rw-r--r-- | libdw/libdw.map | 1 |
7 files changed, 101 insertions, 3 deletions
@@ -1,5 +1,9 @@ 2014-08-15 Mark Wielaard <mjw@redhat.com> + * NEWS: Add dwarf_cu_die. + +2014-08-15 Mark Wielaard <mjw@redhat.com> + * NEWS: Add dwarf_cu_getdwarf. 2014-07-18 Mark Wielaard <mjw@redhat.com> @@ -1,6 +1,6 @@ Version 0.160 -libdw: New function dwarf_cu_getdwarf. +libdw: New functions dwarf_cu_getdwarf, dwarf_cu_die. unstrip: New option -F, --force to combining files even if some ELF headers don't seem to match. diff --git a/libdw/ChangeLog b/libdw/ChangeLog index 8dfd11e8..5f9b0971 100644 --- a/libdw/ChangeLog +++ b/libdw/ChangeLog @@ -1,5 +1,12 @@ 2014-08-15 Mark Wielaard <mjw@redhat.com> + * dwarf_cu_die.c: New file. + * Makefile.am (libdw_a_SOURCES): Add dwarf_cu_die.c. + * libdw.h (dwarf_cu_die): New function declaration. + * libdw.map (ELFUTILS_0.160): Add dwarf_cu_die. + +2014-08-15 Mark Wielaard <mjw@redhat.com> + * dwarf_cu_getdwarf.c: New file. * Makefile.am (libdw_a_SOURCES): Add dwarf_cu_getdwarf.c. * libdw.h (Dwarf_CU): New typedef. diff --git a/libdw/Makefile.am b/libdw/Makefile.am index e39ab9a6..2e42a376 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-2010, 2012 Red Hat, Inc. +## Copyright (C) 2002-2010, 2012, 2014 Red Hat, Inc. ## This file is part of elfutils. ## ## This file is free software; you can redistribute it and/or modify @@ -86,7 +86,8 @@ libdw_a_SOURCES = dwarf_begin.c dwarf_begin_elf.c dwarf_end.c dwarf_getelf.c \ dwarf_getcfi.c dwarf_getcfi_elf.c dwarf_cfi_end.c \ dwarf_aggregate_size.c dwarf_getlocation_implicit_pointer.c \ dwarf_getlocation_die.c dwarf_getlocation_attr.c \ - dwarf_getalt.c dwarf_setalt.c dwarf_cu_getdwarf.c + dwarf_getalt.c dwarf_setalt.c dwarf_cu_getdwarf.c \ + dwarf_cu_die.c if MAINTAINER_MODE BUILT_SOURCES = $(srcdir)/known-dwarf.h diff --git a/libdw/dwarf_cu_die.c b/libdw/dwarf_cu_die.c new file mode 100644 index 00000000..48f4176f --- /dev/null +++ b/libdw/dwarf_cu_die.c @@ -0,0 +1,68 @@ +/* Internal definitions for libdwarf. + Copyright (C) 2014 Red Hat, Inc. + This file is part of elfutils. + + This file is free software; you can redistribute it and/or modify + it under the terms of either + + * the GNU Lesser General Public License as published by the Free + Software Foundation; either version 3 of the License, or (at + your option) any later version + + or + + * the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at + your option) any later version + + or both in parallel, as here. + + elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received copies of the GNU General Public License and + the GNU Lesser General Public License along with this program. If + not, see <http://www.gnu.org/licenses/>. */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <stddef.h> +#include "libdwP.h" + + +Dwarf_Die * +dwarf_cu_die (cu, result, versionp, abbrev_offsetp, address_sizep, + offset_sizep, type_signaturep, type_offsetp) + Dwarf_CU *cu; + Dwarf_Die *result; + Dwarf_Half *versionp; + Dwarf_Off *abbrev_offsetp; + uint8_t *address_sizep; + uint8_t *offset_sizep; + uint64_t *type_signaturep; + Dwarf_Off *type_offsetp; +{ + if (cu == NULL) + return NULL; + + *result = CUDIE (cu); + + if (versionp != NULL) + *versionp = cu->version; + if (abbrev_offsetp != NULL) + *abbrev_offsetp = cu->orig_abbrev_offset; + if (address_sizep != NULL) + *address_sizep = cu->address_size; + if (offset_sizep != NULL) + *offset_sizep = cu->offset_size; + if (type_signaturep != NULL) + *type_signaturep = cu->type_sig8; + if (type_offsetp != NULL) + *type_offsetp = cu->type_offset; + + return result; +} diff --git a/libdw/libdw.h b/libdw/libdw.h index 61d3b386..196d54ae 100644 --- a/libdw/libdw.h +++ b/libdw/libdw.h @@ -364,6 +364,23 @@ extern Dwarf_Die *dwarf_diecu (Dwarf_Die *die, Dwarf_Die *result, uint8_t *address_sizep, uint8_t *offset_sizep) __nonnull_attribute__ (2); +/* Return the CU DIE and the header info associated with a Dwarf_Die + or Dwarf_Attribute. A Dwarf_Die or a Dwarf_Attribute is associated + with a particular Dwarf_CU handle. This function returns the CU or + type unit DIE and header information for that Dwarf_CU. The + returned DIE is either a compile_unit, partial_unit or type_unit. + If it is a type_unit, then the type signature and type offset are + also provided, otherwise type_offset will be set to zero. See also + dwarf_diecu and dwarf_next_unit. */ +extern Dwarf_Die *dwarf_cu_die (Dwarf_CU *cu, Dwarf_Die *result, + Dwarf_Half *versionp, + Dwarf_Off *abbrev_offsetp, + uint8_t *address_sizep, + uint8_t *offset_sizep, + uint64_t *type_signaturep, + Dwarf_Off *type_offsetp) + __nonnull_attribute__ (2); + /* Return CU DIE containing given address. */ extern Dwarf_Die *dwarf_addrdie (Dwarf *dbg, Dwarf_Addr addr, Dwarf_Die *result) __nonnull_attribute__ (3); diff --git a/libdw/libdw.map b/libdw/libdw.map index 27e2273e..55bc5371 100644 --- a/libdw/libdw.map +++ b/libdw/libdw.map @@ -305,4 +305,5 @@ ELFUTILS_0.159 { ELFUTILS_0.160 { global: dwarf_cu_getdwarf; + dwarf_cu_die; } ELFUTILS_0.159;
\ No newline at end of file |