]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Treat first entry special in dwarf_data::directory_table, can be NULL/empty.
authorMark Wielaard <mjw@redhat.com>
Thu, 19 Aug 2010 08:44:46 +0000 (10:44 +0200)
committerMark Wielaard <mjw@redhat.com>
Thu, 19 Aug 2010 08:44:46 +0000 (10:44 +0200)
libdw/ChangeLog
libdw/c++/dwarf_data

index 3d234088be5078d116d6fe2137a9ef5bf1332c84..67bb22a7df0a48630bd644cbc049f798dcc9ebfb 100644 (file)
@@ -1,3 +1,8 @@
+2010-08-19  Mark Wielaard  <mjw@redhat.com>
+
+       * c++/dwarf_data (dwarf_data::directory_table::directory_table):
+       Treat first entry "special", can be NULL/empty.
+
 2010-08-18  Roland McGrath  <roland@redhat.com>
 
        * c++/subr.hh (subr::container_tail_equal): New function.
index daf0aa2c67d45e66c9f85b8104061e8be3c22173..4de17d2daeba2eb737fe351ee39ec9ae10a94480 100644 (file)
@@ -311,7 +311,14 @@ namespace elfutils
 
       template<typename table>
       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;