]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Consolidate API of target_supports_multi_process
authorSergio Durigan Junior <sergiodj@redhat.com>
Tue, 27 Sep 2016 20:21:48 +0000 (16:21 -0400)
committerSergio Durigan Junior <sergiodj@redhat.com>
Thu, 6 Oct 2016 21:00:53 +0000 (17:00 -0400)
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-10-06  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-10-06  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
gdb/gdbserver/ChangeLog
gdb/gdbserver/target.c
gdb/gdbserver/target.h
gdb/target.c
gdb/target.h
gdb/target/target.h

index e1cfc193ef82d82a24ecc79c57ee304a9e126719..95f2b92f65c50abd633fc6fc95c72ad8be74dd74 100644 (file)
@@ -1,3 +1,11 @@
+2016-10-06  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-10-06  Pedro Alves  <palves@redhat.com>
 
        * cp-valprint.c (vtbl_ptr_name): Write "extern const" instead of
index 42edcc792ef4aafd25f6edb39ca6229920b7e1da..371431b183a4e0c9a7af51688586d90bb6bd065b 100644 (file)
@@ -1,3 +1,10 @@
+2016-10-06  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-10-05  Tom Tromey  <tom@tromey.com>
 
        PR remote/20655:
index fd7c7141db87135f53ed7c70ec5d8590ff54312f..249a0631439266e478336df419ed0d912d9e6fda 100644 (file)
@@ -302,6 +302,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)
 {
index 26f7422162a4c67f07ab4aac506c8c173c105e46..d098a92efef2adcf8ced2d292facda8e2e62db03 100644 (file)
@@ -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                                                   \
     {                                                  \
index b6a7e6408de6e5ee8f8da661fe24571aa405ad8a..cb89e750866556d15ffa618dd1e03d54527b767f 100644 (file)
@@ -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)
 {
index b458970c1a9b87f0c479ad04f41befaa50dd8e73..176f33293151aaf0c76a25f8d248717fd0a37fa6 100644 (file)
@@ -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);
index be41fa74a5e32c8a47d229b8ea97c19c25704429..2f4c71617191c355b13dbf6a4f5a3f8ea64435ab 100644 (file)
@@ -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 */