def _describe_attr_line_strp(attr, die, section_offset):
return '(indirect line string, offset: 0x%x): %s' % (
- attr.raw_value, bytes2str(attr.value))
+ attr.raw_value, bytes2str(attr.value))
def _describe_attr_string(attr, die, section_offset):
return bytes2str(attr.value)
""" Given a CU object, fetch the line program it points to from the
.debug_line section.
If the CU doesn't point to a line program, return None.
-
+
Note about directory and file names. They are returned as two collections
in the lineprogram object's header - include_directory and file_entry.
lineprog_header.file_entry = tuple(
translate(e.get('DW_LNCT_path'), e.get('DW_LNCT_directory_index'), e.get('DW_LNCT_timestamp'), e.get('DW_LNCT_size'))
for e in lineprog_header.file_names)
-
+
# Calculate the offset to the next line program (see DWARF 6.2.4)
end_offset = ( debug_line_offset + lineprog_header['unit_length'] +
structs.initial_length_field_size())
parser = Struct('formatted_entry', *fields)
context[self.format_field + "_parser"] = parser
return parser._parse(stream, context)
-
+
ver5 = lambda ctx: ctx.version >= 5
-
+
self.Dwarf_lineprog_header = Struct('Dwarf_lineprog_header',
self.Dwarf_initial_length('unit_length'),
self.Dwarf_uint16('version'),
RepeatUntilExcluding(
lambda obj, ctx: obj == b'',
CString('include_directory'))),
- If(lambda ctx: ctx.version < 5,
+ If(lambda ctx: ctx.version < 5,
RepeatUntilExcluding(
lambda obj, ctx: len(obj.name) == 0,
- self.Dwarf_lineprog_file_entry)) # array name is file_entry
+ self.Dwarf_lineprog_file_entry)) # array name is file_entry
)
def _create_callframe_entry_headers(self):