)]}'
{
  "commit": "263ad5cc818ef8f7700c82f2aecd2a929dbd3be5",
  "tree": "6334604f9cada900b5945c91d6d60dd24ebed15f",
  "parents": [
    "5ae3df226b1b1e45b9326a5eee81b92489ae52f2"
  ],
  "author": {
    "name": "Tom de Vries",
    "email": "tdevries@suse.de",
    "time": "Fri Jul 22 23:50:48 2022 +0200"
  },
  "committer": {
    "name": "Tom de Vries",
    "email": "tdevries@suse.de",
    "time": "Fri Jul 22 23:50:48 2022 +0200"
  },
  "message": "[gdb/symtab] Fix duplicate CUs in all_comp_units\n\nWhen running test-case gdb.cp/cpexprs-debug-types.exp with target board\ncc-with-debug-names on a system with gcc 12.1.1 (defaulting to dwarf 5), I\nrun into:\n...\n(gdb) file cpexprs-debug-types^M\nReading symbols from cpexprs-debug-types...^M\nwarning: Section .debug_aranges in cpexprs-debug-types has duplicate \\\n  debug_info_offset 0x0, ignoring .debug_aranges.^M\ngdb/dwarf2/read.h:309: internal-error: set_length: \\\n  Assertion `m_length \u003d\u003d length\u0027 failed.^M\n...\n\nThe exec contains a .debug_names section, which gdb rejects due to\n.debug_names containing a list of TUs, while the exec doesn\u0027t contain a\n.debug_types section (which is what you\u0027d expect for dwarf 4).\n\nGdb then falls back onto the cooked index, which calls create_all_comp_units\nto create all_comp_units.  However, the failed index reading left some\nelements in all_comp_units, so we end up with duplicates in all_comp_units,\nwhich causes the misleading complaint and the assert.\n\nFix this by:\n- asserting at the start of create_all_comp_units that all_comp_units is empty,\n  as we do in create_cus_from_index and create_cus_from_debug_names, and\n- cleaning up all_comp_units when failing in dwarf2_read_debug_names.\n\nAdd a similar cleanup in dwarf2_read_gdb_index.\n\nTested on x86_64-linux.\n\nBug: https://sourceware.org/bugzilla/show_bug.cgi?id\u003d29381\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "42230607fe0a2d577d7f1c2cb2258efec0fa9eec",
      "old_mode": 33188,
      "old_path": "gdb/dwarf2/read.c",
      "new_id": "f7e55af3e86b41b2dc36a13c84d83b34bede27d9",
      "new_mode": 33188,
      "new_path": "gdb/dwarf2/read.c"
    }
  ]
}
