diff options
author | Petr Machata <pmachata@redhat.com> | 2011-02-25 12:14:54 +0100 |
---|---|---|
committer | Petr Machata <pmachata@redhat.com> | 2011-02-25 12:14:54 +0100 |
commit | 36bdfb6721a5f70e1dfab131485d7203124a1259 (patch) | |
tree | 523e27f39443ecd785463eff4f1e3a90ca58cf9e | |
parent | e1b6af047ae701e2835dacceba53edc6a5544d9c (diff) | |
parent | e15999014144beb60698d524612567a16f3581de (diff) | |
download | elfutils-pmachata/range_list_iterator_formptr.tar.gz |
Merge branch 'dwarf' into pmachata/range_list_iterator_formptrpmachata/range_list_iterator_formptr
-rw-r--r-- | libdw/ChangeLog | 7 | ||||
-rw-r--r-- | libdw/c++/dwarf_tracker | 42 | ||||
-rw-r--r-- | libdw/libdw.map | 6 | ||||
-rw-r--r-- | libdw/libdwP.h | 21 | ||||
-rw-r--r-- | tests/ChangeLog | 4 | ||||
-rw-r--r-- | tests/Makefile.am | 8 |
6 files changed, 70 insertions, 18 deletions
diff --git a/libdw/ChangeLog b/libdw/ChangeLog index 1b85aebf..704dc116 100644 --- a/libdw/ChangeLog +++ b/libdw/ChangeLog @@ -1,3 +1,10 @@ +2011-02-24 Roland McGrath <roland@redhat.com> + + * 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 <roland@redhat.com> * c++/dwarf-knowledge.cc (expected_value_space): 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. 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; +}; 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 <drepper@redhat.com>, 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) 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 <roland@redhat.com> + + * Makefile.am (TESTS): Put the slow dwarfcmp tests last. + 2011-02-02 Josh Stone <jistone@redhat.com> * 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 |