)]}'
{
  "commit": "2bf4cc2b92a45f9d857907aec3d14b5ffd9ebd2e",
  "tree": "1652d5958e3b4b407930b4fc7b456cf192458742",
  "parents": [
    "600b5fc22ec8b6b503b2e976b37b6b550ec18027"
  ],
  "author": {
    "name": "Simon Marchi",
    "email": "simon.marchi@efficios.com",
    "time": "Thu May 04 11:28:48 2023 -0400"
  },
  "committer": {
    "name": "Simon Marchi",
    "email": "simon.marchi@efficios.com",
    "time": "Thu May 18 13:22:30 2023 -0400"
  },
  "message": "gdb.fortran/lbound-ubound.exp: read expected lbound and ubound from function parameters (PR 30414)\n\ngdb.fortran/lbound-ubound.exp reads the expected lbound and ubound\nvalues by reading some output from the inferior.  This is racy when\nrunning on boards where the inferior I/O is on a separate TTY than\nGDB\u0027s, such as native-gdbserver.\n\nI sometimes see this behavior:\n\n    (gdb) continue\n    Continuing.\n\n    Breakpoint 2, do_test (lb\u003d..., ub\u003d...) at /home/jenkins/workspace/binutils-gdb_master_linuxbuild/platform/jammy-amd64/target_board/nati\n    ve-gdbserver/src/binutils-gdb/gdb/testsuite/gdb.fortran/lbound-ubound.F90:45\n    45        print *, \"\"   ! Test Breakpoint\n    (gdb) Remote debugging from host ::1, port 37496\n\n     Expected GDB Output:\n\n    LBOUND \u003d (-8, -10)\n    UBOUND \u003d (-1, -2)\n    APB: Run a test here\n    APB: Expected lbound \u0027(-8, -10)\u0027\n    APB: Expected ubound \u0027\u0027\n\nWhat happened is that expect read the output from GDB before the output\nfrom the inferior, triggering this gdb_test_multiple clause:\n\n    -re \"$gdb_prompt $\" {\n        set found_prompt true\n\n        if {$found_dealloc_breakpoint\n            || ($expected_lbound !\u003d \"\" \u0026\u0026 $expected_ubound !\u003d \"\")} {\n            # We\u0027re done.\n        } else {\n            exp_continue\n        }\n    }\n\nSo it set found_prompt, but the gdb_test_multiple kept going because\nfound_dealloc_breakpoint is false (this is the flag indicating that the\ntest is finished) and we still don\u0027t have expected_lbound and\nexpected_ubound.  Then, expect reads in the inferior I/O, triggering\nthis clause:\n\n    -re \".*LBOUND \u003d (\\[^\\r\\n\\]+)\\r\\n\" {\n        set expected_lbound $expect_out(1,string)\n        if {!$found_prompt} {\n            exp_continue\n        }\n    }\n\nThis sets expected_lbound, but since found_prompt is true, we don\u0027t do\nexp_continue, and exit the gdb_test_multiple, without having an\nexpected_ubound.\n\nChange the test to read the values from the lb and ub function\nparameters instead.  As far as I understand, this still exercises what\nwe want to test.  These variables contain the return values of the\nlbound and ubound functions as computed by the program.  We\u0027ll use them\nto check the return values of the lbound and ubound functions as\ncomputed by GDB.\n\nChange-Id: I3c4d3d17d9291870a758a42301d15a007821ebb5\nBug: https://sourceware.org/bugzilla/show_bug.cgi?id\u003d30414\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "42aca4a35b464f7957cec5d14a3b6194fd47ed71",
      "old_mode": 33188,
      "old_path": "gdb/testsuite/gdb.fortran/lbound-ubound.F90",
      "new_id": "4b7d44d5ccbb1a9df5e6bcbb478b1cf1f2a03494",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/gdb.fortran/lbound-ubound.F90"
    },
    {
      "type": "modify",
      "old_id": "fced41f9fe3d042e847ab57c931ac2b0814bdaf5",
      "old_mode": 33188,
      "old_path": "gdb/testsuite/gdb.fortran/lbound-ubound.exp",
      "new_id": "90cb43af3c22db5ca1d95cefb38a491124c215fb",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/gdb.fortran/lbound-ubound.exp"
    }
  ]
}
