fix .debug_aranges parsing
authorPhilip Pronin <philipp@fb.com>
Thu, 13 Oct 2016 17:09:36 +0000 (10:09 -0700)
committerFacebook Github Bot <facebook-github-bot-bot@fb.com>
Thu, 13 Oct 2016 17:23:32 +0000 (10:23 -0700)
Summary:
Each sequence of tuples within an entires set is terminated with (0,
0) according to the DWARF standard (see 7.20 in
http://www.dwarfstd.org/doc/DWARF4.pdf).

Reviewed By: ot, luciang

Differential Revision: D4014952

fbshipit-source-id: c4b034c94adc4a0d9b052456c02919a54a79eaf1

folly/experimental/symbolizer/Dwarf.cpp

index f1087f80512d114d6220a56ea6710a85e099c153..7709dc0bfa6e8c2e64c5127f9ac004590ece50d3 100644 (file)
@@ -457,7 +457,7 @@ bool Dwarf::findDebugInfoOffset(uintptr_t address,
       auto start = read<uintptr_t>(chunk);
       auto length = read<uintptr_t>(chunk);
 
-      if (start == 0) {
+      if (start == 0 && length == 0) {
         break;
       }