Removed use_origin flag and assume any segment with a start_addr > 0 is meant to have an origin

This commit is contained in:
Rob McMullen 2017-03-24 22:07:57 -07:00
parent c897460df0
commit 2e3a6147d5

View File

@ -339,7 +339,6 @@ class SegmentData(object):
class DefaultSegment(object):
savers = [SegmentSaver]
use_origin_default = False
can_resize_default = False
def __init__(self, rawdata, start_addr=0, name="All", error=None, verbose_name=None):
@ -352,10 +351,6 @@ class DefaultSegment(object):
self.map_width = 40
self.uuid = str(uuid.uuid4())
# Some segments may not have a standard place in memory, so this flag
# can be used to skip the memory map lookup when displaying disassembly
self.use_origin = self.__class__.use_origin_default
# Some segments may be resized to contain additional segments not
# present when the segment was created.
self.can_resize = self.__class__.can_resize_default
@ -404,7 +399,7 @@ class DefaultSegment(object):
def __getstate__(self):
state = dict()
for key in ['start_addr', 'error', 'name', 'verbose_name', 'page_size', 'map_width', 'uuid', 'use_origin', 'can_resize']:
for key in ['start_addr', 'error', 'name', 'verbose_name', 'page_size', 'map_width', 'uuid', 'can_resize']:
state[key] = getattr(self, key)
r = self.rawdata
state['_rawdata_bounds'] = list(r.byte_bounds_offset())
@ -424,8 +419,6 @@ class DefaultSegment(object):
"""
if not hasattr(self, 'uuid'):
self.uuid = str(uuid.uuid4())
if not hasattr(self, 'use_origin'):
self.use_origin = self.__class__.use_origin_default
if not hasattr(self, 'can_resize'):
self.can_resize = self.__class__.can_resize_default
@ -979,7 +972,6 @@ class ObjSegment(DefaultSegment):
DefaultSegment.__init__(self, rawdata, start_addr, name, **kwargs)
self.metadata_start = metadata_start
self.data_start = data_start
self.use_origin = True
def __str__(self):
count = len(self)