From f7d3685431f4158ba4ceca514c4722fa7b088992 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Wed, 23 Feb 2011 10:54:30 -0800 Subject: Add DW_AT_GNU_odr_signature expected value space. --- libdw/ChangeLog | 5 +++++ libdw/c++/dwarf-knowledge.cc | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/libdw/ChangeLog b/libdw/ChangeLog index 51a24b7c..1b85aebf 100644 --- a/libdw/ChangeLog +++ b/libdw/ChangeLog @@ -1,3 +1,8 @@ +2011-02-23 Roland McGrath + + * c++/dwarf-knowledge.cc (expected_value_space): + Grok DW_AT_GNU_odr_signature. + 2010-12-07 Petr Machata * c++/subr.hh (sharing_stack::element::pop): Remove. Move the diff --git a/libdw/c++/dwarf-knowledge.cc b/libdw/c++/dwarf-knowledge.cc index 3d8edeb5..5fdf123e 100644 --- a/libdw/c++/dwarf-knowledge.cc +++ b/libdw/c++/dwarf-knowledge.cc @@ -12,7 +12,6 @@ using namespace elfutils; static unsigned int expected_value_space (int attr, int tag) { - switch (attr) { case DW_AT_sibling: @@ -154,6 +153,9 @@ expected_value_space (int attr, int tag) case DW_AT_MIPS_linkage_name: return VS(identifier); + + case DW_AT_GNU_odr_signature: + return VS(constant); } return 0; -- cgit v1.2.1 From aa23bd349dd79ff5bba7e1d313e206cf73ecb0cc Mon Sep 17 00:00:00 2001 From: Petr Machata Date: Wed, 23 Feb 2011 22:56:45 +0100 Subject: Handle DW_AT_linkage_name in dwarf_attr_string and dwarf-knowledge --- libdw/c++/dwarf-knowledge.cc | 1 + src/dwarfstrings.c | 1 + 2 files changed, 2 insertions(+) diff --git a/libdw/c++/dwarf-knowledge.cc b/libdw/c++/dwarf-knowledge.cc index 5fdf123e..53cf1a17 100644 --- a/libdw/c++/dwarf-knowledge.cc +++ b/libdw/c++/dwarf-knowledge.cc @@ -151,6 +151,7 @@ expected_value_space (int attr, int tag) case DW_AT_picture_string: return VS(string); + case DW_AT_linkage_name: case DW_AT_MIPS_linkage_name: return VS(identifier); diff --git a/src/dwarfstrings.c b/src/dwarfstrings.c index 6feba59f..b340f026 100644 --- a/src/dwarfstrings.c +++ b/src/dwarfstrings.c @@ -233,6 +233,7 @@ dwarf_attr_string (unsigned int attrnum) [DW_AT_elemental] = "elemental", [DW_AT_pure] = "pure", [DW_AT_recursive] = "recursive", + [DW_AT_linkage_name] = "linkage_name", }; const unsigned int nknown_attrs = (sizeof (known_attrs) / sizeof (known_attrs[0])); -- cgit v1.2.1 From a455dd35b49e8a592605d6d63031b2e2ca01bd39 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Thu, 24 Feb 2011 14:40:44 -0800 Subject: Put the slow dwarfcmp tests last. --- tests/ChangeLog | 4 ++++ tests/Makefile.am | 8 +++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/ChangeLog b/tests/ChangeLog index a00733f7..8a39c5bf 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,7 @@ +2011-02-24 Roland McGrath + + * Makefile.am (TESTS): Put the slow dwarfcmp tests last. + 2011-02-02 Josh Stone * run-prelink-addr-test.sh: Add testfile55, 32 and 64-bit. diff --git a/tests/Makefile.am b/tests/Makefile.am index 616f900f..a33e0521 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -87,9 +87,11 @@ TESTS = run-arextract.sh run-arsymtest.sh newfile test-nlist \ run-dwfl-bug-offline-rel.sh run-dwfl-addr-sect.sh \ run-disasm-x86.sh run-disasm-x86-64.sh \ run-early-offscn.sh run-dwarf-getmacros.sh \ - run-dwarfcmp-self.sh run-dwarflint-self.sh run-dwarf-attributes.sh \ - run-dwarf_edit.sh dwarf_edit_output run-dwarfcmp-test-self.sh \ - run-test-flag-nobits.sh run-prelink-addr-test.sh + run-dwarf-attributes.sh \ + run-dwarf_edit.sh dwarf_edit_output \ + run-test-flag-nobits.sh run-prelink-addr-test.sh \ + run-dwarflint-self.sh \ + run-dwarfcmp-self.sh run-dwarfcmp-test-self.sh # run-show-ciefde.sh if !STANDALONE -- cgit v1.2.1 From 2cd13586ef3479b6ae2fe60486d6043f04b68af4 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Thu, 24 Feb 2011 15:11:58 -0800 Subject: Fix dwarf_path_finder::jump for the general case. --- libdw/c++/dwarf_tracker | 42 +++++++++++++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 7 deletions(-) diff --git a/libdw/c++/dwarf_tracker b/libdw/c++/dwarf_tracker index 07317ca2..917502c3 100644 --- a/libdw/c++/dwarf_tracker +++ b/libdw/c++/dwarf_tracker @@ -257,7 +257,6 @@ namespace elfutils assert (_m_tracker->_m_path.empty ()); assert (_m_tracker->_m_steps_taken == 0); assert (_m_tracker->_m_walkahead == NULL); - ::Dwarf_Off cu_offset = (*root).offset (); cu_offset = cu_offset; _m_tracker->_m_root = root; } @@ -301,12 +300,41 @@ namespace elfutils inline void prime_path_to (const typename dw::debug_info_entry &there) { - /* Since we can only used on a cloned tracker, _m_steps_taken - counting does not matter. */ - assert (_m_owner != NULL); - assert (this != _m_owner->_m_walkahead); - assert (at_top ()); - _m_path = path_to (there); + if (_m_owner != NULL) + { + /* Since this is a cloned tracker, + _m_steps_taken counting does not matter. */ + assert (this != _m_owner->_m_walkahead); + _m_path = path_to (there); + } + else + { + /* Spin the walk ahead until we get THERE. */ + const dwarf::debug_info_entry::identity_type id = there.identity (); + if (_m_seen->find (id) != _m_seen->end ()) + { + /* We're walking backwards now. We have to repeat the + whole walk to recover our _m_steps_taken state correctly. */ + _m_path.clear (); + clear_walk (); + } + + if (at_top ()) + { + /* We have to get the walk started. */ + const die first = (*_m_root).children ().begin (); + if (first == (*_m_root).children ().end ()) + unreachable (there); // Empty CU! + + step_forward (first); + if ((*first).identity () == id) + return; + } + + /* We have not walked past it yet, so just keep walking. */ + if (! walk_to (id)) + unreachable (there); + } } // Random access to a DIE, find the path of the walk that gets there. -- cgit v1.2.1 From 2b5a3e13064be99a415c173422a06a6b77623bda Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Thu, 24 Feb 2011 15:25:43 -0800 Subject: Make libdwP.h internal declarations C++-compatible. --- libdw/ChangeLog | 4 ++++ libdw/libdwP.h | 21 +++++++++++++-------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/libdw/ChangeLog b/libdw/ChangeLog index 1b85aebf..35baf27c 100644 --- a/libdw/ChangeLog +++ b/libdw/ChangeLog @@ -1,3 +1,7 @@ +2011-02-24 Roland McGrath + + * libdwP.h: Make declarations C++-compatible using __BEGIN_DECLS. + 2011-02-23 Roland McGrath * c++/dwarf-knowledge.cc (expected_value_space): diff --git a/libdw/libdwP.h b/libdw/libdwP.h index 8d49f501..58f3f908 100644 --- a/libdw/libdwP.h +++ b/libdw/libdwP.h @@ -1,5 +1,5 @@ /* Internal definitions for libdwarf. - Copyright (C) 2002-2010 Red Hat, Inc. + Copyright (C) 2002-2011 Red Hat, Inc. This file is part of Red Hat elfutils. Written by Ulrich Drepper , 2002. @@ -353,6 +353,8 @@ struct Dwarf_Macro_s }; +__BEGIN_DECLS + /* We have to include the file at this point because the inline functions access internals of the Dwarf structure. */ #include "memory-access.h" @@ -471,7 +473,6 @@ extern Dwarf_Die *__libdw_offdie (Dwarf *dbg, Dwarf_Off offset, extern int __dwarf_errno_internal (void); -#ifndef __cplusplus /* Reader hooks. */ /* Relocation hooks return -1 on error (in that case the error code @@ -535,8 +536,10 @@ __libdw_in_section (Dwarf *dbg, int sec_index, Elf_Data *data = __libdw_checked_get_data (dbg, sec_index); if (data == NULL) return false; - if (unlikely (addr < data->d_buf) - || unlikely (data->d_size - (addr - data->d_buf) < size)) + if (unlikely ((const char *) addr < (const char *) data->d_buf) + || unlikely (data->d_size - ((const char *) addr + - (const char *) data->d_buf) + < size)) { __libdw_seterrno (DWARF_E_INVALID_OFFSET); return false; @@ -615,11 +618,10 @@ int __libdw_read_begin_end_pair_inc (Dwarf *dbg, int sec_index, Dwarf_Addr *basep) internal_function; -unsigned char * __libdw_formptr (Dwarf_Attribute *attr, int sec_index, - int err_nodata, unsigned char **endpp, - Dwarf_Off *offsetp) +unsigned char *__libdw_formptr (Dwarf_Attribute *attr, int sec_index, + int err_nodata, unsigned char **endpp, + Dwarf_Off *offsetp) internal_function; -#endif /* Not C++ */ static inline size_t cu_sec_idx (struct Dwarf_CU *cu) @@ -634,6 +636,9 @@ cu_data (struct Dwarf_CU *cu) } +__END_DECLS + + /* Aliases to avoid PLTs. */ INTDECL (dwarf_aggregate_size) INTDECL (dwarf_attr) -- cgit v1.2.1 From e15999014144beb60698d524612567a16f3581de Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Thu, 24 Feb 2011 15:33:47 -0800 Subject: Temporarily export __libdw_formptr for use by C++ code. --- libdw/ChangeLog | 3 +++ libdw/libdw.map | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/libdw/ChangeLog b/libdw/ChangeLog index 35baf27c..704dc116 100644 --- a/libdw/ChangeLog +++ b/libdw/ChangeLog @@ -1,5 +1,8 @@ 2011-02-24 Roland McGrath + * libdw.map (ELFUTILS_PRIVATE_TMP): New version set; + add __libdw_formptr. + * libdwP.h: Make declarations C++-compatible using __BEGIN_DECLS. 2011-02-23 Roland McGrath diff --git a/libdw/libdw.map b/libdw/libdw.map index 1f71d03b..440daf96 100644 --- a/libdw/libdw.map +++ b/libdw/libdw.map @@ -254,3 +254,9 @@ ELFUTILS_0.149 { dwfl_dwarf_line; } ELFUTILS_0.148; + +# This will go away when we figure out the C++ exports. +ELFUTILS_PRIVATE_TMP { + global: + __libdw_formptr; +}; -- cgit v1.2.1