)]}'
{
  "commit": "fb12bc1e8e7c5246e4eabcebdb4644c43bc7e6b9",
  "tree": "03eec95cd3d3f2ec47719832116c9932a48bf613",
  "parents": [
    "b29f2fda4f189a008f5f2017d403976c988ad63e"
  ],
  "author": {
    "name": "Tom de Vries",
    "email": "tdevries@suse.de",
    "time": "Mon Apr 17 18:09:32 2023 +0200"
  },
  "committer": {
    "name": "Tom de Vries",
    "email": "tdevries@suse.de",
    "time": "Mon Apr 17 18:09:32 2023 +0200"
  },
  "message": "[gdb/symtab] Handle empty file name in .debug_line section\n\nWith DWARF 5, it\u0027s possible to produce an empty file name in the File Name\nTable of the .debug_line section:\n...\n The File Name Table (offset 0x112, lines 1, columns 2):\n  Entry Dir     Name\n  0     1       (indirect line string, offset: 0x2d):\n...\n\nCurrently, when gdb reads an exec containing such debug info, it segfaults:\n...\nThread 1 \"gdb\" received signal SIGSEGV, Segmentation fault.\n0x000000000072cd38 in dwarf2_start_subfile (cu\u003d0x2badc50, fe\u003d..., lh\u003d...) at \\\n  gdb/dwarf2/read.c:18716\n18716     if (!IS_ABSOLUTE_PATH (filename) \u0026\u0026 dirname !\u003d NULL)\n...\nbecause read_direct_string transforms \"\" into a nullptr, and we end up\ndereferencing the nullptr.\n\nNote that the behaviour of read_direct_string has been present since repo\ncreation.\n\nFix this in read_formatted_entries, by transforming nullptr filenames in to \"\"\nfilenames.\n\nTested on x86_64-linux.\n\nReviewed-By: Tom Tromey \u003ctom@tromey.com\u003e\n\nPR symtab/30357\nBug: https://sourceware.org/bugzilla/show_bug.cgi?id\u003d30357\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "9d74c8fe75b6ed0a51efb656a04f3416af60d77b",
      "old_mode": 33188,
      "old_path": "gdb/dwarf2/line-header.c",
      "new_id": "d072a91bac93eee90c3a1a7ad1f7bb0b7decc00a",
      "new_mode": 33188,
      "new_path": "gdb/dwarf2/line-header.c"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "6030e4a0579340cc681e2b35e641e9dd3922fc17",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/gdb.dwarf2/dw2-empty-file-name.exp"
    }
  ]
}
