)]}'
{
  "commit": "24bac805d782801ef7287710d4aec777538fe4ac",
  "tree": "146917a4377405c9bb00f1e41aa8ff2348654172",
  "parents": [
    "e71ab8393e4b25296adeea32f65bd612197aea09"
  ],
  "author": {
    "name": "Simon Marchi",
    "email": "simon.marchi@polymtl.ca",
    "time": "Thu Apr 16 16:16:15 2026 -0400"
  },
  "committer": {
    "name": "Simon Marchi",
    "email": "simon.marchi@efficios.com",
    "time": "Fri Apr 17 15:30:30 2026 -0400"
  },
  "message": "gdb, gdbserver: split iterate_over_lwps into for_each_lwp and find_lwp\n\nEven though it works, I have always been mildly annoyed by\niterate_over_lwps being used for both iterating over all lwps and\nfinding one lwp matching a criterion.  I think it would be clearer to\nhave two functions for the two use cases.  Then it would be 100% clear\nat the call site what the intention is.  It would be clear that a\ncallback returning bool is meant to be a predicate for the find\nfunction, while a callback returning void is meant to be a callback for\nthe \"for each\" function.\n\nTherefore, split iterate_over_lwps in two:\n\n - find_lwp to find the first lwp matching a boolean predicate (and the\n   given ptid filter)\n - for_each_lwp to apply a function on all lwps (optionally filtering by\n   ptid or pid)\n\nThe callbacks given to for_each_lwp can now return void.\n\nIntroduce some overloads for for_each_lwp, for the various common use\ncases:\n\n - filtering by ptid\n - filtering by pid\n - no ptid/pid filter\n\nfind_lwp and two overloads of for_each_lwp are actually only used in\ngdb/linux-nat.c, so make them local to that file.  Only the pid variant\nof for_each_lwp is used in shared code.\n\nThe pattern used in this patch serves as the basis for subsequent\npatches that split other \"iterate over\" functions the same way.\n\nChange-Id: I49d3af0916622300cc81e3c32d22e1aff13cf38f\nApproved-By: Andrew Burgess \u003caburgess@redhat.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "9d7bd6e09c977ba1b04fdf28f2aa21a815157638",
      "old_mode": 33188,
      "old_path": "gdb/arm-linux-nat.c",
      "new_id": "b3d4ce1ec37aff22b85dd624e590aba71f0222e9",
      "new_mode": 33188,
      "new_path": "gdb/arm-linux-nat.c"
    },
    {
      "type": "modify",
      "old_id": "362ef5f1cb7551458da68c11efbf129283a95c82",
      "old_mode": 33188,
      "old_path": "gdb/linux-nat.c",
      "new_id": "15fca3f6d35ef758807fbc79d5b89228dc12713c",
      "new_mode": 33188,
      "new_path": "gdb/linux-nat.c"
    },
    {
      "type": "modify",
      "old_id": "1e11d28e906621ffaababb679457ef02e361de31",
      "old_mode": 33188,
      "old_path": "gdb/nat/aarch64-linux-hw-point.c",
      "new_id": "b4d74ab8dc2b3bdabb2b365b2afd865e391fdfe3",
      "new_mode": 33188,
      "new_path": "gdb/nat/aarch64-linux-hw-point.c"
    },
    {
      "type": "modify",
      "old_id": "42c0467191fe0d6c3e5441437231d45e85c5fbf5",
      "old_mode": 33188,
      "old_path": "gdb/nat/linux-nat.h",
      "new_id": "4414749b93de91c5f8a04a7714ba80e1949565ab",
      "new_mode": 33188,
      "new_path": "gdb/nat/linux-nat.h"
    },
    {
      "type": "modify",
      "old_id": "68eee8fb7754d2e69b28767104299d6f22c3192a",
      "old_mode": 33188,
      "old_path": "gdb/nat/loongarch-linux-hw-point.c",
      "new_id": "be867e758edfc230f0464f4cf7652c9213aefe85",
      "new_mode": 33188,
      "new_path": "gdb/nat/loongarch-linux-hw-point.c"
    },
    {
      "type": "modify",
      "old_id": "abdfa50edb936ff2845c85cc7e33393d7e1aad8f",
      "old_mode": 33188,
      "old_path": "gdb/nat/x86-linux-dregs.c",
      "new_id": "ea8de511d5c4931a8ccc0258d48abac4630146e7",
      "new_mode": 33188,
      "new_path": "gdb/nat/x86-linux-dregs.c"
    },
    {
      "type": "modify",
      "old_id": "b077a1d0cf42a5cf7f6d6d4413f5a25d83628fea",
      "old_mode": 33188,
      "old_path": "gdb/ppc-linux-nat.c",
      "new_id": "102a51c85090b8908572d545d8158f8eb3f90496",
      "new_mode": 33188,
      "new_path": "gdb/ppc-linux-nat.c"
    },
    {
      "type": "modify",
      "old_id": "5bee2b1e112828f7b3248a37d7cc83d98a3919c3",
      "old_mode": 33188,
      "old_path": "gdb/s390-linux-nat.c",
      "new_id": "6ef524a310cbe182b2bda6da5148a98e56ef5894",
      "new_mode": 33188,
      "new_path": "gdb/s390-linux-nat.c"
    },
    {
      "type": "modify",
      "old_id": "022e8415fda802080260bbde951b6dc940d25cd0",
      "old_mode": 33188,
      "old_path": "gdbserver/linux-low.cc",
      "new_id": "b4ec524dbbffad1090b21c7d3b8989cadb029ad7",
      "new_mode": 33188,
      "new_path": "gdbserver/linux-low.cc"
    }
  ]
}
