Added leading $ to hex values for printing

This commit is contained in:
Rob McMullen 2016-02-07 11:12:50 -08:00
parent 53261afdb0
commit 63239991e3

View File

@ -296,7 +296,7 @@ class ObjSegment(DefaultSegment):
def __str__(self):
count = len(self)
s = "%s%04x-%04x (%04x @ %04x)" % (self.name, self.start_addr, self.start_addr + count, count, self.data_start)
s = "%s $%04x-$%04x ($%04x @ $%04x)" % (self.name, self.start_addr, self.start_addr + count, count, self.data_start)
if self.error:
s += " " + self.error
return s
@ -328,6 +328,9 @@ class IndexedByteSegment(DefaultSegment):
self.order = byte_order
DefaultSegment.__init__(self, 0, bytes, **kwargs)
def __str__(self):
return "%s ($%x @ $%x)" % (self.name, len(self), self.order[0])
def __len__(self):
return np.alen(self.order)