)]}'
{
  "commit": "11039eff7166cf40d502c88e8b161dd7602120aa",
  "tree": "6e5be5aba46443ab4c01ad070a54925678ffe61d",
  "parents": [
    "a56c63f78ebd158972882b4f8c183d70e9ef1cfd"
  ],
  "author": {
    "name": "Andrew Burgess",
    "email": "aburgess@redhat.com",
    "time": "Fri Apr 29 18:16:21 2022 +0100"
  },
  "committer": {
    "name": "Andrew Burgess",
    "email": "aburgess@redhat.com",
    "time": "Tue May 03 10:30:33 2022 +0100"
  },
  "message": "gdb/testsuite: fix mi-exec-run.exp with native-extended-gdbserver board\n\nWhen running with the native-extended-gdbserver board, I currently see\none failure in gdb.mi/mi-exec-run.exp:\n\n    FAIL: gdb.mi/mi-exec-run.exp: inferior-tty\u003dseparate: mi\u003dseparate: force-fail\u003d0: breakpoint hit reported on console (timeout)\n\nIn this test the MI interface should be started in a separate tty,\nwhich means we should have a CLI tty and an MI tty, however, this is\nnot happening.  Instead GDB is just started in MI mode and there is no\nCLI tty.\n\nThe test script tries to switch between the CLI an MI terminals and\nlook for some expected output on each, however, as there is no CLI\nterminal the expected output never arrives, and the test times out.\n\nIt turns out that this is not a GDB problem, rather, this is an issue\nwith argument passing within the test script.\n\nThe proc default_mi_gdb_start expects to take a set of flags (strings)\nas arguments, each of flag is expected to be a separate argument.  The\ndefault_mi_gdb_start proc collects all its arguments into a list using\nthe special \u0027args\u0027 parameter name, and then iterates over this list to\nsee which flags were passed.\n\nIn mi_gdb_start, which forwards to default_mi_gdb_start, the arguments\nare also gathered into the \u0027args\u0027 parameter list, but are then\nexpanded back to be separate arguments using the eval trick, i.e.:\n\n  proc mi_gdb_start { args } {\n    return [eval default_mi_gdb_start $args]\n  }\n\nThis ensures that when we arrive in default_mi_gdb_start each flag is\na separate argument, rather than appearing as a single list containing\nall arguments.\n\nWhen using the native-extended-gdbserver board however, the file\nboards/native-extended-gdbserver.exp is loaded, and this file replaces\nthe default mi_gdb_start with its own version.\n\nThis new mi_gdb_start also gathers the arguments into an \u0027args\u0027 list,\nbut forgets to expand the arguments out using the eval trick.\n\nAs a result, when using the native-extended-gdbserver board, by the\ntime we get to default_mi_gdb_start, we end up with the args list\ncontaining a single item, which is a list containing all the arguments\nthe user passed.\n\nWhat this means is that if the user passes two arguments, then, in\ndefault_mi_gdb_start, instead of seeing two separate arguments, we see\na single argument made by concatenating the two arguments together.\n\nThe only place this is a problem is in the test mi-exec-run.exp,\nwhich (as far as I can see) is the only test where we might try to\npass both arguments at the same time.  Currently we think we passed\nboth arguments to mi_gdb_start, but mi_gdb_start behaves as if no\narguments were passed.\n\nThis commit fixes the problem by making use of the eval trick within\nthe native-extended-gdbserver version of mi_gdb_start.  After this,\nthe FAIL listed at the top of this message is resolved.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "b925c364993f5689c5e5e2d86408172d21198990",
      "old_mode": 33188,
      "old_path": "gdb/testsuite/boards/native-extended-gdbserver.exp",
      "new_id": "67acc6fea7cfe9162e2cf6be73b9014b33845fb3",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/boards/native-extended-gdbserver.exp"
    }
  ]
}
