public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [RFA] Consolidate API of target_supports_multi_process
@ 2016-09-27 21:51 Sergio Durigan Junior
  2016-09-27 22:22 ` [RFA v2] " Sergio Durigan Junior
  0 siblings, 1 reply; 4+ messages in thread
From: Sergio Durigan Junior @ 2016-09-27 21:51 UTC (permalink / raw)
  To: GDB Patches; +Cc: Sergio Durigan Junior

This simple commit consolidates the API of
target_supports_multi_process.  Since both GDB and gdbserver use the
same function prototype, all that was needed was to move create this
prototype on gdb/target/target.h and turn the macros declared on
gdb/{,gdbserver/}target.h into actual functions.

Regtested (clean pass) on the BuildBot.

gdb/ChangeLog:
2016-09-27  Sergio Durigan Junior  <sergiodj@redhat.com>

	* target.c (target_supports_multi_process): New function, moved
	from...
	* target.h (target_supports_multi_process): ... here.  Remove
	macro.
	* target/target.h (target_supports_multi_process): New prototype.

gdb/gdbserver/ChangeLog:
2016-09-27  Sergio Durigan Junior  <sergiodj@redhat.com>

	* target.c (target_supports_multi_process): New function, moved
	from...
	* target.h (target_supports_multi_process): ... here.  Remove
	macro.
---
 gdb/gdbserver/target.c | 9 +++++++++
 gdb/gdbserver/target.h | 4 ----
 gdb/target.c           | 8 ++++++++
 gdb/target.h           | 6 ------
 gdb/target/target.h    | 5 +++++
 5 files changed, 22 insertions(+), 10 deletions(-)

diff --git a/gdb/gdbserver/target.c b/gdb/gdbserver/target.c
index cf3da47..e39334f 100644
--- a/gdb/gdbserver/target.c
+++ b/gdb/gdbserver/target.c
@@ -298,6 +298,15 @@ target_continue (ptid_t ptid, enum gdb_signal signal)
   (*the_target->resume) (&resume_info, 1);
 }
 
+/* See target/target.h.  */
+
+int
+target_supports_multi_process (void)
+{
+  return (the_target->supports_multi_process != NULL ?
+	  (*the_target->supports_multi_process) () : 0);
+}
+
 int
 start_non_stop (int nonstop)
 {
diff --git a/gdb/gdbserver/target.h b/gdb/gdbserver/target.h
index 26f7422..d098a92 100644
--- a/gdb/gdbserver/target.h
+++ b/gdb/gdbserver/target.h
@@ -535,10 +535,6 @@ int kill_inferior (int);
 #define target_async(enable) \
   (the_target->async ? (*the_target->async) (enable) : 0)
 
-#define target_supports_multi_process() \
-  (the_target->supports_multi_process ? \
-   (*the_target->supports_multi_process) () : 0)
-
 #define target_process_qsupported(features, count)	\
   do							\
     {							\
diff --git a/gdb/target.c b/gdb/target.c
index b6a7e64..cb89e75 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -2727,6 +2727,14 @@ target_supports_disable_randomization (void)
   return 0;
 }
 
+/* See target/target.h.  */
+
+int
+target_supports_multi_process (void)
+{
+  return (*current_target.to_supports_multi_process) (&current_target);
+}
+
 char *
 target_get_osdata (const char *type)
 {
diff --git a/gdb/target.h b/gdb/target.h
index b458970..176f332 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -1380,12 +1380,6 @@ struct address_space *target_thread_address_space (ptid_t);
 
 int target_info_proc (const char *, enum info_proc_what);
 
-/* Returns true if this target can debug multiple processes
-   simultaneously.  */
-
-#define	target_supports_multi_process()	\
-     (*current_target.to_supports_multi_process) (&current_target)
-
 /* Returns true if this target can disable address space randomization.  */
 
 int target_supports_disable_randomization (void);
diff --git a/gdb/target/target.h b/gdb/target/target.h
index be41fa7..2f4c716 100644
--- a/gdb/target/target.h
+++ b/gdb/target/target.h
@@ -90,4 +90,9 @@ extern ptid_t target_wait (ptid_t ptid, struct target_waitstatus *status,
 
 extern void target_mourn_inferior (ptid_t ptid);
 
+/* Return 1 if this target can debug multiple processes
+   simultaneously, zero otherwise.  */
+
+extern int target_supports_multi_process (void);
+
 #endif /* TARGET_COMMON_H */
-- 
2.7.4

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [RFA v2] Consolidate API of target_supports_multi_process
  2016-09-27 21:51 [RFA] Consolidate API of target_supports_multi_process Sergio Durigan Junior
@ 2016-09-27 22:22 ` Sergio Durigan Junior
  2016-10-06 16:37   ` Pedro Alves
  0 siblings, 1 reply; 4+ messages in thread
From: Sergio Durigan Junior @ 2016-09-27 22:22 UTC (permalink / raw)
  To: GDB Patches; +Cc: Sergio Durigan Junior

[ Resending with ChangeLog diffs. ]

This simple commit consolidates the API of
target_supports_multi_process.  Since both GDB and gdbserver use the
same function prototype, all that was needed was to move create this
prototype on gdb/target/target.h and turn the macros declared on
gdb/{,gdbserver/}target.h into actual functions.

Regtested (clean pass) on the BuildBot.

gdb/ChangeLog:
2016-09-27  Sergio Durigan Junior  <sergiodj@redhat.com>

	* target.c (target_supports_multi_process): New function, moved
	from...
	* target.h (target_supports_multi_process): ... here.  Remove
	macro.
	* target/target.h (target_supports_multi_process): New prototype.

gdb/gdbserver/ChangeLog:
2016-09-27  Sergio Durigan Junior  <sergiodj@redhat.com>

	* target.c (target_supports_multi_process): New function, moved
	from...
	* target.h (target_supports_multi_process): ... here.  Remove
	macro.
---
 gdb/ChangeLog           | 8 ++++++++
 gdb/gdbserver/ChangeLog | 7 +++++++
 gdb/gdbserver/target.c  | 9 +++++++++
 gdb/gdbserver/target.h  | 4 ----
 gdb/target.c            | 8 ++++++++
 gdb/target.h            | 6 ------
 gdb/target/target.h     | 5 +++++
 7 files changed, 37 insertions(+), 10 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 4810f1b..24e57f8 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,11 @@
+2016-09-27  Sergio Durigan Junior  <sergiodj@redhat.com>
+
+	* target.c (target_supports_multi_process): New function, moved
+	from...
+	* target.h (target_supports_multi_process): ... here.  Remove
+	macro.
+	* target/target.h (target_supports_multi_process): New prototype.
+
 2016-09-27  Fredrik Hederstierna  <fredrik.hederstierna@verisure.com>
 
 	* arm-tdep.c (arm_m_addr_is_magic): New function.
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index aace877..b4c8234 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,10 @@
+2016-09-27  Sergio Durigan Junior  <sergiodj@redhat.com>
+
+	* target.c (target_supports_multi_process): New function, moved
+	from...
+	* target.h (target_supports_multi_process): ... here.  Remove
+	macro.
+
 2016-09-26  Yao Qi  <yao.qi@linaro.org>
 
 	* linux-low.c (linux_wait_1): Call debug_exit.
diff --git a/gdb/gdbserver/target.c b/gdb/gdbserver/target.c
index cf3da47..e39334f 100644
--- a/gdb/gdbserver/target.c
+++ b/gdb/gdbserver/target.c
@@ -298,6 +298,15 @@ target_continue (ptid_t ptid, enum gdb_signal signal)
   (*the_target->resume) (&resume_info, 1);
 }
 
+/* See target/target.h.  */
+
+int
+target_supports_multi_process (void)
+{
+  return (the_target->supports_multi_process != NULL ?
+	  (*the_target->supports_multi_process) () : 0);
+}
+
 int
 start_non_stop (int nonstop)
 {
diff --git a/gdb/gdbserver/target.h b/gdb/gdbserver/target.h
index 26f7422..d098a92 100644
--- a/gdb/gdbserver/target.h
+++ b/gdb/gdbserver/target.h
@@ -535,10 +535,6 @@ int kill_inferior (int);
 #define target_async(enable) \
   (the_target->async ? (*the_target->async) (enable) : 0)
 
-#define target_supports_multi_process() \
-  (the_target->supports_multi_process ? \
-   (*the_target->supports_multi_process) () : 0)
-
 #define target_process_qsupported(features, count)	\
   do							\
     {							\
diff --git a/gdb/target.c b/gdb/target.c
index b6a7e64..cb89e75 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -2727,6 +2727,14 @@ target_supports_disable_randomization (void)
   return 0;
 }
 
+/* See target/target.h.  */
+
+int
+target_supports_multi_process (void)
+{
+  return (*current_target.to_supports_multi_process) (&current_target);
+}
+
 char *
 target_get_osdata (const char *type)
 {
diff --git a/gdb/target.h b/gdb/target.h
index b458970..176f332 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -1380,12 +1380,6 @@ struct address_space *target_thread_address_space (ptid_t);
 
 int target_info_proc (const char *, enum info_proc_what);
 
-/* Returns true if this target can debug multiple processes
-   simultaneously.  */
-
-#define	target_supports_multi_process()	\
-     (*current_target.to_supports_multi_process) (&current_target)
-
 /* Returns true if this target can disable address space randomization.  */
 
 int target_supports_disable_randomization (void);
diff --git a/gdb/target/target.h b/gdb/target/target.h
index be41fa7..2f4c716 100644
--- a/gdb/target/target.h
+++ b/gdb/target/target.h
@@ -90,4 +90,9 @@ extern ptid_t target_wait (ptid_t ptid, struct target_waitstatus *status,
 
 extern void target_mourn_inferior (ptid_t ptid);
 
+/* Return 1 if this target can debug multiple processes
+   simultaneously, zero otherwise.  */
+
+extern int target_supports_multi_process (void);
+
 #endif /* TARGET_COMMON_H */
-- 
2.7.4

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFA v2] Consolidate API of target_supports_multi_process
  2016-09-27 22:22 ` [RFA v2] " Sergio Durigan Junior
