Bugfix: Reset prevstate if line program sequence ends (#211)
authorrvijayc <44033253+rvijayc@users.noreply.github.com>
Tue, 18 Dec 2018 13:46:05 +0000 (05:46 -0800)
committerEli Bendersky <eliben@users.noreply.github.com>
Tue, 18 Dec 2018 13:46:05 +0000 (05:46 -0800)
examples/dwarf_decode_address.py

index 7b7d3e0186c09314652c7aed33db6aa7559d2f48..047ce3b56281abd4938b3e6e793a69a42d09bfdf 100644 (file)
@@ -83,7 +83,11 @@ def decode_file_line(dwarfinfo, address):
         prevstate = None
         for entry in lineprog.get_entries():
             # We're interested in those entries where a new state is assigned
-            if entry.state is None or entry.state.end_sequence:
+            if entry.state is None:
+                continue
+            if entry.state.end_sequence:
+                # if the line number sequence ends, clear prevstate.
+                prevstate = None
                 continue
             # Looking for a range of addresses in two consecutive states that
             # contain the required address.