On Wed, 2010-08-18 at 20:06 +0200, Mark Wielaard wrote:
On Wed, 2010-08-18 at 10:59 -0700, Roland McGrath wrote:
> > But then I get in similar trouble inside the subr::equal_to template
> > code. Specifically the elfutils::subr::equal_to<std::basic_string<char,
> > std::char_traits<char>, std::allocator<char> >, char
> > instance, which will crash and burn trying to compare the empty string
> > and the NULL. Still looking into that.
> I think those comparisons should work like dwarf::directory_table::table_equal
> and ignore the first element anyway. I did a tweak to dwarf_data to do that.
Yes, that is what I ended up doing too.
Actually my approach was slightly different. I changed the line_info
directory_table extractors to skip the zeroth entry. So the table_equal
implementations can just compare only the "real" entries. If we don't do
this then the NULL (zero) entries are still there and will blow up the
dwarf_output copy constructor. (Try src/dwarfcmp-test -T src/ar src/ar)
Patch attached. What do you think?