Example #1
0
 def close(self):
     cui.get_variable(constants.ST_BREAKPOINTS).remove_session(self)
     for thread in self.threads.values():
         thread.close()
     cui.kill_buffer(buffers.ThreadBuffer, self)
     cui.run_hook(constants.ST_ON_KILL_SESSION)
     super(Session, self).close()
Example #2
0
 def _init_frames(self, frame_infos):
     self.frames = []
     for frame_info in frame_infos:
         self.frames.append(
             D_Frame(self, frame_info['id'], frame_info['file'],
                     frame_info['name'], frame_info['line']))
     frame = self.frames[0]
     cui.run_hook(constants.ST_ON_SUSPEND, self, frame.file, frame.line)
     self.display_frame(frame)
Example #3
0
 def update_thread(self, thread_info):
     if thread_info['type'] == 'thread_suspend':
         self.state = constants.THREAD_STATE_SUSPENDED
         self._init_frames(thread_info['frames'])
     elif thread_info['type'] == 'thread_resume':
         self.state = constants.THREAD_STATE_RUNNING
         self.frames = []
         cui.exec_if_buffer_exists(lambda b: b.set_file(),
                                   buffers.CodeBuffer, self)
         cui.run_hook(constants.ST_ON_RESUME, self)
Example #4
0
    def display(self):
        if self.variables is None and self.pending is None:
            self.pending = self.thread.session.send_command(
                constants.CMD_GET_FRAME,
                '%s\t%s\t%s' % (self.thread.id, self.id, ''))

        cui.exec_in_buffer_window(lambda b: b.set_file(self.file, self.line),
                                  buffers.CodeBuffer, self.thread)
        cui.exec_if_buffer_exists(lambda b: b.set_frame(self),
                                  buffers.FrameBuffer, self.thread)
        cui.exec_if_buffer_exists(lambda b: b.set_frame(self),
                                  buffers.EvalBuffer, self.thread)
        cui.run_hook(constants.ST_ON_SET_FRAME, self.thread, self.file,
                     self.line)
Example #5
0
 def close(self):
     for b in [buffers.CodeBuffer, buffers.FrameBuffer, buffers.EvalBuffer]:
         cui.kill_buffer(b, self)
     cui.delete_window_set_by_name('%s %s' %
                                   (constants.WINDOW_SET_NAME, self.id))
     cui.run_hook(constants.ST_ON_KILL_THREAD, self)