)]}'
{
  "commit": "901e4e8d5c4f1d32c50e4a31b228bc7ef4210775",
  "tree": "a918ecaf5efafb88db7f6f9bec53345377171da0",
  "parents": [
    "06c7226ea19c1880fc160b8890c3a5574d490709"
  ],
  "author": {
    "name": "Simon Marchi",
    "email": "simon.marchi@efficios.com",
    "time": "Fri Apr 29 23:21:15 2022 -0400"
  },
  "committer": {
    "name": "Simon Marchi",
    "email": "simon.marchi@polymtl.ca",
    "time": "Wed May 04 08:24:37 2022 -0400"
  },
  "message": "gdb/remote: send qSymbol to all inferiors on startup\n\nstart_remote_1 calls remote_check_symbols after things are set up to\ngive the remote side a chance to look up symbols.  One call to\nremote_check_symbols sets the \"general thread\", if needed, and sends one\nqSymbol packet.  However, a remote target could have more than one\nprocess on initial connection, and this would send a qSymbol for only\none of these processes.\n\nChange it to iterate on all the target\u0027s inferiors and send a qSymbol\npacket for each one.\n\nI tested this by changing gdbserver to spawn two processes on startup:\n\n    diff --git a/gdbserver/server.cc b/gdbserver/server.cc\n    index 33c42714e72..9b682e9f85f 100644\n    --- a/gdbserver/server.cc\n    +++ b/gdbserver/server.cc\n    @@ -3939,6 +3939,7 @@ captured_main (int argc, char *argv[])\n\n           /* Wait till we are at first instruction in program.  */\n           target_create_inferior (program_path.get (), program_args);\n    +      target_create_inferior (program_path.get (), program_args);\n\n           /* We are now (hopefully) stopped at the first instruction of\n             the target process.  This assumes that the target process was\n\nInstead of hacking GDBserver, it should also be possible to test this by\nstarting manually two inferiors on an \"extended-remote\" connection,\ndisconnecting from GDBserver (with the disconnect command), and\nre-connecting.\n\nI was able to see qSymbol being sent for each inferior:\n\n      [remote] Sending packet: $Hgp828dc.828dc#1f\n      [remote] Packet received: OK\n      [remote] Sending packet: $qSymbol::#5b\n      [remote] Packet received: qSymbol:6764625f6167656e745f6764625f74705f686561705f627566666572\n      [remote] Sending packet: $qSymbol::6764625f6167656e745f6764625f74705f686561705f627566666572#1e\n      [remote] Packet received: qSymbol:6e70746c5f76657273696f6e\n      [remote] Sending packet: $qSymbol::6e70746c5f76657273696f6e#4d\n      [remote] Packet received: OK\n      [remote] Sending packet: $Hgp828dd.828dd#21\n      [remote] Packet received: OK\n      [remote] Sending packet: $qSymbol::#5b\n      [remote] Packet received: qSymbol:6764625f6167656e745f6764625f74705f686561705f627566666572\n      [remote] Sending packet: $qSymbol::6764625f6167656e745f6764625f74705f686561705f627566666572#1e\n      [remote] Packet received: qSymbol:6e70746c5f76657273696f6e\n      [remote] Sending packet: $qSymbol::6e70746c5f76657273696f6e#4d\n      [remote] Packet received: OK\n\nNote that there would probably be more work to be done to fully support\nthis scenario, more things that need to be done for each discovered\ninferior instead of just for one.\n\nChange-Id: I21c4ecf6367391e2e389b560f0b4bd906cf6472f\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "fde6df3f84d52d86cbcfebebb67bd9c521a85f3b",
      "old_mode": 33188,
      "old_path": "gdb/remote.c",
      "new_id": "b8df3326849f66f6ffad9923c74077ff99e113c5",
      "new_mode": 33188,
      "new_path": "gdb/remote.c"
    }
  ]
}
