)]}'
{
  "commit": "04e04460078274b4011b5cb892e162ff61083fcb",
  "tree": "cd3bae86f8e61f77bac1ccdfda2cdecc00983885",
  "parents": [
    "500390720267e2f009f0354e5051fa2e176b143d"
  ],
  "author": {
    "name": "Tom de Vries",
    "email": "tdevries@suse.de",
    "time": "Wed Jun 10 09:54:22 2026 +0200"
  },
  "committer": {
    "name": "Tom de Vries",
    "email": "tdevries@suse.de",
    "time": "Wed Jun 10 09:54:22 2026 +0200"
  },
  "message": "[gdb/contrib] Fix KeyError in dwarf-to-dwarf-assembler.py\n\nExecutable outputs/gdb.threads/stepi-over-clone/stepi-over-clone contains the\nfollowing DWARF (using readelf -w):\n...\n    \u003c31c5\u003e   DW_AT_const_value : 8 byte block: ff ff ff ff ff ff ff ff\n...\nor more explicit using llvm-dwarfdump -v:\n...\n                DW_AT_const_value [DW_FORM_block1] \\\n\t\t  (\u003c0x08\u003e ff ff ff ff ff ff ff ff )\n...\n\nBefore commit 18ad8c1a54d (\"Emit DWARF expressions from\ndwarf-to-dwarf-assembler.py\"), the dwarf-to-dwarf-assembler.py script\ngenerated:\n...\nDW_AT_const_value { MANUAL: Fill expr list } SPECIAL_expr\n...\nfor this.\n\nBut since the commit, we run into a KeyError.\n\nThe problem is that we\u0027re trying to interpret some random data as a DWARF\nexpression.\n\nFix this by special-casing DW_AT_const_value, and generating instead:\n...\nDW_AT_const_value \"\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\" DW_FORM_block1\n...\nwhich mimics the style I found in gdb.dwarf2/info-locals-optimized-out.exp:\n...\n                DW_TAG_variable {\n                    DW_AT_name const_bytes\n                    DW_AT_type :$int_type_label\n                    DW_AT_const_value \"\\x01\\x01\\x01\\x01\" DW_FORM_block1\n\t\t}\n...\n\nLikewise for DW_AT_discr_list.\n\nAnother case for which the KeyError triggers, is DWARF from\noutputs/gdb.ada/array_of_variant/p-minimal:\n...\n \u003c2\u003e\u003c14a4\u003e: Abbrev Number: 20 (DW_TAG_structure_type)\n    \u003c14a5\u003e   DW_AT_name        : p__payload_t\n    \u003c14a9\u003e   DW_AT_byte_size   : 18 byte block: \\\n                                 fd 63 14 0 0 97 94 1 99 45 0 0 0 23 7 9 fc 1a \\\n\t\t\t\t (DW_OP_GNU_variable_value: \u003c0x1463\u003e; \\\n\t\t\t\t  DW_OP_push_object_address; \\\n\t\t\t\t  DW_OP_deref_size: 1; \\\n\t\t\t\t  DW_OP_call4: \u003c0x1421\u003e; \\\n\t\t\t\t  DW_OP_plus_uconst: 7; \\\n\t\t\t\t  DW_OP_const1s: -4; DW_OP_and)\n...\nbecause the pyelftools version that I\u0027m using doesn\u0027t support\nDW_OP_GNU_variable_value yet (supported starting v0.33).\n\nFix this by catching the KeyError, and falling back to the string case:\n...\n  DW_AT_byte_size \\\n  \"\\xfd\\x63\\x14\\x00\\x00\\x97\\x94\\x01\\x99\\x45\\x00\\x00\\x00\\x23\\x07\\x09\\xfc\\x1a\" \\\n  DW_FORM_exprloc # Failed to print op as DWARF expression: 0xfd\n...\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "314a9e9587bdc9e26b9d5e6f1f464bcb37b9aba0",
      "old_mode": 33261,
      "old_path": "gdb/contrib/dwarf-to-dwarf-assembler.py",
      "new_id": "fa32bc4bbabe86d09248ba1db609cfd9c45f1617",
      "new_mode": 33261,
      "new_path": "gdb/contrib/dwarf-to-dwarf-assembler.py"
    }
  ]
}
