diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 1798f92705..fc9dcac563 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2020-07-13 Gary Benson + + * gdb.base/bigcore.c (main): Use a volatile pointer when + attempting to trigger a SIGSEGV. + * gdb.base/gcore-relro-pie.c (break_here): Likewise. + * gdb.base/gcore-tls-pie.c (break_here): Likewise. + * gdb.base/savedregs.c (thrower): Likewise. + * gdb.mi/mi-syn-frame.c (bar): Likewise. + 2020-07-13 Gary Benson * gdb.base/vla-datatypes.c (vla_factory): Factor out sections diff --git a/gdb/testsuite/gdb.base/bigcore.c b/gdb/testsuite/gdb.base/bigcore.c index 174e0f67f0..8be1b154b3 100644 --- a/gdb/testsuite/gdb.base/bigcore.c +++ b/gdb/testsuite/gdb.base/bigcore.c @@ -267,5 +267,5 @@ main () /* Push everything out to disk. */ print_string ("Dump core ....\n"); - *(char*)0 = 0; + *(volatile char*)0 = 0; } diff --git a/gdb/testsuite/gdb.base/gcore-relro-pie.c b/gdb/testsuite/gdb.base/gcore-relro-pie.c index 20cf12c563..9ae7cb2cb9 100644 --- a/gdb/testsuite/gdb.base/gcore-relro-pie.c +++ b/gdb/testsuite/gdb.base/gcore-relro-pie.c @@ -18,7 +18,7 @@ void break_here (void) { - *(int *) 0 = 0; + *(volatile int *) 0 = 0; } void diff --git a/gdb/testsuite/gdb.base/gcore-tls-pie.c b/gdb/testsuite/gdb.base/gcore-tls-pie.c index 73aec409f1..18169fcd62 100644 --- a/gdb/testsuite/gdb.base/gcore-tls-pie.c +++ b/gdb/testsuite/gdb.base/gcore-tls-pie.c @@ -25,7 +25,7 @@ __thread char i; void break_here (void) { - *(int *) 0 = 0; + *(volatile int *) 0 = 0; } void diff --git a/gdb/testsuite/gdb.base/savedregs.c b/gdb/testsuite/gdb.base/savedregs.c index d3bcbf7826..05fba50615 100644 --- a/gdb/testsuite/gdb.base/savedregs.c +++ b/gdb/testsuite/gdb.base/savedregs.c @@ -46,7 +46,7 @@ static void thrower (void) { /* Trigger a SIGSEGV. */ - *(char *)0 = 0; + *(volatile char *)0 = 0; /* On MMU-less system, previous memory access to address zero doesn't trigger a SIGSEGV. Trigger a SIGILL. Each arch should define its diff --git a/gdb/testsuite/gdb.mi/mi-syn-frame.c b/gdb/testsuite/gdb.mi/mi-syn-frame.c index c260112b3f..b6ab6e8d88 100644 --- a/gdb/testsuite/gdb.mi/mi-syn-frame.c +++ b/gdb/testsuite/gdb.mi/mi-syn-frame.c @@ -27,7 +27,7 @@ foo (void) void bar (void) { - *(char *)0 = 0; /* try to cause a segfault */ + *(volatile char *)0 = 0; /* try to cause a segfault */ /* On MMU-less system, previous memory access to address zero doesn't trigger a SIGSEGV. Trigger a SIGILL. Each arch should define its