| 82 | del ql |
| 83 | |
| 84 | def test_gdbdebug_mips32(self): |
| 85 | ql = Qiling(["../examples/rootfs/mips32_linux/bin/mips32_hello"], "../examples/rootfs/mips32_linux", verbose=QL_VERBOSE.DEBUG) |
| 86 | ql.debugger = True |
| 87 | |
| 88 | # some random command test just to make sure we covered most of the command |
| 89 | def gdb_test_client(): |
| 90 | # yield to allow ql to launch its gdbserver |
| 91 | time.sleep(1.337 * 2) |
| 92 | |
| 93 | with SimpleGdbClient('127.0.0.1', 9999) as client: |
| 94 | client.send('qSupported:multiprocess+;swbreak+;hwbreak+;qRelocInsn+;fork-events+;vfork-events+;exec-events+;vContSupported+;QThreadEvents+;no-resumed+;xmlRegisters=i386') |
| 95 | client.send('vMustReplyEmpty') |
| 96 | client.send('QStartNoAckMode') |
| 97 | client.send('Hgp0.0') |
| 98 | client.send('qXfer:auxv:read::0, 1000') |
| 99 | client.send('?') |
| 100 | client.send('qXfer:threads:read::0,fff') |
| 101 | client.send(f'qAttached:{ql.os.pid}') |
| 102 | client.send('qC') |
| 103 | client.send('g') |
| 104 | client.send('m47ccd10,4') |
| 105 | client.send('qXfer:threads:read::0,1000') |
| 106 | client.send('m56555620,4') |
| 107 | client.send('m5655561c,4') |
| 108 | client.send('m56555620,4') |
| 109 | client.send('m5655561c,4') |
| 110 | client.send('m56555620,4') |
| 111 | client.send('qTStatus') |
| 112 | client.send('qTfP') |
| 113 | client.send('m56555600,40') |
| 114 | client.send('m56555620,4') |
| 115 | client.send('Z0,47ccd10,4') |
| 116 | client.send('QPassSignals:e;10;14;17;1a;1b;1c;21;24;25;2c;4c;97;') |
| 117 | client.send('vCont?') |
| 118 | client.send('vCont;c:pa410.-1') |
| 119 | client.send('c') |
| 120 | client.send('k') |
| 121 | |
| 122 | # yield to make sure ql gdbserver has enough time to receive our last command |
| 123 | time.sleep(1.337) |
| 124 | |
| 125 | threading.Thread(target=gdb_test_client, daemon=True).start() |
| 126 | |
| 127 | ql.run() |
| 128 | del ql |
| 129 | |
| 130 | def test_gdbdebug_armeb(self): |
| 131 | ql = Qiling(["../examples/rootfs/armeb_linux/bin/armeb_hello"], "../examples/rootfs/armeb_linux", verbose=QL_VERBOSE.DEBUG) |