Re: [PATCH v3] gdbserver: uclinux: pull in ptrace offset definitions from asm/ptrace.h

Jan Kratochvil
2012-04-27T07:11:41Z

On Thu, 26 Apr 2012 21:20:34 +0200, Pedro Alves wrote:
> Indeed. I've now peeked at strace's sources, and they do some butt-ugly
> #ifdef'ery to pick sys/ptrace.h vs asm/ptrace.h depending on arch x libc.
> So fine with me to forget about including the header at the top, until we
> find some other need.

in
http://sourceware.org/systemtap/wiki/utrace/tests
the ptrace.h inclusion compatible back to RHEL-4 and across
x86*/ppc*/s390*/ia64 ended up as:

#ifdef __ia64__
#define ia64_fpreg ia64_fpreg_DISABLE
#define pt_all_user_regs pt_all_user_regs_DISABLE
#endif /* __ia64__ */
#include <sys/ptrace.h>
#ifdef __ia64__
#undef ia64_fpreg
#undef pt_all_user_regs
#endif /* __ia64__ */
#include <linux/ptrace.h>
#include <sys/types.h>
#include <sys/user.h>
#if defined __i386__ || defined __x86_64__
#include <sys/debugreg.h>
#endif

It may be partially unrelated as there were needed more symbols than in
gdbserver, OTOH it does not have to solve non-Linux platforms.

Regards,
Jan