<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/56268>56268</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
LLDB seem to deadloop upon hitting AArch64 trap asm (brk #0xf000)
</td>
</tr>
<tr>
<th>Labels</th>
<td>
lldb
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
mgorny
</td>
</tr>
</table>
<pre>
`lldb/test/API/tools/lldb-server/main.cpp` defines the following trap code for aarch64:
```
145 #elif defined(__aarch64__)
-> 146 asm volatile("brk #0xf000");
```
However, this seems to deadloop LLDB. E.g.:
```
./bin/lldb lldb-test-build.noindex/tools/lldb-server/TestGdbRemoteFork.test_c_child_llgs/a.out trap
(lldb) target create "lldb-test-build.noindex/tools/lldb-server/TestGdbRemoteFork.test_c_child_llgs/a.out"
Current executable set to '/home/mgorny/llvm-project/build/lldb-test-build.noindex/tools/lldb-server/TestGdbRemoteFork.test_c_child_llgs/a.out' (aarch64).
(lldb) settings set -- target.run-args "trap"
(lldb) run
Process 2869341 launched: '/home/mgorny/llvm-project/build/lldb-test-build.noindex/tools/lldb-server/TestGdbRemoteFork.test_c_child_llgs/a.out' (aarch64)
Process 2869341 stopped
* thread #1, name = 'a.out', stop reason = signal SIGTRAP
frame #0: 0x0000aaaaaaaa4124 a.out`trap() at main.cpp:146:3
143 #if defined(__x86_64__) || defined(__i386__)
144 asm volatile("int3");
145 #elif defined(__aarch64__)
-> 146 asm volatile("brk #0xf000");
147 #elif defined(__arm__)
148 asm volatile("udf #254");
149 #elif defined(__powerpc__)
(lldb) cont
Process 2869341 resuming
Process 2869341 stopped
* thread #1, name = 'a.out', stop reason = signal SIGTRAP
frame #0: 0x0000aaaaaaaa4124 a.out`trap() at main.cpp:146:3
143 #if defined(__x86_64__) || defined(__i386__)
144 asm volatile("int3");
145 #elif defined(__aarch64__)
-> 146 asm volatile("brk #0xf000");
147 #elif defined(__arm__)
148 asm volatile("udf #254");
149 #elif defined(__powerpc__)
```
and so on.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJztVk2P0zAQ_TXpZdTIdT6aHHLo7rKAxGEF3CsndhqDY0e2s5R_z9hN2WVpuSAQByorqT9m5s3rzHNbw782SUmU4m1C771wHl-7h7dhYoxy-A57ayfso7A4G5nUaTdNaARc9FILB34Q0BulzBepD-Atm6AzPKxZYMx2Q5kn2S4hdwk5P0uyjDgFgE1eQELqhGZCyX5xzRNa7feLi_0-ofXp_DrJXqFFGSwAmBvh0SjmpRJokFDa2s-AnsixJ4TgPBhmNxdDn55vzBcR87vFZKQDJ8SIeRnEwbgyZoJ37-5uUniVHtJfp5IiR63UC28QyQu0rttZKp5qIzUXx6v0fsSjr3n7XozGi3tjP6fBeN_tuwHN90odgg1Lzewj0QsGWp1-wRo8swfhobOCeYEk0D-IIDAb49_O1grtQRxFN3vWKoEM-sBfQrd4ejCjCLVzMFZ_jREfx_VkzSfRhXqLwM5A_hTULWKpztVI6_Qn5hCxx_p1Efp6vTCZ2lmv8ZuDQGak_Jz1M1s8dFp7sKYTzgGtyjrLN6DYrLsBCznb_btcXIbuvJkmRL7kusPOwKLiobE2oVE0G7HAsruQ19lvWA92gCed0XHbyYNmCj68ff3x_e7he8NDb6MDbNNADjliqxK2fPINzeHktCQn0qvAM_PwXYCyHSoAPrNnGpItGvJCQY5VuV8EBJLtLY4ftmWG-0_qEj3l17RFap-9kJS_KV8x1vZqLDu-TKS6FmXmfYhCi_xSiPpaiAml0k7dszDP-qAz2l-uJivcPGJ7_a-1_7X2O7V26fZmmoMzYHS64k3G66xmKy-9Ek24teNl_sNdPk9YLoOMcg-7XaTs9LclIMfIL0ipV7NVzeD95MLlT-9xHKQf5jbtzLho-M9SLp2bRVDdoqRltRqabtNvRc76vKoKTvKiL3LetlmflR1lXZ-vFGuFck1S3CwXd2CruFvJhhJKSUmrTU4oKdKKl5u6Im1b5m2NI8mJwGJVaYCQGntY2SaiaWfU_Zwo6bx72mQuNIoQMRL6Z7MfjG1Od9Iq4m4i6G__ff2x">