This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug gdb/20287] X32 and "gdb_static_assert (sizeof (nat_siginfo_t) == sizeof (siginfo_t))"


https://sourceware.org/bugzilla/show_bug.cgi?id=20287

--- Comment #27 from Pedro Alves <palves at redhat dot com> ---
> and I can't see any custom copy_siginfo_to_user under arch/x86/.  There's a 
> custom copy_siginfo_to_user32 implementation (arch/x86/kernel
> /signal_compat.c), but I think that that's for real 32-bit ptrace, not x32.

OK, I think I see now.

arch/x86/kernel/ptrace.c has an x32_arch_ptrace function, that I assume is what
is called when the _ptracer_ is a x32 process (not the kernel!).

That defers to compat_ptrace_request, which then ends up in
copy_siginfo_to_user32, which _does_ handle x32:

int copy_siginfo_to_user32(compat_siginfo_t __user *to, const siginfo_t *from)
{
        bool ia32 = test_thread_flag(TIF_IA32);
...
                                        put_user_ex(from->si_utime,
&to->si_utime);
                                        put_user_ex(from->si_stime,
&to->si_stime);
                                } else {
                                        put_user_ex(from->si_utime,
&to->_sifields._sigchld_x32._utime);
                                        put_user_ex(from->si_stime,
&to->_sifields._sigchld_x32._stime);
                                }
                                put_user_ex(from->si_status, &to->si_status);
...


So it does look plausible that PTRACE_GETSIGINFO returns a x32 siginfo if the
ptracer is a x32 process.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]