title: gdb remote debugging. Implement a fake gdbserver stub. After several requests and response, got a warning:invalid remote reply
body: <p>For the needs of project, I wrote a simple java socket program to implement a "fake" gdbserver stub. Thus, support the minimum number of gdb RSP commands:g,G,m,M,c and s. For other commands, just response with "$#00". According to the manual of gdb, this would tell gdb that the "server" doesn't support other commands.</p>
  
  <p>I use the Eclipse CDT to help me debug. In the debug configurations, I selected c/c++ remote application, and set the debugger connection using TCP on localhost:10000, where my java program will use to listen.</p>
  
  <p>At first, gdb send commands like qSupported, Hg0, qTStatus, ?, and qC. The response to all of them are "$#00" to tell gdb the "server" doesn't support those commands. Then, gdb send qAttached and qOffsets. After sending two "$#00" responses and received a "+" from gdb, gdb says "warning: invalid remote reply:". </p>
  
  <p>Can someone please tell me why did this occur? Why gdb doesn't send commands and say"invalid remote reply:", which I don't know what reply is invalid, after all, I just send "$#00" and "+" to gdb.</p>