This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

g++-4.5 vs dwarf branch


Hi,

I happily updated my machine to fedora 14 which comes with g++ 4.5.1.
Unfortunately that g++ version doesn't like the dwarf branch libdw/c++
stuff. There seem to be three issues. I solved one and put that on the
mjw/gcc45 branch. Reviews to see if it could be moved to the dwarf
branch would be nice.

- g++ 4.5 doesn't like to call constructors by name directly. This makes
  it impractical to have a class and a function that tries to call the
  constructor by the same name. So rename the various compile_units
  classes to compile_units_type. Leaving the function compile_units to
  return the correct instance type. (This is on the branch.)

- std::pair<_T1, _T2>::second’ has incomplete type. This is strange. I
  haven't been able to reproduce it in a smaller setup. The error looks
  as follows:

/usr/lib/gcc/x86_64-redhat-linux/4.5.1/../../../../include/c
++/4.5.1/bits/stl_pair.h: In instantiation of ‘std::pair<const
elfutils::dwarf_output::debug_info_entry,
elfutils::dwarf_output::die_info>’:
/home/mark/src/elfutils/libdw/c++/dwarf_output:233:63:   instantiated
from here
/usr/lib/gcc/x86_64-redhat-linux/4.5.1/../../../../include/c
++/4.5.1/bits/stl_pair.h:77:11: error: ‘std::pair<_T1, _T2>::second’ has
incomplete type
/home/mark/src/elfutils/libdw/c++/dwarf_output:146:12: error: forward
declaration of ‘struct elfutils::dwarf_output::die_info’

Which doesn't make sense to me. The code it complains about is an
invocation of vector<die_info_pair *>.end(). The following "patch" makes
it go away. But I have no idea why, both code constructs seem to not
actually use the pair directly:

diff --git a/libdw/c++/dwarf_output b/libdw/c++/dwarf_output
index 9e5c1f6..3a22b7a 100644
--- a/libdw/c++/dwarf_output
+++ b/libdw/c++/dwarf_output
@@ -230,8 +230,10 @@ namespace elfutils
        inline void set_hash ()
        {
          _m_hash = 0;
+/*
          for (_base::iterator i = _base::begin (); i != _base::end ();
++i)
            subr::hash_combine (_m_hash, (uintptr_t) *i);
+*/
        }
 
         inline children_type () {}
@@ -411,7 +413,7 @@ namespace elfutils
         for the circular_reference case, below.  */
       virtual size_t hash () const
       {
-       return ref->identity ();
+       return 0; // ref->identity ();
       }
     };
 
- Last issue is the "swap" function from compile_units[_type]:
  libdw/c++/dwarf_output:566:7: error: no matching function for call to
‘elfutils::dwarf_output::compile_units_type::swap(elfutils::dwarf_output::compile_units_type)’
  I am not clear where the swap function should have been defined.

Cheers,

Mark




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]