* dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
authorCary Coutant <ccoutant@google.com>
Tue, 13 Mar 2012 00:25:58 +0000 (00:25 +0000)
committerCary Coutant <ccoutant@google.com>
Tue, 13 Mar 2012 00:25:58 +0000 (00:25 +0000)
handling of DW_LNE_define_file.

gold/ChangeLog
gold/dwarf_reader.cc

index f0ec8938f2a83faef08bd3540c7cd1662668507f..0a72132fe02e26a85d449e606e5eebb95182e923 100644 (file)
@@ -1,3 +1,8 @@
+2012-03-12  Cary Coutant  <ccoutant@google.com>
+
+       * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
+       handling of DW_LNE_define_file.
+
 2012-03-12  Cary Coutant  <ccoutant@google.com>
 
        * reduced_debug_output.cc
index 73f84b0d420fcfd84db282714a762c77ea827a7f..189e6a6740f729fffdf12d56a03dacf449e81a26 100644 (file)
@@ -413,17 +413,16 @@ Sized_dwarf_line_info<size, big_endian>::process_one_opcode(
               start += templen;
 
               uint64_t dirindex = read_unsigned_LEB_128(start, &templen);
-              oplen += templen;
 
               if (dirindex >= this->directories_.back().size())
                 dirindex = 0;
              int dirindexi = static_cast<int>(dirindex);
 
-              read_unsigned_LEB_128(start, &templen);   // mod_time
-              oplen += templen;
-
-              read_unsigned_LEB_128(start, &templen);   // filelength
-              oplen += templen;
+              // This opcode takes two additional ULEB128 parameters
+              // (mod_time and filelength), but we don't use those
+              // values.  Because OPLEN already tells us how far to
+              // skip to the next opcode, we don't need to read
+              // them at all.
 
               this->files_.back().push_back(std::make_pair(dirindexi,
                                                           filename));