+2019-02-19 Tom Tromey <tromey@adacore.com>
+
+ * ravenscar-thread.c
+ (ravenscar_thread_target::update_thread_list): Don't call
+ ada_build_task_list.
+ * ada-lang.h (ada_build_task_list): Don't declare.
+ * ada-tasks.c (struct ada_tasks_inferior_data)
+ <task_list_valid_p>: Now bool.
+ (read_known_tasks, ada_task_list_changed)
+ (ada_tasks_invalidate_inferior_data): Update.
+ (read_known_tasks_array): Return bool.
+ (read_known_tasks_list): Likewise.
+ (read_known_tasks): Return void.
+ (ada_build_task_list): Now static.
+
2019-02-18 Andrew Burgess <andrew.burgess@embecosm.com>
* gdbtypes.c (type_align): Allow alignment of TYPE_CODE_METHODPTR
#include "progspace.h"
#include "objfiles.h"
+static int ada_build_task_list ();
+
/* The name of the array in the GNAT runtime where the Ada Task Control
Block of each task is stored. */
#define KNOWN_TASKS_NAME "system__tasking__debug__known_tasks"
/* When nonzero, this flag indicates that the task_list field
below is up to date. When set to zero, the list has either
not been initialized, or has potentially become stale. */
- int task_list_valid_p = 0;
+ bool task_list_valid_p = false;
/* The list of Ada tasks.
}
/* Read the Known_Tasks array from the inferior memory, and store
- it in the current inferior's TASK_LIST. Return non-zero upon success. */
+ it in the current inferior's TASK_LIST. Return true upon success. */
-static int
+static bool
read_known_tasks_array (struct ada_tasks_inferior_data *data)
{
const int target_ptr_byte = TYPE_LENGTH (data->known_tasks_element);
add_ada_task (task_id, current_inferior ());
}
- return 1;
+ return true;
}
/* Read the known tasks from the inferior memory, and store it in
- the current inferior's TASK_LIST. Return non-zero upon success. */
+ the current inferior's TASK_LIST. Return true upon success. */
-static int
+static bool
read_known_tasks_list (struct ada_tasks_inferior_data *data)
{
const int target_ptr_byte = TYPE_LENGTH (data->known_tasks_element);
/* Sanity check. */
if (pspace_data->atcb_fieldno.activation_link < 0)
- return 0;
+ return false;
/* Build a new list by reading the ATCBs. Read head of the list. */
read_memory (data->known_tasks_addr, known_tasks, target_ptr_byte);
pspace_data->atcb_fieldno.activation_link));
}
- return 1;
+ return true;
}
/* Set all fields of the current inferior ada-tasks data pointed by DATA.
}
/* Read the known tasks from the current inferior's memory, and store it
- in the current inferior's data TASK_LIST.
- Return non-zero upon success. */
+ in the current inferior's data TASK_LIST. */
-static int
-read_known_tasks (void)
+static void
+read_known_tasks ()
{
struct ada_tasks_inferior_data *data =
get_ada_tasks_inferior_data (current_inferior ());
ada_tasks_inferior_data_sniffer (data);
gdb_assert (data->known_tasks_kind != ADA_TASKS_UNKNOWN);
+ /* Step 3: Set task_list_valid_p, to avoid re-reading the Known_Tasks
+ array unless needed. */
switch (data->known_tasks_kind)
{
- case ADA_TASKS_NOT_FOUND: /* Tasking not in use in inferior. */
- return 0;
- case ADA_TASKS_ARRAY:
- return read_known_tasks_array (data);
- case ADA_TASKS_LIST:
- return read_known_tasks_list (data);
+ case ADA_TASKS_NOT_FOUND: /* Tasking not in use in inferior. */
+ break;
+ case ADA_TASKS_ARRAY:
+ data->task_list_valid_p = read_known_tasks_array (data);
+ break;
+ case ADA_TASKS_LIST:
+ data->task_list_valid_p = read_known_tasks_list (data);
+ break;
}
-
- /* Step 3: Set task_list_valid_p, to avoid re-reading the Known_Tasks
- array unless needed. Then report a success. */
- data->task_list_valid_p = 1;
-
- return 1;
}
/* Build the task_list by reading the Known_Tasks array from
the inferior, and return the number of tasks in that list
(zero means that the program is not using tasking at all). */
-int
-ada_build_task_list (void)
+static int
+ada_build_task_list ()
{
struct ada_tasks_inferior_data *data;
{
struct ada_tasks_inferior_data *data = get_ada_tasks_inferior_data (inf);
- data->task_list_valid_p = 0;
+ data->task_list_valid_p = false;
}
/* Invalidate the per-program-space data. */
struct ada_tasks_inferior_data *data = get_ada_tasks_inferior_data (inf);
data->known_tasks_kind = ADA_TASKS_UNKNOWN;
- data->task_list_valid_p = 0;
+ data->task_list_valid_p = false;
}
/* The 'normal_stop' observer notification callback. */