Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@cygnus.com>
To: gdb-patches@sources.redhat.com
Cc: Trond Eivind Glomsrød <teg@redhat.com>
Subject: Re: [PATCH RFC] process/thread/lwp id patch - phase 3
Date: Mon, 14 May 2001 17:08:00 -0000	[thread overview]
Message-ID: <1010515000735.ZM7606@ocotillo.lan> (raw)
In-Reply-To: <1010504090641.ZM7298@ocotillo.lan>

On May 4,  2:06am, Kevin Buettner wrote:

> I plan to wait a week for review and discussion before committing this
> patch (or something like it).  I happen to like the representation for
> ptid_t that I've chosen, but I am willing to implement the "opacity
> through obscurity" approach if there is a consensus that this is a
> better approach.  Please note that I've attempted to ward off poor
> coding habits by documenting the ptid manipulation functions at the
> point at which struct ptid is defined (in defs.h).  (I'll also add
> something to gdbint.texinfo once the dust settles.)
> 
> Finally, I'll note that the representation of ptid_t is not cast
> in stone.  Since we're using a typedef, we can easily change
> the represenation in the future.
> 
> 	* inferior.h (null_ptid, minus_one_ptid): New variable declarations.
> 	(ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp)
> 	(ptid_get_tid, ptid_equal): New function declarations.
> 	* infrun.c (null_ptid, minus_one_ptid): New variables.
> 	(ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp)
> 	(ptid_get_tid, ptid_equal): New functions.
> 	(_initialize_infrun): Initialize null_ptid, minus_one_ptid,
> 	inferior_ptid, and target_last_wait_ptid.
> 
> 	* defs.h (ptid_t): Redefine to be a struct rather than an int.
> 	(pid_to_ptid, null_ptid, ptid_equal): Delete these macros.
> 	(PIDGET, TIDGET, MERGEPID): Redefine these macros using the
> 	new ptid accessors and constructor.
> 
> 	* config/i386/tm-i386v42mp.h (PIDGET, TIDGET, LIDGET, MERGEPID,
> 	MKLID, MKTID, ISTID): Provide new definitions for these macros.
> 	The old macros are retained, but disabled via #if 0 in order
> 	to aid in future restructuring.  See FIXME.
> 
> 	* arm-linux-nat.c (PIDGET, TIDGET): Delete macro definitions.
> 	* config/i386/tm-i386sol2.h (PIDGET0, PIDGET, TIDGET, MERGEPID):
> 	Likewise.
> 	* config/sparc/tm-sun4sol2.h (PIDGET0, PIDGET, TIDGET, MERGEPID):
> 	Likewise.
> 	* i386-linux-nat.c (PIDGET, TIDGET): Likewise.
> 	* infptrace.c (PIDGET, TIDGET): Likewise.
> 	* lin-lwp.c (PIDGET0, PIDGET, TIDGET, MERGEPID): Likewise.
> 	* lin-thread.c (PIDGET0, PIDGET, TIDGET, MERGEPID): Likewise.
> 	* proc-service.c (MERGEPID): Likewise.
> 	* procfs.c (PIDGET, TIDGET, MERGEPID): Likewise.
> 	* thread-db.c (PIDGET0, PIDGET, TIDGET, MERGEPID): Likewise.
> 
> 	* lin-lwp.c (THREAD_FLAG): Delete macro definition.
> 	(GET_LWP): Redefine in terms of ptid_get_lwp().
> 	(GET_PID): Redefine in terms of ptid_get_pid().
> 	(is_lwp): Redefine without the need for THREAD_FLAG.
> 	(BUILD_LWP): Redefine in terms of ptid_build().
> 	* lin-thread.c (THREAD_FLAG): Delete macro definition.
> 	(GET_LWP): Redefine in terms of ptid_get_lwp().
> 	(GET_PID): Redefine in terms of ptid_get_pid().
> 	(GET_THREAD): Redefine in terms of ptid_get_tid().
> 	(BUILD_THREAD, BUILD_LWP): Redefine in terms of ptid_build().
> 	(is_lwp, is_thread): Redefine.
> 	(linux_child_wait, check_all_signal_numbers)
> 	(linuxthreads_discard_global_state, attach_thread): Declare these
> 	functions to squash warnings about missing declarations.
> 	* sol-thread.c (THREAD_FLAG): Delete macro definition.
> 	(GET_PID): Redefine in terms of ptid_get_pid().
> 	(GET_LWP): Redefine in terms of ptid_get_lwp().
> 	(GET_THREAD): Redefine in terms of ptid_get_tid().
> 	(BUILD_THREAD, BUILD_LWP): Redefine in terms of ptid_build().
> 	(is_lwp, is_thread): Redefine.
> 	* thread-db.c (THREAD_FLAG): Delete macro definition.
> 	(GET_PID): Redefine in terms of ptid_get_pid().
> 	(GET_LWP): Redefine in terms of ptid_get_lwp().
> 	(GET_THREAD): Redefine in terms of ptid_get_tid().
> 	(BUILD_THREAD, BUILD_LWP): Redefine in terms of ptid_build().
> 	(is_lwp, is_thread): Redefine.
> 
> 	* corelow.c (add_to_thread_list, get_core_register_section):
> 	Eliminate hacks needed to prevent regressions when inferior_ptid
> 	wasn't wide enough to hold the core file thread id in the pid
> 	component of inferior_ptid.

Committed.

There are a few warnings that result when compiling lin-lwp.c as a result
of this patch.  I will commit the necessary changes shortly to eliminate
those warnings.

Kevin


      parent reply	other threads:[~2001-05-14 17:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-04  2:07 Kevin Buettner
2001-05-04  7:39 ` Eli Zaretskii
2001-05-14 17:08 ` Kevin Buettner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1010515000735.ZM7606@ocotillo.lan \
    --to=kevinb@cygnus.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=teg@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox