)]}'
{
  "commit": "dbf19e0f878eb592011c25c1dbbfc35eee330ec2",
  "tree": "a0c97e26174219a701b0f2fd7c5adce465680c06",
  "parents": [
    "28fe282aac536b210aa7476c0f07bb073df831f2"
  ],
  "author": {
    "name": "Tom de Vries",
    "email": "tdevries@suse.de",
    "time": "Thu Aug 13 03:59:17 2026 +0200"
  },
  "committer": {
    "name": "Tom de Vries",
    "email": "tdevries@suse.de",
    "time": "Thu Aug 13 03:59:17 2026 +0200"
  },
  "message": "[gdb/cli] Don\u0027t emit emojis in MI\n\nPR mi/34501 reports the following:\n...\n$ gdb -q \\\n    -ex \u0027set charset UTF-8\u0027 \\\n    -ex \u0027interpreter-exec mi2 \"-break-insert -f foo\u0027 \\\n    -ex quit\n\u0026\"�\\235\\214�\\217 No symbol table is loaded.  Use the \\\"file\\\" command.\\n\"\n  ...\n$\n...\n\nThe output is a bit odd, but that gets better if we use\n\u0027set print sevenbit-strings on\u0027:\n...\n\u0026\"\\342\\235\\214\\357\\270\\217 No symbol table is loaded.  Use the \\\"file\\\" command.\\n\"\n...\n\nThe output we see there is the error emoji:\n...\n$ gdb\n(gdb) b foo\n❌️ No symbol table is loaded.  Use the \"file\" command.\n...\n\nMore specifically, two utf-8 encoded unicode characters:\n- Cross Mark [1]: 0xE2 0x9D 0x8C\n- Variation Selector-16 (VS16) [2]: 0xEF 0xB8 0x8F\n\nNow the question: is GDB doing something wrong?\n\nI think we probably should encode unicode characters in MI error strings as\noctal escapes, independent of the sevenbit-strings setting.  This patch does\nnot address this part.\n\nThen there\u0027s the question whether we should emit emojis in MI error strings in\nthe first place [3].  In principle they\u0027re unicode characters encoded in UTF-8,\nand we can expect other such unicode characters in translated error strings.\n\nBut, given that MI has can_emit_style_escape () \u003d\u003d false, and already filters\nout ANSI escape sequences, I think it\u0027s reasonable to also disable emojis.\n\nAs for implementation, I introduced a function emoji_allowed alongside\ncan_emit_style_escape, which defaults to the value of can_emit_style_escape.\n\nTested on x86_64-linux.\n\nApproved-By: Tom Tromey \u003ctom@tromey.com\u003e\n\nBug: https://sourceware.org/bugzilla/show_bug.cgi?id\u003d34501\n\n[1] https://www.compart.com/en/unicode/U+274C\n[2] https://www.compart.com/en/unicode/U+FE0F\n[3] https://sourceware.org/bugzilla/show_bug.cgi?id\u003d33920#c1\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "5c175ee29ea80a6910755a23501f494dc9c251fb",
      "old_mode": 33188,
      "old_path": "gdb/cli/cli-style.c",
      "new_id": "60c00acdf43a47f29c9dbfabdbde0ed4e592e369",
      "new_mode": 33188,
      "new_path": "gdb/cli/cli-style.c"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "c46c35b04a64d3276f065d67620a5272920cf6a7",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/gdb.base/style-mi-no-emoji.exp"
    },
    {
      "type": "modify",
      "old_id": "76185bbedf0921ab91314ff2e1966b63fe8965ad",
      "old_mode": 33188,
      "old_path": "gdb/ui-file.h",
      "new_id": "f5c23b9b6d9dcba6e26b5509e4dd341b5053dcab",
      "new_mode": 33188,
      "new_path": "gdb/ui-file.h"
    }
  ]
}
