This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Compile error: 'PTRACE_GETREGS' undeclared (first use in this function) by arm64-sdk
- From: Cui Bixuan <cuibixuan at huawei dot com>
- To: <libc-alpha at sourceware dot org>, linya <linya1 at huawei dot com>, Li Jinyue <lijinyue at huawei dot com>, <zhanyongming at huawei dot com>
- Date: Wed, 18 Nov 2015 15:10:08 +0800
- Subject: Compile error: 'PTRACE_GETREGS' undeclared (first use in this function) by arm64-sdk
- Authentication-results: sourceware.org; auth=none
Hi,
I want to use ptrace in arm64, and there is a compile problem:
# aarch64-linux-gnu-gcc ptrace.c -o ptrace
ptrace.c: In function 'main':
ptrace.c:48:29: error: 'PTRACE_GETREGS' undeclared (first use in this function)
ptrace_ret = ptrace(PTRACE_GETREGS, child, NULL, ®s);
^
If the glibc does not support 'PTRACE_GETREGS'?
but I find:
/* Get register content. */
PTRACE_GETREGSET = 0x4204,
#define PTRACE_GETREGSET PTRACE_GETREGSET
in eglibc-2.19/libc/ports/sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h.
Then I don't know why :-(
And I know 'regs' in ptrace(PTRACE_GETREGS, child, NULL, ®s) can define:
'struct user regs' in arm or powerpc;
'struct user_fpregs_struct regs' in X86_64 or i386;
but I can't find the struct in eglibc-2.19/libc/ports/sysdeps/unix/sysv/linux/aarch64/sys/user.h
What should I do in arm64 if I want to use it?
Thanks
Cui Bixuan