This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [PATCH/RFA] AMD64 nptl support
It's in.
elena
Andreas Jaeger writes:
> Elena Zannoni <ezannoni@redhat.com> writes:
>
> > Elena Zannoni writes:
> > >
> > > This is all it's needed on AMD64 to get NPTL to work. Of course you
> > > need the perfect combination of glibc, glibc-kernheaders and kernel.
> > >
> > >
> > > OK?
> > >
> >
> > Mark? any comments on this?
>
> Note there is no official maintainer for amd64, so anybody with
> approval rights can approve it - and I therefore expect that you can
> approve it yourself. The patch itself looks fine to me,
>
> Andreas
>
> > elena
> >
> > > elena
> > >
> > > 2003-07-09 Elena Zannoni <ezannoni@redhat.com>
> > >
> > > * x86-64-linux-nat.c (ps_get_thread_area): New function.
> > >
> > >
> > > Index: x86-64-linux-nat.c
> > > ===================================================================
> > > RCS file: /cvs/uberbaum/gdb/x86-64-linux-nat.c,v
> > > retrieving revision 1.23
> > > diff -u -p -r1.23 x86-64-linux-nat.c
> > > --- x86-64-linux-nat.c 31 May 2003 18:00:04 -0000 1.23
> > > +++ x86-64-linux-nat.c 9 Jul 2003 14:30:02 -0000
> > > @@ -32,7 +32,17 @@
> > > #include <sys/debugreg.h>
> > > #include <sys/syscall.h>
> > > #include <sys/procfs.h>
> > > +#include <asm/prctl.h>
> > > +/* FIXME ezannoni-2003-07-09: we need <sys/reg.h> to be included after
> > > + <asm/ptrace.h> because the latter redefines FS and GS for no apparent
> > > + reason, and those definitions don't match the ones that libpthread_db
> > > + uses, which come from <sys/reg.h>. */
> > > +/* ezannoni-2003-07-09: I think this is fixed. The extraneous defs have
> > > + been removed from ptrace.h in the kernel. However, better safe than
> > > + sorry. */
> > > +#include <asm/ptrace.h>
> > > #include <sys/reg.h>
> > > +#include "gdb_proc_service.h"
> > >
> > > /* Prototypes for supply_gregset etc. */
> > > #include "gregset.h"
> > > @@ -332,3 +342,34 @@ x86_64_linux_dr_get_status (void)
> > > {
> > > return x86_64_linux_dr_get (DR_STATUS);
> > > }
> > > +
> > > +extern ps_err_e
> > > +ps_get_thread_area (const struct ps_prochandle *ph,
> > > + lwpid_t lwpid, int idx, void **base)
> > > +{
> > > +
> > > +/* This definition comes from prctl.h, but some kernels may not have it. */
> > > +#ifndef PTRACE_ARCH_PRCTL
> > > +#define PTRACE_ARCH_PRCTL 30
> > > +#endif
> > > +
> > > + /* FIXME: ezannoni-2003-07-09 see comment above about include file order.
> > > + We could be getting bogus values for these two. */
> > > + gdb_assert (FS < ELF_NGREG);
> > > + gdb_assert (GS < ELF_NGREG);
> > > + switch (idx)
> > > + {
> > > + case FS:
> > > + if (ptrace (PTRACE_ARCH_PRCTL, lwpid, base, ARCH_GET_FS) == 0)
> > > + return PS_OK;
> > > + break;
> > > + case GS:
> > > + if (ptrace (PTRACE_ARCH_PRCTL, lwpid, base, ARCH_GET_GS) == 0)
> > > + return PS_OK;
> > > + break;
> > > + default: /* Should not happen. */
> > > + return PS_BADADDR;
> > > + }
> > > + return PS_ERR; /* ptrace failed. */
> > > +}
> > > +
> >
>
> Andreas
> --
> Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
> SuSE Linux AG, Deutschherrnstr. 15-19, 90429 Nürnberg, Germany
> GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126