qemu-e2k/tests/tcg/multiarch/segfault.c
Gustavo Romero bbc0543b1b tests/tcg: Add multiarch test for Xfer:siginfo:read stub
Add multiarch test for testing if Xfer:siginfo:read query is properly
handled by gdbstub.

Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20240309030901.1726211-6-gustavo.romero@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2024-03-13 11:43:52 +00:00

15 lines
276 B
C

#include <stdio.h>
#include <string.h>
/* Cause a segfault for testing purposes. */
int main(int argc, char *argv[])
{
int *ptr = (void *)0xdeadbeef;
if (argc == 2 && strcmp(argv[1], "-s") == 0) {
/* Cause segfault. */
printf("%d\n", *ptr);
}
}