@ 2016-10-06 16:37   ` Pedro Alves
  2016-10-06 21:02     ` Sergio Durigan Junior
  0 siblings, 1 reply; 4+ messages in thread
From: Pedro Alves @ 2016-10-06 16:37 UTC (permalink / raw)
  To: Sergio Durigan Junior, GDB Patches

On 09/27/2016 10:53 PM, Sergio Durigan Junior wrote:
> [ Resending with ChangeLog diffs. ]
> 
> This simple commit consolidates the API of
> target_supports_multi_process.  Since both GDB and gdbserver use the
> same function prototype, all that was needed was to move create this
> prototype on gdb/target/target.h and turn the macros declared on
> gdb/{,gdbserver/}target.h into actual functions.
> 
> Regtested (clean pass) on the BuildBot.

OK.

Thanks,
Pedro Alves

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFA v2] Consolidate API of target_supports_multi_process
  2016-10-06 16:37   ` Pedro Alves
@ 2016-10-06 21:02     ` Sergio Durigan Junior
  0 siblings, 0 replies; 4+ messages in thread
From: Sergio Durigan Junior @ 2016-10-06 21:02 UTC (permalink / raw)
  To: Pedro Alves; +Cc: GDB Patches

On Thursday, October 06 2016, Pedro Alves wrote:

> On 09/27/2016 10:53 PM, Sergio Durigan Junior wrote:
>> [ Resending with ChangeLog diffs. ]
>> 
>> This simple commit consolidates the API of
>> target_supports_multi_process.  Since both GDB and gdbserver use the
>> same function prototype, all that was needed was to move create this
>> prototype on gdb/target/target.h and turn the macros declared on
>> gdb/{,gdbserver/}target.h into actual functions.
>> 
>> Regtested (clean pass) on the BuildBot.
>
> OK.

Thanks, pushed:

  1fb77080fd74d11c0dbccf812ed98ffa0b3edc4e

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-10-06 21:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-27 21:51 [RFA] Consolidate API of target_supports_multi_process Sergio Durigan Junior
2016-09-27 22:22 ` [RFA v2] " Sergio Durigan Junior
2016-10-06 16:37   ` Pedro Alves
2016-10-06 21:02     ` Sergio Durigan Junior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).