gdb/
[deliverable/binutils-gdb.git] / gdb / ada-tasks.c
index 4c0b66795c9b25717cd196b809c10dfae1dfc2c5..02ac6d0d07ba715da38cba5897efd72926309341 100644 (file)
@@ -847,7 +847,6 @@ read_known_tasks_list (struct ada_tasks_inferior_data *data)
 static void
 ada_tasks_inferior_data_sniffer (struct ada_tasks_inferior_data *data)
 {
-  const char *name;
   struct minimal_symbol *msym;
   struct symbol *sym;
 
@@ -870,13 +869,15 @@ ada_tasks_inferior_data_sniffer (struct ada_tasks_inferior_data *data)
        {
          /* Validate.  */
          struct type *type = check_typedef (SYMBOL_TYPE (sym));
-         struct type *eltype;
-         struct type *idxtype;
-
-         if (TYPE_CODE (type) == TYPE_CODE_ARRAY
-             && (eltype = check_typedef (TYPE_TARGET_TYPE (type)))
-             && TYPE_CODE (eltype) == TYPE_CODE_PTR
-             && (idxtype = check_typedef (TYPE_INDEX_TYPE (type)))
+         struct type *eltype = NULL;
+         struct type *idxtype = NULL;
+
+         if (TYPE_CODE (type) == TYPE_CODE_ARRAY)
+           eltype = check_typedef (TYPE_TARGET_TYPE (type));
+         if (eltype != NULL
+             && TYPE_CODE (eltype) == TYPE_CODE_PTR)
+           idxtype = check_typedef (TYPE_INDEX_TYPE (type));
+         if (idxtype != NULL
              && !TYPE_LOW_BOUND_UNDEFINED (idxtype)
              && !TYPE_HIGH_BOUND_UNDEFINED (idxtype))
            {
@@ -892,7 +893,7 @@ ada_tasks_inferior_data_sniffer (struct ada_tasks_inferior_data *data)
         contains debug information on the task type (due to implicit with of
         Ada.Tasking).  */
       data->known_tasks_element =
-       builtin_type (target_gdbarch)->builtin_data_ptr;
+       builtin_type (target_gdbarch ())->builtin_data_ptr;
       data->known_tasks_length = MAX_NUMBER_OF_KNOWN_TASKS;
       return;
     }
@@ -923,7 +924,7 @@ ada_tasks_inferior_data_sniffer (struct ada_tasks_inferior_data *data)
 
       /* Fallback to default values.  */
       data->known_tasks_element =
-       builtin_type (target_gdbarch)->builtin_data_ptr;
+       builtin_type (target_gdbarch ())->builtin_data_ptr;
       data->known_tasks_length = 1;
       return;
     }
@@ -1172,7 +1173,7 @@ info_task (struct ui_out *uiout, char *taskno_str, struct inferior *inf)
 
   /* Print the Ada task ID.  */
   printf_filtered (_("Ada Task: %s\n"),
-                  paddress (target_gdbarch, task_info->task_id));
+                  paddress (target_gdbarch (), task_info->task_id));
 
   /* Print the name of the task.  */
   if (task_info->name[0] != '\0')
This page took 0.025324 seconds and 4 git commands to generate.