binutils-gdb/gdb/nat
Tom de Vries d3d7d1ba3b [gdb/tdep] Handle si_addr_bnd in compat_siginfo_from_siginfo
When running test-case gdb.arch/i386-mpx-sigsegv.exp with target board
unix/-m32, we run into:
...
(gdb) continue^M
Continuing.^M
Saw a #BR! status 1 at 0x8048c2d^M
^M
Program received signal SIGSEGV, Segmentation fault^M
Upper bound violation while accessing address 0x0804c15c^M
Bounds: [lower = 0x00000000, upper = 0x00000000].^M
0x08048a4f in lower (p=0x804c160, a=0x804c180, b=0x804c1a0, c=0x804c1c0, \
  d=0x804c1e0, len=1) at i386-mpx-sigsegv.c:79^M
79        value = *(p - len);^M
(gdb) FAIL: gdb.arch/i386-mpx-sigsegv.exp: MPX signal segv Lower: 0
...

The problem is that lower and upper in the Bounds message are 0x0, which is
caused by $_siginfo._sifields._sigfault._addr_bnd.{_lower,_upper} evaluating
to 0x0.

Fix this by copying the si_lower/si_upper fields in
compat_siginfo_from_siginfo.

Tested on x86_64-linux, with target board unix/-m32.

gdb/ChangeLog:

2021-01-18  Tom de Vries  <tdevries@suse.de>

	PR tdep/27172
	* nat/amd64-linux-siginfo.c (cpt_si_lower, cpt_si_upper, SEGV_BNDERR):
	New macro.
	(compat_siginfo_from_siginfo): Copy cpt_si_lower and cpt_si_upper
	for SEGV_BNDERR.
2021-01-18 09:32:38 +01:00
..
aarch64-linux-hw-point.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
aarch64-linux-hw-point.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
aarch64-linux.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
aarch64-linux.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
aarch64-sve-linux-ptrace.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
aarch64-sve-linux-ptrace.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
aarch64-sve-linux-sigcontext.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
amd64-linux-siginfo.c [gdb/tdep] Handle si_addr_bnd in compat_siginfo_from_siginfo 2021-01-18 09:32:38 +01:00
amd64-linux-siginfo.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
fork-inferior.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
fork-inferior.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
gdb_ptrace.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
gdb_thread_db.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
glibc_thread_db.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
linux-btrace.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
linux-btrace.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
linux-namespaces.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
linux-namespaces.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
linux-nat.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
linux-osdata.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
linux-osdata.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
linux-personality.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
linux-personality.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
linux-procfs.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
linux-procfs.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
linux-ptrace.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
linux-ptrace.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
linux-waitpid.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
linux-waitpid.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
mips-linux-watch.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
mips-linux-watch.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
netbsd-nat.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
netbsd-nat.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
ppc-linux.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
ppc-linux.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
riscv-linux-tdesc.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
riscv-linux-tdesc.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
windows-nat.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
windows-nat.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
x86-cpuid.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
x86-dregs.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
x86-dregs.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
x86-gcc-cpuid.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
x86-linux-dregs.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
x86-linux-dregs.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
x86-linux.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
x86-linux.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00