31 #define KNOWN_TASKS_NAME "system__tasking__debug__known_tasks" 39 #define KNOWN_TASKS_LIST "system__tasking__debug__first_task" 68 N_(
"Child Activation Wait"),
69 N_(
"Accept or Select Term"),
70 N_(
"Waiting on entry call"),
71 N_(
"Async Select Wait"),
73 N_(
"Child Termination Wait"),
74 N_(
"Wait Child in Term Alt"),
79 N_(
"Asynchronous Hold"),
90 N_(
"Waiting for child activation"),
91 N_(
"Blocked in accept or select with terminate"),
92 N_(
"Waiting on entry call"),
93 N_(
"Asynchronous Selective Wait"),
95 N_(
"Waiting for children termination"),
96 N_(
"Waiting for children in terminate alternative"),
101 N_(
"Asynchronous Hold"),
104 N_(
"Blocked in selective wait statement")
370 for (i = 0; i < nb_tasks; i++)
394 for (i = 0; i < nb_tasks; i++)
421 struct value *array_val;
422 struct value *bounds_val;
427 static int initialize_fieldnos = 1;
428 static int array_fieldno;
429 static int bounds_fieldno;
430 static int upper_bound_fieldno;
434 if (initialize_fieldnos)
437 struct type *bounds_type;
446 error (
_(
"Unknown task name format. Aborting"));
449 initialize_fieldnos = 0;
482 struct type *common_type;
483 struct type *ll_type;
484 struct type *call_type;
488 const char *atcb_name =
"system__tasking__ada_task_control_block___XVE";
489 const char *atcb_name_fixed =
"system__tasking__ada_task_control_block";
490 const char *common_atcb_name =
"system__tasking__common_atcb";
491 const char *private_data_name =
"system__task_primitives__private_data";
492 const char *entry_call_record_name =
"system__tasking__entry_call_record";
501 const struct symbol *common_atcb_sym =
504 const struct symbol *private_data_sym =
507 const struct symbol *entry_call_record_sym =
511 if (atcb_sym == NULL || atcb_sym->
type == NULL)
519 if (atcb_sym == NULL || atcb_sym->
type == NULL)
520 return _(
"Cannot find Ada_Task_Control_Block type");
532 if (common_atcb_sym == NULL || common_atcb_sym->
type == NULL)
533 return _(
"Cannot find Common_ATCB type");
534 if (private_data_sym == NULL || private_data_sym->
type == NULL)
535 return _(
"Cannot find Private_Data type");
536 if (entry_call_record_sym == NULL || entry_call_record_sym->
type == NULL)
537 return _(
"Cannot find Entry_Call_Record type");
540 common_type = common_atcb_sym->
type;
543 ll_type = private_data_sym->
type;
546 call_type = entry_call_record_sym->
type;
559 "activation_link", 1);
597 struct value *ll_value;
622 struct value *tcb_value;
623 struct value *common_value;
624 struct value *atc_nesting_level_value;
625 struct value *entry_calls_value;
626 struct value *entry_calls_value_element;
627 int called_task_fieldno = -1;
628 static const char ravenscar_task_name[] =
"Ravenscar task";
637 error (
_(
"%s. Aborting"), err_msg);
669 sizeof (task_info->
name) - 1);
678 const char *task_name = full_name;
682 for (p = full_name; *p; p++)
683 if (p[0] ==
'_' && p[1] ==
'_')
687 strncpy (task_info->
name, task_name, sizeof (task_info->
name));
688 task_info->
name[
sizeof (task_info->
name) - 1] = 0;
693 strcpy (task_info->
name, ravenscar_task_name);
738 atc_nesting_level_value =
743 entry_calls_value_element =
746 called_task_fieldno =
751 called_task_fieldno));
769 struct value *call_val;
856 struct value *tcb_value;
857 struct value *common_value;
901 struct type *eltype = NULL;
902 struct type *idxtype = NULL;
1016 error (
_(
"Cannot inspect Ada tasks when program is not running"));
1036 int taskno, nb_tasks;
1042 uiout->
message (
_(
"Your application does not use any Ada tasks.\n"));
1046 if (arg_str != NULL && arg_str[0] !=
'\0')
1107 if (taskno_arg && taskno != taskno_arg)
1131 uiout->
field_int (
"thread-id", thread_id);
1141 uiout->
field_int (
"parent-id", parent_id);
1151 _(
"Accepting RV with %-4d"),
1157 _(
"Waiting on RV with %-3d"),
1166 task_info->
name[0] !=
'\0' ? task_info->
name 1181 int parent_taskno = 0;
1186 uiout->
message (
_(
"Your application does not use any Ada tasks.\n"));
1191 error (
_(
"Task ID %d not known. Use the \"info tasks\" command to\n" 1192 "see the IDs of currently known tasks"), taskno);
1200 if (task_info->
name[0] !=
'\0')
1214 if (task_info->
parent != 0)
1222 if (
parent->name[0] !=
'\0')
1234 int target_taskno = 0;
1256 if (target_task_info->
name[0] !=
'\0')
1275 if (arg == NULL || *arg ==
'\0')
1289 if (current_task == 0)
1306 error (
_(
"Task ID %d not known. Use the \"info tasks\" command to\n" 1307 "see the IDs of currently known tasks"), taskno);
1311 error (
_(
"Cannot switch to task %d: Task is no longer running"), taskno);
1331 error (
_(
"Unable to compute thread ID for task %d.\n" 1332 "Cannot switch to this task."),
1354 uiout->
message (
_(
"Your application does not use any Ada tasks.\n"));
1358 if (taskno_str == NULL || taskno_str[0] ==
'\0')
1452 _(
"Provide information about all known Ada tasks"));
1454 _(
"Use this command to switch between Ada tasks.\n\ 1455 Without argument, this command simply prints the current task ID"),
struct gdbarch * target_gdbarch(void)
unsigned int known_tasks_length
static void display_current_task_id(void)
void _initialize_tasks(void)
struct thread_info * find_thread_ptid(ptid_t ptid)
CORE_ADDR extract_typed_address(const gdb_byte *buf, struct type *type)
int ada_get_field_index(const struct type *type, const char *field_name, int maybe_missing)
struct frame_info * get_selected_frame(const char *message)
struct value * value_subscript(struct value *array, LONGEST index)
#define MSYMBOL_LINKAGE_NAME(symbol)
struct value * value_from_contents_and_address(struct type *type, const gdb_byte *valaddr, CORE_ADDR address)
void field_string(const char *fldname, const char *string)
DEF_VEC_O(ada_task_info_s)
void iterate_over_live_ada_tasks(ada_task_list_iterator_ftype *iterator)
#define TYPE_LOW_BOUND(range_type)
static void ada_tasks_normal_stop_observer(struct bpstats *unused_args, int unused_args2)
LONGEST value_as_long(struct value *val)
#define BMSYMBOL_VALUE_ADDRESS(symbol)
struct program_space * pspace
#define TYPE_HIGH_BOUND(range_type)
void field_skip(const char *fldname)
const struct builtin_type * builtin_type(struct gdbarch *gdbarch)
struct cmd_list_element * add_info(const char *name, cmd_const_cfunc_ftype *fun, const char *doc)
void table_header(int width, ui_align align, const std::string &col_name, const std::string &col_hdr)
#define TYPE_HIGH_BOUND_UNDEFINED(range_type)
int ada_build_task_list(void)
void() ada_task_list_iterator_ftype(struct ada_task_info *task)
static void ada_tasks_new_objfile_observer(struct objfile *objfile)
struct cmd_list_element * add_cmd(const char *name, enum command_class theclass, const char *doc, struct cmd_list_element **list)
int valid_task_id(int task_num)
struct value * value_ind(struct value *arg1)
#define VEC_safe_push(T, V, O)
struct inferior * find_inferior_ptid(ptid_t ptid)
struct cmd_list_element * cmdlist
#define TYPE_FIELD_TYPE(thistype, n)
static struct ada_tasks_inferior_data * get_ada_tasks_inferior_data(struct inferior *inf)
static const char * long_task_states[]
void text(const char *string)
void printf_filtered(const char *format,...)
const char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)
static void value_as_string(char *dest, struct value *val, int length)
struct type * known_tasks_element
static void info_tasks_command(const char *arg, int from_tty)
struct value * ada_coerce_to_simple_array_ptr(struct value *arr)
void ada_find_printable_frame(struct frame_info *fi)
void switch_to_thread(ptid_t ptid)
struct type * check_typedef(struct type *type)
#define SYMBOL_VALUE_ADDRESS(symbol)
const gdb_byte * value_contents(struct value *value)
struct value * value_field(struct value *arg1, int fieldno)
static void ada_tasks_inferior_data_sniffer(struct ada_tasks_inferior_data *data)
static int read_known_tasks_list(struct ada_tasks_inferior_data *data)
long ptid_get_tid(const ptid_t &ptid)
struct type * ada_template_to_fixed_record_type_1(struct type *type, const gdb_byte *valaddr, CORE_ADDR address, struct value *dval0, int keep_dynamic_fields)
CORE_ADDR known_tasks_addr
int ptid_to_global_thread_id(ptid_t ptid)
struct inferior * inferior_list
static int read_known_tasks_array(struct ada_tasks_inferior_data *data)
#define VEC_index(T, V, I)
static const struct program_space_data * ada_tasks_pspace_data_handle
void read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
long ptid_get_lwp(const ptid_t &ptid)
static int ada_task_is_alive(struct ada_task_info *task_info)
static const struct inferior_data * ada_tasks_inferior_data_handle
static const int MAX_NUMBER_OF_KNOWN_TASKS
void print_stack_frame(struct frame_info *, int print_level, enum print_what print_what, int set_current_sal)
#define VEC_truncate(T, V, I)
static void info_task(struct ui_out *uiout, const char *taskno_str, struct inferior *inf)
void target_update_thread_list(void)
enum ada_known_tasks_kind known_tasks_kind
void print_ada_task_info(struct ui_out *uiout, char *arg_str, struct inferior *inf)
static struct ada_tasks_pspace_data * get_ada_tasks_pspace_data(struct program_space *pspace)
#define TYPE_TARGET_TYPE(thistype)
struct bound_minimal_symbol lookup_minimal_symbol_by_pc(CORE_ADDR pc)
struct type * atcb_common_type
int frame_relative_level(struct frame_info *fi)
#define TYPE_CODE(thistype)
#define TYPE_INDEX_TYPE(type)
void field_int(const char *fldname, int value)
struct type * builtin_data_ptr
static void task_command(const char *taskno_str, int from_tty)
struct minimal_symbol * minsym
static ptid_t ptid_from_atcb_common(struct value *common_value)
const char * ada_get_tcb_types_info(void)
struct type * atcb_ll_type
static constexpr ptid_t lwp
static void ada_tasks_invalidate_pspace_data(struct program_space *pspace)
void message(const char *format,...) ATTRIBUTE_PRINTF(2
static void read_atcb(CORE_ADDR task_id, struct ada_task_info *task_info)
#define TYPE_LOW_BOUND_UNDEFINED(range_type)
struct type * atcb_call_type
static void add_ada_task(CORE_ADDR task_id, struct inferior *inf)
int ptid_equal(const ptid_t &ptid1, const ptid_t &ptid2)
int ada_get_task_number(ptid_t ptid)
struct inferior * current_inferior(void)
struct ada_task_info * ada_get_task_info_from_ptid(ptid_t ptid)
struct program_space * current_program_space
struct value * parse_and_eval(const char *exp)
static void task_command_1(const char *taskno_str, int from_tty, struct inferior *inf)
static void ada_task_list_changed(struct inferior *inf)
struct observer * observer_attach_normal_stop(observer_normal_stop_ftype *f)
struct observer * observer_attach_new_objfile(observer_new_objfile_ftype *f)
struct type * value_type(const struct value *value)
#define SYMBOL_TYPE(symbol)
CORE_ADDR value_as_address(struct value *val)
#define TYPE_LENGTH(thistype)
struct atcb_fieldnos atcb_fieldno
#define target_get_ada_task_ptid(lwp, tid)
CORE_ADDR value_address(const struct value *value)
struct bound_minimal_symbol lookup_minimal_symbol(const char *name, const char *sfile, struct objfile *objf)
static void ada_tasks_invalidate_inferior_data(struct inferior *inf)
static int read_known_tasks(void)
struct block_symbol lookup_symbol_in_language(const char *name, const struct block *block, const domain_enum domain, enum language lang, struct field_of_this_result *is_a_field_of_this)
void error(const char *fmt,...)
struct program_space * next
static void read_fat_string_value(char *dest, struct value *val, int max_len)
struct program_space * program_spaces
void field_fmt(const char *fldname, const char *format,...) ATTRIBUTE_PRINTF(3
static int get_task_number_from_id(CORE_ADDR task_id, struct inferior *inf)