]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
[gdb] Rewrite error and warning emojis
authorTom de Vries <tdevries@suse.de>
Wed, 12 Aug 2026 21:18:20 +0000 (23:18 +0200)
committerTom de Vries <tdevries@suse.de>
Wed, 12 Aug 2026 21:18:20 +0000 (23:18 +0200)
commitcf94c9060702ecd052d3972e3b138e11d7b2bc2d
tree14c4a6e607b810c9c2673f9a3a5463ff981e61ff
parentbbe4c6cf3d39c3370f9a1a57fbb862d330241c27
[gdb] Rewrite error and warning emojis

While working on PR34501 I realized that these two strings actually contain
two unicode characters:
...
static std::string warning_prefix = "⚠️ ";
static std::string error_prefix = "❌️ ";
...

Both the Warning Sign [1] and the Cross Mark [2] are followed by Variation
Selector-16 (VS16) [3].

To make this obvious, I decided to rewrite in a style that makes it explicit
both which unicode characters are used, and how they are encoded:
...
static std::string warning_prefix = u8"\u26A0\uFE0F ";
...

In the process I found out that the Cross Mark doesn't need VS16, because its
default presentation is already "Emoji" rather than "Text", so that one simply
becomes:
...
static std::string error_prefix = u8"\u274C ";
...

AFAICT, this property (default presentation == "Emoji") can be verified by
finding Cross Mark here [4] and checking that property Emoji_Presentation
applies.

Tested on x86_64-linux.

Approved-By: Tom Tromey <tom@tromey.com>
[1] https://www.compart.com/en/unicode/U+26A0
[2] https://www.compart.com/en/unicode/U+274C
[3] https://www.compart.com/en/unicode/U+FE0F
[4] https://www.unicode.org/Public/17.0.0/ucd/emoji/emoji-data.txt
gdb/cli/cli-style.c
gdb/testsuite/gdb.base/style.exp