)]}'
{
  "commit": "c6115b5eacda61abe76b05f610eea38eb3dbbfb3",
  "tree": "04653dfb096e20f9a28adf460578e38c20915d47",
  "parents": [
    "7da4814ad420b5197e51c732c69c685c2640918b"
  ],
  "author": {
    "name": "Tom de Vries",
    "email": "tdevries@suse.de",
    "time": "Tue Jun 03 08:59:58 2025 +0200"
  },
  "committer": {
    "name": "Tom de Vries",
    "email": "tdevries@suse.de",
    "time": "Tue Jun 03 08:59:58 2025 +0200"
  },
  "message": "[gdb/cli] Use captured per_command_time in worker threads\n\nWith test-case gdb.base/maint.exp, I ran into:\n...\n(gdb) file maint^M\nReading symbols from maint...^M\n(gdb) mt set per-command on^M\n(gdb) Time for \"DWARF indexing worker\": ...^M\nTime for \"DWARF indexing worker\": ...^M\nTime for \"DWARF indexing worker\": ...^M\nTime for \"DWARF indexing worker\": ...^M\nTime for \"DWARF skeletonless type units\": ...^M\nTime for \"DWARF add parent map\": ...^M\nTime for \"DWARF finalize worker\": ...^M\nTime for \"DWARF finalize worker\": ...^M\nTime for \"DWARF finalize worker\": ...^M\nTime for \"DWARF finalize worker\": ...^M\nTime for \"DWARF finalize worker\": ...^M\nFAIL: $exp: warnings: per-command: mt set per-command on (timeout)\nmt set per-command off^M\n2025-05-31 09:33:44.711 - command started^M\n(gdb) PASS: $exp: warnings: per-command: mt set per-command off\n...\n\nI didn\u0027t manage to reproduce this by rerunning the test-case, but it\u0027s fairly\neasy to reproduce using a file with more debug info, for instance gdb:\n...\n$ gdb -q -batch -ex \"file build/gdb/gdb\" -ex \"mt set per-command on\"\n...\n\nDue to the default \"mt dwarf synchronous\" \u003d\u003d off, the file command starts\nbuilding the cooked index in the background, and returns immediately without\nwaiting for the result.\n\nThe subsequent \"mt set per-command on\" implies \"mt set per-command time on\",\nwhich switches on displaying of per-command execution time.\n\nThe \"Time for\" lines are the result of those two commands, but these lines\nshouldn\u0027t be there because \"mt per-command time\" \u003d\u003d off at the point of\nissuing the file command.\n\nFix this by capturing the per_command_time variable, and using the captured\nvalue instead.\n\nTested on x86_64-linux.\n\nApproved-By: Simon Marchi \u003csimon.marchi@efficios.com\u003e\n\nPR cli/33039\nBug: https://sourceware.org/bugzilla/show_bug.cgi?id\u003d33039\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "5d7fc462a05dd4df19244c9cd922f16d0c980ad9",
      "old_mode": 33188,
      "old_path": "gdb/dwarf2/cooked-index-worker.c",
      "new_id": "09d80eff629c4d168e3108e5ee5d9bd082be6543",
      "new_mode": 33188,
      "new_path": "gdb/dwarf2/cooked-index-worker.c"
    },
    {
      "type": "modify",
      "old_id": "c68620578cc7b1fbfe6e665bf0666079093395b3",
      "old_mode": 33188,
      "old_path": "gdb/dwarf2/cooked-index-worker.h",
      "new_id": "8b9766cddcbf1c58361d61ffebc9ca15de8deb84",
      "new_mode": 33188,
      "new_path": "gdb/dwarf2/cooked-index-worker.h"
    },
    {
      "type": "modify",
      "old_id": "2c7e31e5676cc6de7b50834e130a0b4ed42f2007",
      "old_mode": 33188,
      "old_path": "gdb/dwarf2/cooked-index.c",
      "new_id": "7232f286a40b7976a5b8795352ab0a7635b77ab5",
      "new_mode": 33188,
      "new_path": "gdb/dwarf2/cooked-index.c"
    },
    {
      "type": "modify",
      "old_id": "b178dacbe3d18b28abca453edecf805ba0c22a71",
      "old_mode": 33188,
      "old_path": "gdb/dwarf2/read.c",
      "new_id": "d3d0d4c303e8f328d5ce2430c3ce5f495a2f467f",
      "new_mode": 33188,
      "new_path": "gdb/dwarf2/read.c"
    },
    {
      "type": "modify",
      "old_id": "e017d05ef41bbdd9e9a466d5a726de733f8b76ee",
      "old_mode": 33188,
      "old_path": "gdb/maint.c",
      "new_id": "49a308d36e25f5ee26f34cb68609789a19476824",
      "new_mode": 33188,
      "new_path": "gdb/maint.c"
    },
    {
      "type": "modify",
      "old_id": "28e6280a464c0c7f032684c3e5f88d574cafb8d0",
      "old_mode": 33188,
      "old_path": "gdb/maint.h",
      "new_id": "cccb6f60354f2d13d4dd6cab562ec93ced933663",
      "new_mode": 33188,
      "new_path": "gdb/maint.h"
    }
  ]
}
