示例#1
0
  def __init__(self, vm_data = None, asm_data = None, parent = None):
    QAbstractTableModel.__init__(self, parent)
    if vm_data is not None:
      self.words = vm_data.vm.memory
      self.mem_len = vm_data.vm.MEMORY_SIZE
      self.modified = [False for _ in xrange(self.mem_len)]
      self.is_readable = vm_data.is_readable
      self.is_locked = lambda x: not (vm_data.is_readable(x) and vm_data.is_writeable(x))
      self.ca = vm_data.ca()

      self.symtable = asm_data.symtable
      self.end_addr = asm_data.end_address

      self.disasm = Disasm()
      self.inited = True
    else:
      self.inited = False
示例#2
0
 def __show(self, thread, addr, sym, filename, line):
     assert (sym)
     view = None
     #find a view that matches the current filename
     for v in self._Composite__views:
         if v.filename() == filename:
             view = v
             book = self.__book
             book.set_current_page(book.page_num(v.widget()))
             break
     #not found, add a new view
     if not view:
         w = self.__book
         if line:
             view = Source(w)
             view.read(thread, addr, sym)
         else:
             view = Disasm(w)
         self.add(view, filename)
     assert view
     view.show(thread, addr, sym)
     self.__current_view = view