)]}'
{
  "commit": "aef36dee93bf194cb0b976a4ae49a79a736a188d",
  "tree": "8dc6c608f91aa689b068b1bd9496a0f5007a2e16",
  "parents": [
    "84004b2a709e4773b0fb1b01d629b0eb2fe81bbc"
  ],
  "author": {
    "name": "Tom de Vries",
    "email": "tdevries@suse.de",
    "time": "Sun Aug 13 14:08:06 2023 +0200"
  },
  "committer": {
    "name": "Tom de Vries",
    "email": "tdevries@suse.de",
    "time": "Sun Aug 13 14:08:06 2023 +0200"
  },
  "message": "[gdb/symtab] Don\u0027t deduplicate variables in gdb-index\n\nWhen running test-case gdb.python/py-symbol.exp with target board\ncc-with-gdb-index, we run into:\n...\n(gdb) python print (len (gdb.lookup_static_symbols (\u0027rr\u0027)))^M\n1^M\n(gdb) FAIL: gdb.python/py-symbol.exp: print (len (gdb.lookup_static_symbols (\u0027rr\u0027)))\n...\n\n[ Note that the test-case contains rr in both py-symtab.c:\n...\nstatic int __attribute__ ((used)) rr \u003d 42;\t/* line of rr */\n...\nand py-symtab-2.c:\n...\nstatic int __attribute__ ((used)) rr \u003d 99;\t/* line of other rr */\n... ]\n\nThis passes with gdb-12-branch, and fails with gdb-13-branch.\n\nAFAIU the current code in symtab_index_entry::minimize makes the assumption\nthat it\u0027s fine to store only one copy of rr in the gdb-index, because\n\"print rr\" will only ever print one, and always the same.\n\nBut that fails to recognize that gdb supports gdb.lookup_static_symbols, which\nreturns a list of variables rather than the first one.\n\nIn other words, the current approach breaks feature parity between cooked\nindex and gdb-index.\n\nNote btw that also debug-names has both instances:\n...\n[  5] #00597969 rr:\n        \u003c4\u003e DW_TAG_variable DW_IDX_compile_unit\u003d3 DW_IDX_GNU_internal\u003d1\n        \u003c4\u003e DW_TAG_variable DW_IDX_compile_unit\u003d4 DW_IDX_GNU_internal\u003d1\n...\n\nFix this in symtab_index_entry::minimize, by not deduplicating variables.\n\nTested on x86_64-linux, with target boards unix and cc-with-gdb-index.\n\nReviewed-by: Kevin Buettner \u003ckevinb@redhat.com\u003e\n\nPR symtab/30720\nBug: https://sourceware.org/bugzilla/show_bug.cgi?id\u003d30720\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "fdc3b97968aa34b1391fdc2830394e5c8e4e466b",
      "old_mode": 33188,
      "old_path": "gdb/dwarf2/index-write.c",
      "new_id": "e178bb067a989c04ba390fe30d33830ef84b4a3f",
      "new_mode": 33188,
      "new_path": "gdb/dwarf2/index-write.c"
    }
  ]
}
