)]}'
{
  "commit": "6b839dd3deea4de278ebd862edb9c91d335d63e2",
  "tree": "bf4b0b767bc9b9b62faad46fbb58e078b2bf2c92",
  "parents": [
    "b253899c901fed0ff56b2746945ffc824e412b81"
  ],
  "author": {
    "name": "Tom de Vries",
    "email": "tdevries@suse.de",
    "time": "Thu Oct 27 16:53:12 2022 +0200"
  },
  "committer": {
    "name": "Tom de Vries",
    "email": "tdevries@suse.de",
    "time": "Thu Oct 27 16:53:12 2022 +0200"
  },
  "message": "[gdb/testsuite] Fix silent timeouts in gdb.mi/mi-exec-run.exp with remote host\n\nI noticed that running test-case gdb.mi/mi-exec-run.exp with host board\nlocal-remote-host.exp takes about 44 seconds.\n\nI found two silent timeouts responsible for this.\n\nThe first is in mi_gdb_exit, where we have:\n...\n    if { [is_remote host] \u0026\u0026 [board_info host exists fileid] } {\n        send_gdb \"999-gdb-exit\\n\"\n        gdb_expect 10 {\n            -re \"y or n\" {\n                send_gdb \"y\\n\"\n                exp_continue\n            }\n            -re \"Undefined command.*$gdb_prompt $\" {\n                send_gdb \"quit\\n\"\n                exp_continue\n            }\n            -re \"DOSEXIT code\" { }\n        }\n    }\n...\nso in gdb.log we see:\n...\n999-gdb-exit^M\n999^exit^M\n\u003dthread-exited,id\u003d\"1\",group-id\u003d\"i1\"^M\n\u003dthread-group-exited,id\u003d\"i1\"^M\n...\nafter which expect just waits for the timeout.\n\nFix this by adding a gdb_expect clause to parse the exit:\n...\n            -re \"\\r\\n999\\\\^exit\\r\\n\" { }\n...\n\nNote that we\u0027re not parsing the thread-exited/thread-group-exited messages, because\nthey may not be present:\n...\n$ gdb -i\u003dmi\n\u003dthread-group-added,id\u003d\"i1\"\n(gdb)\n999-gdb-exit\n999^exit\n$\n...\n\nAfter fixing that, we have:\n...\n(gdb) ^M\nsaw mi error\nPASS: gdb.mi/mi-exec-run.exp: inferior-tty\u003dseparate: mi\u003dseparate: \\\n  force-fail\u003d1: run failure detected\nquit^M\n\u0026\"quit\\n\"^M\n...\n\nWhat seems to be happening is that default_gdb_exit sends a cli interpreter\nquit command to an mi interpreter, after which again expect just waits for the\ntimeout.\n\nFix this by adding mi_gdb_exit to the end of the test-case, as in many other\ngdb.mi/*.exp test-cases.\n\nAfter these two fixes, the test-case takes about 4 seconds.\n\nTested on x86_64-linux.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "3b373b2c84d7458ccae8a84937f1ccb91e7e31c2",
      "old_mode": 33188,
      "old_path": "gdb/testsuite/gdb.mi/mi-exec-run.exp",
      "new_id": "01f52e22578b059fa789f934c38c7cba03886a77",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/gdb.mi/mi-exec-run.exp"
    },
    {
      "type": "modify",
      "old_id": "e537d3b546bf6f693ed942eb70561626a7967c14",
      "old_mode": 33188,
      "old_path": "gdb/testsuite/lib/mi-support.exp",
      "new_id": "b11457693be82e88ef7f0fb2d4ce54e0c7f63290",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/lib/mi-support.exp"
    }
  ]
}
