mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-10-17 21:03:55 +08:00
Use volatile pointers when attempting to trigger SIGSEGVs
Clang fails to compile a number of files with the following warning: indirection of non-volatile null pointer will be deleted, not trap [-Wnull-dereference]. This commit qualifies the relevant pointers with 'volatile'. gdb/testsuite/ChangeLog: * 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.
This commit is contained in:
@ -1,3 +1,12 @@
|
||||
2020-07-13 Gary Benson <gbenson@redhat.com>
|
||||
|
||||
* 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 <gbenson@redhat.com>
|
||||
|
||||
* gdb.base/vla-datatypes.c (vla_factory): Factor out sections
|
||||
|
@ -267,5 +267,5 @@ main ()
|
||||
/* Push everything out to disk. */
|
||||
|
||||
print_string ("Dump core ....\n");
|
||||
*(char*)0 = 0;
|
||||
*(volatile char*)0 = 0;
|
||||
}
|
||||
|
@ -18,7 +18,7 @@
|
||||
void
|
||||
break_here (void)
|
||||
{
|
||||
*(int *) 0 = 0;
|
||||
*(volatile int *) 0 = 0;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -25,7 +25,7 @@ __thread char i;
|
||||
void
|
||||
break_here (void)
|
||||
{
|
||||
*(int *) 0 = 0;
|
||||
*(volatile int *) 0 = 0;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user