)]}'
{
  "commit": "4d7d74c958e32e2a8aeb6794cc524d84aa180700",
  "tree": "858394e9b91dec3bce9a519ca4b5e8fcfee3727c",
  "parents": [
    "8c65d27b7dfe121c39671aa3b63e6a29438edfd1"
  ],
  "author": {
    "name": "Pedro Alves",
    "email": "pedro@palves.net",
    "time": "Mon Sep 15 22:12:28 2025 +0100"
  },
  "committer": {
    "name": "Pedro Alves",
    "email": "pedro@palves.net",
    "time": "Tue Sep 16 11:57:02 2025 +0100"
  },
  "message": "Fix nested gdb_caching_proc with args\n\nCommit d09eba07 (\"Make get_compiler_info use gdb_caching_proc\")\nregressed some tests when you run them in isolation (as this depends\non the order the gdb_caching_proc procs\u0027 results are cached).\n\nE.g.:\n\n Running /home/pedro/rocm/gdb/build/gdb/testsuite/../../../src/gdb/testsuite/gdb.rocm/simple.exp ...\n ERROR: tcl error sourcing /home/pedro/rocm/gdb/build/gdb/testsuite/../../../src/gdb/testsuite/gdb.rocm/simple.exp.\n ERROR: tcl error code TCL WRONGARGS\n ERROR: wrong # args: should be \"gdb_real__get_compiler_info_1 language\"\n     while executing\n \"gdb_real__get_compiler_info_1\"\n     (\"uplevel\" body line 1)\n     invoked from within\n \"uplevel 2 $real_name\"\n     (procedure \"gdb_do_cache_wrap\" line 3)\n     invoked from within\n \"gdb_do_cache_wrap $real_name {*}$args\"\n     (procedure \"gdb_do_cache\" line 98)\n     invoked from within\n\ngdb.base/attach.exp triggers it too, for example.\n\nThis is actually a latent problem in gdb_do_cache_wrap, introduced in:\n\n commit 71f1ab80f1aabd70bce526635f84c7b849e8a0f4\n CommitDate: Mon Mar 6 16:49:19 2023 +0100\n\n    [gdb/testsuite] Allow args in gdb_caching_proc\n\nThis change:\n\n   # Call proc real_name and return the result, while ignoring calls to pass.\n  -proc gdb_do_cache_wrap {real_name} {\n  +proc gdb_do_cache_wrap {real_name args} {\n       if { [info procs save_pass] !\u003d \"\" } {\n\t  return [uplevel 2 $real_name]   \u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c HERE\n       }\n  @@ -31,7 +31,7 @@ proc gdb_do_cache_wrap {real_name} {\n       rename pass save_pass\n       rename ignore_pass pass\n\n  -    set code [catch {uplevel 2 $real_name} result]\n  +    set code [catch {uplevel 2 [list $real_name {*}$args]} result]\n\nMissed updating the line marked with HERE above, to pass down $args.\nSo the case of a caching proc calling another caching proc with args\nisn\u0027t handled correctly.\n\nWe could fix this by fixing the HERE line like so:\n\n -\t  return [uplevel 2 $real_name]\n +\t  return [uplevel 2 [list $real_name {*}$args]]\n\nHowever, we have with_override nowadays that we can use here which\neliminates the duplicated logic, which was what was missed originally.\n\nA new test that exposes the problem is added to\ngdb.testsuite/gdb-caching-proc.exp.\n\nThis also adds a new test to gdb.testsuite/with-override.exp that I\nthink was missing, making sure that the inner foo override restores\nthe outer foo override.\n\nTested-By: Simon Marchi \u003csimon.marchi@efficios.com\u003e\nChange-Id: I8b2a7366bf910902fe5f547bde58c3b475bf5133\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "f9610afd076340f08b549ccadb698c034f800f1d",
      "old_mode": 33188,
      "old_path": "gdb/testsuite/gdb.testsuite/gdb-caching-proc.exp",
      "new_id": "6b46b1c555af0a5775e0fe46f4d559edf8315c1d",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/gdb.testsuite/gdb-caching-proc.exp"
    },
    {
      "type": "modify",
      "old_id": "1a4ee6adbbb872a2372eb6532273a13cb35d89c1",
      "old_mode": 33188,
      "old_path": "gdb/testsuite/gdb.testsuite/with-override.exp",
      "new_id": "2a316f904e40837470f07d4639e8022697414802",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/gdb.testsuite/with-override.exp"
    },
    {
      "type": "modify",
      "old_id": "6ca3f183f9f59ebf76323240a6c4f9f8c7269f94",
      "old_mode": 33188,
      "old_path": "gdb/testsuite/lib/cache.exp",
      "new_id": "4ebb82599578f906d2237f3eaca5097d6b853ec7",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/lib/cache.exp"
    }
  ]
}
