)]}'
{
  "commit": "12be796ca8a107f91b23e393fc228960ea52c6cc",
  "tree": "27f8eed9418c3e438a94850f203b0f7589206c2a",
  "parents": [
    "1c7682f9f23f47ec47235a6dd97b0f6e8716ebd3"
  ],
  "author": {
    "name": "Simon Marchi",
    "email": "simon.marchi@polymtl.ca",
    "time": "Wed Jul 14 12:31:36 2021 -0400"
  },
  "committer": {
    "name": "Simon Marchi",
    "email": "simon.marchi@polymtl.ca",
    "time": "Sat Jul 17 08:54:40 2021 -0400"
  },
  "message": "gdb: make all_inferiors_safe actually work\n\nThe test gdb.threads/fork-plus-threads.exp fails since 08bdefb58b78\n(\"gdb: make inferior_list use intrusive_list\"):\n\n    FAIL: gdb.threads/fork-plus-threads.exp: detach-on-fork\u003doff: only inferior 1 left\n\nLooking at the log, we see that we are left with a bunch of inferiors in\nthe detach-on-fork\u003doff case:\n\n    info inferiors^M\n      Num  Description       Connection           Executable        ^M\n    * 1    \u003cnull\u003e                                 \u003csnip\u003e/fork-plus-threads ^M\n      2    \u003cnull\u003e                                 \u003csnip\u003e/fork-plus-threads ^M\n      3    \u003cnull\u003e                                 \u003csnip\u003e/fork-plus-threads ^M\n      4    \u003cnull\u003e                                 \u003csnip\u003e/fork-plus-threads ^M\n      5    \u003cnull\u003e                                 \u003csnip\u003e/fork-plus-threads ^M\n      6    \u003cnull\u003e                                 \u003csnip\u003e/fork-plus-threads ^M\n      7    \u003cnull\u003e                                 \u003csnip\u003e/fork-plus-threads ^M\n      8    \u003cnull\u003e                                 \u003csnip\u003e/fork-plus-threads ^M\n      9    \u003cnull\u003e                                 \u003csnip\u003e/fork-plus-threads ^M\n      10   \u003cnull\u003e                                 \u003csnip\u003e/fork-plus-threads ^M\n      11   \u003cnull\u003e                                 \u003csnip\u003e/fork-plus-threads ^M\n    (gdb) FAIL: gdb.threads/fork-plus-threads.exp: detach-on-fork\u003doff: only inferior 1 left\n\nwhen we expect to have just one.  The problem is prune_inferiors not\npruning inferiors.  And this is caused by all_inferiors_safe not\nactually iterating on inferiors.  The current implementation:\n\n  inline all_inferiors_safe_range\n  all_inferiors_safe ()\n  {\n    return {};\n  }\n\ndefault-constructs an all_inferiors_safe_range, which default-constructs\nan all_inferiors_safe_iterator as its m_begin field, which\ndefault-constructs a all_inferiors_iterator.  A default-constructed\nall_inferiors_iterator is an end iterator, which means we have\nconstructed an (end,end) all_inferiors_safe_range.\n\nWe actually need to pass down the list on which we want to iterator\n(that is the inferior_list global), so that all_inferiors_iterator\u0027s\nfirst constructor is chosen.  We also pass nullptr as the proc_target\nfilter.  In this case, we don\u0027t do any filtering, but if in the future\nall_inferiors_safe needed to allow filtering on process target (like\nall_inferiors does), we could pass down a process target pointer.\n\nbasic_safe_iterator\u0027s constructor needs to be changed to allow\nconstructing the wrapped iterator with multiple arguments, not just one.\n\nWith this, gdb.threads/fork-plus-threads.exp is passing once again for\nme.\n\nChange-Id: I650552ede596e3590c4b7606ce403690a0278a01\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "6662a3bde4635190e19360c1d83beecdeee04948",
      "old_mode": 33188,
      "old_path": "gdb/inferior.h",
      "new_id": "94fbac0fc5711365f72c47fe882753cd06552cdf",
      "new_mode": 33188,
      "new_path": "gdb/inferior.h"
    },
    {
      "type": "modify",
      "old_id": "5cfc5b6ee692ec4776ea8c6dfc42a56ce85b7e41",
      "old_mode": 33188,
      "old_path": "gdbsupport/safe-iterator.h",
      "new_id": "53868d3b3eecfc1987cdaf871c3508289610b29a",
      "new_mode": 33188,
      "new_path": "gdbsupport/safe-iterator.h"
    }
  ]
}
