)]}'
{
  "commit": "65c459abebf70bd5a64dcee11d4d7d4a8498465f",
  "tree": "7079c882404567cd9a235a4c52280548837cfb81",
  "parents": [
    "26f047ce788b42b7b5f96515d119138a8ae43979"
  ],
  "author": {
    "name": "Pedro Alves",
    "email": "pedro@palves.net",
    "time": "Tue Nov 23 20:35:12 2021 +0000"
  },
  "committer": {
    "name": "Pedro Alves",
    "email": "pedro@palves.net",
    "time": "Mon Nov 13 14:16:09 2023 +0000"
  },
  "message": "Thread options \u0026 clone events (core + remote)\n\nA previous patch taught GDB about a new TARGET_WAITKIND_THREAD_CLONED\nevent kind, and made the Linux target report clone events.\n\nA following patch will teach Linux GDBserver to do the same thing.\n\nHowever, for remote debugging, it wouldn\u0027t be ideal for GDBserver to\nreport every clone event to GDB, when GDB only cares about such events\nin some specific situations.  Reporting clone events all the time\nwould be potentially chatty.  We don\u0027t enable thread create/exit\nevents all the time for the same reason.  Instead we have the\nQThreadEvents packet.  QThreadEvents is target-wide, though.\n\nThis patch makes GDB instead explicitly request that the target\nreports clone events or not, on a per-thread basis.\n\nIn order to be able to do that with GDBserver, we need a new remote\nprotocol feature.  Since a following patch will want to enable thread\nexit events on per-thread basis too, the packet introduced here is\nmore generic than just for clone events.  It lets you enable/disable a\nset of options at once, modelled on Linux ptrace\u0027s PTRACE_SETOPTIONS.\n\nIOW, this commit introduces a new QThreadOptions packet, that lets you\nspecify a set of per-thread event options you want to enable.  The\npacket accepts a list of options/thread-id pairs, similarly to vCont,\nprocessed left to right, with the options field being a number\ninterpreted as a bit mask of options.  The only option defined in this\ncommit is GDB_THREAD_OPTION_CLONE (0x1), which ask the remote target\nto report clone events.  Another patch later in the series will\nintroduce another option.\n\nFor example, this packet sets option \"1\" (clone events) on thread\np1000.2345:\n\n  QThreadOptions;1:p1000.2345\n\nand this clears options for all threads of process 1000, and then sets\noption \"1\" (clone events) on thread p1000.2345:\n\n  QThreadOptions;0:p1000.-1;1:p1000.2345\n\nThis clears options of all threads of all processes:\n\n  QThreadOptions;0\n\nThe target reports the set of supported options by including\n\"QThreadOptions\u003d\u003csupported options\u003e\" in its qSupported response.\n\ninfrun is then tweaked to enable GDB_THREAD_OPTION_CLONE when stepping\nover a breakpoint.\n\nUnlike PTRACE_SETOPTIONS, fork/vfork/clone children do NOT inherit\ntheir parent\u0027s thread options.  This is so that GDB can send e.g.,\n\"QThreadOptions;0;1:TID\" without worrying about threads it doesn\u0027t\nknow about yet.\n\nDocumentation for this new remote protocol feature is included in a\ndocumentation patch later in the series.\n\nBug: https://sourceware.org/bugzilla/show_bug.cgi?id\u003d19675\nBug: https://sourceware.org/bugzilla/show_bug.cgi?id\u003d27830\nReviewed-By: Andrew Burgess \u003caburgess@redhat.com\u003e\nChange-Id: Ie41e5093b2573f14cf6ac41b0b5804eba75be37e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "48f32bb3a0bc72290c85e406aa7b1b672bacb822",
      "old_mode": 33188,
      "old_path": "gdb/gdbthread.h",
      "new_id": "938a47ff012d586b40cfbc383d13bab980f6ed71",
      "new_mode": 33188,
      "new_path": "gdb/gdbthread.h"
    },
    {
      "type": "modify",
      "old_id": "e3157f86aff367649704b4632a33da620c707593",
      "old_mode": 33188,
      "old_path": "gdb/infrun.c",
      "new_id": "03eb32a68c44fe40f9f2ed2f9a903a9a0a06a270",
      "new_mode": 33188,
      "new_path": "gdb/infrun.c"
    },
    {
      "type": "modify",
      "old_id": "2a460f6f57a5a2c13d3e3aa42ca627fd77001429",
      "old_mode": 33188,
      "old_path": "gdb/remote.c",
      "new_id": "991a4344c7f783a904bec3e78936e507468654f0",
      "new_mode": 33188,
      "new_path": "gdb/remote.c"
    },
    {
      "type": "modify",
      "old_id": "3663ec21740e15f5a2481aac0fcbe4841e7859e1",
      "old_mode": 33188,
      "old_path": "gdb/target-debug.h",
      "new_id": "431f99ed3b1d291777a7a5750b208a1f25e4f5fe",
      "new_mode": 33188,
      "new_path": "gdb/target-debug.h"
    },
    {
      "type": "modify",
      "old_id": "eae96e2daba49d42303f9c102d090aaf1f5862ce",
      "old_mode": 33188,
      "old_path": "gdb/target-delegates.c",
      "new_id": "c5540c366e470ce9f70577eb1e2c4cafd2195a9b",
      "new_mode": 33188,
      "new_path": "gdb/target-delegates.c"
    },
    {
      "type": "modify",
      "old_id": "bf82649ed983fdcb100af24eae280d215a37a4b0",
      "old_mode": 33188,
      "old_path": "gdb/target.c",
      "new_id": "a6ca7fc4f0779f705bddb54952a9ef621de74aa1",
      "new_mode": 33188,
      "new_path": "gdb/target.c"
    },
    {
      "type": "modify",
      "old_id": "d4d81e727e97aec6689d73a3eba4aa1ae5adf961",
      "old_mode": 33188,
      "old_path": "gdb/target.h",
      "new_id": "558be4637554b477929e7e1c67da2b06a100b48b",
      "new_mode": 33188,
      "new_path": "gdb/target.h"
    },
    {
      "type": "modify",
      "old_id": "8089918f1d09b256699871233f05dbe8cf7991c7",
      "old_mode": 33188,
      "old_path": "gdb/target/target.c",
      "new_id": "3af7d73df5aea52f844f2bb82961d8709e040f42",
      "new_mode": 33188,
      "new_path": "gdb/target/target.c"
    },
    {
      "type": "modify",
      "old_id": "d1a18ee22120eb3a83a6168a781b96cd9a914a78",
      "old_mode": 33188,
      "old_path": "gdb/target/target.h",
      "new_id": "2691f92e4ef8ef0d9443856b554cb1b2e2455a9d",
      "new_mode": 33188,
      "new_path": "gdb/target/target.h"
    },
    {
      "type": "modify",
      "old_id": "0660589abbfbaaaa825b14884b66c7d24ff12e3f",
      "old_mode": 33188,
      "old_path": "gdb/thread.c",
      "new_id": "ca0466f35ec20d9212de964a2c98f2a3b7336a56",
      "new_mode": 33188,
      "new_path": "gdb/thread.c"
    },
    {
      "type": "modify",
      "old_id": "493e1dbf6cb6a2f4c91e095420c6de6cd6e9c76e",
      "old_mode": 33188,
      "old_path": "gdbserver/gdbthread.h",
      "new_id": "a4dff0fe1a2cfb603cb756c5ce988bb7588c53ae",
      "new_mode": 33188,
      "new_path": "gdbserver/gdbthread.h"
    },
    {
      "type": "modify",
      "old_id": "38f084bb0359164fad6f333862af11dc01ddb555",
      "old_mode": 33188,
      "old_path": "gdbserver/server.cc",
      "new_id": "c24a5c9fb966eed3521a889cceeca771de3079ba",
      "new_mode": 33188,
      "new_path": "gdbserver/server.cc"
    },
    {
      "type": "modify",
      "old_id": "f8e592d20c3c692178aa28973cb71a5bd182b4d1",
      "old_mode": 33188,
      "old_path": "gdbserver/target.cc",
      "new_id": "1c740bbf583b53c2d5c40e506a5bd1c4418e8d1d",
      "new_mode": 33188,
      "new_path": "gdbserver/target.cc"
    },
    {
      "type": "modify",
      "old_id": "f13ee40489f79d6f43aa6827ff1b97c1321ca01d",
      "old_mode": 33188,
      "old_path": "gdbserver/target.h",
      "new_id": "8893e0a6a8ba9d5f897943ee0bd9ff149e5425ca",
      "new_mode": 33188,
      "new_path": "gdbserver/target.h"
    }
  ]
}
