)]}'
{
  "commit": "cb25fdbb76e41d9c02fe86009fc8a3ecf8737c9a",
  "tree": "b28d904b155e5336b729dd400b2d2d26fea896f4",
  "parents": [
    "7b01c1cc1d111ba0afa51e60fa9842d3b971e2d1"
  ],
  "author": {
    "name": "Simon Marchi",
    "email": "simon.marchi@polymtl.ca",
    "time": "Thu Mar 31 16:38:33 2022 -0400"
  },
  "committer": {
    "name": "Simon Marchi",
    "email": "simon.marchi@polymtl.ca",
    "time": "Mon Apr 04 17:48:54 2022 -0400"
  },
  "message": "gdb: remove assertion in psymbol_functions::expand_symtabs_matching\n\npsymtab_to_symtab is documented as possibly returning nullptr, if the\nprimary symtab of the partial symtab has no symbols.  However,\npsymbol_functions::expand_symtabs_matching asserts that the result of\npsymtab_to_symtab as non-nullptr.\n\nI caught this assert by trying the CTF symbol reader on a library I\nbuilt with -gctf:\n\n    $ ./gdb --data-directory\u003ddata-directory /tmp/babeltrace-ctf/src/lib/.libs/libbabeltrace2.so.0.0.0\n    ...\n    Reading symbols from /tmp/babeltrace-ctf/src/lib/.libs/libbabeltrace2.so.0.0.0...\n    (gdb) maintenance expand-symtabs\n    /home/simark/src/binutils-gdb/gdb/psymtab.c:1142: internal-error: expand_symtabs_matching: Assertion `symtab !\u003d nullptr\u0027 failed.\n\nThe \"symtab\" in question is:\n\n    $  readelf --ctf\u003d.ctf /tmp/babeltrace-ctf/src/lib/.libs/libbabeltrace2.so.0.0.0\n    ...\n    CTF archive member: /home/simark/src/babeltrace/src/lib/graph/component-descriptor-set.c:\n\n      Header:\n        Magic number: 0xdff2\n        Version: 4 (CTF_VERSION_3)\n        Flags: 0xe (CTF_F_NEWFUNCINFO, CTF_F_IDXSORTED, CTF_F_DYNSTR)\n        Parent name: .ctf\n        Compilation unit name: /home/simark/src/babeltrace/src/lib/graph/component-descriptor-set.c\n        Type section:       0x0 -- 0x13 (0x14 bytes)\n        String section:     0x14 -- 0x5f (0x4c bytes)\n\n      Labels:\n\n      Data objects:\n\n      Function objects:\n\n      Variables:\n\n      Types:\n        0x80000001: (kind 5) bt_bool (*) (const bt_value *) (aligned at 0x8)\n\n      Strings:\n        0x0:\n        0x1: .ctf\n        0x6: /home/simark/src/babeltrace/src/lib/graph/component-descriptor-set.c\n\nIt contains a single type, and it is skipped by ctf_add_type_cb, because\nan identical type was already seen earlier in this objfile.  As a\nresult, no compunit_symtab is created.\n\nChange psymbol_functions::expand_symtabs_matching to expect that\npsymtab_to_symtab can return nullptr.\n\nAnother possibility would be to make the CTF symbol reader always create\na compunit_symtab, even if there are no symbols in it (like the DWARF\nparser does), but so far I don\u0027t see any advantage in doing so.\n\nChange-Id: Ic43c38202c838a5eb87630ed1fd61d33528164f4\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "b31ce877b62d7c6b5950a8406748e477f9bed3e9",
      "old_mode": 33188,
      "old_path": "gdb/psymtab.c",
      "new_id": "a26ecd0b4e5edd1bed61eab30b457455d1b3134c",
      "new_mode": 33188,
      "new_path": "gdb/psymtab.c"
    }
  ]
}
