Skip to content

Commit

Permalink
Fix for 1719
Browse files Browse the repository at this point in the history
  • Loading branch information
sevaa committed Sep 19, 2024
1 parent a349131 commit efc2ab4
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions dwex/locs.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,16 @@ def desc_CFA_rule(rule):
# Opcode tooltips?
return GenericTableModel(("Command",), ((cmd,) for cmd in self.dump_expr(ll.loc_expr)))
else: # Loclist
cu_base = get_cu_base(self.die)
cu_base = None
def base_for_entry(l): # May throw NoBaseException
nonlocal cu_base
if l.is_absolute:
return 0
else:
if cu_base is None:
cu_base = get_cu_base(self.die) # Throws here
return cu_base

values = list()
if self.lowlevel:
ver5 = self.die.cu['version'] >= 5
Expand Down Expand Up @@ -117,7 +126,7 @@ def desc_CFA_rule(rule):
from .crash import report_crash
from inspect import currentframe
report_crash(exc, exc.__traceback__, version, currentframe())
base = 0 if l.is_absolute else cu_base
base = base_for_entry(l)
if ver5:
is_def_loc = raw.entry_type == 'DW_LLE_default_location'
(raw_start_type, raw_start) = one_of(raw, ('index', 'start_index', 'start_offset', 'start_address'))
Expand Down Expand Up @@ -151,7 +160,7 @@ def desc_CFA_rule(rule):
from .crash import report_crash
from inspect import currentframe
report_crash(exc, exc.__traceback__, version, currentframe())
base = 0 if l.is_absolute else cu_base
base = base_for_entry(l)
values.append((hex(base + l.begin_offset),
hex(base + l.end_offset),
expr_dump))
Expand Down

0 comments on commit efc2ab4

Please sign in to comment.