[v2,2/3] gdb/ada-tasks: Make the ada_tasks_pspace_data getter public

Message ID 20230127165337.1832937-3-legouguec@adacore.com
State New
Headers
Series Fix Ada tasking for baremetal targets using Ravenscar threads |

Commit Message

Kévin Le Gouguec Jan. 27, 2023, 4:53 p.m. UTC
  A future commit will make ravenscar-thread.c call a new function that
operates on this object.
---
 gdb/ada-tasks.c |  7 ++-----
 gdb/ada-tasks.h | 13 +++++++++++++
 2 files changed, 15 insertions(+), 5 deletions(-)
  

Patch

diff --git a/gdb/ada-tasks.c b/gdb/ada-tasks.c
index bdabc0909cb..a1afd25f9a5 100644
--- a/gdb/ada-tasks.c
+++ b/gdb/ada-tasks.c
@@ -287,12 +287,9 @@  task_to_str (int taskno, const ada_task_info *task_info)
     return string_printf ("%d \"%s\"", taskno, task_info->name);
 }
 
-/* Return the ada-tasks module's data for the given program space (PSPACE).
-   If none is found, add a zero'ed one now.
-
-   This function always returns a valid object.  */
+/* See ada-tasks.h.  */
 
-static struct ada_tasks_pspace_data *
+struct ada_tasks_pspace_data *
 get_ada_tasks_pspace_data (struct program_space *pspace)
 {
   struct ada_tasks_pspace_data *data;
diff --git a/gdb/ada-tasks.h b/gdb/ada-tasks.h
index 5a948c27a44..aa85c853a47 100644
--- a/gdb/ada-tasks.h
+++ b/gdb/ada-tasks.h
@@ -24,6 +24,7 @@ 
 #include "ada-lang.h"
 #include "gdbthread.h"
 #include "inferior.h"
+#include "progspace.h"
 #include "ui-out.h"
 
 /* Return non-zero if TASK_NUM is a valid task number.  */
@@ -69,4 +70,16 @@  extern void print_ada_task_info (struct ui_out *uiout,
 				 const char *taskno_str,
 				 struct inferior *inf);
 
+/* An opaque type for this module's per-program-space data.  */
+
+struct ada_tasks_pspace_data;
+
+/* Return the ada-tasks module's data for the given program space (PSPACE).
+   If none is found, add a zero'ed one now.
+
+   This function always returns a valid object.  */
+
+struct ada_tasks_pspace_data *
+get_ada_tasks_pspace_data (struct program_space *pspace);
+
 #endif /* ADA_TASKS_H */