Stack dump is a dump of the stack from gdb, i.e. the result of the following gdb command :

        ``dump binary memory [stack_dump] [begin_addr] [end_addr]``

        We set the stack to the same addresses as the gdb session to avoid pointers corruption.

        :param stack_dump:  The dump file.
        :param stack_top:   The address of the top of the stack in the gdb session.

def set_stack(self, stack_dump, stack_top):
        """
        Stack dump is a dump of the stack from gdb, i.e. the result of the following gdb command :

        ``dump binary memory [stack_dump] [begin_addr] [end_addr]``

        We set the stack to the same addresses as the gdb session to avoid pointers corruption.

        :param stack_dump:  The dump file.
        :param stack_top:   The address of the top of the stack in the gdb session.
        """
        data = self._read_data(stack_dump)
        self.real_stack_top = stack_top
        addr = stack_top - len(data) # Address of the bottom of the stack
        l.info("Setting stack from 0x%x up to %#x", addr, stack_top)
        #FIXME: we should probably make we don't overwrite other stuff loaded there
        self._write(addr, data)