qilingframework / qiling

A True Instrumentable Binary Emulation Framework
https://qiling.io
GNU General Public License v2.0
5.18k stars 744 forks source link

Remote GDB debugging X8664_Linux occurs warning: Invalid remote reply: #1377

Open Alsoprach opened 1 year ago

Alsoprach commented 1 year ago

*Describe the bug When qiling runs the x8664_linux program and enables default GDB remote debugging, two n/si instructions issued by GDB will trigger warning: Invalid remote reply, causing debugging to fail. But the breakpoint-based c instruction is normal.

Sample Code

import sys
from qiling import *
from qiling.extensions import pipe
from qiling.const import QL_VERBOSE

def test_gdb(path, rootfs):
    ql = Qiling(path, rootfs, verbose=QL_VERBOSE.DEBUG,log_file="./output")
    ql.debugger = True
    ql.run()  

if __name__ == "__main__":
    test_gdb(["../tool/qiling/examples/rootfs/x8664_linux/bin/pwn1"], "../tool/qiling/examples/rootfs/x8664_linux")

Expected behavior Remote gdb can debug normally without restriction.

Screenshots CleanShot 2023-08-30 at 22 05 42

Additional context Part of the log.

[+]     getpkt ("qSupported:multiprocess+;swbreak+;hwbreak+;qRelocInsn+;fork-events+;vfork-events+;exec-events+;vContSupported+;QThreadEvents+;no-resumed+;memory-tagging+;xmlRegisters=i386");
[+]     putpkt ("+");
[+]     [sent ack]
[+]     putpkt ("BreakpointCommands+;ConditionalBreakpoints+;ConditionalTracepoints+;DisconnectedTracing+;EnableDisableTracepoints+;InstallInTrace+;QAgent+;QCatchSyscalls+;QDisableRandomization+;QNonStop+;QPassSignals+;QProgramSignals+;QStartNoAckMode+;QStartupWithShell+;QTBuffer:size+;StaticTracepoints+;TraceStateVariables+;TracepointSource+;exec-events+;fork-events+;hwbreak+;multiprocess+;no-resumed+;qXfer:features:read+;qXfer:siginfo:read+;qXfer:siginfo:write+;qXfer:statictrace:read+;qXfer:traceframe-info:read+;swbreak+;tracenz+;vfork-events+;PacketSize=3fff;qXfer:spu:read+;qXfer:spu:write+;QEnvironmentHexEncoded+;QEnvironmentReset+;QEnvironmentUnset+;QSetWorkingDir+;qXfer:auxv:read+;qXfer:exec-file:read+;qXfer:threads:read+");
[+]     getpkt ("vMustReplyEmpty");
[+]     putpkt ("+");
[+]     [sent ack]
[+]     putpkt ("");
[+]     getpkt ("QStartNoAckMode");
[+]     putpkt ("+");
[+]     [sent ack]
[+]     [noack mode enabled]
[+]     putpkt ("OK");
[+]     getpkt ("QProgramSignals:0;1;3;4;6;7;8;9;a;b;c;d;e;f;10;11;12;13;14;15;16;17;18;19;1a;1b;1c;1d;1e;1f;20;21;22;23;24;25;26;27;28;29;2a;2b;2c;2d;2e;2f;30;31;32;33;34;35;36;37;38;39;3a;3b;3c;3d;3e;3f;40;41;42;43;44;45;46;47;48;49;4a;4b;4c;4d;4e;4f;50;51;52;53;54;55;56;57;58;59;5a;5b;5c;5d;5e;5f;60;61;62;63;64;65;66;67;68;69;6a;6b;6c;6d;6e;6f;70;71;72;73;74;75;76;77;78;79;7a;7b;7c;7d;7e;7f;80;81;82;83;84;85;86;87;88;89;8a;8b;8c;8d;8e;8f;90;91;92;93;94;95;96;97;");
[+]     putpkt ("OK");
[+]     getpkt ("Hgp0.0");
[+]     putpkt ("OK");
[+]     getpkt ("qXfer:features:read:target.xml:0,1000");
[+]     putpkt ("m<?xml version='1.0' encoding='utf-8'?>
<target>
 * <architecture>i386:x86-64</architecture>
 * <osabi>GNU/Linux</osabi>

 * <feature name="org.gnu.gdb.i386.core">
  <flags id="i386_eflags" size="4">
 * <field name="CF" start="0" end="0" />
 * <field name="" start="1" end="1" />
 * <field name="PF" start="2" end="2" />
 * <field name="AF" start="4" end="4" />
 * <field name="ZF" start="6" end="6" />
 * <field name="SF" start="7" end="7" />
 * <field name="TF" start="8" end="8" />
 * <field name="IF" start="9" end="9" />
 * <field name="DF" start="10" end="10" />
 * <field name="OF" start="11" end="11" />
 * <field name="NT" start="14" end="14" />
 * <field name="RF" start="16" end="16" />
 * <field name="VM" start="17" end="17" />
 * <field name="AC" start="18" end="18" />
 * <field name="VIF" start="19" end="19" />
 * <field name="VIP" start="20" end="20" />
 * <field name="ID" start="21" end="21" />
  </flags>

  <reg name="rax" bitsize="64" type="int64" />
  <reg name="rbx" bitsize="64" type="int64" />
  <reg name="rcx" bitsize="64" type="int64" />
  <reg name="rdx" bitsize="64" type="int64" />
  <reg name="rsi" bitsize="64" type="int64" />
  <reg name="rdi" bitsize="64" type="int64" />
  <reg name="rbp" bitsize="64" type="data_ptr" />
  <reg name="rsp" bitsize="64" type="data_ptr" />
  <reg name="r8" bitsize="64" type="int64" />
  <reg name="r9" bitsize="64" type="int64" />
  <reg name="r10" bitsize="64" type="int64" />
  <reg name="r11" bitsize="64" type="int64" />
  <reg name="r12" bitsize="64" type="int64" />
  <reg name="r13" bitsize="64" type="int64" />
  <reg name="r14" bitsize="64" type="int64" />
  <reg name="r15" bitsize="64" type="int64" />

  <reg name="rip" bitsize="64" type="code_ptr" />
  <reg name="eflags" bitsize="32" type="i386_eflags" />
  <reg name="cs" bitsize="32" type="int32" />
  <reg name="ss" bitsize="32" type="int32" />
  <reg name="ds" bitsize="32" type="int32" />
  <reg name="es" bitsize="32" type="int32" />
  <reg name="fs" bitsize="32" type="int32" />
  <reg name="gs" bitsize="32" type="int32" />

  <reg name="st0" bitsize="80" type="i387_ext" />
  <reg name="st1" bitsize="80" type="i387_ext" />
  <reg name="st2" bitsize="80" type="i387_ext" />
  <reg name="st3" bitsize="80" type="i387_ext" />
  <reg name="st4" bitsize="80" type="i387_ext" />
  <reg name="st5" bitsize="80" type="i387_ext" />
  <reg name="st6" bitsize="80" type="i387_ext" />
  <reg name="st7" bitsize="80" type="i387_ext" />

  <reg name="fctrl" bitsize="32" type="int" group="float" />
  <reg name="fstat" bitsize="32" type="int" group="float" />
  <reg name="ftag" bitsize="32" type="int" group="float" />
  <reg name="fiseg" bitsize="32" type="int" group="float" />
  <reg name="fioff" bitsize="32" type="int" group="float" />
  <reg name="foseg" bitsize="32" type="int" group="float" />
  <reg name="fooff" bitsize="32" type="int" group="float" />
  <reg name="fop" bitsize="32" type="int" group="float" />
</feature>
 * <feature name="org.gnu.gdb.i386.sse">
  <vector id="v4f" type="ieee_single" count="4" />
  <vector id="v2d" type="ieee_double" count="2" />
  <vector id="v16i8" type="int8" count="16" />
  <vector id="v8i16" type="int16" count="8" />
  <vector id="v4i32" type="int32" count="4" />
  <vector id="v2i64" type="int64" count="2" />
  <union id="vec128">
 * <field name="v4_float" type="v4f" />
 * <field name="v2_double" type="v2d" />
 * <field name="v16_int8" type="v16i8" />
 * <field name="v8_int16" type="v8i16" />
 * <field name="v4_int32" type="v4i32" />
 * <field name="v2_int64" type="v2i64" />
 * <field name="uint128" type="uint128" />
  </union>
  <flags id="i386_mxcsr" size="4">
 * <field name="IE" start="0" end="0" />
 * <field name="DE" start="1" end="1" />
 * <field name="ZE" start="2" end="2" />
 * <field name="OE" start="3" end="3" />
 * <field name="UE" start="4" end="4" />
 * <field name="PE" start="5" end="5" />
 * <field name="DAZ" start="6" end="6" />
 * <field name="IM" start="7" end="7" />
 * <field name="DM" start="8" end="8" />
 * <field name="ZM" start="9" end=");
[+]     getpkt ("qXfer:features:read:target.xml:1000,1000");
[+]     putpkt ("l"9" />
 * <field name="OM" start="10" end="10" />
 * <field name="UM" start="11" end="11" />
 * <field name="PM" start="12" end="12" />
 * <field name="FZ" start="15" end="15" />
  </flags>

  <reg name="xmm0" bitsize="128" type="vec128" regnum="40" />
  <reg name="xmm1" bitsize="128" type="vec128" />
  <reg name="xmm2" bitsize="128" type="vec128" />
  <reg name="xmm3" bitsize="128" type="vec128" />
  <reg name="xmm4" bitsize="128" type="vec128" />
  <reg name="xmm5" bitsize="128" type="vec128" />
  <reg name="xmm6" bitsize="128" type="vec128" />
  <reg name="xmm7" bitsize="128" type="vec128" />
  <reg name="xmm8" bitsize="128" type="vec128" />
  <reg name="xmm9" bitsize="128" type="vec128" />
  <reg name="xmm10" bitsize="128" type="vec128" />
  <reg name="xmm11" bitsize="128" type="vec128" />
  <reg name="xmm12" bitsize="128" type="vec128" />
  <reg name="xmm13" bitsize="128" type="vec128" />
  <reg name="xmm14" bitsize="128" type="vec128" />
  <reg name="xmm15" bitsize="128" type="vec128" />

  <reg name="mxcsr" bitsize="32" type="i386_mxcsr" group="vector" />
</feature>
 * <feature name="org.gnu.gdb.i386.linux">
  <reg name="orig_rax" bitsize="64" type="int" regnum="57" />
</feature>
 * <feature name="org.gnu.gdb.i386.segments">
  <reg name="fs_base" bitsize="64" type="int" />
  <reg name="gs_base" bitsize="64" type="int" />
</feature>
 * <feature name="org.gnu.gdb.i386.avx">
  <reg name="ymm0h" bitsize="128" type="uint128" />
  <reg name="ymm1h" bitsize="128" type="uint128" />
  <reg name="ymm2h" bitsize="128" type="uint128" />
  <reg name="ymm3h" bitsize="128" type="uint128" />
  <reg name="ymm4h" bitsize="128" type="uint128" />
  <reg name="ymm5h" bitsize="128" type="uint128" />
  <reg name="ymm6h" bitsize="128" type="uint128" />
  <reg name="ymm7h" bitsize="128" type="uint128" />
  <reg name="ymm8h" bitsize="128" type="uint128" />
  <reg name="ymm9h" bitsize="128" type="uint128" />
  <reg name="ymm10h" bitsize="128" type="uint128" />
  <reg name="ymm11h" bitsize="128" type="uint128" />
  <reg name="ymm12h" bitsize="128" type="uint128" />
  <reg name="ymm13h" bitsize="128" type="uint128" />
  <reg name="ymm14h" bitsize="128" type="uint128" />
  <reg name="ymm15h" bitsize="128" type="uint128" />
</feature>
 * <feature name="org.gnu.gdb.i386.mpx">
  <struct id="br128">
 * <field name="lbound" type="uint64" />
 * <field name="ubound_raw" type="uint64" />
  </struct>

  <struct id="_bndstatus" size="8">
 * <field name="bde" start="2" end="63" />
 * <field name="error" start="0" end="1" />
  </struct>

  <union id="status">
 * <field name="raw" type="data_ptr" />
 * <field name="status" type="_bndstatus" />
  </union>

  <struct id="_bndcfgu" size="8">
 * <field name="base" start="12" end="63" />
 * <field name="reserved" start="2" end="11" />
 * 
 * <field name="preserved" start="1" end="1" type="uint64" />
 * <field name="enabled" start="0" end="0" type="uint64" />
  </struct>

   <union id="cfgu">
 * <field name="raw" type="data_ptr" />
 * <field name="config" type="_bndcfgu" />
  </union>

  <reg name="bnd0raw" bitsize="128" type="br128" />
  <reg name="bnd1raw" bitsize="128" type="br128" />
  <reg name="bnd2raw" bitsize="128" type="br128" />
  <reg name="bnd3raw" bitsize="128" type="br128" />
  <reg name="bndcfgu" bitsize="64" type="cfgu" />
  <reg name="bndstatus" bitsize="64" type="status" />
</feature>
</target>");
[+]     getpkt ("qXfer:auxv:read::0,1000");
[+]     putpkt ("l");
[+]     getpkt ("QNonStop:0");
[+]     putpkt ("OK");
[+]     getpkt ("qTStatus");
[+]     putpkt ("T0;tnotrun:0;tframes:0;tcreated:0;tfree:0* 50*';tsize:0* 50*';circular:0;disconn:0;starttime:0;stoptime:0;username:;notes::");
[+]     getpkt ("qTfV");
[+]     putpkt ("l");
[+]     getpkt ("?");
[+]     putpkt ("T0506:0*,;07:20de0*"80*!;10:601040*';");
[+]     getpkt ("qXfer:threads:read::0,1000");
[+]     putpkt ("l<threads>
<thread id="1996" core="1" name="pwn1"/>
</threads>");
[+]     getpkt ("qAttached:a410");
[+]     putpkt ("");
[+]     getpkt ("qXfer:exec-file:read:a410:0,1000");
[+]     putpkt ("l/bin/pwn1");
[+]     getpkt ("vFile:setfs:0");
[+]     putpkt ("");
[+]     getpkt ("vFile:open:6a7573742070726f62696e67,0,1c0");
[+]     gdb> target host path: /home/also/tool/qiling/examples/rootfs/x8664_linux/just probing
[+]     putpkt ("F-1");
[+]     getpkt ("vFile:open:2f62696e2f70776e31,0,0");
[+]     gdb> target host path: /home/also/tool/qiling/examples/rootfs/x8664_linux/bin/pwn1
[+]     putpkt ("F6");
[+]     getpkt ("vFile:pread:6,3fff,0");
[+]     putpkt ("F3fff;ELF");
[+]     getpkt ("vFile:fstat:6");
[+]     putpkt ("");
[+]     getpkt ("vFile:pread:6,3fff,4058");
[+]     putpkt ("F40;*/R8*"***+");
[+]     getpkt ("vFile:pread:6,3fff,3998");
[+]     putpkt ("F700;");
[+]     getpkt ("vFile:pread:6,3fff,40");
[+]     putpkt ("F3fff;");
[+]     getpkt ("vFile:pread:6,3fff,0");
[+]     putpkt ("F3fff;ELF");
[+]     getpkt ("vFile:pread:6,3fff,4058");
[+]     putpkt ("F40;*/R8*"***+");
[+]     getpkt ("vFile:pread:6,3fff,3998");
[+]     putpkt ("F700;");
[+]     getpkt ("vFile:pread:6,3fff,40");
[+]     putpkt ("F3fff;");
[+]     getpkt ("vFile:pread:6,3fff,0");
[+]     putpkt ("F3fff;ELF");
[+]     getpkt ("vFile:pread:6,3fff,4058");
[+]     putpkt ("F40;*/R8*"***+");
[+]     getpkt ("vFile:pread:6,3fff,3998");
[+]     putpkt ("F700;");
[+]     getpkt ("vFile:pread:6,3fff,40");
[+]     putpkt ("F3fff;");
[+]     getpkt ("vFile:close:6");
[+]     putpkt ("F0");
[+]     getpkt ("Hc-1");
[+]     putpkt ("OK");
[+]     getpkt ("qC");
[+]     putpkt ("");
[+]     getpkt ("qOffsets");
[+]     putpkt ("Text=0;Data=0;Bss=0");
[+]     getpkt ("g");
[+]     putpkt ("1c0*;40**a059def7ff7f0*"e7fff7ff7f0*@20de0*"80*"a0* 80*5f0d9fff7ff7f0* 30e9fff7ff7f0* 601040*'20de0*"80*A601040*(60*"330*"280*}0*}0* x*\0*2f*&2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f0* ff0*"ff0*:ff0*:ff0*,ff0*0ff0*"00ff0*}0*}0*}0*9x*}x*}x*}x*}x*}x*}x*}x*M");
[+]     getpkt ("qXfer:auxv:read::0,1000");
[+]     putpkt ("l");
[+]     getpkt ("m400040,38");
[+]     putpkt ("060*"040*"40*+400040*'400040*'68020*(68020*)80**");
[+]     getpkt ("m400078,38");
[+]     putpkt ("030*"040*"a8020*(a80240*'a80240*'1c0**1c0*+10**");
[+]     getpkt ("m4000b0,38");
[+]     putpkt ("010*"040*640*+40*'a8040*(a8040**10*)");
[+]     getpkt ("m4000e8,38");
[+]     putpkt ("010*"050*"0010*+1040*)1040*(d020*)d020**10*)");
[+]     getpkt ("m400120,38");
[+]     putpkt ("010*"040*"0020*+2040*)2040*'88010*(88010**10*)");
[+]     getpkt ("m400158,38");
[+]     putpkt ("010*"060*"102e0*(103e40*'103e40*'30020*(38020**10*)");
[+]     getpkt ("m400190,38");
[+]     putpkt ("020*"060*"202e0*(203e40*'203e40*'d0010*(d0010*)80**");
[+]     getpkt ("m403e20,1d0");
[+]     putpkt ("010*+10*+c0*,1040*(d0*+41240*'190**103e40*'1b0*+80**1a0**183e40*'1c0*+80**f5feff6f0*%80340*(50**b80340*(60**280340*(a0**490*+b0**180**150**40e1fff7ff7f0*!30*,4040*(20**480**140*+70**170**600440*(70**300440*(80**30*,90**180**fef* 6f0*"00100440*'f*"6f0*%10**f0f* 6f0*%20440*}0*}0*%");
[+]     getpkt ("m400040,38");
[+]     putpkt ("060*"040*"40*+400040*'400040*'68020*(68020*)80**");
[+]     getpkt ("m400078,38");
[+]     putpkt ("030*"040*"a8020*(a80240*'a80240*'1c0**1c0*+10**");
[+]     getpkt ("m4000b0,38");
[+]     putpkt ("010*"040*640*+40*'a8040*(a8040**10*)");
[+]     getpkt ("m4000e8,38");
[+]     putpkt ("010*"050*"0010*+1040*)1040*(d020*)d020**10*)");
[+]     getpkt ("m400120,38");
[+]     putpkt ("010*"040*"0020*+2040*)2040*'88010*(88010**10*)");
[+]     getpkt ("m400158,38");
[+]     putpkt ("010*"060*"102e0*(103e40*'103e40*'30020*(38020**10*)");
[+]     getpkt ("m400190,38");
[+]     putpkt ("020*"060*"202e0*(203e40*'203e40*'d0010*(d0010*)80**");
[+]     getpkt ("m403e20,1d0");
[+]     putpkt ("010*+10*+c0*,1040*(d0*+41240*'190**103e40*'1b0*+80**1a0**183e40*'1c0*+80**f5feff6f0*%80340*(50**b80340*(60**280340*(a0**490*+b0**180**150**40e1fff7ff7f0*!30*,4040*(20**480**140*+70**170**600440*(70**300440*(80**30*,90**180**fef* 6f0*"00100440*'f*"6f0*%10**f0f* 6f0*%20440*}0*}0*%");
[+]     getpkt ("m403ee8,8");
[+]     putpkt ("40e1fff7ff7f0* ");
[+]     getpkt ("m7ffff7ffe148,8");
[+]     putpkt ("70e1fff7ff7f0* ");
[+]     getpkt ("m7ffff7ffe170,28");
[+]     putpkt ("0*.e7fff7ff7f0* 203e40*'30e9fff7ff7f0*0");
[+]     getpkt ("m7ffff7ffe930,28");
[+]     putpkt ("0060ddb7ff7f0* 20e9fff7ff7f0* 800b1cb8ff7f0* f0d9fff7ff7f0* 70e1fff7ff7f0* ");
[+]     getpkt ("m7ffff7ffe920,8");
[+]     putpkt ("2f6c69622f6c6962");
[+]     getpkt ("m7ffff7ffe928,8");
[+]     putpkt ("632e736f2e360* ");
[+]     getpkt ("m7ffff7ffd9f0,28");
[+]     putpkt ("0050ddf7ff7f0* a80240*'68cefff7ff7f0*030e9fff7ff7f0* ");
[+]     getpkt ("m4002a8,8");
[+]     putpkt ("2f6c696236342f6c");
[+]     getpkt ("m4002b0,8");
[+]     putpkt ("642d6c696e75782d");
[+]     getpkt ("m4002b8,8");
[+]     putpkt ("7838362d36342e73");
[+]     getpkt ("m4002c0,8");
[+]     putpkt ("6f2e3200040*"");
[+]     getpkt ("m7ffff7ffe140,4");
[+]     putpkt ("010*"");
[+]     getpkt ("vFile:open:2f6c69622f6c6962632e736f2e36,0,0");
[+]     gdb> target host path: /home/also/tool/qiling/examples/rootfs/x8664_linux/lib/libc.so.6
[+]     putpkt ("F6");
[+]     getpkt ("vFile:pread:6,3fff,0");
[+]     putpkt ("F3fff;ELF");
[+]     getpkt ("vFile:pread:6,3fff,1ee990");
[+]     putpkt ("F1240;");
[+]     getpkt ("vFile:pread:6,3fff,40");
[+]     putpkt ("F3fff;");
[+]     getpkt ("vFile:pread:6,3fff,1ee4c8");
[+]     putpkt ("F1708;");
[+]     getpkt ("vFile:pread:6,3fff,270");
[+]     putpkt ("F3fff;");
[+]     getpkt ("vFile:pread:6,3fff,1ec860");
[+]     putpkt ("F3370;");
[+]     getpkt ("vFile:pread:6,3fff,0");
[+]     putpkt ("F3fff;ELF");
[+]     getpkt ("vFile:pread:6,3fff,1ee990");
[+]     putpkt ("F1240;");
[+]     getpkt ("vFile:pread:6,3fff,40");
[+]     putpkt ("F3fff;");
[+]     getpkt ("vFile:pread:6,3fff,1ee4c8");
[+]     putpkt ("F1708;");
[+]     getpkt ("vFile:pread:6,3fff,270");
[+]     putpkt ("F3fff;");
[+]     getpkt ("vFile:pread:6,3fff,1ec860");
[+]     putpkt ("F3370;");
[+]     getpkt ("vFile:pread:6,3fff,0");
[+]     putpkt ("F3fff;ELF");
[+]     getpkt ("vFile:pread:6,3fff,1ee990");
[+]     putpkt ("F1240;");
[+]     getpkt ("vFile:pread:6,3fff,40");
[+]     putpkt ("F3fff;");
[+]     getpkt ("vFile:pread:6,3fff,1ee4c8");
[+]     putpkt ("F1708;");
[+]     getpkt ("vFile:pread:6,3fff,270");
[+]     putpkt ("F3fff;");
[+]     getpkt ("vFile:pread:6,3fff,1ec860");
[+]     putpkt ("F3370;");
[+]     getpkt ("vFile:open:2f6c696236342f6c642d6c696e75782d7838362d36342e736f2e32,0,0");
[+]     gdb> target host path: /home/also/tool/qiling/examples/rootfs/x8664_linux/lib64/ld-linux-x86-64.so.2
[+]     putpkt ("F7");
[+]     getpkt ("vFile:pread:7,3fff,0");
[+]     putpkt ("F3fff;ELF");
[+]     getpkt ("vFile:pread:7,3fff,29510");
[+]     putpkt ("F6c0;");
[+]     getpkt ("vFile:pread:7,3fff,40");
[+]     putpkt ("F3fff;");
[+]     getpkt ("vFile:pread:7,3fff,29410");
[+]     putpkt ("F7c0;");
[+]     getpkt ("vFile:pread:7,3fff,1c8");
[+]     putpkt ("F3fff;");
[+]     getpkt ("vFile:pread:7,3fff,28fd8");
[+]     putpkt ("Fbf8;");
[+]     getpkt ("vFile:pread:7,3fff,0");
[+]     putpkt ("F3fff;ELF");
[+]     getpkt ("vFile:pread:7,3fff,29510");
[+]     putpkt ("F6c0;");
[+]     getpkt ("vFile:pread:7,3fff,40");
[+]     putpkt ("F3fff;");
[+]     getpkt ("vFile:pread:7,3fff,29410");
[+]     putpkt ("F7c0;");
[+]     getpkt ("vFile:pread:7,3fff,1c8");
[+]     putpkt ("F3fff;");
[+]     getpkt ("vFile:pread:7,3fff,28fd8");
[+]     putpkt ("Fbf8;");
[+]     getpkt ("vFile:pread:7,3fff,0");
[+]     putpkt ("F3fff;ELF");
[+]     getpkt ("vFile:pread:7,3fff,29510");
[+]     putpkt ("F6c0;");
[+]     getpkt ("vFile:pread:7,3fff,40");
[+]     putpkt ("F3fff;");
[+]     getpkt ("vFile:pread:7,3fff,29410");
[+]     putpkt ("F7c0;");
[+]     getpkt ("vFile:pread:7,3fff,1c8");
[+]     putpkt ("F3fff;");
[+]     getpkt ("vFile:pread:7,3fff,28fd8");
[+]     putpkt ("Fbf8;");
[+]     getpkt ("vFile:pread:6,3fff,294");
[+]     putpkt ("F3fff;");
[+]     getpkt ("vFile:pread:6,3fff,18ef8");
[+]     putpkt ("F3fff;");
[+]     getpkt ("vFile:pread:6,3fff,119d0");
[+]     putpkt ("F3fff;xdr_u_long__wctomb_chkgetmntent__freelocalexdr_void__rawmemchr_IO_vsprintfgetutentrcmd_afsetitimerargp_usagewcstoimaxexecvppthread_setcancelstate_IO_wfile_underflowsetserventsetuid__wcsncat_chkargp_help__strtok_rcatgets_IO_wmarker_delta_IO_file_seekofffeof_unlockedsetspentget_current_dir_nameqsortstderrfgetxattr__mbstowcs_chkgetservent_raddseveritytowupperlisten__isnanopen_wmemstreamxdr_cryptkeyarg2getutidposix_fadvise__iswxdigit_lioctl__mbrlenntp_adjtimesvc_getreq__tdeletemunlocksetutentsymlinkrand_r_IO_flockfile__iswctype_lsigwaitvtimeserror_one_per_linesetpriorityflock__strcpy_smallmalloc_get_stateiswalnumsendmsgxdrstdio_createwmemcmp__assert_perror_fail__wcstod_internal__strtok_r_1copenat64semctlcfgetispeedfseeko__malloc_initialize_hookabortsetdomainnameposix_spawnattr_getsigdefault__ctype_b_locinet6_option_alloclockf64_sys_siglistttyslotwcrtombiswupper__waitpid__res_iclosetmpfileenvz_addfchdir__strncpy_chkc32rtombgeteuid_IO_setbuffer_IO_least_wmarkerputwchar_unlocked__strndup__strtof_lpthread_selfether_hostton__isoc99_wscanf__dup2sched_getaffinitypkey_get__ctype32_tolower__syslog_chk_IO_iter_begin__inet_pton_lengthuser2netnameiswcntrl_IO_printfregister_printf_functionposix_openptinet6_rth_addhcreateendnetent__isgraph_l__wcstoll_internaldngettextfmtmsgalphasort64srandompthread_attr_setdetachstatemlockallposix_spawn_file_actions_destroyustatmrand48tcsetattrpthread_cond_waitfwrite_unlockedxdr_u_longlong_t_libc_intl_domainname__mempcpy_chk__wctrans_lsethostnameputgrent__fprintf_chkregexecmalloc_set_statemodf__libc_vfork__ispunct_lfreopen64wcscasecmpfstatfsgetutxline_IO_sscanfgetgidsetsidendgrentsymlinkatvhangupsetaliasenticonv_close__morecore_IO_str_overflowclntraw_createsigset_IO_sgetnptsnamefgetspentfanotify_markfsynctmpnam_r__backtrace_symbols_fdclnt_broadcastsgetsgent_rfrexpargp_failuresetfsenttimerfd_createumount2__ctype_toupper_locrenameatstrcspngetutxid_IO_file_seekif_freenameindex_IO_doallocbufinotify_init1__connectpthread_setschedparam__nss_hosts_lookup_IO_putc__recvfrom_chk_IO_file_initcallrpc_IO_str_init_readonly__bsd_getpgrp__strtod_nan__strtoll_lrealpath_IO_iter_file__wunderflow__key_encryptsession_pk_LOCALsrandsched_getcpusemgetwaitidendusershellwcsdup__sigaddsetqecvt_rrtime__readlinkat_chkxdr_wrapstringauthunix_create__wcsncpy_chkstrfromf128__isoc99_vsscanfwcschrnulstrfmonepoll_createreadaheadendttyentrexec_affanotify_init__munmap__sched_get_priority_minif_nameindex__call_tls_dtors__xmknod__progname_full__libc_dlvsymsrandom_rreadlinkatgethostbyname2_rgetaliasbyname_r_IO_file_overflowulimitendspentwcstouq__strtoull_lposix_spawnattr_getsigmaskbindtextdomaindelete_moduleisprintmcheck_pedanticpthread_attr_getscopesigreturn__fread_chk_rtld_globalpmap_getportsvcerr_decodexdr_rejected_replypthread_condattr_destroyargp_parseasctimeclnt_spcreateerror__getlogin_r_chk__key_gendes_LOCALgetusershell__libc_current_sigrtmaxposix_spawnattr_setschedparamwait3inet_nsap_addrgetprotoent_rdrand48inotify_add_watchrecvmsgrresvport_afsvc_exitsetfsuid__argz_stringify_IO_wfile_jumpsendfsentgetrusage__gmtime_ropen_by_handle_atiruserok_afreaddir_rfreopenremqueprlimit64__wcsftime_lwait4strcmp__finitefwcsnrtombspreadvbsd_signal__ctype_get_mb_cur_max__iswctypereaddirsigblockeventfd_IO_putssetrpcent__prognamembrtoc32_IO_free_backup_areacreatsetnetentwcschr__strxfrm_lposix_spawn_file_actions_addcloseargp_err_exit_statusgetgrgid_r__vfwprintf_chkunshare_seterr_reply__recv_chk_IO_getline_info__libc_alloc_buffer_allocate__fwriting__finitel_itoa_lower_digitsinet6_opt_finish__strcspn_c3pthread_cond_init_IO_default_xsputn__wcstof_l__libc_forkmallwatch__libc_dynarray_resize__wcsncasecmp_ladvance_IO_fsetposwcsstr__sysv_signal__nss_lookupstrtof32x_l_IO_proc_closewcsspnhdestroyargz_appendwcswcsfstatfs64_obstack_allocated_psetgidposix_spawnattr_setflags__sched_getparamffsll_IO_link_infreeifaddrs_IO_marker_differencexdrrec_endofrecord_IO_peekc_lockedmcheck_check_allunlinkseed48__wcscasecmp_l_IO_str_pbackfailwcstoulposix_fadvise64__fwritableisasciiputenvfgetws_unlockedxdr_key_netstarg_IO_feof__ctype_initgnu_dev_majorregerror__rcmd_errstrnl_langinfo__strncat_chk__libc_calloc__finitegetpriority__sysctlhsearch_rswapcontextstimealphasortrecvfrom_sys_nerr_IO_free_wbackup_area_IO_initkey_secretkey_is_setpsiginfo__isoc99_vfwscanf__strcasecmpcloselogversionsort64pthread_cond_timedwaitsvcauthdes_statsmrand48_r__nss_next2preadv64v2__libc_clntudp_bufcreate__strcoll_l_IO_unsave_wmarkersnetname2host_res_hconfmblen__write__printf_chkftello_IO_ftell_nss_files_parse_spent__clock_gettimepwritev2pclose__libc_mallinfo_IO_iter_end__strtof128_nan__isinffiswalphaaligned_allocqgcvtgetcwd_IO_flush_all_linebufferedmalloc_info__isupper_lwcscoll__iswalpha_l__sigdelsetwordfree__iswupper_l__isoc99_scanf__duplocalegetaliasent_r_IO_switch_to_main_wget_areafattach__isinflsvc_sendreplyvwprintf__isctype__ctype_tolower_loc__wcsxfrm_ltmpnamfgetwc_unlockedllseekstrptime_lsigorsetgetutid_r__nss_hosts_lookup2eaccessxdr_long__libc_scratch_buffer_grow__fxstatat64__getpagesizeiswdigitverr__nss_configure_lookupargz_create_sepgetdate_errgethostbyname__towctransgetloadavgiscntrlislowergetprotobynumber__wuflowsvcudp_bufcreate_IO_un_linkstrcatxdrrec_createvwarnx_dl_open_hook__flbffchownstrncmpqfcvtwcsftime_IO_setb__libc_freetcdrainopen_memstreampthread_exitsys_sigabbrevpthread_cond_broadcastfchownatstrtof64ldexplposix_spawnattr_init_IO_sungetwcisxdigit__tzname_IO_default_uflowvwarn_IO_file_read__strtold_internalsigpending__internal_endnetgrentrewinddir__fxstat64__libc_alloc_buffer_create_failurexdr_cryptkeyarg__libc_sa_lenin6addr_anychrootstrcpygetprotoentglob__timezone_IO_proc_opensvcerr_weakauthstrtof64x_l_mcount__confstr_chkmbtowc__resolv_context_get_override__clonescalbnlgetgrnamputpmsgversionsortsockatmark__nss_passwd_lookup__nss_disable_nscdmalloc_trimmbsnrtowcsfstatvfs64wcwidthstrrchrclnt_perrorregister_printf_type_IO_fwrite__pread_chkstrxfrmscalbnffputwc_unlocked__cxa_atexitgetnameinfowcsrtombsprintf_sizeposix_spawn_dl_find_dso_for_object__waitxdr_keystatusgetpwnam_rnrand48_r_IO_file_doallocate__ppoll_chkteegetdatere_comp__isnanlhsearch_IO_wdo_writeclosedirgetsgnamgetsecretkeyprlimit__open_cataloggetlogin_rgetrpcbyname_rmkfifoat__libc_current_sigrtmax_privatefts_close__ctype32_toupperstrnlen__isnanfgetutmpisgraph__resolv_context_get_preinit__tunable_get_val__wcstoll_lxdr_pmaplisteventfd_readvfwprintf__underflowxdrmem_createinet6_opt_set_valfcloseall__libc_dynarray_at_failure__ptsname_r_chk_IO_init_markerwcpncpy__wcstol_lcfgetospeedxdr_key_netstresendservent__strcspn_c1fgetsgent__wcscat_chksetusershell__netlink_assert_response__tsearchdcngettext_dl_argvacct_nl_default_dirname__libc_scratch_buffer_grow_preserveftruncate64memmemutimensatstrtoldxdr_u_charbindresvportpsignalcatclosesignalfdtempnaminet_addrgetrlimit64__nss_group_lookupinet_lnaofgetfsent__isalnum_ltdestroy__snprintf_chkldexpfpkey_mprotect__argz_nextposix_madvisesetgrentwcscpyendutxentre_matchwmemcpynftw64modffxdr_intstrtof128_lgetrandomstrfromf32x__strtoull_internalgroup_member__cmsg_nxthdrglobfreemkstemps64qecvtxdr_boolmbstowcs__wcstoul_lclearerr_unlockedmkostempssched_setparamiswlowergetifaddrsfgetsgent_r__strspn_c1pkey_freexdr_replymsggetgrgidgetfsfile__libc_alloc_buffer_copy_stringmodflexplicit_bzerobcmpsvcfd_create__iswpunct_l__asprintflremovexattr__strpbrk_c3fdetachsocketpair__nanosleepstrtoll__nss_group_lookup2timerfd_settimegetfsspecposix_fallocate_IO_wdefault_finishif_indextonamewcswidthfts64_read_IO_wfile_overflowpwritevstrstrsvcerr_auth__wcstof_internalepoll_wait__sigpause_IO_fsetpos64srand48_rmunlockallstrcoll_IO_flush_allxdr_int64_t_IO_default_pbackfail_nss_files_parse_sgentsyncfsl64a__vwprintf_chksgetspent_rftokdirfd_IO_vfscanfkill__cxa_thread_atexit_implget_kernel_symsoptargmsgctlgnu_dev_minor__ctype_tolower__memset_chk__ctype_toupper_IO_file_underflowwcstollregister_printf_modifierrenameiopermwcstof128__internal_setnetgrentunsetenvpututlinelocaleconvbdflush_IO_2_1_stderr___readputsgentcopy_file_rangegrantptgetpwnam__fpending__mempcpy_smallfaccessatfgetpwent__sched_cpucountwordexp__memmove_chkglob_pattern_p_IO_wfile_syncgetdate_reuidaccessxdr_unioninet6_opt_get_valsetfsgid_IO_file_fopenpthread_attr_destroy__gets_chkffslxdr_char__res_nclose_dl_exception_createendaliasentkey_setsecretgetsocknameauthdes_getucredglob64strtof128__libc_rpc_getport__ctype_bgetptctermidquotactlutmpxnamesigrelsemodify_ldtmkostemps64__nss_services_lookup2iconvshmctl_IO_seekofffputwswcscat_obstack_newchunk__getpgidargp_program_version_hook_IO_ferrorstrchr_authenticategetpwgetnetentstrncasecmppthread_attr_getschedparam__libc_msgsndsvcerr_noprocsetttyentgetresuid__isoc99_sscanfinet_ptonmkostemp64__libc_malloptstrtof64_l__wcstoull_internalepoll_pwait__libc_dynarray_finalize__endmntentinet6_opt_append__fgetws_unlocked_chkgnu_get_libc_versionxdr_getcredresswabpreadv64pthread_mutex_destroy__stpncpy_IO_fflush__libc_memalignstrspnwcstof64x_lmakecontext__asprintf_chk__poll_chkstrpbrk__setmntent__iswspace_l_obstack_free_IO_file_finish_IO_marker_deltafutimescreat64__getrlimitre_max_failuressvc_getreq_commongetgroupsgetpublickeyregisterrpctimerfd_gettime__wctype_lhost2netnamebind_obstack_beginrebootsethostidendpwentrindex__towctrans_lcapgetsemtimedop__isoc99_fscanf__backtracerewindscalbnfgetc_unlockedgetgrnam_rgetppidif_nametoindexgetsgnam_rwcstold__mktempxdr_uint64_tfgets_unlocked_IO_switch_to_wbackup_area__after_morecore_hookpersonality__clock_getcpuclockidsvcunix_createre_match_2xdr_accepted_replysetipv4sourcefiltertimegmnicegetpwuidvmsplicefwideppolllocaltime_rgetservbyname_r__fpurge__environ__h_errno_locationgetdirentries__tolower_lsighold__gconv_transliteratexdr_int8_t_IO_2_1_stdout_fputwc__abort_msg__gai_sigqueuelocssvcerr_noprog__strtol_lisalphamtrace__strverscmp__fdelt_chkputwchar__wcstold_lutmpnameispuncton_exit__strncasecmp_l__socketputmsgfopen64xprt_unregisterxdr_uint32_t__fgets_unlocked_chk__nss_hostname_digits_dots_rpc_dtablesize_IO_sungetc__ctype32_bmremapgetsourcefiltersiginterrupt_resgetutmpxclnt_sperrno_IO_sprintfmkostempdl_iterate_phdrsrand48__secure_getenv__curbrkposix_spawn_file_actions_adddup2wcstof32xsvc_getreqsetcanonicalize_file_nameprocess_vm_readv__iscntrl_lscandir64getnetent_rwcsnlen__libc_siglongjmpgetegidargp_program_versionnftw__libc_start_main__strcat_chkputspentsetresgid__libc_msgrcv__close_nocancelseed48_rwcstoqaccept4regfree__strsep_gssignalposix_spawnattr_getpgroup_IO_str_init_static__read_nocancelargz_insertulckpwdfwcstolgetpwuid_rfts_childreninet6_option_spacexdr_des_block__strerror_r_IO_fdopengetwd__daylightgetservent__libc_fatal__sendmmsgtcsendbreakgethostbyname2gethostbyaddr_rstrtoimax__libc_dlopen_mode__getdelimgetentropyhcreate_r__vsyslog_chksetreuidllabspthread_attr_setschedpolicyinnetgrwcstok__wcstoul_internalsendfile64openatreadlink__clock_nanosleepswaponstrncpywcsxfrmtzsetgetaliasbyname__towlower_llfindunlockptwcstof__cyg_profile_func_exit__sigsetjmpcopysignfwcstodsigemptyset_dl_mcount_wrapperfgetc__pipefread_unlocked_IO_file_xsputnsvcerr_systemerrinet6_opt_find_dl_addrpthread_attr_initputcharsigisemptyset__wcstol_internal__libc_dynarray_emplace_enlargeposix_spawnattr_setsigmaskxdr_string__strpbrk_c2__memalign_hook_IO_default_xsgetngetrpcbynumber_rshmat__malloc_hook__rpc_thread_svc_max_pollfd__dgettextgetchar_unlockedrresvportxdr_enum__free_hook__strsep_3c__resolv_context_put__tfindstrerror_l__cxa_finalizesetrlimit__strtof_internalgetaliasentgsignalh_nerr_null_auth_IO_fopen_IO_list_allgetnetbyname_rfgetspent_rruserpass__stpcpy_chkrevokeinet6_option_findether_aton_rsigvec__iswgraph_lgetutline_nl_domain_bindings__libc_ifunc_impl_list__libc_alloc_buffer_alloc_array_IO_file_openraisestrptime_flushlbf__libc_systemttyname_rwcsrchr__posix_getoptkey_get_conva64lexeclepthread_attr_getdetachstate_dl_catch_error__isalpha_lposix_spawn_file_actions_initxdr_uint16_tstrchrnul_IO_sputbackwc__vdprintf_chkscandirat_nl_msg_cat_cntrsync_file_rangememrchrpthread_cond_signal__closexdr_bytesexeclpinitstate_r__argz_countsetprotoentiswprintcopysignlsigsetmasksettimeofdaymincoreposix_memalignexecvpewcscmpinet6_rth_spacerecvmmsgxdr_netobj__inet6_scopeid_ptonwcstombsmalloc_usable_sizetcgetattr__strtod_internalinet6_opt_nextxdr_pointerinit_module__strcpy_chk__fbufsize_IO_fread__vsscanfunlinkat__nss_passwd_lookup2umountwcspbrk_dl_vsym__nl_langinfo_lsetstateatollmemccpyclnt_sperrorrcmd__obstack_printf_chkxdr_floatmoncontrolpthread_attr_setscopexdr_int32_t_IO_fgetposrexecoptionsmuntrace__wcscoll_lfreeaddrinfo__isoc99_vfscanf__freading__libc_alloc_buffer_copy_byteskey_decryptsession_pkgetitimer__libc_current_sigrtmin_privategetttynamgetdtablesize__libc_allocate_rtsig_dl_catch_exceptionauthunix_create_defaultcfmakerawlseek64toasciisetegidisastreamgetservbyname__strtoul_internal__xstatstrtouqargp_program_bug_addressposix_spawnp__iswcntrl_lftello64__strtol_internal__iswalnum_l__nss_lookup_functionwcstof128_lmlock__setpgidauthnone_create_IO_file_stat__iswblank_lstrfromf32pthread_mutex_init__internal_getnetgrent_rclockgnu_dev_makedev_IO_file_setbuffexecvepthread_attr_getschedpolicy__stpcpy_smallstrncatclnt_pcreateerrorgetutent_rstrtoul__key_decryptsession_pk_LOCAL_IO_unsave_markerswcstof32__uflow__libc_scratch_buffer_set_array_sizeimaxabsgetservbyport_r__woverflow__isxdigit_linet6_rth_reverse__assert_fail__getwd_chk__iswdigit_l_IO_str_underflowgetrpcbynamemkstempfsetxattrendprotoentgmtime_sys_errlistget_phys_pagesepoll_ctlh_errlist__backtrace_symbols_IO_file_attach__pread64_chkupdwtmpclntudp_createprogram_invocation_short_namexdr_rmtcallres__selectfpathconf__res_randomid__strtold_l_IO_fputskillpg__monstartupwcslen__isoc99_vscanfgetpasswcsncasecmppthread_getschedparampthread_attr_setschedparamumask__uselocale__sched_cpufreegethostent_rxdr_hyper_IO_seekmark_IO_wdefault_xsputngetwchar_unlockedputchar_unlockedether_ntoa__wcpcpy_chk__fread_unlocked_chkgetcharsetlocale__dprintf_chk__nss_database_lookupposix_fallocate64__pwrite64posix_spawnattr_getflags__xstat64msggetoptind__xpg_sigpausenetname2user__gconv_get_cache_IO_init_wmarkerposix_spawnattr_destroyxdr_unixcredfgetgrentsemopxdr_int16_tisfdtype__isinf__pread64xdr_authdes_cred_IO_gets__adjtimex_IO_ftrylockfilefileno_unlockedptsname_r__fgets_chkllistxattrgetcontext__openat_2vlimit_nss_files_parse_grentwcsncatexeclkey_gendesfflush_unlocked_dl_starting_upinet_networksetrlimit64getsockoptiswspace__strsep_2c__wcpncpy_chkstdoutobstack_alloc_failed_handlerget_nprocs_confxdr_opaque__obstack_vprintf_chkerror_print_progname_IO_wdefault_uflow__sched_get_priority_max__sbrk__libc_secure_getenv__strtoul_ltelldiroptoptpasswd2des__wprintf_chkposix_spawn_file_actions_addopenclnt_create__libc_pvallocinet_atonget_nprocs__open_nocancelerand48_r__libc_preadcfsetospeedposix_spawnattr_setpgroup_IO_setvbufxdr_doublentp_gettimegetutxentsgetsgentfts64_closeinet6_option_nextgetgrouplist_IO_switch_to_get_mode__h_errnoimaxdiv_IO_getcsetstate_r__mmapfchflagscuserid_mcleanupgethostname_IO_fgetpos64initgroups__strtof128_internal__strspn_c2_IO_ungetcre_compile_fastmapmsyncseteuidhtonscbc_crypt__nss_nextjrand48_rsetnsposix_spawnattr_getschedpolicy_IO_funlockfile__sched_cpualloc__getmntent_r__getgroups_chklockfrmdiret");
[+]     getpkt ("vFile:pread:6,3fff,159cf");
[+]     putpkt ("F3fff;her_line");
[+]     getpkt ("vFile:pread:6,3fff,3ee8");
[+]     putpkt ("F3fff;");
[+]     getpkt ("vFile:pread:6,3fff,7ee7");
[+]     putpkt ("F3fff;");
[+]     getpkt ("vFile:pread:6,3fff,bee6");
[+]     putpkt ("F3fff;
");
[+]     getpkt ("vFile:pread:6,3fff,fee5");
[+]     putpkt ("F3fff;");
[+]     getpkt ("vFile:pread:6,3fff,178ae");
[+]     putpkt ("F3fff;");
[+]     getpkt ("vFile:pread:6,3fff,20b78");
[+]     putpkt ("F3fff;8");
[+]     getpkt ("vFile:pread:6,3fff,18f28");
[+]     putpkt ("F3fff; v>");
[+]     getpkt ("vFile:pread:6,3fff,1cf27");
[+]     putpkt ("F3fff;");
[+]     getpkt ("vFile:open:2f7573722f6c69622f64656275672f2e6275696c642d69642f62342f31376330626137636335636630366431643162656436363532636564623932353363363064302e6465627567,0,0");
[+]     gdb> target host path: /home/also/tool/qiling/examples/rootfs/x8664_linux/usr/lib/debug/.build-id/b4/17c0ba7cc5cf06d1d1bed6652cedb9253c60d0.debug
[+]     putpkt ("F-1");
[+]     getpkt ("vFile:pread:6,3fff,1ee4b4");
[+]     putpkt ("F171c;libc-2.27.so");
[+]     getpkt ("vFile:open:2f6c69622f6c6962632d322e32372e736f,0,0");
[+]     gdb> target host path: /home/also/tool/qiling/examples/rootfs/x8664_linux/lib/libc-2.27.so
[+]     putpkt ("F-1");
[+]     getpkt ("vFile:open:2f6c69622f2e64656275672f6c6962632d322e32372e736f,0,0");
[+]     gdb> target host path: /home/also/tool/qiling/examples/rootfs/x8664_linux/lib/.debug/libc-2.27.so
[+]     putpkt ("F-1");
[+]     getpkt ("vFile:open:2f7573722f6c69622f64656275672f2f6c69622f6c6962632d322e32372e736f,0,0");
[+]     gdb> target host path: /home/also/tool/qiling/examples/rootfs/x8664_linux/usr/lib/debug/lib/libc-2.27.so
[+]     putpkt ("F-1");
[+]     getpkt ("vFile:open:2f7573722f6c69622f64656275672f6c69622f2f6c6962632d322e32372e736f,0,0");
[+]     gdb> target host path: /home/also/tool/qiling/examples/rootfs/x8664_linux/usr/lib/debug/lib/libc-2.27.so
[+]     putpkt ("F-1");
[+]     getpkt ("vFile:open:7461726765743a2f7573722f6c69622f64656275672f6c69622f2f6c6962632d322e32372e736f,0,0");
[+]     gdb> target host path: /home/also/tool/qiling/examples/rootfs/x8664_linux/target:/usr/lib/debug/lib/libc-2.27.so
[+]     putpkt ("F-1");
[+]     getpkt ("vFile:pread:7,3fff,958");
[+]     putpkt ("F3fff;");
[+]     getpkt ("vFile:pread:7,3fff,6f0");
[+]     putpkt ("F3fff;");
[+]     getpkt ("vFile:pread:7,3fff,3c0");
[+]     putpkt ("F3fff;");
[+]     getpkt ("vFile:open:2f7573722f6c69622f64656275672f2e6275696c642d69642f36342f64663162393631323238333832666531383638343234396564383030616231646365616164342e6465627567,0,0");
[+]     gdb> target host path: /home/also/tool/qiling/examples/rootfs/x8664_linux/usr/lib/debug/.build-id/64/df1b961228382fe18684249ed800ab1dceaad4.debug
[+]     putpkt ("F-1");
[+]     getpkt ("vFile:pread:7,3fff,29400");
[+]     putpkt ("F7d0;ld-2.27.so");
[+]     getpkt ("vFile:open:2f6c696236342f6c642d322e32372e736f,0,0");
[+]     gdb> target host path: /home/also/tool/qiling/examples/rootfs/x8664_linux/lib64/ld-2.27.so
[+]     putpkt ("F-1");
[+]     getpkt ("vFile:open:2f6c696236342f2e64656275672f6c642d322e32372e736f,0,0");
[+]     gdb> target host path: /home/also/tool/qiling/examples/rootfs/x8664_linux/lib64/.debug/ld-2.27.so
[+]     putpkt ("F-1");
[+]     getpkt ("vFile:open:2f7573722f6c69622f64656275672f2f6c696236342f6c642d322e32372e736f,0,0");
[+]     gdb> target host path: /home/also/tool/qiling/examples/rootfs/x8664_linux/usr/lib/debug/lib64/ld-2.27.so
[+]     putpkt ("F-1");
[+]     getpkt ("vFile:open:2f7573722f6c69622f64656275672f6c696236342f2f6c642d322e32372e736f,0,0");
[+]     gdb> target host path: /home/also/tool/qiling/examples/rootfs/x8664_linux/usr/lib/debug/lib64/ld-2.27.so
[+]     putpkt ("F-1");
[+]     getpkt ("vFile:open:7461726765743a2f7573722f6c69622f64656275672f6c696236342f2f6c642d322e32372e736f,0,0");
[+]     gdb> target host path: /home/also/tool/qiling/examples/rootfs/x8664_linux/target:/usr/lib/debug/lib64/ld-2.27.so
[+]     putpkt ("F-1");
[+]     getpkt ("m7fffb7f0abc3,1");
[+]     putpkt ("90");
[+]     getpkt ("m7fffb7e14c93,1");
[+]     putpkt ("90");
[+]     getpkt ("m7ffff7ffe148,8");
[+]     putpkt ("70e1fff7ff7f0* ");
[+]     getpkt ("m7ffff7ffe150,8");
[+]     putpkt ("a05ddef7ff7f0* ");
[+]     getpkt ("m7ffff7dd8df2,1");
[+]     putpkt ("90");
[+]     getpkt ("m7ffff7dd94d1,1");
[+]     putpkt ("90");
[+]     getpkt ("m7ffff7ddbb2a,1");
[+]     putpkt ("90");
[+]     getpkt ("m7ffff7ddaba6,1");
[+]     putpkt ("90");
[+]     getpkt ("m7ffff7dea41c,1");
[+]     putpkt ("90");
[+]     getpkt ("m7ffff7deb0b7,1");
[+]     putpkt ("90");
[+]     getpkt ("m7ffff7deb354,1");
[+]     putpkt ("90");
[+]     getpkt ("m7fffb7f0abc3,1");
[+]     putpkt ("90");
[+]     getpkt ("m7fffb7e14c93,1");
[+]     putpkt ("90");
[+]     getpkt ("qXfer:threads:read::0,1000");
[+]     putpkt ("l<threads>
<thread id="1996" core="1" name="pwn1"/>
</threads>");
[+]     getpkt ("m401060,1");
[+]     putpkt ("31");
[+]     getpkt ("m401060,1");
[+]     putpkt ("31");
[+]     getpkt ("qSymbol::");
[+]     putpkt ("OK");
[+]     getpkt ("qTStatus");
[+]     putpkt ("T0;tnotrun:0;tframes:0;tcreated:0;tfree:0* 50*';tsize:0* 50*';circular:0;disconn:0;starttime:0;stoptime:0;username:;notes::");
[+]     getpkt ("qTfP");
[+]     putpkt ("l");
[+]     getpkt ("Z0,7fffb7e14c93,1");
[=]     gdb> breakpoint added at 0x7fffb7e14c93
[+]     putpkt ("OK");
[+]     getpkt ("Z0,7fffb7f0abc3,1");
[=]     gdb> breakpoint added at 0x7fffb7f0abc3
[+]     putpkt ("OK");
[+]     getpkt ("Z0,7ffff7dd94d1,1");
[=]     gdb> breakpoint added at 0x7ffff7dd94d1
[+]     putpkt ("OK");
[+]     getpkt ("Z0,7ffff7dea41c,1");
[=]     gdb> breakpoint added at 0x7ffff7dea41c
[+]     putpkt ("OK");
[+]     getpkt ("Z0,7ffff7deb354,1");
[=]     gdb> breakpoint added at 0x7ffff7deb354
[+]     putpkt ("OK");
[+]     getpkt ("QPassSignals:e;10;14;17;1a;1b;1c;21;24;25;2c;4c;97;");
[+]     putpkt ("OK");
[+]     getpkt ("vCont?");
[+]     putpkt ("vCont;c;C;s;S");
[+]     getpkt ("vCont;s:pa410.1996;c:pa410.-1");
[=]     gdb> stepping 1 instructions from 0x401060
[+]     putpkt ("S0f");
[+]     getpkt ("g");
[+]     putpkt ("1c0*;40**a059def7ff7f0*"e7fff7ff7f0*@20de0*"80*"a0* 80*5f0d9fff7ff7f0* 30e9fff7ff7f0* 601040*'20de0*"80*A621040*'460*"330*"280*}0*}0* x*\0*2f*&2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f0* ff0*"ff0*:ff0*:ff0*,ff0*0ff0*"00ff0*}0*}0*}0*9x*}x*}x*}x*}x*}x*}x*}x*M");
[+]     getpkt ("z0,7fffb7f0abc3,1");
[=]     gdb> breakpoint removed from 0x7fffb7f0abc3
[+]     putpkt ("OK");
[+]     getpkt ("z0,7fffb7e14c93,1");
[=]     gdb> breakpoint removed from 0x7fffb7e14c93
[+]     putpkt ("OK");
[+]     getpkt ("qXfer:threads:read::0,1000");
[+]     putpkt ("l<threads>
<thread id="1996" core="1" name="pwn1"/>
</threads>");
[+]     getpkt ("z0,7ffff7dd94d1,1");
[=]     gdb> breakpoint removed from 0x7ffff7dd94d1
[+]     putpkt ("OK");
[+]     getpkt ("z0,7ffff7dea41c,1");
[=]     gdb> breakpoint removed from 0x7ffff7dea41c
[+]     putpkt ("OK");
[+]     getpkt ("z0,7ffff7deb354,1");
[=]     gdb> breakpoint removed from 0x7ffff7deb354
[+]     putpkt ("OK");
[+]     getpkt ("m401062,1");
[+]     putpkt ("49");
[+]     getpkt ("m401062,1");
[+]     putpkt ("49");
[+]     getpkt ("Z0,7fffb7e14c93,1");
[=]     gdb> breakpoint added at 0x7fffb7e14c93
[+]     putpkt ("OK");
[+]     getpkt ("Z0,7fffb7f0abc3,1");
[=]     gdb> breakpoint added at 0x7fffb7f0abc3
[+]     putpkt ("OK");
[+]     getpkt ("Z0,7ffff7dd94d1,1");
[=]     gdb> breakpoint added at 0x7ffff7dd94d1
[+]     putpkt ("OK");
[+]     getpkt ("Z0,7ffff7dea41c,1");
[=]     gdb> breakpoint added at 0x7ffff7dea41c
[+]     putpkt ("OK");
[+]     getpkt ("Z0,7ffff7deb354,1");
[=]     gdb> breakpoint added at 0x7ffff7deb354
[+]     putpkt ("OK");
[+]     getpkt ("vCont;S0f:pa410.1996;c:pa410.-1");
[+]     putpkt ("");
elicn commented 1 year ago

The last incoming command is vCont;S0f:pa410.1996;c:pa410.-1. Since vCont support is limited, Qiling doesn't know how to handle the S0f command and fails. We should fix that.

Alsoprach commented 1 year ago

Thank you for your reply

bstee615 commented 1 year ago

I'm also experiencing this issue. Is there any fix or workaround for it? Would running on a compatible VM or using a different debugger solve the issue, and if so, what do you suggest to try?

Here is the last bit of my log - seems to break on the same command:

[=]     gdb> breakpoint added at 0x7ffff7de5590
[+]     putpkt ("OK");
[+]     getpkt ("QPassSignals:e;10;14;17;1a;1b;1c;21;24;25;2c;4c;97;");
[+]     putpkt ("OK");
[+]     getpkt ("vCont;S0f:pa410.1996;c:pa410.-1");
[+]     putpkt ("");
GreaterGoodest commented 6 months ago

Same issue here, usually if I try to do anything (step, continue, etc) after hitting a breakpoint I get a SIGTERM disconnect.

cbdm commented 1 month ago

I was also getting this issue. I think I found the issue and a possible workaround.

What I think is going on:

The issue seems that the handle_s method inside the gdb server sends a sigterm if Qiling has stopped the emulation: https://github.com/qilingframework/qiling/blob/9a78d186c97d6ff42d7df31155dda2cd9e1a7fe3/qiling/debugger/gdb/gdb.py#L683-L684

Following the calls from self.gdb.resume_emu(steps=1) above that check, we get to Qiling.emu_start, and in that method it also sets emulation as stopped once it has executed the number of steps: https://github.com/qilingframework/qiling/blob/9a78d186c97d6ff42d7df31155dda2cd9e1a7fe3/qiling/core.py#L766-L771

So qiling doesn't seem to know whether the emulation stopped because the program exited or if the emulation stopped because we're simply debugging.

How we're resolving this:

Commenting out that if-statement. Really.

You need to find where qiling is installed (python -c "from qiling import __file__; from os.path import dirname; print(dirname(__file__))"). In my case, running inside docker, I get this: /usr/local/lib/python3.12/site-packages/qiling

Then edit /usr/local/lib/python3.12/site-packages/qiling/debugger/gdb/gdb.py and comment out lines 683 and 684.

So far it's been ok, only issue is that the gdb-client doesn't know when the process terminates, so you might get a bad exit if you step too much.