def _dir_gdb(self, data, total, index, exe, bsp_arch, bsp): if len(data) < 3 or len(data) > 4: raise error.general('invalid %gdb arguments') self.process = gdb.gdb(bsp_arch, bsp, trace=self.exe_trace('gdb'), mi_trace=self.exe_trace('gdb-mi')) script = self.expand('%%{%s}' % data[2]) if script: script = [l.strip() for l in script.splitlines()] if not self.in_error: if self.console: self.console.open() if not self.opts.dry_run(): self.process.open( data[0], data[1], script=script, output=self.capture, gdb_console=self.capture_console, timeout=(int(self.expand('%{timeout}')), int(self.expand('%{max_test_period}')), self._timeout, self._test_too_long)) if self.console: self.console.close()
def restart(self): log('Restart clicked') self.gdb.quit() self.pdb.quit() self.gdb = gdb.gdb(self.python_file_gdb, self.cpp_file, self.cpp_start_line) self.pdb = pdb.pdb(self.python_file_pdb, self.python_start_line) self.button_step_over.setEnabled(True) self.updateView()
def __init__(self): self.db=gdb() self.driver = webdriver.Chrome('C:/greed/chromedriver.exe') self.driver.implicitly_wait(5) self.base_url = "http://www.greedgame.com/" self.order=[] # my orders self.have={} # set in worldbank, 0s added during makeneed self.low=True self.offered=[] # offered by others self.valua=[] # those cu not having a player assigned self.dont=[] # do not order in val self.need={} # qty needed self.want=[] # self.bought=[] # key to bought to avoid errors self.phase="n" # see desc
def __init__(self, ui, dbgio): self.ui = ui self.dbgio = dbgio self.device = vendor.get_device(self.ui, soc_name) self.dbgio.connect(self.device.cpu_info.name, 'swd') self.cpu = cortexm.cortexm(self, ui, self.dbgio, self.device) self.device.bind_cpu(self.cpu) self.mem = mem.mem(self.cpu) self.flash = flash.flash(flash_driver.sdrv(self.device), self.device, self.mem) gpio_drv = (gpio_driver.drv(self.device, gpio_cfg)) self.gpio = gpio.gpio(gpio_drv) self.i2c = i2c.i2c(i2c_driver.gpio(gpio_drv, 'PB6', 'PB9')) self.dac = dac.cs43l22(self.i2c, 0x94, self.dac_reset) # setup the rtt client ram = self.device.sram self.rtt = rtt.rtt(self.cpu, mem.region('ram', ram.address, ram.size)) # setup the gdb server self.gdb = gdb.gdb(self.cpu) self.menu_root = ( ('cpu', self.cpu.menu, 'cpu functions'), ('da', self.cpu.cmd_disassemble, cortexm.help_disassemble), ('dac', self.dac.menu, 'dac functions'), ('debugger', self.dbgio.menu, 'debugger functions'), ('exit', self.cmd_exit), ('flash', self.flash.menu, 'flash functions'), ('gdb', self.gdb.run), ('go', self.cpu.cmd_go), ('gpio', self.gpio.menu, 'gpio functions'), ('halt', self.cpu.cmd_halt), ('help', self.ui.cmd_help), ('history', self.ui.cmd_history, cli.history_help), ('i2c', self.i2c.menu, 'i2c functions'), ('map', self.device.cmd_map), ('mem', self.mem.menu, 'memory functions'), ('program', self.flash.cmd_program, flash.help_program), ('regs', self.cmd_regs, soc.help_regs), ('rtt', self.rtt.menu, 'rtt client functions'), ('vtable', self.cpu.cmd_vtable), ) self.ui.cli.set_root(self.menu_root) self.set_prompt() self.dbgio.cmd_info(self.ui, None)
def _dir_gdb(self, data, total, index, exe, bsp_arch, bsp): if len(data) < 3 or len(data) > 4: raise error.general('invalid %gdb arguments') self.process = gdb.gdb(bsp_arch, bsp, trace = self.debug_trace('gdb'), mi_trace = self.debug_trace('gdb-mi')) script = self.expand('%%{%s}' % data[2]) if script: script = [l.strip() for l in script.splitlines()] if not self.in_error: if self.console: self.console.open() self.process.open(data[0], data[1], script = script, output = self.capture, gdb_console = self.capture_console, timeout = int(self.expand('%{timeout}'))) if self.console: self.console.close()
def __init__(self, mixedText, python_file_gdb, cpp_file, cpp_start_line, python_file_pdb, python_start_line, next_dict, cpp_offset_lines=0, python_offset_lines=0, parent=None, watches=[], cpponly=False): self.python_file_gdb = python_file_gdb self.cpp_file = cpp_file self.cpp_start_line = cpp_start_line self.next_dict = next_dict self.python_file_pdb = python_file_pdb self.python_start_line = python_start_line self.cpp_offset_lines = cpp_offset_lines self.python_offset_lines = python_offset_lines self.watches = watches self.cpponly = cpponly self.fontFamily = "Courier" super(Form, self).__init__(parent) self.setWindowTitle("SEJITS Integrated Debugger") self.resize(1920, 1024) self.textedit = QTextEdit() self.textedit.setReadOnly(True) self.textedit.setLineWrapMode(QTextEdit.NoWrap) self.button_step_over = QPushButton("Step over") self.button_step_over.clicked.connect(self.stepOver) self.button_restart = QPushButton("Restart") self.button_restart.clicked.connect(self.restart) self.button_close = QPushButton("Close") self.button_close.clicked.connect(self.accept) self.lang_colors = dict() self.lang_colors['C++'] = '#ff0000' self.lang_colors['Python'] = '#0000ff' if self.cpponly: self.watches = [x for x in watches if x[0] == 'C++'] self.watch_layout = QGridLayout() self.watch_values = dict() self.button_add_watch = QPushButton("Add watch") self.button_add_watch.clicked.connect(self.add_watch) self.right_panel = QVBoxLayout() self.right_panel.addLayout(self.watch_layout) self.right_panel.addWidget(self.button_add_watch) self.right_panel.addStretch() self.button_hlayout = QHBoxLayout() self.button_hlayout.addWidget(self.button_step_over) self.button_hlayout.addWidget(self.button_restart) self.button_hlayout.addWidget(self.button_close) self.edit_watch_hlayout = QHBoxLayout() self.edit_watch_hlayout.addWidget(self.textedit) self.edit_watch_hlayout.addLayout(self.right_panel) self.edit_watch_hlayout.setStretch(0, 3) self.edit_watch_hlayout.setStretch(1, 1) self.vlayout = QVBoxLayout() self.vlayout.addLayout(self.edit_watch_hlayout) self.vlayout.addLayout(self.button_hlayout) self.setLayout(self.vlayout) self.mixedText = mixedText self.gdb = gdb.gdb(self.python_file_gdb, self.cpp_file, self.cpp_start_line) self.pdb = pdb.pdb(self.python_file_pdb, self.python_start_line) self.updateView() self.update_watch_widgets()
def __init__(self): self.db=gdb() self.user="******"
# -*- coding: utf-8 -*- from gdb import gdb import time import sys import urllib2 def getIp(): f = urllib2.urlopen('http://wtfismyip.com/').read() x=f.split("Your f*****g IP address is:</h2></center><center><p>") x=x[1].split("</center>",1) return x[0] if __name__ == "__main__": db=gdb() ip=getIp() print "my IP >"+ip+"<" result = db.existIp(ip) print result if len(sys.argv)>1: ich=sys.argv[1] else: ich ="not set" zeit=time.strftime("%Y %b %d %H:%M:%S", time.localtime()) if result==None: db.insertIp(ip,ich,zeit) print "inserted with "+zeit db.setUserOn(ich) else: print "<----------------------"