Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Luis Machado <lgustavo@codesourcery.com>
To: "'gdb-patches@sourceware.org'" <gdb-patches@sourceware.org>
Subject: [PATCH] Move code to common/ptid.h
Date: Thu, 19 Sep 2013 12:16:00 -0000	[thread overview]
Message-ID: <523AEB33.9080100@codesourcery.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 162 bytes --]

Hi,

One more piece of cleanup. These macros currently live in linux-nat.h, 
but they should really go to common/ptid.h so gdbserver can use them as 
well.

OK?


[-- Attachment #2: ptid.diff --]
[-- Type: text/x-patch, Size: 1452 bytes --]

2013-09-19  Luis Machado  <lgustavo@codesourcery.com>

	* common/ptid.h (GET_LWP, GET_PID): Moved from
	linux-nat.h.
	(is_lwp, BUILD_LWP): Likewise.
	* linux-nat.h (GET_LWP, GET_PID): Moved to
	common/ptid.h.
	(is_lwp, BUILD_LWP): Likewise.

 gdb/common/ptid.h | 6 ++++++
 gdb/linux-nat.h   | 5 -----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/gdb/common/ptid.h b/gdb/common/ptid.h
index fefe8b6..ceafd02 100644
--- a/gdb/common/ptid.h
+++ b/gdb/common/ptid.h
@@ -20,6 +20,12 @@
 #ifndef PTID_H
 #define PTID_H
 
+/* Helper macros.  */
+#define GET_LWP(ptid)		ptid_get_lwp (ptid)
+#define GET_PID(ptid)		ptid_get_pid (ptid)
+#define is_lwp(ptid)		(GET_LWP (ptid) != 0)
+#define BUILD_LWP(lwp, pid)	ptid_build (pid, lwp, 0)
+
 /* The ptid struct is a collection of the various "ids" necessary
    for identifying the inferior.  This consists of the process id
    (pid), thread id (tid), and other fields necessary for uniquely
diff --git a/gdb/linux-nat.h b/gdb/linux-nat.h
index 044f646..0fc68ef 100644
--- a/gdb/linux-nat.h
+++ b/gdb/linux-nat.h
@@ -110,11 +110,6 @@ extern struct lwp_info *lwp_list;
        (LP) != NULL;							\
        (LP) = (LP)->next)
 
-#define GET_LWP(ptid)		ptid_get_lwp (ptid)
-#define GET_PID(ptid)		ptid_get_pid (ptid)
-#define is_lwp(ptid)		(GET_LWP (ptid) != 0)
-#define BUILD_LWP(lwp, pid)	ptid_build (pid, lwp, 0)
-
 /* Attempt to initialize libthread_db.  */
 void check_for_thread_db (void);
 

             reply	other threads:[~2013-09-19 12:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-19 12:16 Luis Machado [this message]
2013-09-19 12:28 ` Pedro Alves
2013-09-19 12:34 ` Joel Brobecker
2013-09-19 12:44   ` Luis Machado
2013-09-19 13:29     ` Pedro Alves

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=523AEB33.9080100@codesourcery.com \
    --to=lgustavo@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    /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