aboutsummaryrefslogtreecommitdiff
path: root/gdb/nat
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2021-11-22 12:21:46 +0100
committerTom de Vries <tdevries@suse.de>2021-11-22 12:21:46 +0100
commita92d031d7ef6e192fb404a86d53fa834e1e3eb8c (patch)
treeec138f68311e43efd9ef3664b42c38dd5445674e /gdb/nat
parent577bf39f10c6d50a52866eb8fc32d6d1e34bb215 (diff)
downloadgdb-a92d031d7ef6e192fb404a86d53fa834e1e3eb8c.zip
gdb-a92d031d7ef6e192fb404a86d53fa834e1e3eb8c.tar.gz
gdb-a92d031d7ef6e192fb404a86d53fa834e1e3eb8c.tar.bz2
[gdb/build] Fix x86_64 x32 build
A build error on x86_64 with x32 abi was reported here ( https://sourceware.org/pipermail/gdb/2021-November/049787.html ): ... gdb/nat/amd64-linux-siginfo.c:280:42: error: \ 'struct compat_x32_siginfo_t::<unnamed union>::<unnamed>' has no member \ named 'si_addr_bnd' 280 | #define cpt_si_lower _sifields._sigfault.si_addr_bnd._lower | ^~~~~~~~~~~ gdb/nat/amd64-linux-siginfo.c:337:38: note: in expansion of macro 'cpt_si_lower' 337 | to->cpt_si_lower = from_ptrace.cpt_si_lower; | ^~~~~~~~~~~~ ... The problem is that code added in commit d3d7d1ba3bb "[gdb/tdep] Handle si_addr_bnd in compat_siginfo_from_siginfo" doesn't compile on an x86_64 x32 setup, because compat_x32_siginfo_t doesn't have the si_addr_bnd fields. Fix this conservatively by disabling the code for x32. Tested on x86_64-linux.
Diffstat (limited to 'gdb/nat')
-rw-r--r--gdb/nat/amd64-linux-siginfo.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/nat/amd64-linux-siginfo.c b/gdb/nat/amd64-linux-siginfo.c
index 342840e..fc52b5b 100644
--- a/gdb/nat/amd64-linux-siginfo.c
+++ b/gdb/nat/amd64-linux-siginfo.c
@@ -330,6 +330,9 @@ compat_siginfo_from_siginfo (compat_siginfo_t *to, const siginfo_t *from)
to->cpt_si_pid = from_ptrace.cpt_si_pid;
to->cpt_si_uid = from_ptrace.cpt_si_uid;
}
+#ifndef __ILP32__
+ /* The struct compat_x32_siginfo_t doesn't contain
+ cpt_si_lower/cpt_si_upper. */
else if (to->si_code == SEGV_BNDERR
&& to->si_signo == SIGSEGV)
{
@@ -337,6 +340,7 @@ compat_siginfo_from_siginfo (compat_siginfo_t *to, const siginfo_t *from)
to->cpt_si_lower = from_ptrace.cpt_si_lower;
to->cpt_si_upper = from_ptrace.cpt_si_upper;
}
+#endif
else if (to->si_code < 0)
{
to->cpt_si_pid = from_ptrace.cpt_si_pid;