Skip to content

Commit

Permalink
Add cu_offset to DIES table
Browse files Browse the repository at this point in the history
  • Loading branch information
fzakaria committed Nov 5, 2023
1 parent 3433990 commit cc4ec1b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sqlelf/elf.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,7 @@ def determine_high_low_pc(DIE: DIE_t) -> Tuple[int | None, int | None]:
low_pc = low_pc_attr.value
high_pc_attr = DIE.attributes.get("DW_AT_high_pc", None)
# TODO(fzakaria): understand why high can be not be present if low exists
# seems to be possible though...
if not high_pc_attr:
return (low_pc, None)
high_pc_attr_class = describe_form_class(high_pc_attr.form)
Expand Down Expand Up @@ -546,10 +547,11 @@ def dwarf_dies_generator() -> Iterator[dict[str, Any]]:
# This is also the primary key of the DIE
"offset": DIE.offset,
"size": DIE.size,
"cu_offset": CU.cu_offset,
}

generator = Generator.make_generator(
["path", "tag", "name", "low_pc", "high_pc", "offset", "size"],
["path", "tag", "name", "low_pc", "high_pc", "offset", "size", "cu_offset"],
dwarf_dies_generator,
)

Expand Down

0 comments on commit cc4ec1b

Please sign in to comment.