)]}'
{
  "commit": "a7041de85a0cc43b86989eb697cef7a6cecdbdb7",
  "tree": "0e59babe7b0a46de2d60f82c2dc96d840754de71",
  "parents": [
    "659971cb0f8fd749aa951221d99de2868a860d07"
  ],
  "author": {
    "name": "Tom Tromey",
    "email": "tromey@adacore.com",
    "time": "Tue Jan 25 11:26:15 2022 -0700"
  },
  "committer": {
    "name": "Tom Tromey",
    "email": "tromey@adacore.com",
    "time": "Mon Feb 28 10:49:29 2022 -0700"
  },
  "message": "Handle \u0027QWW\u0027 encoding case in Ada enums\n\nIn Ada, an enum can contain character literals.  GNAT encodes these\nvalues in a special way.  For example, the Unicode character U+0178\nwould be represented as \u0027QW0178\u0027 in the DWARF:\n\n \u003c3\u003e\u003c112f\u003e: Abbrev Number: 2 (DW_TAG_enumerator)\n    \u003c1130\u003e   DW_AT_name        : (indirect string, offset: 0x19ff): QW0178\n    \u003c1134\u003e   DW_AT_const_value : 2\n\ngdb handles this reasonably well, but failed to handle the \u0027QWW\u0027\nencoding, which is used for characters outside the base plane.\n\nAlso, while working on this, I noticed that gdb will print the decimal\nvalue for an enum character constant:\n\n    (gdb) print Char_X\n    $2 \u003d 1 \u0027x\u0027\n\nThis is a nice feature, IMO, because in this situation the \u0027x\u0027 enum\nconstant does not have its usual decimal value -- it has the value\nthat\u0027s assigned based on the enumeration type.\n\nHowever, gdb did not do this when it decided to print the constant\nusing the bracket notation:\n\n    (gdb) print Char_Thorn\n    $3 \u003d [\"de\"]\n\nThis patch changes gdb to print the decimal value here as well, and to\nput the bracket notation in single quotes -- otherwise gdb will be\nprinting something that it can\u0027t then read.  Now it looks like:\n\n    (gdb) print Char_Thorn\n    $3 \u003d 4 \u0027[\"de\"]\u0027\n\nNote that gdb can\u0027t read longer bracket notations, like the other ones\nprinted in this test case:\n\n    (gdb) print Char_King\n    $4 \u003d 3 \u0027[\"01fa00\"]\u0027\n\nWhile I think this is a bug, I plan to fix it separately.\n\nFinally, in the new test case, the copyright dates are chosen this way\nbecause this all started as a copy of an existing test.\n\n\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "d2f620cbb041acd199a919cda41e35079723657f",
      "old_mode": 33188,
      "old_path": "gdb/ada-lang.c",
      "new_id": "f1d59d2aadb6364c364ab5ef1b983e99c69fa19c",
      "new_mode": 33188,
      "new_path": "gdb/ada-lang.c"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "aa8136054e70daf6c2c5691a9ccea09608fe3abc",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/gdb.ada/char_enum_unicode.exp"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "0975687032098d606e8bb436080f1fded0c40d92",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/gdb.ada/char_enum_unicode/foo.adb"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "d9308b6c04d04ebfc347056b5c7571ffeb9ec9ff",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/gdb.ada/char_enum_unicode/pck.adb"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "4e937b8a5a2bf5ac4764b2924c3203d4980678aa",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/gdb.ada/char_enum_unicode/pck.ads"
    }
  ]
}
