)]}'
{
  "commit": "4ea7412e53616ecc29d61a95ff8afc284ed9d240",
  "tree": "82c6c90894926874374ab311813b05cdb2a73bd4",
  "parents": [
    "aed77b16f17fc3ed9c952af632674dc25d0dfdb5"
  ],
  "author": {
    "name": "Pedro Alves",
    "email": "pedro@palves.net",
    "time": "Tue Nov 21 12:23:11 2023 +0000"
  },
  "committer": {
    "name": "Pedro Alves",
    "email": "pedro@palves.net",
    "time": "Wed Dec 20 21:18:20 2023 +0000"
  },
  "message": "gdb.threads/step-over-thread-exit.exp improvements\n\nThis commit makes the following improvements to\ngdb.threads/step-over-thread-exit.exp:\n\n- Add a third axis to stepping over the breakpoint with displaced vs\n  inline stepping -- also test with no breakpoint at all.\n\n- Check that when GDB reports \"Command aborted, thread exited.\", the\n  selected thread is the thread that exited.  This is always true\n  currently on GNU/Linux by coincidence, but a similar testcase on AMD\n  GPU exposed a problem here.  Better make the testcase catch any\n  potential regression.\n\n- Fixes a race that Simon ran into with GDBserver testing.\n\n    (gdb) next\n    [New Thread 2143071.2143438]\n\n    Thread 3 \"step-over-threa\" hit Breakpoint 2, 0x000055555555524e in my_exit_syscall () at .../testsuite/lib/my-syscalls.S:74\n    74      SYSCALL (my_exit, __NR_exit)\n    (gdb) FAIL: gdb.threads/step-over-thread-exit.exp: displaced-stepping\u003dauto: non-stop\u003don: target-non-stop\u003don: schedlock\u003doff: cmd\u003dnext: ns_stop_all\u003d0: command aborts when thread exits\n\n  I was not able to reproduce it, but I believe that what happens is\n  the following:\n\n  Once we continue, the thread 2 exits, and the main thread thus\n  unblocks from its pthread_join, and spawns a new thread.  That new\n  thread may hit the breakpoint at my_exit_syscall very quickly.  GDB\n  could then see/process that breakpoint event before the thread exit\n  event for the thread we care about, which would result in the\n  failure seen above.\n\n  The fix here is to not loop and start a new thread at all in the\n  scenario where the race can happen.  We only need to loop and spawn\n  new threads when testing with \"cmd\u003dcontinue\" and schedlock off, in\n  which case GDB doesn\u0027t abort the command when the thread exits.\n\nApproved-By: Simon Marchi \u003csimon.marchi@efficios.com\u003e\nChange-Id: I90c95c32f00630a3f682b1541c23aff52451f9b6\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "878e5924c5c77f2a4ac17261dbdcd4c14adb3160",
      "old_mode": 33188,
      "old_path": "gdb/testsuite/gdb.threads/step-over-thread-exit.c",
      "new_id": "218f003b205c8e188cd6d925a179bdfed2b85a7d",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/gdb.threads/step-over-thread-exit.c"
    },
    {
      "type": "modify",
      "old_id": "615bd838763166d41b22733f1b13a03d5873fc43",
      "old_mode": 33188,
      "old_path": "gdb/testsuite/gdb.threads/step-over-thread-exit.exp",
      "new_id": "32f64ce1a3eba515b3370c3eceb8e320766f5861",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/gdb.threads/step-over-thread-exit.exp"
    }
  ]
}
