This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[patch 1/4]#3 Pedro's fix: compat_siginfo_from_siginfo (PR 11842)
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Wed, 22 Sep 2010 00:49:10 +0200
- Subject: [patch 1/4]#3 Pedro's fix: compat_siginfo_from_siginfo (PR 11842)
series #3 of: http://sourceware.org/ml/gdb-patches/2010-08/msg00484.html
[ no change here ]
Hi,
compat_siginfo_from_siginfo and siginfo_from_compat_siginfo are wrong
http://sourceware.org/bugzilla/show_bug.cgi?id=11842
This fix is no longer critical as in the series #2 and it now affects only the
real biarch execution (x86_64 gdb with i386 inferior). Without this fix in
biarch mode these new testcases of this patchset FAIL:
gdb.base/siginfo-infcall.exp
gdb.threads/siginfo-threads.exp
I guess the fix is not complete and that (at least; but maybe only) si_utime
and si_stime may be lost during the conversion already in Linux kernel.
Just I failed to get any meaningful value for non-converting x86_64-x86_64
testcase. I also could not google out any code using si_utime / si_stime.
This patch is at least an incremental non-regressing fix.
Thanks,
Jan
gdb/
2010-08-06 Pedro Alves <pedro@codesourcery.com>
* amd64-linux-nat.c (compat_siginfo_from_siginfo)
(siginfo_from_compat_siginfo): Also copy si_pid and si_uid when
si_code is < 0.
gdb/gdbserver/
2010-08-06 Pedro Alves <pedro@codesourcery.com>
* linux-x86-low.c (compat_siginfo_from_siginfo)
(siginfo_from_compat_siginfo): Also copy si_pid and si_uid when
si_code is < 0.
--- a/gdb/amd64-linux-nat.c
+++ b/gdb/amd64-linux-nat.c
@@ -576,6 +576,8 @@ compat_siginfo_from_siginfo (compat_siginfo_t *to, siginfo_t *from)
if (to->si_code < 0)
{
+ to->cpt_si_pid = from->si_pid;
+ to->cpt_si_uid = from->si_uid;
to->cpt_si_ptr = (intptr_t) from->si_ptr;
}
else if (to->si_code == SI_USER)
@@ -630,6 +632,8 @@ siginfo_from_compat_siginfo (siginfo_t *to, compat_siginfo_t *from)
if (to->si_code < 0)
{
+ to->si_pid = from->cpt_si_pid;
+ to->si_uid = from->cpt_si_uid;
to->si_ptr = (void *) (intptr_t) from->cpt_si_ptr;
}
else if (to->si_code == SI_USER)
--- a/gdb/gdbserver/linux-x86-low.c
+++ b/gdb/gdbserver/linux-x86-low.c
@@ -794,6 +794,8 @@ compat_siginfo_from_siginfo (compat_siginfo_t *to, siginfo_t *from)
if (to->si_code < 0)
{
+ to->cpt_si_pid = from->si_pid;
+ to->cpt_si_uid = from->si_uid;
to->cpt_si_ptr = (intptr_t) from->si_ptr;
}
else if (to->si_code == SI_USER)
@@ -848,6 +850,8 @@ siginfo_from_compat_siginfo (siginfo_t *to, compat_siginfo_t *from)
if (to->si_code < 0)
{
+ to->si_pid = from->cpt_si_pid;
+ to->si_uid = from->cpt_si_uid;
to->si_ptr = (void *) (intptr_t) from->cpt_si_ptr;
}
else if (to->si_code == SI_USER)