1#include <signal.h>
2#include <unistd.h>
3
4int __attribute__((naked)) signal_generating_add(int a, int b) {
5 asm("add w0, w1, w0\n\t"
6 "udf #0xdead\n\t"
7 "ret");
8}
9
10void sigill_handler(int signo) { _exit(status: 0); }
11
12int main() {
13 signal(SIGILL, handler: sigill_handler);
14 return signal_generating_add(a: 42, b: 47);
15}
16

Provided by KDAB

Privacy Policy
Update your C++ knowledge – Modern C++11/14/17 Training
Find out more

source code of lldb/test/Shell/Unwind/Inputs/signal-in-leaf-function-aarch64.c