)]}'
{
  "commit": "86b4a00fa329a4df7ec2cb404c2b52152560aa0f",
  "tree": "66c60bb532c43c954933e5e3fc7d676a21d341e0",
  "parents": [
    "3f2ef5ba4278e7a436208b4aa48e7cb599392a92"
  ],
  "author": {
    "name": "Tom de Vries",
    "email": "tdevries@suse.de",
    "time": "Tue Oct 11 10:14:38 2022 +0200"
  },
  "committer": {
    "name": "Tom de Vries",
    "email": "tdevries@suse.de",
    "time": "Tue Oct 11 10:14:38 2022 +0200"
  },
  "message": "[gdb/testsuite] Fix prompt parsing in capture_command_output\n\nI noticed in capture_command_output that the output of a single command is\nmatched using two gdb_test_multiples:\n- the first one matching the echoed command and skipping an optional prefix,\n- the second one matching the output and the prompt.\n\nThis is error-prone, because the first gdb_test_multiple has implicit\nclauses which may consume the prompt.\n\nThe problem is easy to spot with an example.  First consider:\n...\nset output [capture_command_output \"print 1\" \"\\\\\\$1 \u003d \"]\ngdb_assert { [string equal $output \"1\"] }\n...\nfor which we get:\n...\nPASS: [string equal $output \"1\"]\n...\n\nIf we change the prefix string to a no-match, say \"1 \u003d \", and update the\noutput string match accordingly, we get instead:\n...\nFAIL: capture_command_output for print 1\nFAIL: [string equal $output \"\\$1 \u003d 1\"]\n...\n\nThe first FAIL is produced by the first gdb_test_multiple, consuming the prompt.\n\nThe second gdb_test_multiple then silently times out waiting for another prompt,\nafter which the second FAIL is produced.  Note that the timeout is silent\nbecause the gdb_test_multiple is called with an empty message argument.\n\nThe second FAIL is because capture_command_output returns \"\", given that all\nthe command output was consumed by the first gdb_test_multiple.\n\nFix this by rewriting capture_command_output to use only a single\ngdb_test_multiple.\n\nTested on x86_64-linux.\n",
  "tree_diff": [
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "a48ceb0d65c4821aa6c0850d255e0ea46050e948",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/gdb.testsuite/capture-command-output.exp"
    },
    {
      "type": "modify",
      "old_id": "f53d90edd00e123e33a40821740fdef7d8fa63da",
      "old_mode": 33188,
      "old_path": "gdb/testsuite/lib/gdb.exp",
      "new_id": "61bc060b2f779259d4678332ec3ba50b1ce15c39",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/lib/gdb.exp"
    }
  ]
}
