)]}'
{
  "commit": "c0a07e7d48801c7cffaf825545fc05024a7c686e",
  "tree": "c912ca428bf6102208da5058fdbff01687995729",
  "parents": [
    "599df6e2db17d1c4be94522fbd4da3d56d5c5515"
  ],
  "author": {
    "name": "Lancelot SIX",
    "email": "lancelot.six@amd.com",
    "time": "Tue Nov 05 11:07:00 2024 +0000"
  },
  "committer": {
    "name": "Lancelot SIX",
    "email": "lancelot.six@amd.com",
    "time": "Mon Nov 11 09:26:15 2024 +0000"
  },
  "message": "gdb/dwarf2/read.c: Handle empty CU name\n\nI recently came across a case where a compiler would emit a CU with an\nempty name.  In such case, the attribute object constructed by GDB will\nreturn nullptr when as_string is called.  One place is not checking for\nthis possibility.  As a result, loading such binary results in a GDB\ncrash:\n\n    $ gdb -q a.out\n    Reading symbols from a.out...\n\n    Fatal signal: Segmentation fault\n    ----- Backtrace -----\n    [...]\n    0x742f4dd8afab __strcmp_avx2\n            ../sysdeps/x86_64/multiarch/strcmp-avx2.S:283\n    0x58593704a0bc prepare_one_comp_unit\n            ../../gdb/dwarf2/read.c:21842\n    0x585937053fd9 process_psymtab_comp_unit\n            ../../gdb/dwarf2/read.c:4633\n    0x585937053fd9 _ZN23cooked_index_debug_info11process_cusEmN9__gnu_cxx17__normal_iteratorIPSt10unique_ptrI18dwarf2_per_cu_data26dwarf2_per_cu_data_deleterESt6vectorIS5_SaIS5_EEEESA_\n            ../../gdb/dwarf2/read.c:4943\n    [...]\n    ---------------------\n    A fatal error internal to GDB has been detected, further\n    debugging is not possible.  GDB will now terminate.\n\n    This is a bug, please report it.  For instructions, see:\n    \u003chttps://www.gnu.org/software/gdb/bugs/\u003e.\n\n    Segmentation fault (core dumped)\n\nThis seems to be a regression introduced by the following commit:\n\n    commit 00105aa1c4d9933fe3cfe9bc1be0daefe9f8ca36\n    Date:   Tue Sep 24 10:24:22 2024 +0200\n\n        [gdb/symtab] Don\u0027t expand non-Ada CUs for info exceptions\n\nThis patch fixes this issue by checking if attr-\u003eas_string returns\nnullptr.\n\nChange-Id: I78fe7a090f0bd1045b8cb2f8d088a8d6cf57fe1c\nApproved-By: Andrew Burgess \u003caburgess@redhat.com\u003e\nApproved-By: Tom Tromey \u003ctom@tromey.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "30ef69aea3031afb9321a0ffb9f65d7aa33ad1d4",
      "old_mode": 33188,
      "old_path": "gdb/dwarf2/read.c",
      "new_id": "665e00bb8e7642a5bef2db39e0fd8f3664e79780",
      "new_mode": 33188,
      "new_path": "gdb/dwarf2/read.c"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "2b72fe16c1e8678d3c0aad147baf29a2d1512a40",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/gdb.dwarf2/cu-empty-name.c"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "a8909621183c46b80aae1c1b80b190fec7fb34ab",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/gdb.dwarf2/cu-empty-name.exp"
    }
  ]
}
