)]}'
{
  "commit": "31cb4bb676dde0db3f24e03380a02ae92633c98f",
  "tree": "f25d9f48a86bce1f0a70f714363b633d76721b3b",
  "parents": [
    "d20af3a3c253a76400d8d98f1c1dc651f818cda4"
  ],
  "author": {
    "name": "Keith Seitz",
    "email": "keiths@redhat.com",
    "time": "Fri Sep 19 09:50:46 2025 -0700"
  },
  "committer": {
    "name": "Keith Seitz",
    "email": "keiths@redhat.com",
    "time": "Fri Sep 19 09:50:46 2025 -0700"
  },
  "message": "Correct bounds check when working around GAS DWARF 5 directory table bug\n\nRecent Go toolchains are causing GDB to crash on a relatively recent\nworkaround for a GAS bug:\n\ncommit a833790a626d9620319d0ca6aee23daa584d445c\nDate:   Wed Nov 1 00:33:12 2023 +0100\n\n    [gdb/symtab] Work around gas PR28629\n\nIn the original GAS bug, the first directory table entry did not contain\nthe current directory of the compilation. So the above commit added a\nworkaround fix to prepend the second directory table entry.\n\nHowever recent Go toolchain compilations (specifically on aarch64)\nonly output a single directory table entry. Looking at the workaround:\n\n       if (lh-\u003eversion \u003d\u003d 5 \u0026\u0026 lh-\u003eis_valid_file_index (1))\n         {\n           std::string dir \u003d lh-\u003einclude_dir_at (1);\n           fnd.set_comp_dir (std::move (dir));\n         }\n\n`lh-\u003eis_valid_file_index (1)\u0027 is true, but since the directory table only\nhas one entry, `include_dir_at (1)\u0027 returns nullptr. Consequently the\nstd::string ctor will segfault. Since there are no guarantees that the file\nand directory tables are the same size, a better bounds check is to simply\nrely on `include_dir_at\u0027 to ensure a valid directory table entry.\n\nI have updated the workaround commit\u0027s test, gdb.dwarf2/dw2-gas-workaround.exp\nand tested on x86_64 and aarch64 RHEL 9 and Fedora 41.\n\nApproved-By: Andrew Burgess \u003caburgess@redhat.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "7cf89d8f80e4da2c852c18d75613803fa1150d1f",
      "old_mode": 33188,
      "old_path": "gdb/dwarf2/read.c",
      "new_id": "bc8b0883ed2c2e59510efcb487c10d4900468110",
      "new_mode": 33188,
      "new_path": "gdb/dwarf2/read.c"
    },
    {
      "type": "modify",
      "old_id": "2c8213e0ec3ba9905f320cbfc7f3c7b6c72253e2",
      "old_mode": 33188,
      "old_path": "gdb/testsuite/gdb.dwarf2/dw2-gas-workaround.exp",
      "new_id": "6611bf31828df779c85313442d1d078741c29476",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/gdb.dwarf2/dw2-gas-workaround.exp"
    }
  ]
}
