67 #ifndef TRUNCATION_TOWARDS_ZERO
68 #define TRUNCATION_TOWARDS_ZERO ((-5 / 2) == -2)
103 static int full_match (
const char *,
const char *);
108 const struct block *,
const char *,
114 const struct block *);
146 const struct block *);
201 static int wild_match (
const char *,
const char *);
221 struct type **,
int *,
int *,
int *,
int *);
227 struct value **,
int,
const char *,
297 #define HASH_SIZE 1009
317 " \t\n!@#%^&*()+=|~`}{[]\";:?/,-";
319 " \t\n!@#$%^&*()+=|~`}{[]\";:?/,-";
324 =
"__gnat_ada_main_program_name";
395 struct ada_inferior_data *data;
397 data = inferior_data (inf, ada_inferior_data);
410 static struct ada_inferior_data *
413 struct ada_inferior_data *data;
415 data = inferior_data (inf, ada_inferior_data);
418 data = XCNEW (
struct ada_inferior_data);
419 set_inferior_data (inf, ada_inferior_data, data);
432 set_inferior_data (inf, ada_inferior_data, NULL);
458 data = program_space_data (pspace, ada_pspace_data_handle);
462 set_program_space_data (pspace, ada_pspace_data_handle, data);
530 if (decoded_name[0] ==
'<')
533 result = strrchr (decoded_name,
'.');
537 result = decoded_name;
548 static char *result = NULL;
578 if (*size < min_size)
581 if (*size < min_size)
583 vect =
xrealloc (vect, *size * element_size);
594 int len = strlen (target);
597 (strncmp (field_name, target, len) == 0
598 && (field_name[len] ==
'\0'
600 && strcmp (field_name + strlen (field_name) - 6,
618 struct type *struct_type =
check_typedef ((
struct type *) type);
620 for (fieldno = 0; fieldno <
TYPE_NFIELDS (struct_type); fieldno++)
625 error (
_(
"Unable to find field %s in struct %s. Aborting"),
640 const char *p = strstr (name,
"___");
643 return strlen (name);
660 len2 = strlen (suffix);
661 return (len1 >= len2 && strcmp (str + len1 - len2, suffix) == 0);
667 static struct value *
675 struct value *result;
729 va_start (args, format);
730 warnings_issued += 1;
731 if (warnings_issued <= warning_limit)
745 error (
_(
"object size is larger than varsize-limit"));
754 return top_bit | (top_bit - 1);
770 return top_bit | (top_bit - 1);
810 error (
_(
"Unexpected type in ada_discrete_type_high_bound."));
831 error (
_(
"Unexpected type in ada_discrete_type_low_bound."));
900 (
struct objfile *) NULL).minsym != NULL)
914 static char *main_program_name = NULL;
929 if (main_program_name_addr == 0)
930 error (
_(
"Invalid address for Ada main program name."));
932 xfree (main_program_name);
938 return main_program_name;
951 {
"Oadd",
"\"+\"", BINOP_ADD},
952 {
"Osubtract",
"\"-\"", BINOP_SUB},
953 {
"Omultiply",
"\"*\"", BINOP_MUL},
954 {
"Odivide",
"\"/\"", BINOP_DIV},
955 {
"Omod",
"\"mod\"", BINOP_MOD},
956 {
"Orem",
"\"rem\"", BINOP_REM},
957 {
"Oexpon",
"\"**\"", BINOP_EXP},
958 {
"Olt",
"\"<\"", BINOP_LESS},
959 {
"Ole",
"\"<=\"", BINOP_LEQ},
960 {
"Ogt",
"\">\"", BINOP_GTR},
961 {
"Oge",
"\">=\"", BINOP_GEQ},
962 {
"Oeq",
"\"=\"", BINOP_EQUAL},
963 {
"One",
"\"/=\"", BINOP_NOTEQUAL},
964 {
"Oand",
"\"and\"", BINOP_BITWISE_AND},
965 {
"Oor",
"\"or\"", BINOP_BITWISE_IOR},
966 {
"Oxor",
"\"xor\"", BINOP_BITWISE_XOR},
967 {
"Oconcat",
"\"&\"", BINOP_CONCAT},
968 {
"Oabs",
"\"abs\"", UNOP_ABS},
969 {
"Onot",
"\"not\"", UNOP_LOGICAL_NOT},
970 {
"Oadd",
"\"+\"", UNOP_PLUS},
971 {
"Osubtract",
"\"-\"", UNOP_NEG},
981 static char *encoding_buffer = NULL;
982 static size_t encoding_buffer_size = 0;
989 GROW_VECT (encoding_buffer, encoding_buffer_size,
990 2 * strlen (decoded) + 10);
993 for (p = decoded; *p !=
'\0'; p += 1)
997 encoding_buffer[k] = encoding_buffer[k + 1] =
'_';
1004 for (mapping = ada_opname_table;
1009 error (
_(
"invalid Ada operator name: %s"), p);
1010 strcpy (encoding_buffer + k, mapping->
encoded);
1011 k += strlen (mapping->
encoded);
1016 encoding_buffer[k] = *p;
1021 encoding_buffer[k] =
'\0';
1022 return encoding_buffer;
1032 static char *fold_buffer = NULL;
1033 static size_t fold_buffer_size = 0;
1035 int len = strlen (name);
1036 GROW_VECT (fold_buffer, fold_buffer_size, len + 1);
1038 if (name[0] ==
'\'')
1040 strncpy (fold_buffer, name + 1, len - 2);
1041 fold_buffer[len - 2] =
'\000';
1047 for (i = 0; i <=
len; i += 1)
1048 fold_buffer[i] = tolower (name[i]);
1059 return (isdigit (c) || (isalpha (c) && islower (c)));
1077 if (*len > 1 && isdigit (encoded[*len - 1]))
1081 while (i > 0 && isdigit (encoded[i]))
1083 if (i >= 0 && encoded[i] ==
'.')
1085 else if (i >= 0 && encoded[i] ==
'$')
1087 else if (i >= 2 &&
startswith (encoded + i - 2,
"___"))
1089 else if (i >= 1 &&
startswith (encoded + i - 1,
"__"))
1111 && encoded[*len - 1] ==
'N'
1112 && (isdigit (encoded[*len - 2]) || islower (encoded[*len - 2])))
1123 while (i > 0 && (encoded[i] ==
'b' || encoded[i] ==
'n'))
1126 if (encoded[i] !=
'X')
1132 if (isalnum (encoded[i-1]))
1152 static char *decoding_buffer = NULL;
1153 static size_t decoding_buffer_size = 0;
1164 if (encoded[0] ==
'_' || encoded[0] ==
'<')
1167 len0 = strlen (encoded);
1176 p = strstr (encoded,
"___");
1177 if (p != NULL && p - encoded < len0 - 3)
1189 if (len0 > 3 &&
startswith (encoded + len0 - 3,
"TKB"))
1196 if (len0 > 2 &&
startswith (encoded + len0 - 2,
"TB"))
1202 if (len0 > 1 &&
startswith (encoded + len0 - 1,
"B"))
1207 GROW_VECT (decoding_buffer, decoding_buffer_size, 2 * len0 + 1);
1208 decoded = decoding_buffer;
1212 if (len0 > 1 && isdigit (encoded[len0 - 1]))
1215 while ((i >= 0 && isdigit (encoded[i]))
1216 || (i >= 1 && encoded[i] ==
'_' && isdigit (encoded[i - 1])))
1218 if (i > 1 && encoded[i] ==
'_' && encoded[i - 1] ==
'_')
1220 else if (encoded[i] ==
'$')
1227 for (i = 0, j = 0; i < len0 && !isalpha (encoded[i]); i += 1, j += 1)
1228 decoded[j] = encoded[i];
1234 if (at_start_name && encoded[i] ==
'O')
1238 for (k = 0; ada_opname_table[k].
encoded != NULL; k += 1)
1240 int op_len = strlen (ada_opname_table[k].encoded);
1241 if ((strncmp (ada_opname_table[k].encoded + 1, encoded + i + 1,
1243 && !isalnum (encoded[i + op_len]))
1245 strcpy (decoded + j, ada_opname_table[k].decoded);
1248 j += strlen (ada_opname_table[k].decoded);
1252 if (ada_opname_table[k].encoded != NULL)
1260 if (i < len0 - 4 &&
startswith (encoded + i,
"TK__"))
1267 if (len0 - i > 5 && encoded [i] ==
'_' && encoded [i+1] ==
'_'
1268 && encoded [i+2] ==
'B' && encoded [i+3] ==
'_'
1269 && isdigit (encoded [i+4]))
1273 while (k < len0 && isdigit (encoded[k]))
1278 if (len0 - k > 2 && encoded [k] ==
'_' && encoded [k+1] ==
'_')
1295 if (len0 - i > 3 && encoded [i] ==
'_' && encoded[i+1] ==
'E'
1296 && isdigit (encoded[i+2]))
1300 while (k < len0 && isdigit (encoded[k]))
1304 && (encoded[k] ==
'b' || encoded[k] ==
's'))
1311 || (k < len0 && encoded[k] ==
'_'))
1320 && encoded[i] ==
'N' && encoded[i+1] ==
'_' && encoded[i+2] ==
'_')
1325 const char *ptr = encoded + i - 1;
1330 || (ptr > encoded && ptr[0] ==
'_' && ptr[-1] ==
'_'))
1334 if (encoded[i] ==
'X' && i != 0 && isalnum (encoded[i - 1]))
1345 while (i < len0 && (encoded[i] ==
'b' || encoded[i] ==
'n'));
1349 else if (i < len0 - 2 && encoded[i] ==
'_' && encoded[i + 1] ==
'_')
1361 decoded[j] = encoded[i];
1366 decoded[j] =
'\000';
1371 for (i = 0; decoded[i] !=
'\0'; i += 1)
1372 if (isupper (decoded[i]) || decoded[i] ==
' ')
1375 if (strcmp (decoded, encoded) == 0)
1381 GROW_VECT (decoding_buffer, decoding_buffer_size, strlen (encoded) + 3);
1382 decoded = decoding_buffer;
1383 if (encoded[0] ==
'<')
1384 strcpy (decoded, encoded);
1386 xsnprintf (decoded, decoding_buffer_size,
"<%s>", encoded);
1412 const char **resultp =
1422 if (obstack != NULL)
1423 *resultp = obstack_copy0 (obstack, decoded, strlen (decoded));
1431 char **slot = (
char **) htab_find_slot (decoded_names_store,
1435 *slot = xstrdup (decoded);
1459 if (sym_name == NULL || name == NULL)
1465 int len_name = strlen (name);
1467 return (strncmp (sym_name, name, len_name) == 0
1470 && strncmp (sym_name + 5, name, len_name) == 0
1506 if (index_desc_type == NULL)
1536 "LB0",
"UB0",
"LB1",
"UB1",
"LB2",
"UB2",
"LB3",
"UB3",
1537 "LB4",
"UB4",
"LB5",
"UB5",
"LB6",
"UB6",
"LB7",
"UB7"
1542 #define MAX_ADA_DIMENS (sizeof(bound_name) / (2*sizeof(char *)))
1551 static struct type *
1580 static struct type *
1585 if (base_type == NULL)
1593 if (alt_type == NULL)
1602 static struct value *
1629 static struct type *
1659 static struct value *
1666 struct type *bounds_type =
1670 if (bounds_type == NULL)
1671 error (
_(
"Bad GNAT array descriptor"));
1689 _(
"Bad GNAT array descriptor"));
1690 struct type *p_bounds_type =
value_type (p_bounds);
1703 error (
_(
"Bad GNAT array descriptor"));
1739 static struct type *
1762 static struct value *
1771 _(
"Bad GNAT array descriptor"));
1804 static struct value *
1807 return value_struct_elt (&bounds, NULL, bound_name[2 * i + which - 2], NULL,
1808 _(
"Bad GNAT array descriptor bounds"));
1839 static struct type *
1914 return (data_type != NULL
1954 struct type *array_type =
1965 struct type *elt_type;
1967 struct value *descriptor;
1972 if (elt_type == NULL || arity == 0)
2008 TYPE_LENGTH (array_type) = (array_bitsize + 7) / 8;
2029 if (arrType == NULL)
2051 error (
_(
"Bounds unavailable for null array pointer."));
2117 const char *raw_name;
2134 tail = strstr (raw_name,
"___XP");
2137 if (sscanf (tail +
sizeof (
"___XP") - 1,
"%ld", &bits) != 1)
2140 (
_(
"could not understand bit size information on packed array"));
2164 static struct type *
2167 struct type *new_elt_type;
2169 struct type *index_type_desc;
2170 struct type *index_type;
2171 LONGEST low_bound, high_bound;
2178 if (index_type_desc)
2195 low_bound = high_bound = 0;
2196 if (high_bound < low_bound)
2200 *elt_bits *= (high_bound - low_bound + 1);
2212 static struct type *
2218 struct type *shadow_type;
2227 name = (
char *) alloca (strlen (raw_name) + 1);
2228 tail = strstr (raw_name,
"___XP");
2231 memcpy (name, raw_name, tail - raw_name);
2232 name[tail - raw_name] =
'\000';
2236 if (shadow_type == NULL)
2238 lim_warning (
_(
"could not find bounds information on packed array"));
2246 "information on packed array"));
2260 static struct value *
2279 error (
_(
"can't unpack array"));
2290 int bit_size, bit_pos;
2315 static struct value *
2319 int bits, elt_off, bit_off;
2320 long elt_total_bit_offset;
2321 struct type *elt_type;
2325 elt_total_bit_offset = 0;
2327 for (i = 0; i < arity; i += 1)
2332 (
_(
"attempt to do packed indexing of "
2333 "something other than a packed array"));
2337 LONGEST lowerbound, upperbound;
2343 lowerbound = upperbound = 0;
2347 if (idx < lowerbound || idx > upperbound)
2348 lim_warning (
_(
"packed array index %ld out of bounds"),
2351 elt_total_bit_offset += (idx - lowerbound) * bits;
2391 long offset,
int bit_offset,
int bit_size,
2402 unsigned char *bytes;
2403 unsigned char *unpacked;
2404 unsigned long accum;
2416 bytes = (
unsigned char *) (valaddr + offset);
2433 bytes = (
unsigned char *) alloca (len);
2444 long new_offset =
offset;
2464 srcBitsLeft = bit_size;
2505 int sign_bit_offset = (bit_size + bit_offset - 1) % 8;
2508 unusedLS = bit_offset;
2511 if (
has_negatives (type) && (bytes[len - 1] & (1 << sign_bit_offset)))
2520 unsigned int unusedMSMask =
2524 unsigned int signMask = sign & ~unusedMSMask;
2527 (((bytes[src] >> unusedLS) & unusedMSMask) | signMask) << accumSize;
2544 accum |= sign << accumSize;
2565 int src_offset,
int n,
int bits_big_endian_p)
2567 unsigned int accum, mask;
2568 int accum_bits, chunk_size;
2574 if (bits_big_endian_p)
2576 accum = (
unsigned char) *source;
2591 mask = ((1 << chunk_size) - 1) << unused_right;
2594 | ((accum >> (accum_bits - chunk_size - unused_right)) & mask);
2596 accum_bits -= chunk_size;
2603 accum = (
unsigned char) *source >> src_offset;
2609 accum = accum + ((
unsigned char) *source << accum_bits);
2615 mask = ((1 << chunk_size) - 1) << targ_offset;
2616 *target = (*target & ~mask) | ((accum << targ_offset) & mask);
2618 accum_bits -= chunk_size;
2619 accum >>= chunk_size;
2631 static struct value *
2646 error (
_(
"Left operand of assignment is not a modifiable lvalue."));
2704 int bit_offset_in_container =
2736 struct type *elt_type;
2745 for (k = 0; k < arity; k += 1)
2748 error (
_(
"too many subscripts (%d expected)"), k);
2758 static struct value *
2765 for (k = 0; k < arity; k += 1)
2768 struct value *lwb_value;
2771 error (
_(
"too many subscripts (%d expected)"), k);
2787 static struct value *
2793 struct type *index_type
2795 struct type *slice_type =
2798 LONGEST base_low_pos, low_pos;
2804 warning (
_(
"unable to get positions in slice, use bounds instead"));
2806 base_low_pos = base_low;
2810 + ((low_pos - base_low_pos)
2816 static struct value *
2821 struct type *index_type
2823 struct type *slice_type =
2830 warning (
_(
"unable to get positions in slice, use bounds instead"));
2836 value_slice (array, low, high_pos - low_pos + 1));
2880 struct type *p_array_type;
2889 if (nindices >= 0 && k > nindices)
2891 while (k > 0 && p_array_type != NULL)
2896 return p_array_type;
2917 static struct type *
2920 struct type *result_type;
2925 error (
_(
"invalid dimension number to '%s"), name);
2931 for (i = 1; i < n; i += 1)
2943 if (result_type == NULL)
2944 error (
_(
"attempt to take bound of something that is not an array"));
2959 struct type *
type, *index_type_desc, *index_type;
2980 index_type_desc = NULL;
2988 if (index_type_desc != NULL)
2995 for (i = 1; i < n; i++)
3015 struct type *arr_type;
3038 struct type *arr_type, *index_type;
3061 if (index_type != NULL)
3063 struct type *base_type;
3067 base_type = index_type;
3072 return high - low + 1;
3078 static struct value *
3082 struct type *index_type
3101 for (i = 0; ada_opname_table[i].
encoded != NULL; i += 1)
3103 if (ada_opname_table[i].op == op)
3104 return ada_opname_table[i].
decoded;
3106 error (
_(
"Could not find operator name for opcode"));
3122 struct type *context_type = NULL;
3140 static struct value *
3142 struct type *context_type)
3148 struct value **argvec;
3182 case OP_ATR_MODULUS:
3192 case TERNOP_IN_RANGE:
3193 case BINOP_IN_BOUNDS:
3199 case OP_DISCRETE_RANGE:
3231 case BINOP_LOGICAL_AND:
3232 case BINOP_LOGICAL_OR:
3233 case BINOP_BITWISE_AND:
3234 case BINOP_BITWISE_IOR:
3235 case BINOP_BITWISE_XOR:
3238 case BINOP_NOTEQUAL:
3245 case BINOP_SUBSCRIPT:
3253 case UNOP_LOGICAL_NOT:
3269 case OP_INTERNALVAR:
3282 case STRUCTOP_STRUCT:
3296 error (
_(
"Unexpected operator during name resolution"));
3299 argvec = (
struct value * *) alloca (
sizeof (
struct value *) * (nargs + 1));
3300 for (i = 0; i < nargs; i += 1)
3323 if (n_candidates > 1)
3329 for (j = 0; j < n_candidates; j += 1)
3343 if (j < n_candidates)
3346 while (j < n_candidates)
3350 candidates[j] = candidates[n_candidates - 1];
3359 if (n_candidates == 0)
3360 error (
_(
"No definition found for %s"),
3362 else if (n_candidates == 1)
3364 else if (deprocedure_p
3368 (candidates, n_candidates, NULL, 0,
3372 error (
_(
"Could not find a match for %s"),
3414 if (n_candidates == 1)
3419 (candidates, n_candidates,
3424 error (
_(
"Could not find a match for %s"),
3443 case BINOP_BITWISE_AND:
3444 case BINOP_BITWISE_IOR:
3445 case BINOP_BITWISE_XOR:
3447 case BINOP_NOTEQUAL:
3455 case UNOP_LOGICAL_NOT:
3472 candidates[i].
sym, candidates[i].
block);
3558 return (n_actuals == 0);
3565 for (i = 0; i < n_actuals; i += 1)
3567 if (actuals[i] == NULL)
3590 struct type *return_type;
3592 if (func_type == NULL)
3599 if (return_type == NULL)
3605 return context_type == NULL || return_type == context_type;
3606 else if (context_type == NULL)
3627 int nsyms,
struct value **args,
int nargs,
3628 const char *
name,
struct type *context_type)
3638 for (fallback = 0; m == 0 && fallback < 2; fallback++)
3640 for (k = 0; k < nsyms; k += 1)
3675 else if (N0 == NULL)
3681 for (k0 = strlen (N0) - 1; k0 > 0 && isdigit (N0[k0]); k0 -= 1)
3683 for (k1 = strlen (N1) - 1; k1 > 0 && isdigit (N1[k1]); k1 -= 1)
3685 if ((N0[k0] ==
'_' || N0[k0] ==
'$') && N0[k0 + 1] !=
'\000'
3686 && (N1[k1] ==
'_' || N1[k1] ==
'$') && N1[k1 + 1] !=
'\000')
3691 while (N0[n0] ==
'_' && n0 > 0 && N0[n0 - 1] ==
'_')
3694 while (N1[n1] ==
'_' && n1 > 0 && N1[n1 - 1] ==
'_')
3696 if (n0 == n1 && strncmp (N0, N1, n0) == 0)
3697 return (atoi (N0 + k0 + 1) < atoi (N1 + k1 + 1));
3699 return (strcmp (N0, N1) < 0);
3711 for (i = 1; i < nsyms; i += 1)
3716 for (j = i - 1; j >= 0; j -= 1)
3721 syms[j + 1] = syms[j];
3739 int *chosen = (
int *) alloca (
sizeof (
int) * nsyms);
3741 int first_choice = (max_results == 1) ? 1 : 2;
3744 if (max_results < 1)
3745 error (
_(
"Request to select 0 symbols!"));
3751 canceled because the command is ambiguous\n\
3752 See set/show multiple-symbol."));
3761 if (max_results > 1)
3766 for (i = 0; i < nsyms; i += 1)
3768 if (syms[i].
sym == NULL)
3799 if (
SYMBOL_LINE (syms[i].sym) != 0 && symtab != NULL)
3805 else if (is_enumeral
3814 else if (symtab != NULL)
3816 ?
_(
"[%d] %s in %s (enumeral)\n")
3817 :
_(
"[%d] %s at %s:?\n"),
3823 ?
_(
"[%d] %s (enumeral)\n")
3824 :
_(
"[%d] %s at ?\n"),
3830 n_chosen =
get_selections (chosen, nsyms, max_results, max_results > 1,
3833 for (i = 0; i < n_chosen; i += 1)
3834 syms[i] = syms[chosen[i]];
3857 int is_all_choice,
char *annotation_suffix)
3862 int first_choice = is_all_choice ? 2 : 1;
3864 prompt = getenv (
"PS2");
3883 if (*args ==
'\0' && n_chosen == 0)
3885 else if (*args ==
'\0')
3888 choice = strtol (args, &args2, 10);
3889 if (args == args2 || choice < 0
3890 || choice > n_choices + first_choice - 1)
3891 error (
_(
"Argument must be choice number"));
3897 if (choice < first_choice)
3899 n_chosen = n_choices;
3900 for (j = 0; j < n_choices; j += 1)
3904 choice -= first_choice;
3906 for (j = n_chosen - 1; j >= 0 && choice < choices[j]; j -= 1)
3910 if (j < 0 || choice != choices[j])
3914 for (k = n_chosen - 1; k > j; k -= 1)
3915 choices[k + 1] = choices[k];
3916 choices[j + 1] = choice;
3921 if (n_chosen > max_results)
3922 error (
_(
"Select no more than %d of the above"), max_results);
3933 int oplen,
struct symbol *sym,
3947 memcpy (newexp->
elts + pc + 7, exp->
elts + pc + oplen,
4060 struct type *type0 =
4062 struct type *type1 =
4081 case BINOP_BITWISE_AND:
4082 case BINOP_BITWISE_IOR:
4083 case BINOP_BITWISE_XOR:
4087 case BINOP_NOTEQUAL:
4102 case UNOP_LOGICAL_NOT:
4144 const char **renamed_entity,
int *
len,
4145 const char **renaming_expr)
4159 renamed_entity, len, renaming_expr);
4190 if (renamed_entity != NULL)
4191 *renamed_entity = info;
4192 suffix = strstr (info,
"___XE");
4193 if (suffix == NULL || suffix == info)
4196 *len = strlen (info) - strlen (suffix);
4198 if (renaming_expr != NULL)
4199 *renaming_expr = suffix;
4209 const char **renamed_entity,
int *
len,
4210 const char **renaming_expr)
4225 name = strstr (name,
"___XR");
4250 if (renamed_entity != NULL)
4251 *renamed_entity = info;
4252 suffix = strstr (info,
"___XE");
4253 if (renaming_expr != NULL)
4254 *renaming_expr = suffix + 5;
4255 if (suffix == NULL || suffix == info)
4258 *len = suffix - info;
4266 static struct value *
4270 const char *sym_name;
4273 struct cleanup *old_chain = NULL;
4291 static struct value *
4319 struct type *formal_target =
4322 struct type *actual_target =
4332 struct value *result;
4398 static struct value *
4462 memset (sym_cache->
root,
'\000', sizeof (sym_cache->
root));
4514 for (e = &sym_cache->
root[h]; *e != NULL; e = &(*e)->
next)
4516 if (domain == (*e)->domain && strcmp (name, (*e)->name) == 0)
4539 *block = (*e)->block;
4576 sym_cache->
root[h] = e;
4577 e->
name = copy = obstack_alloc (&sym_cache->
cache_space, strlen (name) + 1);
4578 strcpy (copy, name);
4595 return (strstr (lookup_name,
"__") == NULL);
4606 struct symbol *sym = NULL;
4624 for (i = 0; i < n; i += 1)
4641 if (type0 == NULL || type1 == NULL
4675 int len0 = strlen (name0);
4680 || (len0 < strlen (name1) && strncmp (name0, name1, len0) == 0
4738 return obstack_object_size (obstackp) /
sizeof (
struct ada_symbol_info);
4749 return obstack_finish (obstackp);
4768 memset (&result, 0,
sizeof (result));
4778 name +=
sizeof (
"standard__") - 1;
4815 return (name != NULL && strcmp (name,
"<variable, no debug info>") == 0);
4846 int len_1 = strlen (name_1);
4847 int len_2 = strlen (name_2);
4894 for (i = 0; i < nsyms; i++)
4899 for (i = 1; i < nsyms; i++)
4904 for (i = 1; i < nsyms; i++)
4912 for (i = 1; i < nsyms; i++)
4949 for (j = 0; j < nsyms; j++)
4967 for (j = 0; j < nsyms; j += 1)
4982 for (j = i + 1; j < nsyms; j += 1)
4983 syms[j - 1] = syms[j];
5022 char *suffix = strstr (name,
"___XR");
5030 for (last = suffix - 3; last >
name; last--)
5031 if (last[0] ==
'_' && last[1] ==
'_')
5036 scope_len = last -
name;
5037 scope = (
char *)
xmalloc ((scope_len + 1) *
sizeof (char));
5039 strncpy (scope, name, scope_len);
5040 scope[scope_len] =
'\0';
5068 if (strstr (name,
"__") != NULL)
5109 int is_invisible = !
startswith (function_name, scope);
5112 return is_invisible;
5155 int nsyms,
const struct block *current_block)
5157 struct symbol *current_function;
5158 const char *current_function_name;
5160 int is_new_style_renaming;
5165 is_new_style_renaming = 0;
5166 for (i = 0; i < nsyms; i += 1)
5176 suffix = strstr (name,
"___XR");
5180 int name_len = suffix -
name;
5183 is_new_style_renaming = 1;
5184 for (j = 0; j < nsyms; j += 1)
5185 if (i != j && syms[j].sym != NULL
5188 && block == syms[j].block)
5192 if (is_new_style_renaming)
5196 for (j = k = 0; j < nsyms; j += 1)
5197 if (syms[j].sym != NULL)
5208 if (current_block == NULL)
5212 if (current_function == NULL)
5216 if (current_function_name == NULL)
5232 for (j = i + 1; j < nsyms; j += 1)
5233 syms[j - 1] = syms[j];
5260 while (block != NULL)
5338 while (*string1 !=
'\0' && *string2 !=
'\0')
5342 if (isspace (*string1) || isspace (*string2))
5347 c1 = tolower (*string1);
5348 c2 = tolower (*string2);
5367 if (*string2 ==
'\0')
5376 if (*string2 ==
'(')
5381 return tolower (*string1) - tolower (*string2);
5383 return *string1 - *string2;
5428 memset (&data, 0,
sizeof data);
5449 char *name1 = alloca (strlen (name) +
sizeof (
"_ada_"));
5450 strcpy (name1,
"_ada_");
5451 strcpy (name1 +
sizeof (
"_ada_") - 1, name);
5489 int syms_from_global_search = 0;
5510 name = name0 +
sizeof (
"standard__") - 1;
5520 domain, wild_match_p);
5528 domain, NULL, wild_match_p);
5545 syms_from_global_search = 1;
5565 if (ndefns == 0 && full_search && syms_from_global_search)
5568 if (ndefns == 1 && full_search && syms_from_global_search)
5569 cache_symbol (name0, domain, (*results)[0].sym, (*results)[0].block);
5600 for (i = 0; i < ndefs; ++i)
5602 if (! (*callback) (results[i].
sym, data))
5619 int nlen = strlen (name);
5621 if (name[0] ==
'<' && name[nlen - 1] ==
'>')
5624 memcpy (canon, name + 1, nlen - 2);
5625 canon[nlen - 2] =
'\0';
5651 if (n_candidates == 0)
5654 *info = candidates[0];
5670 if (is_a_field_of_this != NULL)
5671 *is_a_field_of_this = 0;
5674 block0, domain, &info);
5738 const char *matching;
5739 const int len = strlen (str);
5743 if (len > 3 && str[0] ==
'_' && str[1] ==
'_' && isdigit (str[2]))
5746 while (isdigit (str[0]))
5752 if (str[0] ==
'.' || str[0] ==
'$')
5755 while (isdigit (matching[0]))
5757 if (matching[0] ==
'\0')
5763 if (len > 3 && str[0] ==
'_' && str[1] ==
'_' && str[2] ==
'_')
5766 while (isdigit (matching[0]))
5768 if (matching[0] ==
'\0')
5774 if (strcmp (str,
"TKB") == 0)
5790 if (len == 1 && str [0] ==
'N')
5795 if (len > 3 && str[0] ==
'_' && str [1] ==
'E' && isdigit (str[2]))
5798 while (isdigit (matching[0]))
5800 if ((matching[0] ==
'b' || matching[0] ==
's')
5801 && matching [1] ==
'\0')
5813 while (str[0] !=
'_' && str[0] !=
'\0')
5815 if (str[0] !=
'n' && str[0] !=
'b')
5821 if (str[0] ==
'\000')
5826 if (str[1] !=
'_' || str[2] ==
'\000')
5830 if (strcmp (str + 3,
"JM") == 0)
5837 if (strcmp (str + 3,
"LJM") == 0)
5841 if (str[4] ==
'F' || str[4] ==
'D' || str[4] ==
'B'
5842 || str[4] ==
'U' || str[4] ==
'P')
5844 if (str[4] ==
'R' && str[5] !=
'T')
5848 if (!isdigit (str[2]))
5850 for (k = 3; str[k] !=
'\0'; k += 1)
5851 if (!isdigit (str[k]) && str[k] !=
'_')
5855 if (str[0] ==
'$' && isdigit (str[1]))
5857 for (k = 2; str[k] !=
'\0'; k += 1)
5858 if (!isdigit (str[k]) && str[k] !=
'_')
5871 const char *decoded_name =
ada_decode (name0);
5877 if (decoded_name[0] ==
'<')
5880 for (i=0; decoded_name[i] !=
'\0'; i++)
5881 if (isalpha (decoded_name[i]) && !islower (decoded_name[i]))
5894 const char *
name = *namep;
5904 if ((t1 >=
'a' && t1 <=
'z') || (t1 >=
'0' && t1 <=
'9'))
5907 if (name == name0 + 5 &&
startswith (name0,
"_ada"))
5912 else if (t1 ==
'_' && ((name[2] >=
'a' && name[2] <=
'z')
5913 || name[2] == target0))
5921 else if ((t0 >=
'a' && t0 <=
'z') || (t0 >=
'0' && t0 <=
'9'))
5939 const char *name0 =
name;
5943 const char *match =
name;
5947 for (name += 1, p = patn + 1; *p !=
'\0'; name += 1, p += 1)
5953 if (name[-1] ==
'_')
5967 return !
match_name (sym_name, search_name, 0);
5983 int name_len = strlen (name);
6039 if (!found_sym && arg_sym != NULL)
6088 if (!found_sym && arg_sym != NULL)
6111 const char *text,
int text_len,
6112 int wild_match_p,
int encoded_p)
6114 const int verbatim_match = (text[0] ==
'<');
6126 if (strncmp (sym_name, text, text_len) == 0)
6129 if (match && !encoded_p)
6135 const char *sym_name_copy = sym_name;
6136 int has_angle_bracket;
6139 has_angle_bracket = (sym_name[0] ==
'<');
6140 match = (has_angle_bracket == verbatim_match);
6141 sym_name = sym_name_copy;
6144 if (match && !verbatim_match)
6153 for (tmp = sym_name; *tmp !=
'\0' && !isupper (*tmp); tmp++);
6160 if (!match && wild_match_p)
6167 if (strncmp (sym_name, text, text_len) == 0)
6202 const char *sym_name,
6203 const char *text,
int text_len,
6204 const char *orig_text,
const char *
word,
6205 int wild_match_p,
int encoded_p)
6208 wild_match_p, encoded_p);
6217 if (word == orig_text)
6219 completion =
xmalloc (strlen (match) + 5);
6220 strcpy (completion, match);
6222 else if (word > orig_text)
6225 completion =
xmalloc (strlen (match) + 5);
6226 strcpy (completion, match + (word - orig_text));
6231 completion =
xmalloc (strlen (match) + (orig_text - word) + 5);
6232 strncpy (completion, word, orig_text - word);
6233 completion[orig_text -
word] =
'\0';
6234 strcat (completion, match);
6261 data->wild_match, data->encoded) != NULL;
6268 ada_make_symbol_completion_list (
const char *text0,
const char *
word,
6280 const struct block *b, *surrounding_static_block = 0;
6287 if (text0[0] ==
'<')
6289 text = xstrdup (text0);
6291 text_len = strlen (text);
6299 text_len = strlen (text);
6300 for (i = 0; i < text_len; i++)
6301 text[i] = tolower (text[i]);
6303 encoded_p = (strstr (text0,
"__") != NULL);
6308 wild_match_p = (strchr (text0,
'.') == NULL && !encoded_p);
6315 data.completions = &completions;
6317 data.text_len = text_len;
6320 data.wild_match = wild_match_p;
6321 data.encoded = encoded_p;
6335 text, text_len, text0, word, wild_match_p,
6345 surrounding_static_block = b;
6350 text, text_len, text0, word,
6351 wild_match_p, encoded_p);
6365 text, text_len, text0, word,
6366 wild_match_p, encoded_p);
6375 if (b == surrounding_static_block)
6380 text, text_len, text0, word,
6381 wild_match_p, encoded_p);
6406 return (strcmp (name,
"ada__tags__dispatch_table") == 0);
6419 return (strcmp (name,
"ada__tags__interface_tag") == 0);
6448 if (name[0] ==
'_' && !
startswith (name,
"_parent"))
6485 return (name != NULL
6486 && strcmp (name,
"ada__tags__dispatch_table") == 0);
6519 static struct value *
6524 int tag_byte_offset;
6525 struct type *tag_type;
6530 const gdb_byte *valaddr1 = ((valaddr == NULL)
6532 : valaddr + tag_byte_offset);
6533 CORE_ADDR address1 = (address == 0) ? 0 : address + tag_byte_offset;
6540 static struct type *
6545 if (type_name != NULL)
6561 struct type *ptr_type, *obj_type;
6606 if (offset_to_top == 0)
6613 if (offset_to_top == -1)
6636 static struct type *
6651 static struct value *
6690 static char name[1024];
6698 for (p = name; *p !=
'\0'; p += 1)
6781 return (name != NULL
6797 return (name != NULL
6799 || strcmp (name,
"REP") == 0
6801 || name[0] ==
'S' || name[0] ==
'R' || name[0] ==
'O'));
6841 return (name != NULL && name[0] ==
'O');
6851 static char *result = NULL;
6852 static size_t result_len = 0;
6855 const char *discrim_end;
6856 const char *discrim_start;
6865 if (name == NULL || name[0] ==
'\000')
6868 for (discrim_end = name + strlen (name) - 6; discrim_end !=
name;
6874 if (discrim_end == name)
6877 for (discrim_start = discrim_end; discrim_start != name + 3;
6880 if (discrim_start == name + 1)
6882 if ((discrim_start > name + 3
6884 || discrim_start[-1] ==
'.')
6888 GROW_VECT (result, result_len, discrim_end - discrim_start + 1);
6889 strncpy (result, discrim_start, discrim_end - discrim_start);
6890 result[discrim_end - discrim_start] =
'\0';
6907 if (!isdigit (str[k]))
6914 while (isdigit (str[k]))
6916 RU = RU * 10 + (str[k] -
'0');
6923 *R = (-(
LONGEST) (RU - 1)) - 1;
6974 if (val >= L && val <= U)
6993 static struct value *
6995 struct type *arg_type)
7010 offset + bit_pos / 8,
7011 bit_pos % 8, bit_size, type);
7034 struct type **field_type_p,
7035 int *byte_offset_p,
int *bit_offset_p,
int *bit_size_p,
7042 if (field_type_p != NULL)
7043 *field_type_p = NULL;
7044 if (byte_offset_p != NULL)
7046 if (bit_offset_p != NULL)
7048 if (bit_size_p != NULL)
7054 int fld_offset = offset + bit_pos / 8;
7057 if (t_field_name == NULL)
7064 if (field_type_p != NULL)
7066 if (byte_offset_p != NULL)
7067 *byte_offset_p = fld_offset;
7068 if (bit_offset_p != NULL)
7069 *bit_offset_p = bit_pos % 8;
7070 if (bit_size_p != NULL)
7071 *bit_size_p = bit_size;
7077 field_type_p, byte_offset_p, bit_offset_p,
7078 bit_size_p, index_p))
7086 struct type *field_type
7094 field_type_p, byte_offset_p,
7095 bit_offset_p, bit_size_p, index_p))
7099 else if (index_p != NULL)
7123 static struct value *
7134 if (t_field_name == NULL)
7176 int,
struct type *);
7184 static struct value *
7196 static struct value *
7222 error (
_(
"Cannot assign this kind of variant record"));
7224 else if (*index_p == 0)
7247 struct type *t, *t1;
7287 int bit_offset, bit_size, byte_offset;
7288 struct type *field_type;
7298 &field_type, &byte_offset, &bit_offset,
7308 bit_offset, bit_size,
7316 if (v != NULL || no_err)
7319 error (
_(
"There is no member named %s."), name);
7325 error (
_(
"Attempt to extract a component of "
7326 "a value that is not a record."));
7346 static struct type *
7348 int noerr,
int *dispp)
7355 if (refok && type != NULL)
7376 error (
_(
"Type (null) is not a structure or union type"));
7382 error (
_(
" is not a structure or union type"));
7395 if (t_field_name == NULL)
7424 for (j = TYPE_NFIELDS (field_type) - 1; j >= 0; j -= 1)
7432 if (v_field_name != NULL
7461 error (
_(
" has no component named <null>"));
7468 error (
_(
" has no component named %s"), name);
7502 struct value *outer;
7503 struct value *discrim;
7512 if (discrim == NULL)
7525 return others_clause;
7583 static struct value *
7588 struct value *val = val0;
7607 return (off + alignment - 1) & ~(alignment - 1);
7625 len = strlen (name);
7627 if (!isdigit (name[len - 1]))
7630 if (isdigit (name[len - 2]))
7631 align_offset = len - 2;
7633 align_offset = len - 1;
7635 if (align_offset < 7 || !
startswith (name + align_offset - 6,
"___XV"))
7660 static struct type *
7683 if (strstr (name,
"___XR") != NULL)
7705 if (function_sym != NULL)
7718 const int rename_len = function_name_len + 2
7719 + strlen (name) + 6 ;
7730 if (function_name_len > 5
7731 && strstr (function_name,
"_ada_") == function_name)
7734 function_name_len -= 5;
7737 rename = (
char *) alloca (rename_len *
sizeof (
char));
7738 strncpy (rename, function_name, function_name_len);
7739 xsnprintf (rename + function_name_len, rename_len - function_name_len,
7744 const int rename_len = strlen (name) + 6;
7746 rename = (
char *) alloca (rename_len *
sizeof (
char));
7747 xsnprintf (rename, rename_len *
sizeof (
char),
"%s___XR", name);
7763 else if (type0 == NULL)
7781 if (type0_name != NULL && strstr (type0_name,
"___XR") != NULL
7782 && (type1_name == NULL || strstr (type1_name,
"___XR") == NULL))
7805 static struct type *
7808 struct type *result, *tmp;
7810 if (ada_ignore_descriptive_types_p)
7819 while (result != NULL)
7823 if (result_name == NULL)
7825 warning (
_(
"unexpected null name on descriptive type"));
7830 if (strcmp (result_name, name) == 0)
7866 static struct type *
7869 struct type *result = NULL;
7889 if (type_name == NULL)
7892 len = strlen (type_name);
7894 name = (
char *) alloca (len + strlen (suffix) + 1);
7896 strcpy (name, type_name);
7897 strcpy (name + len, suffix);
7905 static struct type *
7917 if (len > 6 && strcmp (
ada_type_name (type) + len - 6,
"___XVE") == 0)
7934 && strstr (name,
"___XVL") != NULL;
7958 static struct type *
7994 int keep_dynamic_fields)
7999 int nfields, bit_len;
8008 if (keep_dynamic_fields)
8034 for (f = 0; f < nfields; f += 1)
8048 const gdb_byte *field_valaddr = valaddr;
8050 struct type *field_type =
8100 field_address, dval, 0);
8153 if (off + fld_bit_len > bit_len)
8154 bit_len = off + fld_bit_len;
8164 if (variant_field >= 0)
8166 struct type *branch_type;
8187 if (branch_type == NULL)
8189 for (f = variant_field + 1; f <
TYPE_NFIELDS (rtype); f += 1)
8200 if (off + fld_bit_len > bit_len)
8201 bit_len = off + fld_bit_len;
8216 warning (
_(
"Invalid type size for `%s' detected: %d."),
8219 warning (
_(
"Invalid type size for <unnamed> detected: %d."),
8230 error (
_(
"record type with dynamic size is larger than varsize-limit"));
8237 static struct type *
8254 static struct type *
8277 for (f = 0; f < nfields; f += 1)
8290 if (new_type != field_type)
8302 sizeof (
struct field) * nfields);
8323 static struct type *
8330 struct type *branch_type;
8334 if (variant_field == -1)
8352 sizeof (
struct field) * nfields);
8366 if (branch_type == NULL)
8370 for (f = variant_field + 1; f < nfields; f += 1)
8405 static struct type *
8409 struct type *templ_type;
8416 if (templ_type != NULL)
8420 if (dval == NULL && valaddr == NULL && address == 0)
8441 static struct type *
8446 struct type *templ_type;
8447 struct type *var_type;
8452 var_type = var_type0;
8456 if (templ_type != NULL)
8457 var_type = templ_type;
8470 valaddr, address, dval);
8485 struct type *encoding_type)
8487 struct type *fixed_range_type;
8511 bounds_str = strstr (
TYPE_NAME (encoding_type),
"___XDLU_");
8512 if (bounds_str == NULL)
8536 struct type *desc_type)
8560 static struct type *
8564 struct type *index_type_desc;
8565 struct type *result;
8566 int constrained_packed_array_p;
8567 static const char *xa_suffix =
"___XA";
8574 if (constrained_packed_array_p)
8583 if (index_type_desc == NULL)
8587 if (type_name != NULL)
8589 const int len = strlen (type_name);
8590 char *
name = (
char *) alloca (len + strlen (xa_suffix));
8592 if (type_name[len - 1] ==
'P')
8594 strcpy (name, type_name);
8595 strcpy (name + len - 1, xa_suffix);
8602 if (index_type_desc != NULL
8610 index_type_desc = NULL;
8613 if (index_type_desc == NULL)
8633 if (elt_type0 == elt_type && !constrained_packed_array_p)
8642 struct type *elt_type0;
8645 for (i =
TYPE_NFIELDS (index_type_desc); i > 0; i -= 1)
8663 for (i =
TYPE_NFIELDS (index_type_desc) - 1; i >= 0; i -= 1)
8665 struct type *range_type =
8669 result, range_type);
8672 if (!ignore_too_big &&
TYPE_LENGTH (result) > varsize_limit)
8673 error (
_(
"array type with dynamic size is larger than varsize-limit"));
8681 if (constrained_packed_array_p)
8713 static struct type *
8725 struct type *fixed_record_type =
8748 if (real_type != NULL)
8759 char *xvz_name = alloca (strlen (name) + 7 );
8763 xsnprintf (xvz_name, strlen (name) + 7,
"%s___XVZ", name);
8765 if (xvz_found &&
TYPE_LENGTH (fixed_record_type) != size)
8767 fixed_record_type =
copy_type (fixed_record_type);
8793 return fixed_record_type;
8830 struct type *fixed_type =
8861 static struct type *
8895 static struct type *
8910 if (raw_real_type == type)
8976 static struct value *
8982 if (type == type0 && val0 != NULL)
9008 static const char *attribute_names[] = {
9028 if (n >= OP_ATR_FIRST && n <= (
int) OP_ATR_VAL)
9029 return attribute_names[n - OP_ATR_FIRST + 1];
9031 return attribute_names[0];
9044 error (
_(
"'POS only defined on discrete types"));
9047 error (
_(
"enumeration value is invalid: can't find 'POS"));
9052 static struct value *
9060 static struct value *
9064 error (
_(
"'VAL only defined on discrete types"));
9066 error (
_(
"'VAL requires integral argument"));
9073 error (
_(
"argument to 'VAL out of range"));
9100 return (name != NULL
9103 && (strcmp (name,
"character") == 0
9104 || strcmp (name,
"wide_character") == 0
9105 || strcmp (name,
"wide_wide_character") == 0
9106 || strcmp (name,
"unsigned char") == 0));
9138 static int trust_pad_over_xvs = 1;
9163 struct type *real_type_namer;
9164 struct type *raw_real_type;
9185 if (real_type_namer == NULL
9196 if (raw_real_type == NULL)
9199 return raw_real_type;
9240 static char *result;
9241 static size_t result_len = 0;
9253 tmp = strrchr (name,
'.');
9258 while ((tmp = strstr (name,
"__")) != NULL)
9260 if (isdigit (tmp[2]))
9271 if (name[1] ==
'U' || name[1] ==
'W')
9273 if (sscanf (name + 2,
"%x", &v) != 1)
9280 if (isascii (v) && isprint (v))
9281 xsnprintf (result, result_len,
"'%c'", v);
9282 else if (name[1] ==
'U')
9283 xsnprintf (result, result_len,
"[\"%02x\"]", v);
9285 xsnprintf (result, result_len,
"[\"%04x\"]", v);
9291 tmp = strstr (name,
"__");
9293 tmp = strstr (name,
"$");
9296 GROW_VECT (result, result_len, tmp - name + 1);
9297 strncpy (result, name, tmp - name);
9298 result[tmp -
name] =
'\0';
9310 static struct value *
9319 static struct value *
9336 struct type *raw_real_type =
9341 if ((type == raw_real_type)
9353 static struct value *
9374 static struct value *
9395 error (
_(
"unable to determine array bounds"));
9405 return (hi1 - lo1 == hi2 - lo2);
9414 static struct value *
9433 error (
_(
"unable to determine array bounds"));
9438 for (i = 0; i < hi - lo + 1; i++)
9452 static struct value *
9474 error (
_(
"cannot assign arrays of different length"));
9488 error (
_(
"Incompatible types in assignment"));
9494 static struct value *
9498 struct type *type1, *type2;
9533 v += v > 0 ? -1 : 1;
9567 error (
_(
"Attempt to compare array with non-array"));
9591 for (i = 0; i <
m; i += 1)
9651 static struct value *
9656 struct type *lhs_type;
9658 LONGEST low_index, high_index;
9661 int max_indices, num_indices;
9667 for (i = 0; i < n; i += 1)
9677 error (
_(
"Left operand of assignment is not a modifiable lvalue."));
9693 error (
_(
"Left-hand side must be array or record."));
9696 max_indices = 4 * num_specs + 4;
9697 indices = alloca (max_indices *
sizeof (indices[0]));
9698 indices[0] = indices[1] = low_index - 1;
9699 indices[2] = indices[3] = high_index + 1;
9702 for (i = 0; i < n; i += 1)
9708 &num_indices, max_indices,
9709 low_index, high_index);
9713 &num_indices, max_indices,
9714 low_index, high_index);
9718 error (
_(
"Misplaced 'others' clause"));
9720 num_indices, low_index, high_index);
9723 error (
_(
"Internal error: bad aggregate clause"));
9739 int *pos,
LONGEST *indices,
int *num_indices,
9744 if (ind - 1 == high)
9745 warning (
_(
"Extra components in aggregate ignored."));
9764 int *pos,
LONGEST *indices,
int *num_indices,
9769 int choice_pos, expr_pc;
9772 choice_pos = *pos += 3;
9774 for (j = 0; j < n_choices; j += 1)
9779 for (j = 0; j < n_choices; j += 1)
9784 if (op == OP_DISCRETE_RANGE)
9812 error (
_(
"Invalid record component association."));
9817 NULL, NULL, NULL, NULL, &ind))
9818 error (
_(
"Unknown component name: %s."), name);
9819 lower = upper = ind;
9822 if (lower <= upper && (lower < low || upper > high))
9823 error (
_(
"Index in component association out of bounds."));
9827 while (lower <= upper)
9846 int *pos,
LONGEST *indices,
int num_indices,
9850 int expr_pc = *pos + 1;
9852 for (i = 0; i < num_indices - 2; i += 2)
9856 for (ind = indices[i + 1] + 1; ind < indices[i + 2]; ind += 1)
9877 for (i = 0; i < *
size; i += 2) {
9878 if (high >= indices[i] && low <= indices[i + 1])
9882 for (kh = i + 2; kh < *
size; kh += 2)
9883 if (high < indices[kh])
9885 if (low < indices[i])
9887 indices[i + 1] = indices[kh - 1];
9888 if (high > indices[i + 1])
9889 indices[i + 1] = high;
9890 memcpy (indices + i + 2, indices + kh, *size - kh);
9891 *size -= kh - i - 2;
9894 else if (high < indices[i])
9898 if (*size == max_size)
9899 error (
_(
"Internal error: miscounted aggregate components."));
9901 for (j = *size-1; j >= i+2; j -= 1)
9902 indices[j] = indices[j - 2];
9904 indices[i + 1] = high;
9910 static struct value *
10182 static struct value *
10190 struct value *arg1 = NULL, *arg2 = NULL, *arg3;
10193 struct value **argvec;
10216 if ((op == OP_DOUBLE || op == OP_LONG) && expect_type != NULL)
10223 struct value *result;
10271 (
_(
"Fixed-point values must be assigned to fixed-point variables"));
10292 error (
_(
"Operands of fixed-point addition must have the same type"));
10318 error (
_(
"Operands of fixed-point subtraction "
10319 "must have the same type"));
10354 case BINOP_NOTEQUAL:
10366 if (op == BINOP_NOTEQUAL)
10383 case BINOP_LOGICAL_AND:
10384 case BINOP_LOGICAL_OR:
10385 case UNOP_LOGICAL_NOT:
10395 case BINOP_BITWISE_AND:
10396 case BINOP_BITWISE_IOR:
10397 case BINOP_BITWISE_XOR:
10421 error (
_(
"Unexpected unresolved symbol, %s, during evaluation"),
10457 struct type *actual_type;
10460 if (actual_type == NULL)
10466 actual_type =
type;
10508 (
struct value **) alloca (
sizeof (
struct value *) * (nargs + 2));
10512 error (
_(
"Unexpected unresolved symbol, %s, during evaluation"),
10516 for (tem = 0; tem <= nargs; tem += 1)
10561 error (
_(
"cannot subscript or call something of type `%s'"),
10588 argvec[0], nargs, argvec + 1);
10597 error (
_(
"cannot subscript or call a record"));
10598 if (arity != nargs)
10599 error (
_(
"wrong number of subscripts; expecting %d"), arity);
10604 (argvec[0], nargs, argvec + 1));
10611 error (
_(
"element type of array unknown"));
10618 nargs, argvec + 1));
10625 error (
_(
"element type of array unknown"));
10631 nargs, argvec + 1));
10634 error (
_(
"Attempt to index or call something other than an "
10635 "array or function"));
10641 struct value *low_bound_val =
10643 struct value *high_bound_val =
10649 high_bound_val =
coerce_ref (high_bound_val);
10664 error (
_(
"cannot slice a packed array"));
10692 error (
_(
"cannot take slice of non-array"));
10703 struct type *arr_type0 =
10713 else if (high_bound < low_bound)
10720 case UNOP_IN_RANGE:
10731 lim_warning (
_(
"Membership test incompletely implemented; "
10732 "always returns true"));
10750 case BINOP_IN_BOUNDS:
10783 case TERNOP_IN_RANGE:
10803 case OP_ATR_LENGTH:
10805 struct type *type_arg;
10827 if (type_arg == NULL)
10834 if (op == OP_ATR_LENGTH)
10850 error (
_(
"unexpected attribute encountered"));
10857 case OP_ATR_LENGTH:
10864 struct type *range_type;
10870 if (range_type == NULL)
10871 range_type = type_arg;
10875 error (
_(
"unexpected attribute encountered"));
10882 case OP_ATR_LENGTH:
10883 error (
_(
"the 'length attribute applies only to array types"));
10887 error (
_(
"unimplemented type attribute"));
10895 if (op == OP_ATR_LENGTH)
10910 error (
_(
"unexpected attribute encountered"));
10917 case OP_ATR_LENGTH:
10948 op == OP_ATR_MIN ? BINOP_MIN : BINOP_MAX);
10951 case OP_ATR_MODULUS:
10960 error (
_(
"'modulus must be applied to modular type"));
11044 preeval_pos = *pos;
11056 if (arrType == NULL)
11057 error (
_(
"Attempt to dereference null array pointer."));
11090 if (expect_type == NULL)
11101 error (
_(
"Attempt to take contents of a non-pointer value."));
11111 if (expect_type != NULL)
11125 case STRUCTOP_STRUCT:
11128 preeval_pos = *pos;
11178 error (
_(
"Attempt to use a type name as an expression"));
11183 case OP_DISCRETE_RANGE:
11184 case OP_POSITIONAL:
11190 error (
_(
"Undefined name, ambiguous name, or renaming used in "
11191 "component association: %s."), &exp->
elts[pc+2].
string);
11193 error (
_(
"Aggregates only allowed on the right of an assignment"));
11196 _(
"aggregate apparently mangled"));
11201 for (tem = 0; tem < nargs; tem += 1)
11217 static const char *
11225 const char *tail = strstr (name,
"___XF_");
11252 && strcmp (
TYPE_NAME (type),
"system__address") == 0);
11288 n = sscanf (encoding,
11291 &num0, &den0, &num1, &den1);
11296 return num1 / den1;
11298 return num0 / den0;
11334 static char *bound_buffer = NULL;
11335 static size_t bound_buffer_len = 0;
11338 struct value *bound_val;
11340 if (dval == NULL || str == NULL || str[k] ==
'\0')
11343 pend = strstr (str + k,
"__");
11347 k += strlen (bound);
11351 GROW_VECT (bound_buffer, bound_buffer_len, pend - (str + k) + 1);
11352 bound = bound_buffer;
11353 strncpy (bound_buffer, str + k, pend - (str + k));
11354 bound[pend - (str + k)] =
'\0';
11359 if (bound_val == NULL)
11363 if (pnew_k != NULL)
11372 static struct value *
11383 if (err_msg == NULL)
11386 error ((
"%s"), err_msg);
11425 static struct type *
11429 struct type *base_type;
11430 char *subtype_info;
11438 base_type = raw_type;
11441 subtype_info = strstr (name,
"___XD");
11442 if (subtype_info == NULL)
11447 if (L < INT_MIN || U >
INT_MAX)
11455 static char *name_buf = NULL;
11456 static size_t name_len = 0;
11457 int prefix_len = subtype_info -
name;
11463 GROW_VECT (name_buf, name_len, prefix_len + 5);
11464 strncpy (name_buf, name, prefix_len);
11465 name_buf[prefix_len] =
'\0';
11468 bounds_str = strchr (subtype_info,
'_');
11471 if (*subtype_info ==
'L')
11476 if (bounds_str[n] ==
'_')
11478 else if (bounds_str[n] ==
'.')
11486 strcpy (name_buf + prefix_len,
"___L");
11495 if (*subtype_info ==
'U')
11505 strcpy (name_buf + prefix_len,
"___U");
11509 lim_warning (
_(
"Unknown upper bound, using %ld."), (
long) L);
11526 return (name != NULL && strstr (name,
"___XD"));
11593 static char *standard_exc[] = {
11594 "constraint_error",
11635 "__gnat_debug_raise_exception",
11636 "__gnat_unhandled_exception",
11637 "__gnat_debug_raise_assert_failure",
11647 "__gnat_raise_nodefer_with_msg",
11648 "__gnat_unhandled_exception",
11649 "system__assertions__raise_assert_failure",
11690 error (
_(
"Your Ada runtime appears to be missing some debugging "
11691 "information.\nCannot insert Ada exception catchpoint "
11692 "in this configuration."));
11700 error (
_(
"Symbol \"%s\" is not a function (class = %d)"),
11742 error (
_(
"Unable to insert catchpoint. Is this an Ada main program?"));
11750 error (
_(
"Unable to insert catchpoint. Try to start the program first."));
11759 error (
_(
"Cannot insert Ada exception catchpoints in this configuration."));
11774 const char *fullname;
11790 if (access (fullname, R_OK) != 0)
11798 for (i = 0; known_runtime_file_name_patterns[i] != NULL; i += 1)
11800 re_comp (known_runtime_file_name_patterns[i]);
11811 if (func_name == NULL)
11814 for (i = 0; known_auxiliary_function_name_patterns[i] != NULL; i += 1)
11816 re_comp (known_auxiliary_function_name_patterns[i]);
11817 if (re_exec (func_name))
11875 for (frame_level = 0; frame_level < 3; frame_level += 1)
11886 if (func_name != NULL)
11890 if (strcmp (func_name,
11932 internal_error (__FILE__, __LINE__,
_(
"unexpected catchpoint type"));
11957 warning (
_(
"failed to get exception name: %s"), e.message);
12052 for (bl = c->
base.
loc; bl != NULL; bl = bl->
next)
12070 warning (
_(
"failed to reevaluate internal exception condition "
12071 "for catchpoint %d: %s"),
12151 if (ada_loc->excep_cond_expr == NULL)
12161 struct value *mark;
12170 _(
"Error in testing exception condition:\n"));
12206 :
"\nCatchpoint ");
12216 char exception_name[256];
12221 sizeof (exception_name) - 1);
12222 exception_name [
sizeof (exception_name) - 1] =
'\0';
12232 memcpy (exception_name,
"exception",
sizeof (
"exception"));
12278 *last_loc = b->
loc;
12303 internal_error (__FILE__, __LINE__,
_(
"unexpected catchpoint type"));
12319 :
_(
"Catchpoint "));
12347 internal_error (__FILE__, __LINE__,
_(
"unexpected catchpoint type"));
12378 internal_error (__FILE__, __LINE__,
_(
"unexpected catchpoint type"));
12550 char *args = *argsp;
12555 if (args[0] ==
'\0')
12568 result =
xmalloc (end - args + 1);
12569 strncpy (result, args, end - args);
12570 result[end - args] =
'\0';
12586 char **excep_string,
12587 char **cond_string)
12590 char *exception_name;
12594 if (exception_name != NULL && strcmp (exception_name,
"if") == 0)
12599 xfree (exception_name);
12600 exception_name = NULL;
12609 && (isspace (args[2]) || args[2] ==
'\0'))
12614 if (args[0] ==
'\0')
12615 error (
_(
"Condition missing after `if' keyword"));
12616 cond = xstrdup (args);
12619 args += strlen (args);
12625 if (args[0] !=
'\0')
12626 error (
_(
"Junk at end of expression"));
12630 if (exception_name == NULL)
12634 *excep_string = NULL;
12636 else if (strcmp (exception_name,
"unhandled") == 0)
12640 *excep_string = NULL;
12646 *excep_string = exception_name;
12648 *cond_string = cond;
12654 static const char *
12674 _(
"unexpected catchpoint kind (%d)"), ex);
12697 _(
"unexpected catchpoint kind (%d)"), ex);
12733 for (i = 0; i <
sizeof (
standard_exc) /
sizeof (
char *); i++)
12735 if (strcmp (standard_exc [i], excep_string) == 0)
12737 return xstrprintf (
"long_integer (e) = long_integer (&standard.%s)",
12741 return xstrprintf (
"long_integer (e) = long_integer (&%s)", excep_string);
12758 const char *sym_name;
12779 *addr_string = xstrdup (sym_name);
12809 char *excep_string,
12816 char *addr_string = NULL;
12823 ops, tempflag, disabled, from_tty);
12826 if (cond_string != NULL)
12840 char *excep_string = NULL;
12841 char *cond_string = NULL;
12850 excep_string, cond_string,
12870 && (isspace (args[2]) || args[2] ==
'\0'))
12874 if (args[0] ==
'\0')
12875 error (
_(
"condition missing after `if' keyword"));
12876 *cond_string = xstrdup (args);
12881 else if (args[0] !=
'\0')
12882 error (
_(
"Junk at end of arguments."));
12893 char *cond_string = NULL;
12917 && type_name != NULL && strcmp (type_name,
"exception") == 0);
12932 for (i = 0; i < ARRAY_SIZE (standard_exc); i++)
12958 result = strcmp (exc_a->
name, exc_b->
name);
12988 for (i = 1, j = 1; i < to_sort_len; i++)
12990 to_sort[j++] = to_sort[i];
13008 regex_t *preg = user_data;
13016 return (regexec (preg,
ada_decode (search_name), 0, NULL, 0) == 0);
13034 for (i = 0; i < ARRAY_SIZE (standard_exc); i++)
13037 || regexec (preg, standard_exc[i], 0, NULL, 0) == 0)
13042 if (msymbol.
minsym != NULL)
13159 ada_exceptions_list_1 (regex_t *preg)
13210 ada_exceptions_list (
const char *regexp)
13213 struct cleanup *old_chain = NULL;
13216 if (regexp != NULL)
13218 _(
"invalid regular expression"));
13220 result = ada_exceptions_list_1 (regexp != NULL ? ® : NULL);
13222 if (old_chain != NULL)
13238 exceptions = ada_exceptions_list (regexp);
13241 if (regexp != NULL)
13243 (
_(
"All Ada exceptions matching regular expression \"%s\":\n"), regexp);
13258 #define ADA_OPERATORS \
13259 OP_DEFN (OP_VAR_VALUE, 4, 0, 0) \
13260 OP_DEFN (BINOP_IN_BOUNDS, 3, 2, 0) \
13261 OP_DEFN (TERNOP_IN_RANGE, 1, 3, 0) \
13262 OP_DEFN (OP_ATR_FIRST, 1, 2, 0) \
13263 OP_DEFN (OP_ATR_LAST, 1, 2, 0) \
13264 OP_DEFN (OP_ATR_LENGTH, 1, 2, 0) \
13265 OP_DEFN (OP_ATR_IMAGE, 1, 2, 0) \
13266 OP_DEFN (OP_ATR_MAX, 1, 3, 0) \
13267 OP_DEFN (OP_ATR_MIN, 1, 3, 0) \
13268 OP_DEFN (OP_ATR_MODULUS, 1, 1, 0) \
13269 OP_DEFN (OP_ATR_POS, 1, 2, 0) \
13270 OP_DEFN (OP_ATR_SIZE, 1, 1, 0) \
13271 OP_DEFN (OP_ATR_TAG, 1, 1, 0) \
13272 OP_DEFN (OP_ATR_VAL, 1, 2, 0) \
13273 OP_DEFN (UNOP_QUAL, 3, 1, 0) \
13274 OP_DEFN (UNOP_IN_RANGE, 3, 1, 0) \
13275 OP_DEFN (OP_OTHERS, 1, 1, 0) \
13276 OP_DEFN (OP_POSITIONAL, 3, 1, 0) \
13277 OP_DEFN (OP_DISCRETE_RANGE, 1, 2, 0)
13289 #define OP_DEFN(op, len, args, binop) \
13290 case op: *oplenp = len; *argsp = args; break;
13316 switch (elts[pos].opcode)
13318 case UNOP_IN_RANGE:
13320 type = elts[pos + 1].
type;
13344 #define OP_DEFN(op, len, args, binop) case op: return #op;
13349 return "OP_AGGREGATE";
13351 return "OP_CHOICES";
13363 int *oplenp,
int *argsp)
13368 *oplenp = *argsp = 0;
13371 #define OP_DEFN(op, len, args, binop) \
13372 case op: *oplenp = len; *argsp = args; break;
13413 case OP_ATR_LENGTH:
13417 case OP_ATR_MODULUS:
13424 case UNOP_IN_RANGE:
13433 case BINOP_IN_BOUNDS:
13437 case TERNOP_IN_RANGE:
13442 case OP_DISCRETE_RANGE:
13443 case OP_POSITIONAL:
13462 for (i = 0; i < nargs; i += 1)
13474 int oplen, nargs, i;
13492 case BINOP_IN_BOUNDS:
13503 case TERNOP_IN_RANGE:
13518 case OP_ATR_LENGTH:
13522 case OP_ATR_MODULUS:
13541 for (tem = 1; tem < nargs; tem += 1)
13557 case UNOP_IN_RANGE:
13565 case OP_DISCRETE_RANGE:
13577 for (i = 0; i < nargs-1; i += 1)
13587 case OP_POSITIONAL:
13593 for (i = 0; i < nargs; i += 1)
13673 0,
"long_integer");
13676 0,
"short_integer");
13685 "long_float", NULL);
13688 0,
"long_long_integer");
13691 "long_long_float", NULL);
13704 =
"system__address";
13723 warnings_issued = 0;
13750 static struct value *
13753 const struct block *frame_block = NULL;
13754 struct symbol *renaming_sym = NULL;
13762 if (renaming_sym != NULL)
13802 ada_make_symbol_completion_list,
13828 "\"set ada\" must be followed by the name of a setting.\n"));
13905 _(
"Prefix command for changing Ada-specfic settings"),
13906 &set_ada_list,
"set ada ", 0, &
setlist);
13909 _(
"Generic command for showing Ada-specific settings."),
13910 &show_ada_list,
"show ada ", 0, &
showlist);
13913 &trust_pad_over_xvs,
_(
"\
13914 Enable or disable an optimization trusting PAD types over XVS types"),
_(
"\
13915 Show whether an optimization trusting PAD types over XVS types is activated"),
13917 This is related to the encoding used by the GNAT compiler. The debugger\n\
13918 should normally trust the contents of PAD types, but certain older versions\n\
13919 of GNAT have a bug that sometimes causes the information in the PAD type\n\
13920 to be incorrect. Turning this setting \"off\" allows the debugger to\n\
13921 work around this bug. It is always safe to turn this option \"off\", but\n\
13922 this incurs a slight performance penalty, so it is recommended to NOT change\n\
13923 this option to \"off\" unless necessary."),
13924 NULL, NULL, &set_ada_list, &show_ada_list);
13927 Catch Ada exceptions, when raised.\n\
13928 With an argument, catch only exceptions with the given name."),
13934 Catch failed Ada assertions, when raised.\n\
13935 With an argument, catch only exceptions with the given name."),
13941 varsize_limit = 65536;
13945 List all Ada exception names.\n\
13946 If a regular expression is passed as an argument, only those matching\n\
13947 the regular expression are listed."));
13950 _(
"Set Ada maintenance-related variables."),
13951 &maint_set_ada_cmdlist,
"maintenance set ada ",
13955 _(
"Show Ada maintenance-related variables"),
13956 &maint_show_ada_cmdlist,
"maintenance show ada ",
13961 &ada_ignore_descriptive_types_p,
13962 _(
"Set whether descriptive types generated by GNAT should be ignored."),
13963 _(
"Show whether descriptive types generated by GNAT should be ignored."),
13965 When enabled, the debugger will stop using the DW_AT_GNAT_descriptive_type\n\
13966 DWARF attribute."),
13967 NULL, NULL, &maint_set_ada_cmdlist, &maint_show_ada_cmdlist);
13971 decoded_names_store = htab_create_alloc
13972 (256, htab_hash_string, (
int (*)(
const void *,
const void *))
streq,
13983 ada_pspace_data_handle
void ada_emit_char(int, struct type *, struct ui_file *, int, int)
static int ada_is_redundant_range_encoding(struct type *range_type, struct type *encoding_type)
void error_no_arg(const char *why)
struct gdbarch * target_gdbarch(void)
void set_value_bitpos(struct value *value, int bit)
static int is_valid_name_for_wild_match(const char *name0)
static struct symbol * ada_lookup_symbol_nonlocal(const struct language_defn *langdef, const char *name, const struct block *block, const domain_enum domain)
struct value * value_zero(struct type *type, enum lval_type lv)
static void replace_operator_with_call(struct expression **, int, int, int, struct symbol *, const struct block *)
void target_terminal_ours(void)
static struct type * template_to_fixed_record_type(struct type *type, const gdb_byte *valaddr, CORE_ADDR address, struct value *dval0)
static void ada_remove_trailing_digits(const char *encoded, int *len)
CORE_ADDR( ada_unhandled_exception_name_addr_ftype)(void)
union exp_element elts[1]
ULONGEST extract_unsigned_integer(const gdb_byte *, int, enum bfd_endian)
int ada_is_character_type(struct type *type)
struct value * value_mark(void)
static int desc_bound_bitpos(struct type *, int, int)
static int should_stop_exception(const struct bp_location *bl)
struct cmd_list_element * add_prefix_cmd(const char *name, enum command_class theclass, cmd_cfunc_ftype *fun, const char *doc, struct cmd_list_element **prefixlist, const char *prefixname, int allow_unknown, struct cmd_list_element **list)
static int ada_lookup_symbol_list_worker(const char *name0, const struct block *block0, domain_enum domain, struct ada_symbol_info **results, int full_search)
const char * symtab_to_filename_for_display(struct symtab *symtab)
struct value * ada_get_decoded_value(struct value *value)
void(* print_recreate)(struct breakpoint *, struct ui_file *fp)
static void ada_add_exceptions_from_frame(regex_t *preg, struct frame_info *frame, VEC(ada_exc_info)**exceptions)
static void print_mention_catch_exception_unhandled(struct breakpoint *b)
static void create_excep_cond_exprs(struct ada_catchpoint *c)
static void ada_operator_length(const struct expression *exp, int pc, int *oplenp, int *argsp)
LONGEST get_int_var_value(char *name, int *flag)
struct value * call_function_by_hand(struct value *function, int nargs, struct value **args)
void value_contents_copy_raw(struct value *dst, int dst_offset, struct value *src, int src_offset, int length)
struct symbol * language_lookup_primitive_type_as_symbol(const struct language_defn *la, struct gdbarch *gdbarch, const char *name)
static int ada_args_match(struct symbol *, struct value **, int)
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)
static struct value * ada_value_slice(struct value *array, int low, int high)
struct value * value_addr(struct value *arg1)
struct value * ada_value_struct_elt(struct value *arg, char *name, int no_err)
int ada_get_field_index(const struct type *type, const char *field_name, int maybe_missing)
struct value * value_primitive_field(struct value *arg1, int offset, int fieldno, struct type *arg_type)
static void sort_choices(struct ada_symbol_info syms[], int nsyms)
struct type * copy_type(const struct type *type)
struct frame_info * get_selected_frame(const char *message)
int ada_is_bogus_array_descriptor(struct type *type)
static int ada_has_this_exception_support(const struct exception_support_info *einfo)
void init_bp_location(struct bp_location *loc, const struct bp_location_ops *ops, struct breakpoint *owner)
void * get_cmd_context(struct cmd_list_element *cmd)
static int old_renaming_is_invisible(const struct symbol *sym, const char *function_name)
static char * ada_get_next_arg(char **argsp)
struct type * create_static_range_type(struct type *result_type, struct type *index_type, LONGEST low_bound, LONGEST high_bound)
static void resolve(struct expression **expp, int void_context_p)
struct observer * observer_attach_free_objfile(observer_free_objfile_ftype *f)
#define SYMBOL_PRINT_NAME(symbol)
static void print_one_catch_exception_unhandled(struct breakpoint *b, struct bp_location **last_loc)
void value_free_to_mark(struct value *mark)
static int advance_wild_match(const char **, const char *, int)
static int wild_match(const char *, const char *)
struct type * ada_parent_type(struct type *type)
struct value * value_subscript(struct value *array, LONGEST index)
union general_symbol_info::@159 language_specific
const char * ada_tag_name(struct value *tag)
#define MSYMBOL_LINKAGE_NAME(symbol)
void ui_out_field_int(struct ui_out *uiout, const char *fldname, int value)
struct frame_info * get_current_frame(void)
struct value * value_from_contents_and_address(struct type *type, const gdb_byte *valaddr, CORE_ADDR address)
static int field_name_match(const char *field_name, const char *target)
static void ada_add_local_symbols(struct obstack *obstackp, const char *name, const struct block *block, domain_enum domain, int wild_match_p)
void read_memory_string(CORE_ADDR memaddr, char *buffer, int max_len)
static const struct exp_descriptor ada_exp_descriptor
#define TYPE_FIELD_NAME(thistype, n)
int( symbol_found_callback_ftype)(struct symbol *sym, void *data)
static struct value * value_val_atr(struct type *, struct value *)
static const gdb_byte * cond_offset_host(const gdb_byte *valaddr, long offset)
static void ada_print_array_index(struct value *index_value, struct ui_file *stream, const struct value_print_options *options)
static struct type * thin_descriptor_type(struct type *type)
const struct lang_varobj_ops ada_varobj_ops
const char multiple_symbols_cancel[]
char * ada_encode(const char *decoded)
int ada_is_others_clause(struct type *type, int field_num)
struct value * ada_value_primitive_packed_val(struct value *obj, const gdb_byte *valaddr, long offset, int bit_offset, int bit_size, struct type *type)
#define HAVE_GNAT_AUX_INFO(type)
#define TYPE_LOW_BOUND(range_type)
struct value * value_ref(struct value *arg1)
struct obstack * obstackp
#define GDBARCH_OBSTACK_CALLOC(GDBARCH, NR, TYPE)
struct frame_info * get_prev_frame(struct frame_info *this_frame)
static int parse(struct parser_state *ps)
LONGEST value_as_long(struct value *val)
void ada_lookup_encoded_symbol(const char *name, const struct block *block, domain_enum domain, struct ada_symbol_info *info)
int gdbarch_int_bit(struct gdbarch *gdbarch)
#define BMSYMBOL_VALUE_ADDRESS(symbol)
void warning(const char *fmt,...)
static void ada_iterate_over_symbols(const struct block *block, const char *name, domain_enum domain, symbol_found_callback_ftype *callback, void *data)
static struct breakpoint_ops catch_exception_unhandled_breakpoint_ops
struct type ** const(pascal_builtin_types[])
struct value * evaluate_subexp_with_coercion(struct expression *exp, int *pos, enum noside noside)
struct type * create_array_type(struct type *result_type, struct type *element_type, struct type *range_type)
#define TYPE_NAME(thistype)
static struct value * ada_value_cast(struct type *type, struct value *arg2, enum noside noside)
char * ada_fold_name(const char *name)
enum print_stop_action(* print_it)(struct bpstats *bs)
#define INIT_CPLUS_SPECIFIC(type)
initialize_file_ftype _initialize_ada_language
int value_bitpos(const struct value *value)
struct type * ada_to_fixed_type(struct type *type, const gdb_byte *valaddr, CORE_ADDR address, struct value *dval, int check_tag)
struct value * value_at(struct type *type, CORE_ADDR addr)
int ada_in_variant(LONGEST val, struct type *type, int field_num)
#define TYPE_HIGH_BOUND(range_type)
struct type * arch_float_type(struct gdbarch *gdbarch, int bit, char *name, const struct floatformat **floatformats)
void annotate_field(int num)
enum domain_enum_tag domain_enum
static int num_visible_fields(struct type *type)
struct ui_file * gdb_stdout
const struct type_print_options type_print_raw_options
const struct builtin_type * builtin_type(struct gdbarch *gdbarch)
static struct type * empty_record(struct type *templ)
static int warnings_issued
struct value * allocate_value_lazy(struct type *type)
void select_frame(struct frame_info *fi)
struct type * ada_variant_discrim_type(struct type *var_type, struct type *outer_type)
static struct value * value_pos_atr(struct type *, struct value *)
#define SYMBOL_CLASS(symbol)
static void check_status_catch_exception_unhandled(bpstat bs)
void internal_error(const char *file, int line, const char *fmt,...)
void binop_promote(const struct language_defn *language, struct gdbarch *gdbarch, struct value **arg1, struct value **arg2)
static struct value * desc_one_bound(struct value *, int, int)
static struct type * constrained_packed_array_type(struct type *, long *)
static LONGEST min_of_size(int size)
const struct language_defn * language_defn
static char * standard_exc[]
int ui_out_is_mi_like_p(struct ui_out *uiout)
static struct breakpoint_ops catch_assert_breakpoint_ops
const char * ada_decode(const char *encoded)
static CORE_ADDR ada_exception_name_addr(enum ada_exception_catchpoint_kind ex, struct breakpoint *b)
struct obstack cache_space
void ada_print_typedef(struct type *type, struct symbol *new_symbol, struct ui_file *stream)
void(* print_mention)(struct breakpoint *)
void find_frame_funname(struct frame_info *frame, char **funname, enum language *funlang, struct symbol **funcp)
static int ada_type_match(struct type *, struct type *, int)
void ada_print_type(struct type *, const char *, struct ui_file *, int, int, const struct type_print_options *)
static int ada_complete_symbol_matcher(const char *name, void *user_data)
struct value * default_read_var_value(struct symbol *var, struct frame_info *frame)
static void value_assign_to_component(struct value *container, struct value *component, struct value *val)
struct value * coerce_ref(struct value *arg)
static struct value * ensure_lval(struct value *val)
struct symbol * block_linkage_function(const struct block *bl)
void type_print(struct type *type, const char *varstring, struct ui_file *stream, int show)
struct value * value_ind(struct value *arg1)
int gdbarch_long_bit(struct gdbarch *gdbarch)
struct value * value_copy(struct value *arg)
const struct block * innermost_block
static const struct exception_support_info exception_support_info_fallback
struct type * ada_get_base_type(struct type *raw_type)
static struct type * to_fixed_variant_branch_type(struct type *, const gdb_byte *, CORE_ADDR, struct value *)
struct type * ada_coerce_to_simple_array_type(struct type *type)
struct value * value_from_contents_and_address_unresolved(struct type *type, const gdb_byte *valaddr, CORE_ADDR address)
struct bp_location *(* allocate_location)(struct breakpoint *)
static void ada_print_subexp(struct expression *exp, int *pos, struct ui_file *stream, enum precedence prec)
static struct type * to_fixed_range_type(struct type *, struct value *)
struct observer * observer_attach_inferior_exit(observer_inferior_exit_ftype *f)
#define VEC_safe_push(T, V, O)
#define BLOCKVECTOR_BLOCK(blocklist, n)
static void maint_set_ada_cmd(char *args, int from_tty)
static LONGEST ada_array_length(struct value *arr, int n)
static int ada_ignore_descriptive_types_p
const char * catch_assert_sym
static void print_recreate_exception(enum ada_exception_catchpoint_kind ex, struct breakpoint *b, struct ui_file *fp)
static int integer_type_p(struct type *)
static struct type * static_unwrap_type(struct type *type)
static struct value * ada_value_primitive_field(struct value *, int, int, struct type *)
const char * catch_exception_unhandled_sym
static struct value * ada_search_struct_field(char *, struct value *, int, struct type *)
char * skip_spaces(char *chp)
static void check_status_catch_exception(bpstat bs)
static int remove_extra_symbols(struct ada_symbol_info *syms, int nsyms)
static const char * known_runtime_file_name_patterns[]
static void print_recreate_catch_exception_unhandled(struct breakpoint *b, struct ui_file *fp)
static int aux_add_nonlocal_symbols(struct block *block, struct symbol *sym, void *data0)
static struct value * evaluate_subexp_type(struct expression *, int *)
static struct bp_location * allocate_location_catch_assert(struct breakpoint *self)
struct symtab_and_line find_function_start_sal(struct symbol *sym, int funfirstline)
static char * add_angle_brackets(const char *str)
struct type * string_char_type
static struct value * get_var_value(char *, char *)
#define SET_FIELD_BITPOS(thisfld, bitpos)
int ada_is_range_type_name(const char *name)
#define TYPE_FIELD(thistype, n)
static int is_nonfunction(struct ada_symbol_info *, int)
void add_catch_command(char *name, char *docstring, cmd_sfunc_ftype *sfunc, completer_ftype *completer, void *user_data_catch, void *user_data_tcatch)
void init_ada_exception_breakpoint(struct breakpoint *b, struct gdbarch *gdbarch, struct symtab_and_line sal, char *addr_string, const struct breakpoint_ops *ops, int tempflag, int enabled, int from_tty)
#define bits(obj, st, fn)
static const char * known_auxiliary_function_name_patterns[]
struct type * ada_check_typedef(struct type *type)
static struct type * to_fixed_array_type(struct type *, struct value *, int)
static int is_known_support_routine(struct frame_info *frame)
#define BYTES_TO_EXP_ELEM(bytes)
struct value * call_internal_function(struct gdbarch *gdbarch, const struct language_defn *language, struct value *func, int argc, struct value **argv)
#define TYPE_FIELD_ENUMVAL(thistype, n)
#define TYPE_FIELD_TYPE(thistype, n)
struct cache_entry * next
const gdb_byte * ada_aligned_value_addr(struct type *type, const gdb_byte *valaddr)
int ada_is_string_type(struct type *type)
struct value * allocate_value(struct type *type)
static struct cmd_list_element * show_ada_list
static struct type * desc_base_type(struct type *)
static enum print_stop_action print_it_catch_assert(bpstat bs)
static void print_recreate_catch_exception(struct breakpoint *b, struct ui_file *fp)
struct cmd_list_element * maintenance_set_cmdlist
static const char ADA_MAIN_PROGRAM_SYMBOL_NAME[]
void add_language(const struct language_defn *lang)
void c_get_string(struct value *value, gdb_byte **buffer, int *length, struct type **char_type, const char **charset)
void ui_out_text(struct ui_out *uiout, const char *string)
static int equiv_types(struct type *, struct type *)
const struct block * block_for_pc(CORE_ADDR pc)
static struct type * ada_lookup_struct_elt_type(struct type *, char *, int, int, int *)
const char * ada_attribute_name(enum exp_opcode n)
static CORE_ADDR ada_unhandled_exception_name_addr(void)
void store_unsigned_integer(gdb_byte *, int, enum bfd_endian, ULONGEST)
void printf_filtered(const char *format,...)
static int ada_is_exception_sym(struct symbol *sym)
int longest_to_int(LONGEST)
static void ada_remove_Xbn_suffix(const char *encoded, int *len)
const struct block * block
const char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)
static const char * ada_exception_sym_name(enum ada_exception_catchpoint_kind ex)
struct expression * excep_cond_expr
const char * multiple_symbols_select_mode(void)
static struct type * new_type(char *)
static struct type * ada_find_parallel_type_with_name(struct type *, const char *)
static int return_match(struct type *func_type, struct type *context_type)
static char * xget_renaming_scope(struct type *renaming_type)
static struct type * ada_index_type(struct type *type, int n, const char *name)
int dump_subexp(struct expression *exp, struct ui_file *stream, int elt)
static struct type * type_from_tag(struct value *tag)
#define BLOCK_FUNCTION(bl)
static int possible_user_operator_p(enum exp_opcode, struct value **)
static void initialize_ada_catchpoint_ops(void)
void deprecated_set_value_type(struct value *value, struct type *type)
static struct value * cast_from_fixed(struct type *type, struct value *arg)
#define GROW_VECT(v, s, m)
struct type * ada_tag_type(struct value *val)
static struct type * decode_constrained_packed_array_type(struct type *)
void set_value_address(struct value *value, CORE_ADDR addr)
const char * symtab_to_fullname(struct symtab *s)
static int is_ada95_tag(struct value *tag)
static void cache_symbol(const char *name, domain_enum domain, struct symbol *sym, const struct block *block)
static struct value * value_subscript_packed(struct value *, int, struct value **)
void null_cleanup(void *arg)
static void re_set_catch_exception(struct breakpoint *b)
static struct value * unwrap_value(struct value *)
int(* symbol_name_cmp_ftype)(const char *symbol_search_name, const char *lookup_name)
struct value * evaluate_expression(struct expression *exp)
static LONGEST ada_array_bound_from_type(struct type *arr_type, int n, int which)
static void print_recreate_catch_assert(struct breakpoint *b, struct ui_file *fp)
static int has_negatives(struct type *type)
static enum print_stop_action print_it_catch_exception(bpstat bs)
#define R(name, type, sim_num)
const struct block * block
struct value * ada_coerce_to_simple_array_ptr(struct value *arr)
static struct value * ada_index_struct_field_1(int *, struct value *, int, struct type *)
struct value * value_ptradd(struct value *arg1, LONGEST arg2)
static struct type * ada_find_any_type(const char *name)
void find_frame_sal(struct frame_info *frame, struct symtab_and_line *sal)
void ada_find_printable_frame(struct frame_info *fi)
int discrete_position(struct type *type, LONGEST val, LONGEST *pos)
struct cmd_list_element * setlist
static int is_thick_pntr(struct type *type)
static void lim_warning(const char *format,...) ATTRIBUTE_PRINTF(1
#define SYMTAB_BLOCKVECTOR(symtab)
#define ALL_OBJFILES(obj)
static void ada_add_standard_exceptions(regex_t *preg, VEC(ada_exc_info)**exceptions)
struct value * value_struct_elt(struct value **argp, struct value **args, const char *name, int *static_memfuncp, const char *err)
static CORE_ADDR ada_unhandled_exception_name_addr_from_raise(void)
#define VEC_iterate(T, V, I, P)
static char * ada_exception_catchpoint_cond_string(const char *excep_string)
char * command_line_input(const char *, int, char *)
struct bp_location * next
char * ada_main_name(void)
struct type * check_typedef(struct type *type)
#define TYPE_GNU_IFUNC(t)
#define SYMBOL_VALUE_ADDRESS(symbol)
static void emit_char(int c, struct type *type, struct ui_file *stream, int quoter)
static struct value * ada_evaluate_subexp(struct type *, struct expression *, int *, enum noside)
void ada_fixup_array_indexes_type(struct type *index_desc_type)
static struct value * coerce_unspec_val_to_type(struct value *, struct type *)
const gdb_byte * value_contents(struct value *value)
static int lesseq_defined_than(struct symbol *, struct symbol *)
#define CATCH(EXCEPTION, MASK)
int contained_in(const struct block *a, const struct block *b)
static struct cmd_list_element * maint_set_ada_cmdlist
static void print_mention_catch_assert(struct breakpoint *b)
static struct ada_pspace_data * get_ada_pspace_data(struct program_space *pspace)
static int find_struct_field(const char *, struct type *, int, struct type **, int *, int *, int *, int *)
#define TYPE_MAIN_TYPE(thistype)
struct type * bool_type_default
static void ada_forward_operator_length(struct expression *, int, int *, int *)
static int ada_same_array_size_p(struct type *t1, struct type *t2)
static int full_match(const char *, const char *)
static const char * fixed_type_info(struct type *type)
#define SYMBOL_DOMAIN(symbol)
int ada_prefer_type(struct type *type0, struct type *type1)
void initialize_file_ftype(void)
int value_lazy(struct value *value)
struct bp_location * bp_location_at
LONGEST ada_discrete_type_high_bound(struct type *type)
static int remove_irrelevant_renamings(struct ada_symbol_info *syms, int nsyms, const struct block *current_block)
struct type * alloc_type_copy(const struct type *type)
static enum ada_renaming_category parse_old_style_renaming(struct type *, const char **, int *, const char **)
void fprintf_filtered(struct ui_file *stream, const char *format,...)
ULONGEST ada_modulus(struct type *type)
static int encoded_ordered_before(const char *N0, const char *N1)
int value_bitsize(const struct value *value)
static unsigned int align_value(unsigned int off, unsigned int alignment)
void * xzalloc(size_t size)
#define SYMTAB_OBJFILE(symtab)
int ada_is_tagged_type(struct type *type, int refok)
static ULONGEST umax_of_size(int size)
void create_ada_exception_catchpoint(struct gdbarch *gdbarch, enum ada_exception_catchpoint_kind ex_kind, char *excep_string, char *cond_string, int tempflag, int disabled, int from_tty)
static long decode_packed_array_bitsize(struct type *)
const struct block * get_frame_block(struct frame_info *frame, CORE_ADDR *addr_in_block)
int ada_name_prefix_len(const char *name)
int ada_is_simple_array_type(struct type *type)
static void sort_remove_dups_ada_exceptions_list(VEC(ada_exc_info)**exceptions, int skip)
struct value * value_cast_pointers(struct type *type, struct value *arg2, int subclass_check)
static struct type * find_parallel_type_by_descriptive_type(struct type *type, const char *name)
static int is_lower_alphanum(const char c)
static const struct op_print ada_op_print_tab[]
static struct symbol * find_old_style_renaming_symbol(const char *, const struct block *)
static int scalar_type_p(struct type *)
struct cleanup * compile_rx_or_error(regex_t *pattern, const char *rx, const char *message)
static struct htab * decoded_names_store
void fprintf_unfiltered(struct ui_file *stream, const char *format,...)
static void info_exceptions_command(char *regexp, int from_tty)
struct cmd_list_element * showlist
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)
static void add_symbols_from_enclosing_procs(struct obstack *obstackp, const char *name, domain_enum domain, int wild_match_p)
const gdb_byte * value_contents_all(struct value *value)
static LONGEST max_of_type(struct type *t)
void fputs_filtered(const char *linebuffer, struct ui_file *stream)
struct expression * parse_exp_1(const char **, CORE_ADDR pc, const struct block *, int)
static int should_use_wild_match(const char *lookup_name)
int streq(const char *lhs, const char *rhs)
int ada_is_system_address_type(struct type *type)
void set_value_parent(struct value *value, struct value *parent)
#define ADA_KNOWN_AUXILIARY_FUNCTION_NAME_PATTERNS
int is_integral_type(struct type *t)
const char * bool_type_symbol
void free_current_contents(void *ptr)
const struct sym_fns * sf
void unop_promote(const struct language_defn *language, struct gdbarch *gdbarch, struct value **arg1)
static unsigned int varsize_limit
const struct exception_support_info * exception_info
int default_pass_by_reference(struct type *type)
struct type * value_enclosing_type(struct value *value)
static struct ada_inferior_data * get_ada_inferior_data(struct inferior *inf)
static int desc_bound_bitsize(struct type *, int, int)
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
struct type * basic_lookup_transparent_type(const char *name)
struct cleanup * make_cleanup(make_cleanup_ftype *function, void *arg)
static struct cmd_list_element * set_ada_list
static void ada_add_block_symbols(struct obstack *, const struct block *, const char *, domain_enum, struct objfile *, int)
static void add_component_interval(LONGEST, LONGEST, LONGEST *, int *, int)
#define ALL_COMPUNITS(objfile, cu)
static void ada_free_symbol_cache(struct ada_symbol_cache *sym_cache)
static int ada_is_packed_array_type(struct type *)
struct type * ada_find_parallel_type(struct type *type, const char *suffix)
static void aggregate_assign_from_choices(struct value *, struct value *, struct expression *, int *, LONGEST *, int *, int, LONGEST, LONGEST)
static void ada_language_arch_info(struct gdbarch *, struct language_arch_info *)
static DOUBLEST scaling_factor(struct type *type)
static struct symbol * standard_lookup(const char *, const struct block *, domain_enum)
static int is_package_name(const char *name)
const struct block * block_found
struct cache_entry * root[HASH_SIZE]
const struct block * block
#define BLOCK_SUPERBLOCK(bl)
int ada_is_wrapper_field(struct type *type, int field_num)
struct gdbarch * get_type_arch(const struct type *type)
static int compare_ada_exception_info(const void *a, const void *b)
static int ada_is_unconstrained_packed_array_type(struct type *)
struct cmd_list_element * add_info(const char *name, cmd_cfunc_ftype *fun, const char *doc)
struct gdbarch * get_current_arch(void)
gdb_byte * value_contents_writeable(struct value *value)
static LONGEST min_of_type(struct type *t)
struct type * ada_type_of_array(struct value *arr, int bounds)
struct value * value_assign(struct value *toval, struct value *fromval)
int dump_subexp_body_standard(struct expression *exp, struct ui_file *stream, int elt)
struct type * language_bool_type(const struct language_defn *la, struct gdbarch *gdbarch)
static struct type * desc_bounds_type(struct type *)
int gdbarch_double_bit(struct gdbarch *gdbarch)
struct value * value_from_longest(struct type *type, LONGEST num)
#define SYMBOL_LINE(symbol)
#define SYMBOL_LINKAGE_NAME(symbol)
void exception_fprintf(struct ui_file *file, struct gdb_exception e, const char *prefix,...)
static struct bp_location * allocate_location_catch_exception_unhandled(struct breakpoint *self)
static int startswith(const char *string, const char *pattern)
static LONGEST ada_array_bound(struct value *arr, int n, int which)
static int ada_value_equal(struct value *arg1, struct value *arg2)
void set_value_offset(struct value *value, int offset)
struct value * value_at_lazy(struct type *type, CORE_ADDR addr)
static void aggregate_assign_others(struct value *, struct value *, struct expression *, int *, LONGEST *, int, LONGEST, LONGEST)
void expand_symtabs_matching(expand_symtabs_file_matcher_ftype *file_matcher, expand_symtabs_symbol_matcher_ftype *symbol_matcher, expand_symtabs_exp_notify_ftype *expansion_notify, enum search_domain kind, void *data)
struct value * value_cast(struct type *type, struct value *arg2)
static int match_name(const char *sym_name, const char *name, int wild)
static struct type * to_record_with_fixed_variant_part(struct type *type, const gdb_byte *valaddr, CORE_ADDR address, struct value *dval0)
char * ada_name_for_lookup(const char *name)
int ada_is_array_descriptor_type(struct type *type)
char * xstrprintf(const char *format,...)
static struct type * template_to_static_fixed_type(struct type *type0)
struct type * arch_integer_type(struct gdbarch *gdbarch, int bit, int unsigned_p, char *name)
int deprecated_value_modifiable(struct value *value)
void printf_unfiltered(const char *format,...)
static void symbol_completion_add(VEC(char_ptr)**sv, const char *sym_name, const char *text, int text_len, const char *orig_text, const char *word, int wild_match_p, int encoded_p)
#define TRUNCATION_TOWARDS_ZERO
static struct type * ada_to_fixed_type_1(struct type *type, const gdb_byte *valaddr, CORE_ADDR address, struct value *dval, int check_tag)
static char * ada_completer_word_break_characters
static enum print_stop_action print_it_exception(enum ada_exception_catchpoint_kind ex, bpstat bs)
#define TYPE_FIELDS(thistype)
static symbol_name_cmp_ftype ada_get_symbol_name_cmp(const char *lookup_name)
static void maint_show_ada_cmd(char *args, int from_tty)
void read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
char * op_name_standard(enum exp_opcode opcode)
#define ADA_KNOWN_RUNTIME_FILE_NAME_PATTERNS
static struct value * empty_array(struct type *arr_type, int low)
static unsigned int field_alignment(struct type *type, int f)
static struct value * ada_read_renaming_var_value(struct symbol *renaming_sym, const struct block *block)
struct value * value_from_double(struct type *type, DOUBLEST num)
const char * objfile_name(const struct objfile *objfile)
int value_equal(struct value *arg1, struct value *arg2)
static const struct inferior_data * ada_inferior_data
struct breakpoint_ops bkpt_breakpoint_ops
static int fat_pntr_data_bitpos(struct type *)
unsigned int msymbol_hash(const char *string)
struct ada_symbol_cache * sym_cache
void set_value_bitsize(struct value *value, int bit)
static const char * symbol_completion_match(const char *sym_name, const char *text, int text_len, int wild_match_p, int encoded_p)
int ada_lookup_symbol_list(const char *name0, const struct block *block0, domain_enum domain, struct ada_symbol_info **results)
static int variant_field_index(struct type *type)
#define TYPE_FIELD_BITSIZE(thistype, n)
#define EXP_ELEM_TO_BYTES(elements)
void ada_value_print(struct value *, struct ui_file *, const struct value_print_options *)
struct type * builtin_bool
static int ada_is_dispatch_table_ptr_type(struct type *type)
static void catch_assert_command(char *arg, int from_tty, struct cmd_list_element *command)
struct type * ada_get_decoded_type(struct type *type)
struct value * ada_value_subscript(struct value *arr, int arity, struct value **ind)
struct type * lookup_struct_elt_type(struct type *type, const char *name, int noerr)
static char * ada_tag_name_from_tsd(struct value *tsd)
void cmd_show_list(struct cmd_list_element *list, int from_tty, const char *prefix)
void(* check_status)(struct bpstats *bs)
#define TYPE_FIELD_BITPOS(thistype, n)
enum ada_renaming_category ada_parse_renaming(struct symbol *sym, const char **renamed_entity, int *len, const char **renaming_expr)
static int ada_is_redundant_index_type_desc(struct type *array_type, struct type *desc_type)
static void print_one_catch_assert(struct breakpoint *b, struct bp_location **last_loc)
int ada_is_constrained_packed_array_type(struct type *type)
static void dtor_catch_exception_unhandled(struct breakpoint *b)
static int ada_is_interface_tag(struct type *type)
#define SYMBOL_VALUE(symbol)
static void ada_new_objfile_observer(struct objfile *objfile)
static void re_set_exception(enum ada_exception_catchpoint_kind ex, struct breakpoint *b)
struct value * ada_tag_value_at_base_address(struct value *obj)
#define DOUBLEST_SCAN_FORMAT
int ada_is_tag_type(struct type *type)
static struct value * decode_constrained_packed_array(struct value *)
static struct value * ada_to_fixed_value_create(struct type *, CORE_ADDR, struct value *)
int ptid_get_pid(ptid_t ptid)
int ada_scan_number(const char str[], int k, LONGEST *R, int *new_k)
static void dtor_catch_exception(struct breakpoint *b)
static LONGEST max_of_size(int size)
void print_recreate_thread(struct breakpoint *b, struct ui_file *fp)
LONGEST ada_discrete_type_low_bound(struct type *type)
static int ada_is_array_type(struct type *type)
struct symbol * block_iter_match_next(const char *name, symbol_compare_ftype *compare, struct block_iterator *iterator)
static char * ada_get_gdb_completer_word_break_characters(void)
struct breakpoint * breakpoint_at
struct symbol * ada_lookup_symbol(const char *name, const struct block *block0, domain_enum domain, int *is_a_field_of_this)
static LONGEST pos_atr(struct value *)
#define SYMBOL_OBJFILE_OWNED(symbol)
int ada_is_fixed_point_type(struct type *type)
#define LA_PRINT_TYPE(type, varstring, stream, show, level, flags)
PTR xrealloc(PTR ptr, size_t size)
int ada_which_variant_applies(struct type *var_type, struct type *outer_type, const gdb_byte *outer_valaddr)
static struct obstack symbol_list_obstack
#define VEC_truncate(T, V, I)
static void ada_init_symbol_cache(struct ada_symbol_cache *sym_cache)
int ada_is_ignored_field(struct type *type, int field_num)
static int numeric_type_p(struct type *)
ada_unhandled_exception_name_addr_ftype * unhandled_exception_name_addr
#define COMPUNIT_BLOCKVECTOR(cust)
struct symbol * fixup_symbol_section(struct symbol *sym, struct objfile *objfile)
static void assign_component(struct value *container, struct value *lhs, LONGEST index, struct expression *exp, int *pos)
static int ada_dump_subexp_body(struct expression *exp, struct ui_file *stream, int elt)
const char const char int
static struct bp_location * allocate_location_exception(enum ada_exception_catchpoint_kind ex, struct breakpoint *self)
int ada_array_arity(struct type *type)
static void aggregate_assign_positional(struct value *, struct value *, struct expression *, int *, LONGEST *, int *, int, LONGEST, LONGEST)
static struct value * ada_coerce_ref(struct value *)
static char * ada_la_decode(const char *encoded, int options)
#define MSYMBOL_TYPE(msymbol)
void help_list(struct cmd_list_element *list, const char *cmdtype, enum command_class theclass, struct ui_file *stream)
static const struct exception_support_info default_exception_support_info
enum language ada_update_initial_language(enum language lang)
void discard_cleanups(struct cleanup *old_chain)
int strcmp_iw_ordered(const char *string1, const char *string2)
#define ALL_MSYMBOLS(objfile, m)
static int compare_names_with_case(const char *string1, const char *string2, enum case_sensitivity casing)
#define TYPE_TARGET_TYPE(thistype)
static void print_one_catch_exception(struct breakpoint *b, struct bp_location **last_loc)
void gdb_print_host_address(const void *addr, struct ui_file *stream)
struct type * builtin_double
struct value * value_neg(struct value *arg1)
static char * bound_name[]
struct type * ada_aligned_type(struct type *type)
static struct value * desc_data(struct value *)
void install_breakpoint(int internal, struct breakpoint *b, int update_gll)
static CORE_ADDR cond_offset_target(CORE_ADDR address, long offset)
void print_subexp_standard(struct expression *exp, int *pos, struct ui_file *stream, enum precedence prec)
static struct value * ada_get_tsd_from_tag(struct value *tag)
void print_subexp(struct expression *exp, int *pos, struct ui_file *stream, enum precedence prec)
const char * async_reason_lookup(enum async_reply_reason reason)
static const struct program_space_data * ada_pspace_data_handle
int xsnprintf(char *str, size_t size, const char *format,...)
CORE_ADDR parse_and_eval_address(const char *exp)
static struct type * to_static_fixed_type(struct type *)
static struct cache_entry ** find_entry(const char *name, domain_enum domain)
const struct block * block_static_block(const struct block *block)
#define TYPE_CODE(thistype)
#define TYPE_INDEX_TYPE(type)
void modify_field(struct type *type, gdb_byte *addr, LONGEST fieldval, int bitpos, int bitsize)
static struct cmd_list_element * maint_show_ada_cmdlist
static int ada_is_non_standard_exception_sym(struct symbol *sym)
struct type * resolve_dynamic_type(struct type *type, const gdb_byte *valaddr, CORE_ADDR addr)
static enum print_stop_action print_it_catch_exception_unhandled(bpstat bs)
struct value * value_of_variable(struct symbol *var, const struct block *b)
static struct type * desc_index_type(struct type *, int)
struct ui_file * gdb_stderr
static struct value * ada_index_struct_field(int, struct value *, int, struct type *)
#define TYPE_FIXED_INSTANCE(t)
struct type * builtin_data_ptr
static void catch_ada_assert_command_split(char *args, char **cond_string)
struct minimal_symbol * minsym
const char * ada_type_name(struct type *type)
static struct value * ada_value_ptr_subscript(struct value *arr, int arity, struct value **ind)
int gdbarch_long_long_bit(struct gdbarch *gdbarch)
static void ada_clear_symbol_cache(void)
struct gdbarch * block_gdbarch(const struct block *block)
static struct type * ada_get_tsd_type(struct inferior *inf)
int ada_parse(struct parser_state *par_state)
LONGEST ada_float_to_fixed(struct type *type, DOUBLEST x)
static void ada_catchpoint_location_dtor(struct bp_location *bl)
static void ada_add_global_exceptions(regex_t *preg, VEC(ada_exc_info)**exceptions)
int operator_check_standard(struct expression *exp, int pos, int(*objfile_func)(struct objfile *objfile, void *data), void *data)
struct value * ada_coerce_to_simple_array(struct value *arr)
void get_user_print_options(struct value_print_options *opts)
static char * ada_op_name(enum exp_opcode)
static int desc_arity(struct type *)
int value_less(struct value *arg1, struct value *arg2)
int ada_is_variant_part(struct type *type, int field_num)
static int ada_identical_enum_types_p(struct type *type1, struct type *type2)
#define TYPE_NFIELDS(thistype)
static void ada_exception_support_info_sniffer(void)
ada_exception_catchpoint_kind
static CORE_ADDR ada_exception_name_addr_1(enum ada_exception_catchpoint_kind ex, struct breakpoint *b)
static void check_status_catch_assert(bpstat bs)
int gdbarch_float_bit(struct gdbarch *gdbarch)
struct value * evaluate_subexp(struct type *expect_type, struct expression *exp, int *pos, enum noside noside)
struct value * ada_value_ind(struct value *val0)
#define SYMBOL_LANGUAGE(symbol)
char * ada_variant_discrim_name(struct type *type0)
DOUBLEST ada_delta(struct type *type)
static struct value * ada_promote_array_of_integrals(struct type *type, struct value *val)
static int is_nondebugging_type(struct type *type)
#define VEC_address(T, V)
struct value * ada_value_tag(struct value *val)
void ada_val_print(struct type *, const gdb_byte *, int, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *)
#define CHECK_TYPEDEF(TYPE)
int symbol_matches_domain(enum language symbol_language, domain_enum symbol_domain, domain_enum domain)
static int ada_exc_search_name_matches(const char *search_name, void *user_data)
struct value * evaluate_subexp_standard(struct type *expect_type, struct expression *exp, int *pos, enum noside noside)
struct value * value_binop(struct value *arg1, struct value *arg2, enum exp_opcode op)
void ada_printstr(struct ui_file *, struct type *, const gdb_byte *, unsigned int, const char *, int, const struct value_print_options *)
static struct value * ada_value_slice_from_ptr(struct value *array_ptr, struct type *type, int low, int high)
#define TYPE_TAG_NAME(type)
struct bound_minimal_symbol ada_lookup_simple_minsym(const char *name)
struct type * ada_array_element_type(struct type *type, int nindices)
void * grow_vect(void *vect, size_t *size, size_t min_size, int element_size)
void operator_length_standard(const struct expression *expr, int endpos, int *oplenp, int *argsp)
int ada_is_modular_type(struct type *type)
static int is_name_suffix(const char *)
static void ada_free_objfile_observer(struct objfile *objfile)
struct inferior * current_inferior(void)
static int is_thin_pntr(struct type *type)
const struct block * get_selected_block(CORE_ADDR *addr_in_block)
static const struct breakpoint_ops * ada_exception_breakpoint_ops(enum ada_exception_catchpoint_kind ex)
const char * ada_decode_symbol(const struct general_symbol_info *arg)
#define SYMBOL_NATURAL_NAME(symbol)
static struct value * coerce_for_assign(struct type *type, struct value *val)
EXTERN_C char * re_comp(const char *)
static int fat_pntr_data_bitsize(struct type *)
struct program_space * current_program_space
static void add_defn_to_vec(struct obstack *, struct symbol *, const struct block *)
static struct value * thin_data_pntr(struct value *val)
void ui_out_field_core_addr(struct ui_out *uiout, const char *fldname, struct gdbarch *gdbarch, CORE_ADDR address)
const char * ada_enum_name(const char *name)
int gdbarch_bits_big_endian(struct gdbarch *gdbarch)
unsigned long long ULONGEST
const char * catch_exception_sym
static void ATTRIBUTE_PRINTF(6, 0)
static CORE_ADDR value_pointer(struct value *value, struct type *type)
static PyObject * field_name(struct type *type, int field)
void initialize_breakpoint_ops(void)
void(* map_matching_symbols)(struct objfile *, const char *name, domain_enum domain, int global, int(*callback)(struct block *, struct symbol *, void *), void *data, symbol_compare_ftype *match, symbol_compare_ftype *ordered_compare)
static int is_unchecked_variant(struct type *var_type, struct type *outer_type)
struct value * value_allocate_space_in_inferior(int len)
struct value * value_slice(struct value *array, int lowbound, int length)
int is_dynamic_type(struct type *type)
int ada_is_aligner_type(struct type *type)
static int symbols_are_identical_enums(struct ada_symbol_info *syms, int nsyms)
struct observer * observer_attach_new_objfile(observer_new_objfile_ftype *f)
static int is_dynamic_field(struct type *, int)
void(* dtor)(struct breakpoint *self)
static void move_bits(gdb_byte *, int, const gdb_byte *, int, int, int)
struct type * value_type(const struct value *value)
static void print_mention_catch_exception(struct breakpoint *b)
static void set_ada_command(char *arg, int from_tty)
static struct value * ada_value_binop(struct value *arg1, struct value *arg2, enum exp_opcode op)
#define TYPE_ARRAY_LOWER_BOUND_VALUE(arraytype)
#define TYPE_ALLOC(t, size)
#define SYMBOL_TYPE(symbol)
static struct value * assign_aggregate(struct value *, struct value *, struct expression *, int *, enum noside)
void ada_ensure_varsize_limit(const struct type *type)
static int scan_discrim_bound(char *str, int k, struct value *dval, LONGEST *px, int *pnew_k)
struct value * ada_convert_actual(struct value *actual, struct type *formal_type0)
static int fat_pntr_bounds_bitsize(struct type *)
struct symbol * ada_find_renaming_symbol(struct symbol *name_sym, const struct block *block)
static void ada_pspace_data_cleanup(struct program_space *pspace, void *data)
CORE_ADDR value_as_address(struct value *val)
#define LA_VALUE_PRINT(val, stream, options)
void ui_out_field_string(struct ui_out *uiout, const char *fldname, const char *string)
static void catch_ada_exception_command_split(char *args, enum ada_exception_catchpoint_kind *ex, char **excep_string, char **cond_string)
static void re_set_catch_exception_unhandled(struct breakpoint *b)
static int num_component_specs(struct expression *exp, int pc)
static struct value * make_array_descriptor(struct type *, struct value *)
static int num_defns_collected(struct obstack *)
DOUBLEST ada_fixed_to_float(struct type *type, LONGEST x)
struct value * ada_to_fixed_value(struct value *val)
gdb_byte * value_contents_raw(struct value *value)
void annotate_catchpoint(int num)
int ada_is_parent_field(struct type *type, int field_num)
static struct value * cast_to_fixed(struct type *type, struct value *arg)
static int is_suffix(const char *str, const char *suffix)
const char * type_name_no_tag(const struct type *type)
static struct bp_location * allocate_location_catch_exception(struct breakpoint *self)
#define TYPE_LENGTH(thistype)
static int lookup_cached_symbol(const char *name, domain_enum domain, struct symbol **sym, const struct block **block)
static struct breakpoint_ops catch_exception_breakpoint_ops
static const char * ada_unqualified_name(const char *decoded_name)
static struct type * to_fixed_record_type(struct type *type0, const gdb_byte *valaddr, CORE_ADDR address, struct value *dval)
static int ada_is_direct_array_type(struct type *)
static void dtor_exception(enum ada_exception_catchpoint_kind ex, struct breakpoint *b)
struct type * arch_type(struct gdbarch *gdbarch, enum type_code code, int length, char *name)
static void re_set_catch_assert(struct breakpoint *b)
void gdb_flush(struct ui_file *file)
static int block_depth(struct block *)
struct ui_out * current_uiout
static struct value * desc_bounds(struct value *)
char * op_string(enum exp_opcode op)
void void vwarning(const char *fmt, va_list args) ATTRIBUTE_PRINTF(1
static void ada_remove_po_subprogram_suffix(const char *encoded, int *len)
void write_memory_with_notification(CORE_ADDR memaddr, const bfd_byte *myaddr, ssize_t len)
int value_true(struct value *val)
static void ada_inferior_exit(struct inferior *inf)
struct general_symbol_info::@159::mangled_lang mangled_lang
void write_memory(CORE_ADDR memaddr, const bfd_byte *myaddr, ssize_t len)
static struct value * value_tag_from_contents_and_address(struct type *type, const gdb_byte *valaddr, CORE_ADDR address)
static struct symtab_and_line ada_exception_sal(enum ada_exception_catchpoint_kind ex, char *excep_string, char **addr_string, const struct breakpoint_ops **ops)
const struct quick_symbol_functions * qf
void ada_printchar(int, struct type *, struct ui_file *)
static void dtor_catch_assert(struct breakpoint *b)
CORE_ADDR value_address(const struct value *value)
static void catch_ada_exception_command(char *arg, int from_tty, struct cmd_list_element *command)
static struct type * desc_data_target_type(struct type *)
int gdbarch_short_bit(struct gdbarch *gdbarch)
#define TYPE_DESCRIPTIVE_TYPE(thistype)
struct type ** primitive_type_vector
struct bound_minimal_symbol lookup_minimal_symbol(const char *name, const char *sfile, struct objfile *objf)
PTR xcalloc(size_t number, size_t size)
static struct value * resolve_subexp(struct expression **, int *, int, struct type *)
static void print_mention_exception(enum ada_exception_catchpoint_kind ex, struct breakpoint *b)
struct symtab * symbol_symtab(const struct symbol *symbol)
static struct type * dynamic_template_type(struct type *type)
static int discrete_type_p(struct type *)
struct symbol * block_iter_match_first(const struct block *block, const char *name, symbol_compare_ftype *compare, struct block_iterator *iterator)
struct cmd_list_element * maintenance_show_cmdlist
int get_array_bounds(struct type *type, LONGEST *low_bound, LONGEST *high_bound)
static void ada_inferior_data_cleanup(struct inferior *inf, void *arg)
#define TYPE_ARRAY_UPPER_BOUND_VALUE(arraytype)
int target_read_string(CORE_ADDR memaddr, char **string, int len, int *errnop)
static void print_one_exception(enum ada_exception_catchpoint_kind ex, struct breakpoint *b, struct bp_location **last_loc)
struct breakpoint * owner
struct type * builtin_void
int has_stack_frames(void)
static struct type * get_base_type(struct type *type)
void(* print_one)(struct breakpoint *, struct bp_location **)
int get_discrete_bounds(struct type *type, LONGEST *lowp, LONGEST *highp)
static int ada_operator_check(struct expression *exp, int pos, int(*objfile_func)(struct objfile *objfile, void *data), void *data)
const char multiple_symbols_all[]
void error(const char *fmt,...)
DOUBLEST value_as_double(struct value *val)
void(* re_set)(struct breakpoint *self)
void gdbarch_address_to_pointer(struct gdbarch *gdbarch, struct type *type, gdb_byte *buf, CORE_ADDR addr)
void set_breakpoint_condition(struct breakpoint *b, const char *exp, int from_tty)
#define skip_to_space(INP)
#define ALL_BLOCK_SYMBOLS(block, iter, sym)
struct type * lookup_pointer_type(struct type *type)
static struct ada_symbol_cache * ada_get_symbol_cache(struct program_space *pspace)
static struct type * ada_typedef_target_type(struct type *type)
static void add_nonlocal_symbols(struct obstack *obstackp, const char *name, domain_enum domain, int global, int is_wild_match)
static struct symbol * ada_find_any_type_symbol(const char *name)
void do_cleanups(struct cleanup *old_chain)
void add_setshow_boolean_cmd(const char *name, enum command_class theclass, int *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
static struct value * ada_value_assign(struct value *toval, struct value *fromval)
static const char * ada_decoded_op_name(enum exp_opcode)
static void check_status_exception(enum ada_exception_catchpoint_kind ex, bpstat bs)
void set_value_component_location(struct value *component, const struct value *whole)
#define SYMBOL_IS_ARGUMENT(symbol)
static void show_ada_command(char *args, int from_tty)
const char * bpdisp_text(enum bpdisp disp)
int user_select_syms(struct ada_symbol_info *syms, int nsyms, int max_results)
__extension__ enum domain_enum_tag domain
static struct value * ada_read_var_value(struct symbol *var, struct frame_info *frame)
static int fat_pntr_bounds_bitpos(struct type *)
int get_selections(int *choices, int n_choices, int max_results, int is_all_choice, char *annotation_suffix)
struct type * builtin_int
static struct ada_symbol_info * defns_collected(struct obstack *, int)
static int compare_names(const char *string1, const char *string2)
const ULONGEST const LONGEST len
static int ada_resolve_function(struct ada_symbol_info *, int, struct value **, int, const char *, struct type *)