Skip to content

Commit

Permalink
show alloc size memory attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiesenj authored Apr 15, 2023
1 parent d1f4a92 commit cf9d2a6
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion amitools/binfmt/hunk/HunkShow.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ def show_segment(self, hunk, seg_list):
else:
alloc_size = None

if "alloc_type" in main:
alloc_type = main["alloc_type"]
else:
alloc_type = None

self.print_segment_header(
hunk_no,
type_name,
Expand All @@ -103,6 +108,7 @@ def show_segment(self, hunk, seg_list):
data_file_offset,
hunk_file_offset,
alloc_size,
alloc_type,
)
if self.hexdump and "data" in main:
print_hex(main["data"], indent=8)
Expand Down Expand Up @@ -239,10 +245,14 @@ def print_segment_header(
data_file_offset,
hunk_file_offset,
alloc_size,
alloc_type,
):
extra = ""
if alloc_size != None:
extra += "alloc size %08x " % alloc_size
if alloc_type:
extra += "alloc size (%s) %08x " % (alloc_type, alloc_size)
else:
extra += "alloc size %08x " % alloc_size
extra += "file header @%08x" % hunk_file_offset
if data_file_offset != None:
extra += " data @%08x" % data_file_offset
Expand Down

0 comments on commit cf9d2a6

Please sign in to comment.