<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/127014>127014</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
__builtin_verbose_trap with `$` and other characters in either category or reason will break LLDB
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
pinskia
</td>
</tr>
</table>
<pre>
While reading the commits for __builtin_verbose_trap support in both clang (https://github.com/llvm/llvm-project/pull/79230) and LLDB (https://github.com/llvm/llvm-project/pull/80368), I noticed that if someone uses `$` in the category or reason, the regex `^{0}\\$(.*)\\$(.*)$` that is inside LLDB can match a few different ways (I am not sure if `.*` here is gready or will it stop at the first `$` but it will definitely be incorrect in a few different cases). This is because `CreateTrapFailureMessageFor` does not (re)encodes `$` in the strings.
Also I wonder if someone puts \n or escape characters ASCII coloring in the category/reason. It seems like that can mess up things too.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJykU8GOrDYQ_BpzaQUZw8Bw4DA7G6SRXk55Uo4rYxpw1tjI3exk_z4yk6dMXpJDFAkJqW1Xd1V1aSI7e8ROnF7E6TXTOy8hdpv19G51NoTxs_tlsQ4hoh6tn4EXBBPW1TLBFCK8vQ27dWz92wfGIRC-cdQb0L5tITJYD0PgBYzTfgahzgvzRqK8CNUL1c-Wl33ITViF6p37-Pb7YYvhVzQsVL_tzgnVN60qpVAtaD_Cly-vL_8H7CzL-ixUK9QVbuADW4Mj8KIZ7AQUVgweYSckELUUqhK1TFQO8ppxDvETQkyiUPAJJZ1EnPG348HpR9G8SNG8itM1faoS6pwLdUk9_6H0aPDoT2A92REfJI32sGo2C2iY8A6jnSaM6Bnu-pOSBjfQa6IAtEdM44taHri1hAVTiWBO7h0T361zYBmIwwaaj7knG4mfiA47pyvH1REn6y2j-4QBwXoTYkRz-Pr9QEYTklBtDl-XxIJgQKN3wgR9jagZv0a99dq6PeJPSKRn7ENMLceAdJAQ6hxRqBa9CeNf5P-mP3G0fqZcyIuQl4ujADe4Bz9ifDZv25lAnK4-sUYyekMwi47aMEaCy8_X2w1McCGhfe-tUP3D2hxuDIS4Ejj7jg-LDk-QCPYNeEnDAIeQZ2NXjm3Z6gy7oinbStVtUWdLp4u6qMtKKlO1Z9XICeUgsSqmcmh1W58y2ympTlIVpazluazzqTgrbE5To4uhkfUkKomrti5P65yHOGeWaMeuUI0sqszpAR0dGVbK4x2OU6FUinTsjgwM-0yiks4S058wbNlh9y8ZvltengxIwQu8YHzW0XpA-yj-LRePDRoi6vdjmbM9uu4_R_bgQkL1f5D96NTvAQAA__8PIoiE">