)]}'
{
  "commit": "76183fd1bf613fd0d899092bf5594a641e1224ae",
  "tree": "2deb652ef91ce6890ae23bdf017ec1b68f6588c6",
  "parents": [
    "140eb481d1c31d9327b7baf7901c354c8e224dab"
  ],
  "author": {
    "name": "Kevin Buettner",
    "email": "kevinb@redhat.com",
    "time": "Thu Nov 18 15:06:01 2021 -0700"
  },
  "committer": {
    "name": "Kevin Buettner",
    "email": "kevinb@redhat.com",
    "time": "Thu Nov 18 15:38:34 2021 -0700"
  },
  "message": "dprintf-execution-x-script.exp: Adjust test for native-extended-gdbserver\n\nWithout this commit, doing...\n\nmake check RUNTESTFLAGS\u003d\"--target_board\u003dnative-extended-gdbserver\" \\\n           TESTS\u003d\"gdb.base/dprintf-execution-x-script.exp\"\n\n...will show one failure.\n\nHere\u0027s a snippet from gdb.log showing the circumstances - I\u0027ve trimmed\nthe paths for readability:\n\nbuiltin_spawn gdb -nw -nx -data-directory data-directory -iex set height 0 -iex set width 0 -iex set auto-connect-native-target off -iex set sysroot -ex set height unlimited -x testsuite/gdb.base/dprintf-execution-x-script.gdb --args testsuite/outputs/gdb.base/dprintf-execution-x-script/dprintf-execution-x-script\n...\nReading symbols from testsuite/outputs/gdb.base/dprintf-execution-x-script/dprintf-execution-x-script...\nDprintf 1 at 0x40116e: file testsuite/gdb.base/dprintf-execution-x-script.c, line 38.\nBreakpoint 2 at 0x40113a: file testsuite/gdb.base/dprintf-execution-x-script.c, line 26.\ntestsuite/gdb.base/dprintf-execution-x-script.gdb:21: Error in sourced command file:\nDon\u0027t know how to run.  Try \"help target\".\n(gdb) FAIL: gdb.base/dprintf-execution-x-script.exp: load and run script with -x\n...\nGNU gdb (GDB) 12.0.50.20211118-git\nCopyright (C) 2021 Free Software Foundation, Inc.\n...\n(gdb) set height 0\n(gdb) set width 0\n(gdb) builtin_spawn gdbserver/gdbserver --once --multi localhost:2346\nListening on port 2346\ntarget extended-remote localhost:2346\nRemote debugging using localhost:2346\n...\n[Tests after this point will pass.]\n\nNote that the command which spawns gdb prevents the gdb script from\nusing the native target via \"-iex set auto-connect-native-target off\".\n\nMoreover, the script in question contains a \"run\" command, so GDB\ndoesn\u0027t know how to run (since it\u0027s prevented from using the native\ntarget and no alternate \"target\" command has been issued.  But, once\nGDB finishes starting up, the test will spawn a gdbserver and then\nconnect to it.  The other (two) tests after this point both pass.\n\nI\u0027ve fixed this by using gdb_test_multiple instead of gdb_test.\nWhen a \"Don\u0027t know how to run message\" is received, the test is\nunsupported.\n\nI\u0027ve also added a comment explaining the reason for needing to check\nfor \"Don\u0027t know how to run\" despite bailing out at the top of the test\nvia:\n\n  if ![target_can_use_run_cmd] {\n      return 0\n  }\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "9133af752be8bf328245d1d220e8e129aadc7b02",
      "old_mode": 33188,
      "old_path": "gdb/testsuite/gdb.base/dprintf-execution-x-script.exp",
      "new_id": "99caf359e41e9acbd128821158a3cc34e88ef31d",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/gdb.base/dprintf-execution-x-script.exp"
    }
  ]
}
