diff options
| author | Gustavo Romero <gustavo.romero@linaro.org> | 2024-03-09 03:09:01 +0000 |
|---|---|---|
| committer | Alex Bennée <alex.bennee@linaro.org> | 2024-03-13 11:43:52 +0000 |
| commit | bbc0543b1b8231eb9712aa9b93091a1ccb2a08cd (patch) | |
| tree | 921fd61cc9490744fa0290024ad72c465b82f3a2 /tests/tcg/multiarch/segfault.c | |
| parent | 9ae5801d35b5228583dfcdb9c76cf2c6f4566215 (diff) | |
| download | focaccia-qemu-bbc0543b1b8231eb9712aa9b93091a1ccb2a08cd.tar.gz focaccia-qemu-bbc0543b1b8231eb9712aa9b93091a1ccb2a08cd.zip | |
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>
Diffstat (limited to 'tests/tcg/multiarch/segfault.c')
| -rw-r--r-- | tests/tcg/multiarch/segfault.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/tcg/multiarch/segfault.c b/tests/tcg/multiarch/segfault.c new file mode 100644 index 0000000000..e6c8ff31ca --- /dev/null +++ b/tests/tcg/multiarch/segfault.c @@ -0,0 +1,14 @@ +#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); + } +} |