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")
323 if (task_info->
task_id == task_id)
367 for (i = 0; i < nb_tasks; i++)
394 struct value *array_val;
395 struct value *bounds_val;
400 static int initialize_fieldnos = 1;
401 static int array_fieldno;
402 static int bounds_fieldno;
403 static int upper_bound_fieldno;
407 if (initialize_fieldnos)
410 struct type *bounds_type;
419 error (
_(
"Unknown task name format. Aborting"));
422 initialize_fieldnos = 0;
456 struct type *common_type;
457 struct type *ll_type;
458 struct type *call_type;
462 const char *atcb_name =
"system__tasking__ada_task_control_block___XVE";
463 const char *atcb_name_fixed =
"system__tasking__ada_task_control_block";
464 const char *common_atcb_name =
"system__tasking__common_atcb";
465 const char *private_data_name =
"system__task_primitives__private_data";
466 const char *entry_call_record_name =
"system__tasking__entry_call_record";
475 const struct symbol *common_atcb_sym =
478 const struct symbol *private_data_sym =
481 const struct symbol *entry_call_record_sym =
485 if (atcb_sym == NULL || atcb_sym->
type == NULL)
492 if (atcb_sym == NULL || atcb_sym->
type == NULL)
493 error (
_(
"Cannot find Ada_Task_Control_Block type. Aborting"));
495 type = atcb_sym->
type;
501 type = atcb_sym->
type;
505 if (common_atcb_sym == NULL || common_atcb_sym->
type == NULL)
506 error (
_(
"Cannot find Common_ATCB type. Aborting"));
507 if (private_data_sym == NULL || private_data_sym->
type == NULL)
508 error (
_(
"Cannot find Private_Data type. Aborting"));
509 if (entry_call_record_sym == NULL || entry_call_record_sym->
type == NULL)
510 error (
_(
"Cannot find Entry_Call_Record type. Aborting"));
513 common_type = common_atcb_sym->
type;
516 ll_type = private_data_sym->
type;
519 call_type = entry_call_record_sym->
type;
532 "activation_link", 1);
568 struct value *ll_value;
593 struct value *tcb_value;
594 struct value *common_value;
595 struct value *atc_nesting_level_value;
596 struct value *entry_calls_value;
597 struct value *entry_calls_value_element;
598 int called_task_fieldno = -1;
599 static const char ravenscar_task_name[] =
"Ravenscar task";
635 sizeof (task_info->
name) - 1);
644 const char *task_name = full_name;
648 for (p = full_name; *p; p++)
649 if (p[0] ==
'_' && p[1] ==
'_')
653 strncpy (task_info->
name, task_name, sizeof (task_info->
name));
654 task_info->
name[
sizeof (task_info->
name) - 1] = 0;
659 strcpy (task_info->
name, ravenscar_task_name);
704 atc_nesting_level_value =
709 entry_calls_value_element =
712 called_task_fieldno =
717 called_task_fieldno));
735 struct value *call_val;
786 gdb_byte *known_tasks = alloca (known_tasks_size);
812 gdb_byte *known_tasks = alloca (target_ptr_byte);
826 struct value *tcb_value;
827 struct value *common_value;
871 struct type *eltype = NULL;
872 struct type *idxtype = NULL;
986 error (
_(
"Cannot inspect Ada tasks when program is not running"));
1006 int taskno, nb_tasks;
1014 _(
"Your application does not use any Ada tasks.\n"));
1018 if (arg_str != NULL && arg_str[0] !=
'\0')
1081 if (taskno_arg && taskno != taskno_arg)
1125 _(
"Accepting RV with %-4d"),
1131 _(
"Waiting on RV with %-3d"),
1140 task_info->
name[0] !=
'\0' ? task_info->
name
1158 int parent_taskno = 0;
1164 _(
"Your application does not use any Ada tasks.\n"));
1169 error (
_(
"Task ID %d not known. Use the \"info tasks\" command to\n"
1170 "see the IDs of currently known tasks"), taskno);
1178 if (task_info->
name[0] !=
'\0')
1188 if (task_info->
parent != 0)
1196 if (parent->
name[0] !=
'\0')
1208 int target_taskno = 0;
1230 if (target_task_info->
name[0] !=
'\0')
1249 if (arg == NULL || *arg ==
'\0')
1263 if (current_task == 0)
1280 error (
_(
"Task ID %d not known. Use the \"info tasks\" command to\n"
1281 "see the IDs of currently known tasks"), taskno);
1285 error (
_(
"Cannot switch to task %d: Task is no longer running"), taskno);
1305 error (
_(
"Unable to compute thread ID for task %d.\n"
1306 "Cannot switch to this task."),
1329 _(
"Your application does not use any Ada tasks.\n"));
1333 if (taskno_str == NULL || taskno_str[0] ==
'\0')
1349 Task switching not supported when debugging from core files\n\
1350 (use thread support instead)"));
1404 if (objfile == NULL)
1446 _(
"Provide information about all known Ada tasks"));
1448 _(
"Use this command to switch between Ada tasks.\n\
1449 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)
static void get_tcb_types_info(void)
struct thread_info * find_thread_ptid(ptid_t ptid)
struct 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)
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)
initialize_file_ftype _initialize_tasks
struct value * value_subscript(struct value *array, LONGEST index)
#define MSYMBOL_LINKAGE_NAME(symbol)
void ui_out_field_int(struct ui_out *uiout, const char *fldname, int value)
int ptid_equal(ptid_t ptid1, ptid_t ptid2)
struct value * value_from_contents_and_address(struct type *type, const gdb_byte *valaddr, CORE_ADDR address)
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
struct cleanup * make_cleanup_ui_out_table_begin_end(struct ui_out *ui_out, int nr_cols, int nr_rows, const char *tblid)
#define TYPE_HIGH_BOUND(range_type)
const struct builtin_type * builtin_type(struct gdbarch *gdbarch)
#define TYPE_HIGH_BOUND_UNDEFINED(range_type)
int ui_out_is_mi_like_p(struct ui_out *uiout)
int ada_build_task_list(void)
void switch_to_thread(ptid_t ptid)
static void ada_tasks_new_objfile_observer(struct objfile *objfile)
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 ui_out_field_fmt(struct ui_out *uiout, const char *fldname, const char *format,...)
void ui_out_text(struct ui_out *uiout, 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
struct value * ada_coerce_to_simple_array_ptr(struct value *arr)
void ada_find_printable_frame(struct frame_info *fi)
struct type * check_typedef(struct type *type)
#define SYMBOL_VALUE_ADDRESS(symbol)
const gdb_byte * value_contents(struct value *value)
static void task_command_1(char *taskno_str, int from_tty, struct inferior *inf)
struct value * value_field(struct value *arg1, int fieldno)
static void ada_tasks_inferior_data_sniffer(struct ada_tasks_inferior_data *data)
void ui_out_field_skip(struct ui_out *uiout, const char *fldname)
void initialize_file_ftype(void)
struct cleanup * make_cleanup_ui_out_tuple_begin_end(struct ui_out *uiout, const char *id)
struct program_space * pspace
static int read_known_tasks_list(struct ada_tasks_inferior_data *data)
void ui_out_message(struct ui_out *uiout, int verbosity, const char *format,...)
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)
struct cmd_list_element * add_cmd(const char *name, enum command_class theclass, cmd_cfunc_ftype *fun, const char *doc, struct cmd_list_element **list)
CORE_ADDR known_tasks_addr
static void task_command(char *taskno_str, int from_tty)
struct inferior * inferior_list
static int read_known_tasks_array(struct ada_tasks_inferior_data *data)
#define VEC_index(T, V, I)
void( ada_task_list_iterator_ftype)(struct ada_task_info *task)
struct cmd_list_element * add_info(const char *name, cmd_cfunc_ftype *fun, const char *doc)
static const struct program_space_data * ada_tasks_pspace_data_handle
#define target_has_execution
void read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
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)
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 void info_task(struct ui_out *uiout, char *taskno_str, struct inferior *inf)
static struct ada_tasks_pspace_data * get_ada_tasks_pspace_data(struct program_space *pspace)
long ptid_get_tid(ptid_t ptid)
#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)
struct type * builtin_data_ptr
struct minimal_symbol * minsym
static ptid_t ptid_from_atcb_common(struct value *common_value)
struct type * atcb_ll_type
void ui_out_table_header(struct ui_out *uiout, int width, enum ui_align alignment, const char *col_name, const char *colhdr)
static void ada_tasks_invalidate_pspace_data(struct program_space *pspace)
static void read_atcb(CORE_ADDR task_id, struct ada_task_info *task_info)
static void info_tasks_command(char *arg, int from_tty)
#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 ada_get_task_number(ptid_t ptid)
struct inferior * current_inferior(void)
struct program_space * current_program_space
struct value * parse_and_eval(const char *exp)
int pid_to_thread_id(ptid_t ptid)
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)
long ptid_get_lwp(ptid_t ptid)
struct type * value_type(const struct value *value)
#define SYMBOL_TYPE(symbol)
CORE_ADDR value_as_address(struct value *val)
void ui_out_field_string(struct ui_out *uiout, const char *fldname, const char *string)
#define TYPE_LENGTH(thistype)
struct atcb_fieldnos atcb_fieldno
void ui_out_table_body(struct ui_out *uiout)
#define target_get_ada_task_ptid(lwp, tid)
struct ui_out * current_uiout
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)
void error(const char *fmt,...)
struct program_space * next
static void read_fat_string_value(char *dest, struct value *val, int max_len)
void do_cleanups(struct cleanup *old_chain)
struct program_space * program_spaces
static int get_task_number_from_id(CORE_ADDR task_id, struct inferior *inf)
const ULONGEST const LONGEST len