)]}'
{
  "commit": "2c9d78274a9a2c70b50246e29bae2acbbe239d2a",
  "tree": "5e07fdf6dd9ee41b74f823fffbbb23faec50150f",
  "parents": [
    "cdb090c88b4ebf6f728a000d1ee73d9bdee9ebb3"
  ],
  "author": {
    "name": "Pedro Alves",
    "email": "pedro@palves.net",
    "time": "Fri Apr 28 19:11:31 2023 +0100"
  },
  "committer": {
    "name": "Pedro Alves",
    "email": "pedro@palves.net",
    "time": "Wed Aug 23 15:40:48 2023 +0100"
  },
  "message": "Fix Windows sharing_input_terminal hang\n\nAfter running a number of programs under Windows gdb and detaching\nthem, I typed run in gdb, and got a hang, here:\n\n (top-gdb) bt\n #0  sharing_input_terminal (pid\u003d4672) at /home/pedro/gdb/src/gdb/mingw-hdep.c:388\n #1  0x00007ff71a2d8678 in sharing_input_terminal (inf\u003d0x23bf23dafb0) at /home/pedro/gdb/src/gdb/inflow.c:269\n #2  0x00007ff71a2d887b in child_terminal_save_inferior (self\u003d0x23bf23de060) at /home/pedro/gdb/src/gdb/inflow.c:423\n #3  0x00007ff71a2c80c0 in inf_child_target::terminal_save_inferior (this\u003d0x23bf23de060) at /home/pedro/gdb/src/gdb/inf-child.c:111\n #4  0x00007ff71a429c0f in target_terminal_is_ours_kind (desired_state\u003dtarget_terminal_state::is_ours_for_output) at /home/pedro/gdb/src/gdb/target.c:1037\n #5  0x00007ff71a429e02 in target_terminal::ours_for_output () at /home/pedro/gdb/src/gdb/target.c:1094\n #6  0x00007ff71a2ccc8e in post_create_inferior (from_tty\u003d0) at /home/pedro/gdb/src/gdb/infcmd.c:245\n #7  0x00007ff71a2cd431 in run_command_1 (args\u003d0x0, from_tty\u003d0, run_how\u003dRUN_NORMAL) at /home/pedro/gdb/src/gdb/infcmd.c:502\n #8  0x00007ff71a2cd58b in run_command (args\u003d0x0, from_tty\u003d0) at /home/pedro/gdb/src/gdb/infcmd.c:527\n\nThe problem is that the loop around GetConsoleProcessList looped\nforever, because there were exactly 10 processes to return.\nGetConsoleProcessList\u0027s documentation says:\n\n  If the buffer is too small to hold all the valid process identifiers,\n  the return value is the required number of array elements. The\n  function will have stored no identifiers in the buffer. In this\n  situation, use the return value to allocate a buffer that is large\n  enough to store the entire list and call the function again.\n\nIn this case, the buffer wasn\u0027t too small, it was exactly the right\nsize, so we should have broken out of the loop.  We didn\u0027t due to a\n\"\u003c\" check that should have been \"\u003c\u003d\".  That is fixed by this patch.\n\nApproved-By: Tom Tromey \u003ctom@tromey.com\u003e\nReviewed-By: Eli Zaretskii \u003celiz@gnu.org\u003e\nChange-Id: I14e4909f2ac2fa83d0d9b6e64418b5831ac4e4e3\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "75f63a3fe1771afe606965f2789358031176b50b",
      "old_mode": 33188,
      "old_path": "gdb/mingw-hdep.c",
      "new_id": "137a63eb244b277c084707dc23bc1e01e49aeded",
      "new_mode": 33188,
      "new_path": "gdb/mingw-hdep.c"
    }
  ]
}
