)]}'
{
  "commit": "f62cf22157cf527f1cc5c91854b1be3373024d4a",
  "tree": "2664725b75c2981c6793652294aa9b6a207ff3b0",
  "parents": [
    "c05c9914b1875d9edca946532d02daafc82c8615"
  ],
  "author": {
    "name": "Simon Marchi",
    "email": "simon.marchi@efficios.com",
    "time": "Mon Mar 03 16:18:55 2025 -0500"
  },
  "committer": {
    "name": "Simon Marchi",
    "email": "simon.marchi@efficios.com",
    "time": "Mon Mar 10 16:09:01 2025 -0400"
  },
  "message": "gdb/dwarf: save DWARF version in dwarf2_loclist_baton, remove it from dwarf2_per_cu\n\nWhen running:\n\n    $ make check TESTS\u003d\"gdb.cp/cpexprs-debug-types.exp\" RUNTESTFLAGS\u003d\"--target_board\u003dfission\"\n\nI get:\n\n    (gdb) break -qualified main\n    /home/smarchi/src/binutils-gdb/gdb/dwarf2/read.h:295: internal-error: version: Assertion `m_dwarf_version !\u003d 0\u0027 failed.\n\nThe problem is that dwarf2_per_cu objects created in the\nread_cutu_die_from_dwo code path never have their DWARF version set.  A\nseemingly obvious solution would be to add a call to\ndwarf2_per_cu::set_version in there (there\u0027s a patch in the referenced\nPR that does that).  However, this comment in\nread_comp_units_from_section is a bit scary:\n\n      /* Init this asap, to avoid a data race in the set_version in\n\t cutu_reader::cutu_reader (which may be run in parallel for the cooked\n\t index case).  */\n      this_cu-\u003eset_version (cu_header.version);\n\nI don\u0027t know if a DWO file can be read while the cooked indexer runs, so\nif it would be a problem here, but I prefer to be safe than sorry.  This\npatch side-steps the problem by deleting the DWARF version from\ndwarf2_per_cu.\n\nThe only users of dwarf2_per_cu::version are the loclists callbacks in\n`loc.c`.  Add the DWARF version to dwarf2_loclist_baton and modify those\ncallbacks to get the version from there instead.  Initialize that new\nfield in fill_in_loclist_baton.\n\nI like this approach because there is no version field that is possibly\nunset now.\n\nI wasn\u0027t keen on doing this at first because I thought it would waste\nspace, but the dwarf2_loclist_baton has 7 bytes of padding at the end\nanyway, so we might as well use that.\n\nCc: Ricky Zhou \u003cricky@rzhou.org\u003e\nCc: Tom de Vries \u003ctdevries@suse.de\u003e\nCc: Tom Tromey \u003ctom@tromey.com\u003e\nBug: https://sourceware.org/bugzilla/show_bug.cgi?id\u003d32309\nChange-Id: I30d4ede7d67da5d80ff65c6122f5868e1098ec52\nApproved-By: Tom Tromey \u003ctom@tromey.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "398c2b1b35223181b6c477b37eda5da1ed50a88f",
      "old_mode": 33188,
      "old_path": "gdb/dwarf2/loc.c",
      "new_id": "7c12c0d4d4ddc1520c3fa1716de39470ece31406",
      "new_mode": 33188,
      "new_path": "gdb/dwarf2/loc.c"
    },
    {
      "type": "modify",
      "old_id": "5c7330e43a09cfd6a798d26f733fdffb2d7de36d",
      "old_mode": 33188,
      "old_path": "gdb/dwarf2/loc.h",
      "new_id": "de9e14479eae28d6a074896173ef72030e74db1b",
      "new_mode": 33188,
      "new_path": "gdb/dwarf2/loc.h"
    },
    {
      "type": "modify",
      "old_id": "a58c83257c3750c4cc3f6ab63937e5695c8b7bd0",
      "old_mode": 33188,
      "old_path": "gdb/dwarf2/read.c",
      "new_id": "a25daa36d38caca8f5651ea7bc0a1b4d94b492a7",
      "new_mode": 33188,
      "new_path": "gdb/dwarf2/read.c"
    },
    {
      "type": "modify",
      "old_id": "4376ee9fbe9509896cc0939349c2f514945b031d",
      "old_mode": 33188,
      "old_path": "gdb/dwarf2/read.h",
      "new_id": "e178c60509eaa1ce58bd1da4d6b6845d9d840786",
      "new_mode": 33188,
      "new_path": "gdb/dwarf2/read.h"
    }
  ]
}
