Exemple #1
0
def main(vw):
    vq_main.startup(css=vq_colors.qt_matrix)
    mw = VQVivMainWindow(vw)
    viv_extensions.loadExtensions(vw, mw)
    mw.show()
    vq_main.main()
Exemple #2
0
        QtGui.QTabWidget.__init__(self, parent=parent)

        for name,config in configs:
            editor = EnviConfigEditor(config, parent=self)
            self.addTab(editor, name)

if __name__ == '__main__':

    import vqt.main as vq_main
    import envi.config as e_config

    defaults = {
        'woot':10,
        'baz':'faz',
        'foo':True,
    }

    docs = {
        'woot':'The number of woots!',
        'baz':'Where to look for a baz',
        'foo':'Should we do foo?',
    }

    config = e_config.EnviConfig(filename='test.json', defaults=defaults, docs=docs)

    vq_main.startup()
    widget = EnviConfigEditor( config )
    widget.show()
    vq_main.main()

Exemple #3
0
        QTabWidget.__init__(self, parent=parent)

        for name,config in configs:
            editor = EnviConfigEditor(config, parent=self)
            self.addTab(editor, name)

if __name__ == '__main__':

    import vqt.main as vq_main
    import envi.config as e_config

    defaults = {
        'woot':10,
        'baz':'faz',
        'foo':True,
    }

    docs = {
        'woot':'The number of woots!',
        'baz':'Where to look for a baz',
        'foo':'Should we do foo?',
    }

    config = e_config.EnviConfig(filename='test.json', defaults=defaults, docs=docs)

    vq_main.startup()
    widget = EnviConfigEditor( config )
    widget.show()
    vq_main.main()

Exemple #4
0
def main(vw):
    vq_main.startup(css=vq_colors.qt_matrix)
    mw = VQVivMainWindow(vw)
    viv_extensions.loadExtensions( vw, mw )
    mw.show()
    vq_main.main()
Exemple #5
0
def main():
    parser = argparse.ArgumentParser(prog='vdbbin', usage='%(prog)s [options] [platformopt=foo, ...]')
    parser.add_argument('-c', '--cmd', dest='command', default=None, help='Debug a fired command')
    parser.add_argument('-p', '--process', dest='process', default=None, help='Attach to process by name or pid')
    parser.add_argument('-Q', '--qt', dest='doqt', default=False, action='store_true', help='Run the QT gui')
    parser.add_argument('-R', '--remote', dest='remotehost', default=None, help='Attach to remote VDB server')
    parser.add_argument('-r', '--run', dest='dorunagain', default=False, action='store_true', help='Do not stop on attach')
    parser.add_argument('-s', '--snapshot', dest='snapshot', default=None, help='Load a vtrace snapshot file')
    parser.add_argument('-S', '--server', dest='doserver', default=False, action='store_true')
    parser.add_argument('-v', '--verbose', dest='doverbose', default=False, action='store_true')
    parser.add_argument('-t', '--target', dest='target', default=None, help='Activate special vdb target ( -t ? for list )')
    parser.add_argument('--android', dest='doandroid', default=False, action='store_true', help='Debug Android with ADB!')
    parser.add_argument('-e', '--eventid', dest='eventid', default=None, type=int, help='Used for Windows JIT')
    parser.add_argument('-w', '--waitfor', dest='waitfor', default=None, help='Wait for process with name')
    parser.add_argument('platargs', nargs='*')

    args = parser.parse_args()

    # Handle some options before we even create a trace.
    vtrace.remote = args.remotehost # None by default

    platargs = {}

    for arg in args.platargs:

        if arg.find('=') == -1:
            continue

        k, v = arg.split('=', 1)
        if v.isdigit():
            v = int(v)

        platargs[k.lower()] = v

    if args.doandroid:
        import vdb.tools.android as v_utils_android
        v_utils_android.runVdbOnDroid()
        return

    if args.target == '?':
        targetusage()

    trace = None
    if args.snapshot:
        print('Loading process snapshot...')
        trace = vt_snap.loadSnapshot(args.snapshot)

    if trace == None:
        trace = vtrace.getTrace(target=args.target, **platargs)

    db = vdb.Vdb(trace)
    db.runagain = args.dorunagain
    db.windows_jit_event = args.eventid

    if args.waitfor:
        while True:
            newest_pid = 0
            for pid, pname in trace.ps():
                pname = pname.split(' ')[0]
                if pname.find(args.waitfor) != -1:
                    newest_pid = pid

            if newest_pid != 0:
                trace.attach(newest_pid)
                break

    if args.doqt:
        import vqt.main as vq_main
        import vdb.qt.main as vdb_q_main
        import vqt.colors as vq_colors
        vq_main.startup(css=vq_colors.qt_matrix)
        qgui = vdb_q_main.VdbWindow(db)
        qgui.show()

    if args.doserver:
        db.do_server('')

    if args.process:
        db.do_attach(args.process)

    elif args.command:
        trace.execute(args.command)

    if args.eventid:
        db.trace.setMeta('WindowsJitEvent', args.eventid)

    if args.doqt:
        vq_main.main()

    else:

        while not db.shutdown.isSet():
            try:

                db.cmdloop()

            except KeyboardInterrupt:
                if db.trace.isRunning():
                    db.trace.sendBreak()

            except SystemExit:
                break

            except:
                traceback.print_exc()