This is the mail archive of the gdb-patches@sources.redhat.com 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]

Re: [PATCH RFC] process/thread/lwp id patch - phase 1


On May 1, 11:49am, Eli Zaretskii wrote:

[regarding addition of ptid_t]
> Wearing my Docs Cop hat, I'd say that something about this should
> probably be added to gdbint.texinfo.  Please consider that at some
> point.

Okay.  I'll let the dust settle first with regards to the name of the
type and its representation.  After that, I'll submit a patch for
gdbint.texinfo.

> > +#define pid_to_ptid(PID) ((ptid_t) MERGEPID ((PID),0))
> 
> This definition is global, for all ports and targets.  However,
> MERGEPID is only defined for some of them, so it looks like the other
> targets will instantly become broken by this change (since pid_to_ptid
> is called in much more targets than those which define MERGEPID).  So
> I think some header (target.h?) should have a fallback definition for
> MERGEPID, something like this:
> 
>   #ifndef MERGEPID
>   #define MERGEPID(PID,DUMMY)  (PID)
>   #endif
> 
> Or did I miss something?

MERGEPID will be defined for all ports and all targets since it is
defined later on in defs.h...

#ifndef PIDGET
#define PIDGET(PID) (PID)
#define TIDGET(PID) 0
#define MERGEPID(PID, TID) (PID)
#endif

Also, MERGEPID is defined along with PIDGET in each each header file
where PIDGET is defined.  These are:

    config/nm-linux.h
    config/sparc/tm-sun4sol2.h
    config/i386/tm-i386sol2.h
    config/i386/tm-i386v42mp.h

There are also some .c files which define PIDGET (if not already
defined), but *don't* define MERGEPID.  In each case, however, the
relevant bit of code always occurs after the defs.h include.  This
means that MERGEPID will either have been defined in defs.h or in one
of the other header files included by defs.h.

The following .c files superfluously define PIDGET and TIDGET:

    arm-linux-nat.c
    i386-linux-nat.c
    infptrace.c
    lin-thread.c
    procfs.c
    lin-lwp.c
    thread-db.c

The last four of these also (superfluously) define MERGEPID.

The phase 3 patch that I have planned will remove the superfluous
PIDGET, TIDGET, and MERGEPID defines.

Thanks for looking over my patch.

Kevin


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