From: Mark Wielaard Date: Thu, 19 Aug 2010 08:44:46 +0000 (+0200) Subject: Treat first entry special in dwarf_data::directory_table, can be NULL/empty. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cb3624fbee26df832d636566efaf93203d271dd3;p=thirdparty%2Felfutils.git Treat first entry special in dwarf_data::directory_table, can be NULL/empty. --- diff --git a/libdw/ChangeLog b/libdw/ChangeLog index 3d234088b..67bb22a7d 100644 --- a/libdw/ChangeLog +++ b/libdw/ChangeLog @@ -1,3 +1,8 @@ +2010-08-19 Mark Wielaard + + * c++/dwarf_data (dwarf_data::directory_table::directory_table): + Treat first entry "special", can be NULL/empty. + 2010-08-18 Roland McGrath * c++/subr.hh (subr::container_tail_equal): New function. diff --git a/libdw/c++/dwarf_data b/libdw/c++/dwarf_data index daf0aa2c6..4de17d2da 100644 --- a/libdw/c++/dwarf_data +++ b/libdw/c++/dwarf_data @@ -311,7 +311,14 @@ namespace elfutils template directory_table (const table &other) - : _base (other.begin (), other.end ()) {} + { + /* The first entry is "special". It can be NULL/empty. + This is not encoded in the .debug_line table, but in + the DW_AT_comp_dir attribute of the referring CU. */ + typename table::const_iterator first = other.begin (); + _base::push_back (*first != NULL ? std::string (*first) : ""); + _base::insert (_base::end (), ++first, other.end ()); + } std::string to_string () const;