This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [Patch v2 1/2] Enable ILP32 mode in gdb on aarch64
- From: Steve Ellcey <sellcey at caviumnetworks dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: gdb-patches <gdb-patches at sourceware dot org>
- Date: Thu, 09 Mar 2017 09:33:06 -0800
- Subject: Re: [Patch v2 1/2] Enable ILP32 mode in gdb on aarch64
- Authentication-results: sourceware.org; auth=none
- Authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=caviumnetworks.com;
- References: <1488837762.2866.268.camel@caviumnetworks.com> <867f41wfph.fsf@gmail.com> <1488916527.22552.8.camel@caviumnetworks.com> <CAH=s-PM6+sjn5MN=qV-z64s0pv1=K=5dX2DR-X4vSgkwgHr+xQ@mail.gmail.com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
On Thu, 2017-03-09 at 13:24 +0000, Yao Qi wrote:
>
> Assuming ILP32 kernel patches is correct, you can get these
> magic number by loading ILP32 kernel vmlinux, and doing these
> steps I do above.
The problem is that it looks like this isn't just a case of the offsets
changing, some of the kernel types have changed too and I think that is
the bigger problem. The problem may be related to this GCC patch
involving exception handling:
https://gcc.gnu.org/ml/gcc-patches/2017-02/msg00581.html
This patch sets REG_VALUE_IN_UNWIND_CONTEXT, something that is only done
on one other platform, ILP32 mode on x86_64. I tried looking at the ILP32
support for x86_64 in gdb but it doesn't seem to have any type of
sigframe_init routine.
In the unpatched kernel:
(gdb) ptype struct rt_sigframe
type = struct rt_sigframe {
struct siginfo info;
struct ucontext uc;
u64 fp;
u64 lr;
}
In the new kernel:
(gdb) ptype struct rt_sigframe
type = struct rt_sigframe {
struct siginfo info;
struct sigframe sig;
}
there is no ucontext. There is one inside sigframe though:
(gdb) ptype struct sigframe
type = struct sigframe {
struct ucontext uc;
u64 fp;
u64 lr;
}
But if I change the print to use the new structure I get the same offsets
with both kernels:
Old kernel:
(gdb) p/d &((struct rt_sigframe *) 0)->uc
$2 = 128
(gdb) p/d &((struct rt_sigframe *) 0)->uc->uc_mcontext
$1 = 304
New kernel:
(gdb) p/d &((struct rt_sigframe *) 0)->sig->uc
$2 = 128
(gdb) p/d &((struct rt_sigframe *) 0)->sig->uc->uc_mcontext
$1 = 304
Steve Ellcey
sellcey@cavium.com