test-sigsegv: Add a deeper segfault to test debugging libs

This commit is contained in:
K. Lange 2021-09-24 00:12:29 +09:00
parent 6fd05ef013
commit a697f1abf5
1 changed files with 8 additions and 1 deletions

View File

@ -1,4 +1,11 @@
#include <stdio.h>
#include <string.h>
int main(int argc, char * argv[]) {
*(volatile int*)0x12345 = 42;
if (argc > 1) {
fprintf(stderr, "%s\n", (char*)(uintptr_t)strtoul(argv[1],NULL,0));
} else {
*(volatile int*)0x12345 = 42;
}
return 0;
}