https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118857
Bug ID: 118857
Summary: __builtin_verbose_trap should be added
Product: gcc
Version: 15.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: middle-end
Assignee: unassigned at gcc dot gnu.org
Reporter: pinskia at gcc dot gnu.org
Target Milestone: ---
Clang implements __builtin_verbose_trap via emitting inling markers for the
debug info and then lowers it to __builtin_trap.
__builtin_verbose_trap(const char *category, const char *reason)
See
https://discourse.llvm.org/t/rfc-adding-builtin-verbose-trap-string-literal/75845
and https://github.com/llvm/llvm-project/pull/79230 .
This seems like an useful extension.
The fake function name is __clang_trap_msg$"category"$"reason"
clang does NOT do any extra encoding of the function name (which means if the
category or the reason has a $ in it, LLDB errors out); I think GCC should NOT
be bug compatiable here but rather improve and change $ when emitting the fake
function name.