'Add a mapping between an absolute address and a region ID. If this is a stack region map, all stack regions
beyond (lower than) this newly added regions will be discarded.
:param absolute_address:            An absolute memory address.
:param region_id:                   ID of the memory region.
:param related_function_address:    A related function address, mostly used for stack regions.'

def map(self, absolute_address, region_id, related_function_address=None):

    if self.is_stack:
        if (not region_id.startswith('stack_')):
            raise SimRegionMapError(('Received    a    non-stack    memory    ID    "%d"    in    a    stack    region    map' % region_id))
        while True:
            try:
                addr = self._address_to_region_id.floor_key(absolute_address)
                descriptor = self._address_to_region_id[addr]
                del self._address_to_region_id[addr]
                del self._region_id_to_address[descriptor.region_id]
            except KeyError:
                break
    elif (absolute_address in self._address_to_region_id):
        descriptor = self._address_to_region_id[absolute_address]
        del self._address_to_region_id[absolute_address]
        del self._region_id_to_address[descriptor.region_id]
    desc = RegionDescriptor(region_id, absolute_address, related_function_address=related_function_address)
    self._address_to_region_id[absolute_address] = desc
    self._region_id_to_address[region_id] = desc
