71 #ifndef TRUNCATION_TOWARDS_ZERO 72 #define TRUNCATION_TOWARDS_ZERO ((-5 / 2) == -2) 110 const struct block *,
121 const struct block *);
153 const struct block *);
226 struct type **,
int *,
int *,
int *,
int *);
232 struct value **,
int,
const char *,
306 #define HASH_SIZE 1009 324 " \t\n!@#%^&*()+=|~`}{[]\";:?/,-";
326 " \t\n!@#$%^&*()+=|~`}{[]\";:?/,-";
331 =
"__gnat_ada_main_program_name";
535 if (decoded_name[0] ==
'<')
538 result = strrchr (decoded_name,
'.');
542 result = decoded_name;
553 static char *result = NULL;
583 if (*
size < min_size)
586 if (*
size < min_size)
599 int len = strlen (target);
625 for (fieldno = 0; fieldno <
TYPE_NFIELDS (struct_type); fieldno++)
630 error (
_(
"Unable to find field %s in struct %s. Aborting"),
645 const char *p = strstr (
name,
"___");
648 return strlen (
name);
665 len2 = strlen (suffix);
666 return (len1 >= len2 && strcmp (str + len1 - len2, suffix) == 0);
672 static struct value *
680 struct value *result;
734 va_start (args, format);
750 error (
_(
"object size is larger than varsize-limit"));
759 return top_bit | (top_bit - 1);
775 return top_bit | (top_bit - 1);
815 error (
_(
"Unexpected type in ada_discrete_type_high_bound."));
836 error (
_(
"Unexpected type in ada_discrete_type_low_bound."));
905 (
struct objfile *) NULL).minsym != NULL)
919 static char *main_program_name = NULL;
934 if (main_program_name_addr == 0)
935 error (
_(
"Invalid address for Ada main program name."));
937 xfree (main_program_name);
943 return main_program_name;
956 {
"Oadd",
"\"+\"", BINOP_ADD},
957 {
"Osubtract",
"\"-\"", BINOP_SUB},
958 {
"Omultiply",
"\"*\"", BINOP_MUL},
959 {
"Odivide",
"\"/\"", BINOP_DIV},
960 {
"Omod",
"\"mod\"", BINOP_MOD},
961 {
"Orem",
"\"rem\"", BINOP_REM},
962 {
"Oexpon",
"\"**\"", BINOP_EXP},
963 {
"Olt",
"\"<\"", BINOP_LESS},
964 {
"Ole",
"\"<=\"", BINOP_LEQ},
965 {
"Ogt",
"\">\"", BINOP_GTR},
966 {
"Oge",
"\">=\"", BINOP_GEQ},
967 {
"Oeq",
"\"=\"", BINOP_EQUAL},
968 {
"One",
"\"/=\"", BINOP_NOTEQUAL},
969 {
"Oand",
"\"and\"", BINOP_BITWISE_AND},
970 {
"Oor",
"\"or\"", BINOP_BITWISE_IOR},
971 {
"Oxor",
"\"xor\"", BINOP_BITWISE_XOR},
972 {
"Oconcat",
"\"&\"", BINOP_CONCAT},
973 {
"Oabs",
"\"abs\"", UNOP_ABS},
974 {
"Onot",
"\"not\"", UNOP_LOGICAL_NOT},
975 {
"Oadd",
"\"+\"", UNOP_PLUS},
976 {
"Osubtract",
"\"-\"", UNOP_NEG},
988 static char *encoding_buffer = NULL;
989 static size_t encoding_buffer_size = 0;
996 GROW_VECT (encoding_buffer, encoding_buffer_size,
1000 for (p =
decoded; *p !=
'\0'; p += 1)
1004 encoding_buffer[k] = encoding_buffer[k + 1] =
'_';
1018 error (
_(
"invalid Ada operator name: %s"), p);
1022 strcpy (encoding_buffer + k, mapping->
encoded);
1023 k += strlen (mapping->
encoded);
1028 encoding_buffer[k] = *p;
1033 encoding_buffer[k] =
'\0';
1034 return encoding_buffer;
1053 static char *fold_buffer = NULL;
1054 static size_t fold_buffer_size = 0;
1056 int len = strlen (
name);
1057 GROW_VECT (fold_buffer, fold_buffer_size, len + 1);
1059 if (
name[0] ==
'\'')
1061 strncpy (fold_buffer,
name + 1, len - 2);
1062 fold_buffer[len - 2] =
'\000';
1068 for (i = 0; i <= len; i += 1)
1069 fold_buffer[i] = tolower (
name[i]);
1080 return (isdigit (c) || (isalpha (c) && islower (c)));
1098 if (*len > 1 && isdigit (
encoded[*len - 1]))
1102 while (i > 0 && isdigit (
encoded[i]))
1104 if (i >= 0 &&
encoded[i] ==
'.')
1106 else if (i >= 0 &&
encoded[i] ==
'$')
1173 static char *decoding_buffer = NULL;
1174 static size_t decoding_buffer_size = 0;
1198 if (p != NULL && p -
encoded < len0 - 3)
1228 GROW_VECT (decoding_buffer, decoding_buffer_size, 2 * len0 + 1);
1233 if (len0 > 1 && isdigit (
encoded[len0 - 1]))
1236 while ((i >= 0 && isdigit (
encoded[i]))
1248 for (i = 0, j = 0; i < len0 && !isalpha (
encoded[i]); i += 1, j += 1)
1255 if (at_start_name &&
encoded[i] ==
'O')
1264 && !isalnum (
encoded[i + op_len]))
1294 while (k < len0 && isdigit (
encoded[k]))
1321 while (k < len0 && isdigit (
encoded[k]))
1332 || (k < len0 &&
encoded[k] ==
'_'))
1346 const char *ptr =
encoded + i - 1;
1351 || (ptr >
encoded && ptr[0] ==
'_' && ptr[-1] ==
'_'))
1370 else if (i < len0 - 2 &&
encoded[i] ==
'_' &&
encoded[i + 1] ==
'_')
1392 for (i = 0;
decoded[i] !=
'\0'; i += 1)
1433 const char **resultp =
1443 if (obstack != NULL)
1445 = (
const char *) obstack_copy0 (obstack, decoded, strlen (decoded));
1457 *slot = xstrdup (decoded);
1476 const char *demangled =
ada_decode (mangled);
1480 if (demangled != mangled && demangled != NULL && demangled[0] !=
'<')
1542 if (index_desc_type == NULL)
1572 "LB0",
"UB0",
"LB1",
"UB1",
"LB2",
"UB2",
"LB3",
"UB3",
1573 "LB4",
"UB4",
"LB5",
"UB5",
"LB6",
"UB6",
"LB7",
"UB7" 1578 #define MAX_ADA_DIMENS (sizeof(bound_name) / (2*sizeof(char *))) 1587 static struct type *
1616 static struct type *
1621 if (base_type == NULL)
1629 if (alt_type == NULL)
1638 static struct value *
1665 static struct type *
1695 static struct value *
1702 struct type *bounds_type =
1706 if (bounds_type == NULL)
1707 error (
_(
"Bad GNAT array descriptor"));
1725 _(
"Bad GNAT array descriptor"));
1739 error (
_(
"Bad GNAT array descriptor"));
1775 static struct type *
1798 static struct value *
1807 _(
"Bad GNAT array descriptor"));
1840 static struct value *
1844 _(
"Bad GNAT array descriptor bounds"));
1875 static struct type *
1950 return (data_type != NULL
1990 struct type *array_type =
2001 struct type *elt_type;
2003 struct value *descriptor;
2008 if (elt_type == NULL || arity == 0)
2044 TYPE_LENGTH (array_type) = (array_bitsize + 7) / 8;
2065 if (arrType == NULL)
2087 error (
_(
"Bounds unavailable for null array pointer."));
2153 const char *raw_name;
2170 tail = strstr (raw_name,
"___XP");
2173 if (sscanf (tail +
sizeof (
"___XP") - 1,
"%ld", &
bits) != 1)
2176 (
_(
"could not understand bit size information on packed array"));
2200 static struct type *
2203 struct type *new_elt_type;
2205 struct type *index_type_desc;
2206 struct type *index_type;
2207 LONGEST low_bound, high_bound;
2214 if (index_type_desc)
2231 low_bound = high_bound = 0;
2232 if (high_bound < low_bound)
2236 *elt_bits *= (high_bound - low_bound + 1);
2248 static struct type *
2254 struct type *shadow_type;
2263 name = (
char *) alloca (strlen (raw_name) + 1);
2264 tail = strstr (raw_name,
"___XP");
2267 memcpy (
name, raw_name, tail - raw_name);
2268 name[tail - raw_name] =
'\000';
2272 if (shadow_type == NULL)
2274 lim_warning (
_(
"could not find bounds information on packed array"));
2282 "information on packed array"));
2296 static struct value *
2315 error (
_(
"can't unpack array"));
2326 int bit_size, bit_pos;
2351 static struct value *
2355 int bits, elt_off, bit_off;
2356 long elt_total_bit_offset;
2357 struct type *elt_type;
2361 elt_total_bit_offset = 0;
2363 for (i = 0; i < arity; i += 1)
2368 (
_(
"attempt to do packed indexing of " 2369 "something other than a packed array"));
2373 LONGEST lowerbound, upperbound;
2379 lowerbound = upperbound = 0;
2383 if (idx < lowerbound || idx > upperbound)
2384 lim_warning (
_(
"packed array index %ld out of bounds"),
2387 elt_total_bit_offset += (idx - lowerbound) *
bits;
2431 gdb_byte *unpacked,
int unpacked_len,
2432 int is_big_endian,
int is_signed_type,
2435 int src_len = (bit_size + bit_offset +
HOST_CHAR_BIT - 1) / 8;
2443 int unpacked_bytes_left;
2445 unsigned long accum;
2451 int delta = is_big_endian ? -1 : 1;
2456 error (
_(
"Cannot unpack %d bits into buffer of %d bytes"),
2457 bit_size, unpacked_len);
2459 srcBitsLeft = bit_size;
2460 src_bytes_left = src_len;
2461 unpacked_bytes_left = unpacked_len;
2466 src_idx = src_len - 1;
2478 unpacked_idx = unpacked_len - 1;
2488 unpacked_bytes_left = unpacked_idx + 1;
2493 int sign_bit_offset = (bit_size + bit_offset - 1) % 8;
2495 src_idx = unpacked_idx = 0;
2496 unusedLS = bit_offset;
2499 if (is_signed_type && (src[src_len - 1] & (1 << sign_bit_offset)))
2504 while (src_bytes_left > 0)
2508 unsigned int unusedMSMask =
2512 unsigned int signMask = sign & ~unusedMSMask;
2515 (((src[src_idx] >> unusedLS) & unusedMSMask) | signMask) << accumSize;
2522 unpacked_bytes_left -= 1;
2523 unpacked_idx += delta;
2527 src_bytes_left -= 1;
2530 while (unpacked_bytes_left > 0)
2532 accum |= sign << accumSize;
2538 unpacked_bytes_left -= 1;
2539 unpacked_idx += delta;
2554 long offset,
int bit_offset,
int bit_size,
2581 staging.resize (staging_len);
2584 staging.data (), staging.size (),
2608 int src_len = (bit_size + bit_offset +
HOST_CHAR_BIT - 1) / 8;
2612 buf = (
gdb_byte *) alloca (src_len);
2624 long new_offset =
offset;
2655 memcpy (unpacked, staging.data (), staging.size ());
2670 int src_offset,
int n,
int bits_big_endian_p)
2672 unsigned int accum, mask;
2673 int accum_bits, chunk_size;
2679 if (bits_big_endian_p)
2681 accum = (
unsigned char) *source;
2696 mask = ((1 << chunk_size) - 1) << unused_right;
2699 | ((accum >> (accum_bits - chunk_size - unused_right)) & mask);
2701 accum_bits -= chunk_size;
2708 accum = (
unsigned char) *source >> src_offset;
2714 accum = accum + ((
unsigned char) *source << accum_bits);
2720 mask = ((1 << chunk_size) - 1) << targ_offset;
2721 *target = (*target & ~mask) | ((accum << targ_offset) & mask);
2723 accum_bits -= chunk_size;
2724 accum >>= chunk_size;
2736 static struct value *
2751 error (
_(
"Left operand of assignment is not a modifiable lvalue."));
2809 int bit_offset_in_container =
2841 struct type *elt_type;
2850 for (k = 0; k < arity; k += 1)
2853 error (
_(
"too many subscripts (%d expected)"), k);
2871 static struct value *
2883 for (k = 0; k < arity; k += 1)
2886 struct value *lwb_value;
2889 error (
_(
"too many subscripts (%d expected)"), k);
2905 static struct value *
2911 struct type *index_type
2918 LONGEST base_low_pos, low_pos;
2924 warning (
_(
"unable to get positions in slice, use bounds instead"));
2926 base_low_pos = base_low;
2930 + ((low_pos - base_low_pos)
2936 static struct value *
2941 struct type *index_type
2952 warning (
_(
"unable to get positions in slice, use bounds instead"));
2958 value_slice (array, low, high_pos - low_pos + 1));
3002 struct type *p_array_type;
3011 if (nindices >= 0 && k > nindices)
3013 while (k > 0 && p_array_type != NULL)
3018 return p_array_type;
3039 static struct type *
3042 struct type *result_type;
3047 error (
_(
"invalid dimension number to '%s"),
name);
3053 for (i = 1; i < n; i += 1)
3065 if (result_type == NULL)
3066 error (
_(
"attempt to take bound of something that is not an array"));
3081 struct type *
type, *index_type_desc, *index_type;
3102 index_type_desc = NULL;
3110 if (index_type_desc != NULL)
3117 for (i = 1; i < n; i++)
3137 struct type *arr_type;
3160 struct type *arr_type, *index_type;
3183 if (index_type != NULL)
3185 struct type *base_type;
3189 base_type = index_type;
3194 return high - low + 1;
3200 static struct value *
3204 struct type *index_type
3228 error (
_(
"Could not find operator name for opcode"));
3244 struct type *context_type = NULL;
3262 static struct value *
3264 struct type *context_type)
3270 struct value **argvec;
3305 case OP_ATR_MODULUS:
3315 case TERNOP_IN_RANGE:
3316 case BINOP_IN_BOUNDS:
3322 case OP_DISCRETE_RANGE:
3354 case BINOP_LOGICAL_AND:
3355 case BINOP_LOGICAL_OR:
3356 case BINOP_BITWISE_AND:
3357 case BINOP_BITWISE_IOR:
3358 case BINOP_BITWISE_XOR:
3361 case BINOP_NOTEQUAL:
3368 case BINOP_SUBSCRIPT:
3376 case UNOP_LOGICAL_NOT:
3386 case OP_VAR_MSYM_VALUE:
3393 case OP_INTERNALVAR:
3406 case STRUCTOP_STRUCT:
3420 error (
_(
"Unexpected operator during name resolution"));
3423 argvec = XALLOCAVEC (
struct value *, nargs + 1);
3424 for (i = 0; i < nargs; i += 1)
3448 if (n_candidates > 1)
3454 for (j = 0; j < n_candidates; j += 1)
3468 if (j < n_candidates)
3471 while (j < n_candidates)
3475 candidates[j] = candidates[n_candidates - 1];
3484 if (n_candidates == 0)
3485 error (
_(
"No definition found for %s"),
3487 else if (n_candidates == 1)
3489 else if (deprocedure_p
3493 (candidates, n_candidates, NULL, 0,
3497 error (
_(
"Could not find a match for %s"),
3541 if (n_candidates == 1)
3546 (candidates, n_candidates,
3551 error (
_(
"Could not find a match for %s"),
3570 case BINOP_BITWISE_AND:
3571 case BINOP_BITWISE_IOR:
3572 case BINOP_BITWISE_XOR:
3574 case BINOP_NOTEQUAL:
3582 case UNOP_LOGICAL_NOT:
3602 candidates[i].
block);
3615 if (exp->
elts[pc].
opcode == OP_VAR_MSYM_VALUE)
3695 return (n_actuals == 0);
3702 for (i = 0; i < n_actuals; i += 1)
3704 if (actuals[i] == NULL)
3727 struct type *return_type;
3736 if (return_type == NULL)
3742 return context_type == NULL || return_type == context_type;
3743 else if (context_type == NULL)
3764 int nsyms,
struct value **args,
int nargs,
3765 const char *
name,
struct type *context_type)
3775 for (fallback = 0;
m == 0 && fallback < 2; fallback++)
3777 for (k = 0; k < nsyms; k += 1)
3816 else if (N0 == NULL)
3822 for (k0 = strlen (N0) - 1; k0 > 0 && isdigit (N0[k0]); k0 -= 1)
3824 for (k1 = strlen (N1) - 1; k1 > 0 && isdigit (N1[k1]); k1 -= 1)
3826 if ((N0[k0] ==
'_' || N0[k0] ==
'$') && N0[k0 + 1] !=
'\000' 3827 && (N1[k1] ==
'_' || N1[k1] ==
'$') && N1[k1 + 1] !=
'\000')
3832 while (N0[n0] ==
'_' && n0 > 0 && N0[n0 - 1] ==
'_')
3835 while (N1[n1] ==
'_' && n1 > 0 && N1[n1 - 1] ==
'_')
3837 if (n0 == n1 && strncmp (N0, N1, n0) == 0)
3838 return (atoi (N0 + k0 + 1) < atoi (N1 + k1 + 1));
3840 return (strcmp (N0, N1) < 0);
3852 for (i = 1; i < nsyms; i += 1)
3857 for (j = i - 1; j >= 0; j -= 1)
3862 syms[j + 1] = syms[j];
3923 int *chosen = XALLOCAVEC (
int , nsyms);
3925 int first_choice = (max_results == 1) ? 1 : 2;
3928 if (max_results < 1)
3929 error (
_(
"Request to select 0 symbols!"));
3935 canceled because the command is ambiguous\n\ 3936 See set/show multiple-symbol."));
3945 if (max_results > 1)
3950 for (i = 0; i < nsyms; i += 1)
3952 if (syms[i].
symbol == NULL)
3992 else if (is_enumeral
4009 ?
_(
" in %s (enumeral)\n")
4014 ?
_(
" (enumeral)\n")
4020 n_chosen =
get_selections (chosen, nsyms, max_results, max_results > 1,
4023 for (i = 0; i < n_chosen; i += 1)
4024 syms[i] = syms[chosen[i]];
4047 int is_all_choice,
const char *annotation_suffix)
4052 int first_choice = is_all_choice ? 2 : 1;
4054 prompt = getenv (
"PS2");
4073 if (*args ==
'\0' && n_chosen == 0)
4075 else if (*args ==
'\0')
4078 choice = strtol (args, &args2, 10);
4079 if (args == args2 || choice < 0
4080 || choice > n_choices + first_choice - 1)
4081 error (
_(
"Argument must be choice number"));
4087 if (choice < first_choice)
4089 n_chosen = n_choices;
4090 for (j = 0; j < n_choices; j += 1)
4094 choice -= first_choice;
4096 for (j = n_chosen - 1; j >= 0 && choice < choices[j]; j -= 1)
4100 if (j < 0 || choice != choices[j])
4104 for (k = n_chosen - 1; k > j; k -= 1)
4105 choices[k + 1] = choices[k];
4106 choices[j + 1] = choice;
4111 if (n_chosen > max_results)
4112 error (
_(
"Select no more than %d of the above"), max_results);
4123 int oplen,
struct symbol *sym,
4137 memcpy (newexp->
elts + pc + 7, exp->
elts + pc + oplen,
4147 expp->reset (newexp);
4249 struct type *type0 =
4251 struct type *type1 =
4270 case BINOP_BITWISE_AND:
4271 case BINOP_BITWISE_IOR:
4272 case BINOP_BITWISE_XOR:
4276 case BINOP_NOTEQUAL:
4291 case UNOP_LOGICAL_NOT:
4333 const char **renamed_entity,
int *len,
4334 const char **renaming_expr)
4348 renamed_entity, len, renaming_expr);
4379 if (renamed_entity != NULL)
4380 *renamed_entity = info;
4381 suffix = strstr (info,
"___XE");
4382 if (suffix == NULL || suffix == info)
4385 *len = strlen (info) - strlen (suffix);
4387 if (renaming_expr != NULL)
4388 *renaming_expr = suffix;
4398 const char **renamed_entity,
int *len,
4399 const char **renaming_expr)
4439 if (renamed_entity != NULL)
4440 *renamed_entity = info;
4441 suffix = strstr (info,
"___XE");
4442 if (renaming_expr != NULL)
4443 *renaming_expr = suffix + 5;
4444 if (suffix == NULL || suffix == info)
4447 *len = suffix - info;
4455 static struct value *
4459 const char *sym_name;
4473 static struct value *
4501 struct type *formal_target =
4504 struct type *actual_target =
4514 struct value *result;
4580 static struct value *
4696 for (e = &sym_cache->
root[h]; *e != NULL; e = &(*e)->
next)
4698 if (
domain == (*e)->domain && strcmp (
name, (*e)->name) == 0)
4721 *
block = (*e)->block;
4758 sym_cache->
root[h] = e;
4760 = (
char *) obstack_alloc (&sym_cache->
cache_space, strlen (
name) + 1);
4761 strcpy (copy,
name);
4778 return (strstr (lookup_name,
"__") == NULL
4809 for (i = 0; i < n; i += 1)
4826 if (type0 == NULL || type1 == NULL
4860 int len0 = strlen (name0);
4865 || (len0 < strlen (name1) && strncmp (name0, name1, len0) == 0
4902 prevDefns[i].
symbol = sym;
4913 obstack_grow (obstackp, &info,
sizeof (
struct block_symbol));
4923 return obstack_object_size (obstackp) /
sizeof (
struct block_symbol);
4933 return (
struct block_symbol *) obstack_finish (obstackp);
4935 return (
struct block_symbol *) obstack_base (obstackp);
4951 memset (&result, 0,
sizeof (result));
4994 return (
name != NULL && strcmp (
name,
"<variable, no debug info>") == 0);
5025 int len_1 = strlen (name_1);
5026 int len_2 = strlen (name_2);
5073 for (i = 0; i < nsyms; i++)
5078 for (i = 1; i < nsyms; i++)
5083 for (i = 1; i < nsyms; i++)
5091 for (i = 1; i < nsyms; i++)
5128 for (j = 0; j < nsyms; j++)
5146 for (j = 0; j < nsyms; j += 1)
5162 for (j = i + 1; j < nsyms; j += 1)
5163 syms[j - 1] = syms[j];
5202 const char *suffix = strstr (
name,
"___XR");
5210 for (last = suffix - 3; last >
name; last--)
5211 if (last[0] ==
'_' && last[1] ==
'_')
5216 scope_len = last -
name;
5217 scope = (
char *)
xmalloc ((scope_len + 1) *
sizeof (char));
5219 strncpy (scope,
name, scope_len);
5220 scope[scope_len] =
'\0';
5248 if (strstr (
name,
"__") != NULL)
5289 int is_invisible = !
startswith (function_name, scope);
5292 return is_invisible;
5335 int nsyms,
const struct block *current_block)
5337 struct symbol *current_function;
5338 const char *current_function_name;
5340 int is_new_style_renaming;
5345 is_new_style_renaming = 0;
5346 for (i = 0; i < nsyms; i += 1)
5356 suffix = strstr (
name,
"___XR");
5360 int name_len = suffix -
name;
5363 is_new_style_renaming = 1;
5364 for (j = 0; j < nsyms; j += 1)
5365 if (i != j && syms[j].
symbol != NULL
5372 if (is_new_style_renaming)
5376 for (j = k = 0; j < nsyms; j += 1)
5377 if (syms[j].
symbol != NULL)
5388 if (current_block == NULL)
5392 if (current_function == NULL)
5396 if (current_function_name == NULL)
5412 for (j = i + 1; j < nsyms; j += 1)
5413 syms[j - 1] = syms[j];
5440 while (
block != NULL)
5528 renaming = renaming->
next)
5552 r_name = (renaming->
alias != NULL
5555 if (name_match (r_name, lookup_name, NULL))
5574 while (*string1 !=
'\0' && *string2 !=
'\0')
5578 if (isspace (*string1) || isspace (*string2))
5583 c1 = tolower (*string1);
5584 c2 = tolower (*string2);
5603 if (*string2 ==
'\0')
5612 if (*string2 ==
'(')
5617 return tolower (*string1) - tolower (*string2);
5619 return *string1 - *string2;
5675 memset (&data, 0,
sizeof data);
5749 int *made_global_lookup_p)
5753 if (made_global_lookup_p)
5754 *made_global_lookup_p = 0;
5795 if (made_global_lookup_p)
5796 *made_global_lookup_p = 1;
5833 int syms_from_global_search;
5839 domain, full_search, &syms_from_global_search);
5843 results_size = obstack_object_size (&obstack);
5844 *results = (
struct block_symbol *) malloc (results_size);
5849 if (ndefns == 0 && full_search && syms_from_global_search)
5852 if (ndefns == 1 && full_search && syms_from_global_search)
5893 for (i = 0; i < ndefs; ++i)
5895 if (!callback (results[i].
symbol))
5936 if (is_a_field_of_this != NULL)
5937 *is_a_field_of_this = 0;
5946 if (n_candidates == 0)
5969 if (sym.symbol != NULL)
5993 if (sym.symbol != NULL)
6020 const char *matching;
6021 const int len = strlen (str);
6025 if (len > 3 && str[0] ==
'_' && str[1] ==
'_' && isdigit (str[2]))
6028 while (isdigit (str[0]))
6034 if (str[0] ==
'.' || str[0] ==
'$')
6037 while (isdigit (matching[0]))
6039 if (matching[0] ==
'\0')
6045 if (len > 3 && str[0] ==
'_' && str[1] ==
'_' && str[2] ==
'_')
6048 while (isdigit (matching[0]))
6050 if (matching[0] ==
'\0')
6056 if (strcmp (str,
"TKB") == 0)
6072 if (len == 1 && str [0] ==
'N')
6077 if (len > 3 && str[0] ==
'_' && str [1] ==
'E' && isdigit (str[2]))
6080 while (isdigit (matching[0]))
6082 if ((matching[0] ==
'b' || matching[0] ==
's')
6083 && matching [1] ==
'\0')
6095 while (str[0] !=
'_' && str[0] !=
'\0')
6097 if (str[0] !=
'n' && str[0] !=
'b')
6103 if (str[0] ==
'\000')
6108 if (str[1] !=
'_' || str[2] ==
'\000')
6112 if (strcmp (str + 3,
"JM") == 0)
6119 if (strcmp (str + 3,
"LJM") == 0)
6123 if (str[4] ==
'F' || str[4] ==
'D' || str[4] ==
'B' 6124 || str[4] ==
'U' || str[4] ==
'P')
6126 if (str[4] ==
'R' && str[5] !=
'T')
6130 if (!isdigit (str[2]))
6132 for (k = 3; str[k] !=
'\0'; k += 1)
6133 if (!isdigit (str[k]) && str[k] !=
'_')
6137 if (str[0] ==
'$' && isdigit (str[1]))
6139 for (k = 2; str[k] !=
'\0'; k += 1)
6140 if (!isdigit (str[k]) && str[k] !=
'_')
6153 const char *decoded_name =
ada_decode (name0);
6159 if (decoded_name[0] ==
'<')
6162 for (i=0; decoded_name[i] !=
'\0'; i++)
6163 if (isalpha (decoded_name[i]) && !islower (decoded_name[i]))
6176 const char *
name = *namep;
6186 if ((t1 >=
'a' && t1 <=
'z') || (t1 >=
'0' && t1 <=
'9'))
6194 else if (t1 ==
'_' && ((
name[2] >=
'a' &&
name[2] <=
'z')
6195 ||
name[2] == target0))
6203 else if ((t0 >=
'a' && t0 <=
'z') || (t0 >=
'0' && t0 <=
'9'))
6222 const char *name0 =
name;
6226 const char *match =
name;
6230 for (
name += 1, p = patn + 1; *p !=
'\0';
name += 1, p += 1)
6236 if (
name[-1] ==
'_')
6252 size_t search_name_len = strlen (search_name);
6254 if (strncmp (sym_name, search_name, search_name_len) == 0
6259 && strncmp (sym_name + 5, search_name, search_name_len) == 0
6312 if (!found_sym && arg_sym != NULL)
6364 if (!found_sym && arg_sym != NULL)
6380 (
const char *sym_name,
6385 const char *text = m_encoded_name.c_str ();
6386 size_t text_len = m_encoded_name.size ();
6390 if (strncmp (sym_name, text, text_len) == 0)
6393 if (match && !m_encoded_p)
6399 const char *sym_name_copy = sym_name;
6400 bool has_angle_bracket;
6403 has_angle_bracket = (sym_name[0] ==
'<');
6404 match = (has_angle_bracket == m_verbatim_p);
6405 sym_name = sym_name_copy;
6408 if (match && !m_verbatim_p)
6417 for (tmp = sym_name; *tmp !=
'\0' && !isupper (*tmp); tmp++);
6424 if (!match && m_wild_match_p)
6431 if (strncmp (sym_name, text, text_len) == 0)
6440 if (comp_match_res != NULL)
6451 match_str = sym_name;
6455 comp_match_res->
set_match (match_str.c_str ());
6468 const char *text,
const char *word,
6475 const struct block *b, *surrounding_static_block = 0;
6522 lookup_name, text, word);
6531 surrounding_static_block = b;
6541 lookup_name, text, word);
6560 lookup_name, text, word);
6569 if (b == surrounding_static_block)
6579 lookup_name, text, word);
6603 return (strcmp (
name,
"ada__tags__dispatch_table") == 0);
6616 return (strcmp (
name,
"ada__tags__interface_tag") == 0);
6682 return (
name != NULL
6683 && strcmp (
name,
"ada__tags__dispatch_table") == 0);
6716 static struct value *
6721 int tag_byte_offset;
6722 struct type *tag_type;
6727 const gdb_byte *valaddr1 = ((valaddr == NULL)
6729 : valaddr + tag_byte_offset);
6730 CORE_ADDR address1 = (address == 0) ? 0 : address + tag_byte_offset;
6737 static struct type *
6742 if (type_name != NULL)
6758 struct type *ptr_type, *obj_type;
6804 if (offset_to_top == 0)
6811 if (offset_to_top == -1)
6822 if (offset_to_top > 0)
6823 offset_to_top = -offset_to_top;
6845 static struct type *
6860 static struct value *
6899 static char name[1024];
6907 for (p =
name; *p !=
'\0'; p += 1)
6990 return (
name != NULL
7006 if (
name != NULL && strcmp (
name,
"RETVAL") == 0)
7017 return (
name != NULL
7019 || strcmp (
name,
"REP") == 0
7021 ||
name[0] ==
'S' ||
name[0] ==
'R' ||
name[0] ==
'O'));
7061 return (
name != NULL &&
name[0] ==
'O');
7071 static char *result = NULL;
7072 static size_t result_len = 0;
7075 const char *discrim_end;
7076 const char *discrim_start;
7085 if (
name == NULL ||
name[0] ==
'\000')
7088 for (discrim_end =
name + strlen (
name) - 6; discrim_end !=
name;
7094 if (discrim_end ==
name)
7097 for (discrim_start = discrim_end; discrim_start !=
name + 3;
7100 if (discrim_start ==
name + 1)
7102 if ((discrim_start >
name + 3
7104 || discrim_start[-1] ==
'.')
7108 GROW_VECT (result, result_len, discrim_end - discrim_start + 1);
7109 strncpy (result, discrim_start, discrim_end - discrim_start);
7110 result[discrim_end - discrim_start] =
'\0';
7127 if (!isdigit (str[k]))
7134 while (isdigit (str[k]))
7136 RU = RU * 10 + (str[k] -
'0');
7194 if (val >=
L && val <= U)
7213 static struct value *
7215 struct type *arg_type)
7231 bit_pos % 8, bit_size,
type);
7304 struct type **field_type_p,
7305 int *byte_offset_p,
int *bit_offset_p,
int *bit_size_p,
7309 int parent_offset = -1;
7313 if (field_type_p != NULL)
7314 *field_type_p = NULL;
7315 if (byte_offset_p != NULL)
7317 if (bit_offset_p != NULL)
7319 if (bit_size_p != NULL)
7325 int fld_offset =
offset + bit_pos / 8;
7328 if (t_field_name == NULL)
7349 if (field_type_p != NULL)
7351 if (byte_offset_p != NULL)
7352 *byte_offset_p = fld_offset;
7353 if (bit_offset_p != NULL)
7354 *bit_offset_p = bit_pos % 8;
7355 if (bit_size_p != NULL)
7356 *bit_size_p = bit_size;
7362 field_type_p, byte_offset_p, bit_offset_p,
7363 bit_size_p, index_p))
7371 struct type *field_type
7379 field_type_p, byte_offset_p,
7380 bit_offset_p, bit_size_p, index_p))
7384 else if (index_p != NULL)
7391 if (parent_offset != -1)
7394 int fld_offset =
offset + bit_pos / 8;
7397 fld_offset, field_type_p, byte_offset_p,
7398 bit_offset_p, bit_size_p, index_p))
7426 static struct value *
7431 int parent_offset = -1;
7438 if (t_field_name == NULL)
7494 if (parent_offset != -1)
7508 int,
struct type *);
7516 static struct value *
7528 static struct value *
7554 error (
_(
"Cannot assign this kind of variant record"));
7556 else if (*index_p == 0)
7579 struct type *t, *t1;
7619 int bit_offset, bit_size, byte_offset;
7620 struct type *field_type;
7642 &field_type, &byte_offset, &bit_offset,
7652 &field_type, &byte_offset, &bit_offset,
7662 bit_offset, bit_size,
7670 if (v != NULL || no_err)
7673 error (
_(
"There is no member named %s."),
name);
7679 error (
_(
"Attempt to extract a component of " 7680 "a value that is not a record."));
7692 return std::move (tmp_stream.
string ());
7715 static struct type *
7720 int parent_offset = -1;
7725 if (refok &&
type != NULL)
7742 error (
_(
"Type %s is not a structure or union type"),
7753 if (t_field_name == NULL)
7787 for (j =
TYPE_NFIELDS (field_type) - 1; j >= 0; j -= 1)
7795 if (v_field_name != NULL
7813 if (parent_offset != -1)
7826 const char *name_str =
name != NULL ?
name :
_(
"<null>");
7828 error (
_(
"Type %s has no component named %s"),
7861 struct value *outer;
7862 struct value *discrim;
7871 if (discrim == NULL)
7884 return others_clause;
7942 static struct value *
7947 struct value *val = val0;
7966 return (off + alignment - 1) & ~(alignment - 1);
7984 len = strlen (
name);
7986 if (!isdigit (
name[len - 1]))
7989 if (isdigit (
name[len - 2]))
7990 align_offset = len - 2;
7992 align_offset = len - 1;
7994 if (align_offset < 7 || !
startswith (
name + align_offset - 6,
"___XV"))
8019 static struct type *
8042 if (strstr (
name,
"___XR") != NULL)
8064 if (function_sym != NULL)
8077 const int rename_len = function_name_len + 2
8078 + strlen (
name) + 6 ;
8089 if (function_name_len > 5
8090 && strstr (function_name,
"_ada_") == function_name)
8093 function_name_len -= 5;
8096 rename = (
char *) alloca (rename_len *
sizeof (
char));
8097 strncpy (rename, function_name, function_name_len);
8098 xsnprintf (rename + function_name_len, rename_len - function_name_len,
8103 const int rename_len = strlen (
name) + 6;
8105 rename = (
char *) alloca (rename_len *
sizeof (
char));
8106 xsnprintf (rename, rename_len *
sizeof (
char),
"%s___XR",
name);
8122 else if (type0 == NULL)
8140 if (type0_name != NULL && strstr (type0_name,
"___XR") != NULL
8141 && (type1_name == NULL || strstr (type1_name,
"___XR") == NULL))
8164 static struct type *
8167 struct type *result, *tmp;
8178 while (result != NULL)
8182 if (result_name == NULL)
8184 warning (
_(
"unexpected null name on descriptive type"));
8189 if (strcmp (result_name,
name) == 0)
8225 static struct type *
8228 struct type *result = NULL;
8248 if (type_name == NULL)
8251 len = strlen (type_name);
8253 name = (
char *) alloca (len + strlen (suffix) + 1);
8255 strcpy (
name, type_name);
8256 strcpy (
name + len, suffix);
8264 static struct type *
8293 && strstr (
name,
"___XVL") != NULL;
8317 static struct type *
8353 int keep_dynamic_fields)
8358 int nfields, bit_len;
8367 if (keep_dynamic_fields)
8393 for (f = 0; f < nfields; f += 1)
8407 const gdb_byte *field_valaddr = valaddr;
8409 struct type *field_type =
8459 field_address, dval, 0);
8512 if (off + fld_bit_len > bit_len)
8513 bit_len = off + fld_bit_len;
8523 if (variant_field >= 0)
8525 struct type *branch_type;
8546 if (branch_type == NULL)
8548 for (f = variant_field + 1; f <
TYPE_NFIELDS (rtype); f += 1)
8559 if (off + fld_bit_len > bit_len)
8560 bit_len = off + fld_bit_len;
8575 warning (
_(
"Invalid type size for `%s' detected: %d."),
8578 warning (
_(
"Invalid type size for <unnamed> detected: %d."),
8589 error (
_(
"record type with dynamic size is larger than varsize-limit"));
8596 static struct type *
8613 static struct type *
8636 for (f = 0; f < nfields; f += 1)
8661 sizeof (
struct field) * nfields);
8682 static struct type *
8689 struct type *branch_type;
8693 if (variant_field == -1)
8711 sizeof (
struct field) * nfields);
8725 if (branch_type == NULL)
8729 for (f = variant_field + 1; f < nfields; f += 1)
8764 static struct type *
8768 struct type *templ_type;
8775 if (templ_type != NULL)
8779 if (dval == NULL && valaddr == NULL && address == 0)
8800 static struct type *
8805 struct type *templ_type;
8806 struct type *var_type;
8811 var_type = var_type0;
8815 if (templ_type != NULL)
8816 var_type = templ_type;
8829 valaddr, address, dval);
8844 struct type *encoding_type)
8846 const char *bounds_str;
8869 bounds_str = strstr (
TYPE_NAME (encoding_type),
"___XDLU_");
8870 if (bounds_str == NULL)
8894 struct type *desc_type)
8918 static struct type *
8922 struct type *index_type_desc;
8923 struct type *result;
8924 int constrained_packed_array_p;
8925 static const char *xa_suffix =
"___XA";
8932 if (constrained_packed_array_p)
8941 if (index_type_desc == NULL)
8945 if (type_name != NULL)
8947 const int len = strlen (type_name);
8948 char *
name = (
char *) alloca (len + strlen (xa_suffix));
8950 if (type_name[len - 1] ==
'P')
8952 strcpy (
name, type_name);
8953 strcpy (
name + len - 1, xa_suffix);
8960 if (index_type_desc != NULL
8968 index_type_desc = NULL;
8971 if (index_type_desc == NULL)
8991 if (elt_type0 == elt_type && !constrained_packed_array_p)
9000 struct type *elt_type0;
9003 for (i =
TYPE_NFIELDS (index_type_desc); i > 0; i -= 1)
9021 for (i =
TYPE_NFIELDS (index_type_desc) - 1; i >= 0; i -= 1)
9031 error (
_(
"array type with dynamic size is larger than varsize-limit"));
9039 if (constrained_packed_array_p)
9071 static struct type *
9083 struct type *fixed_record_type =
9106 if (real_type != NULL)
9118 = (
char *) alloca (strlen (
name) + 7 );
9119 bool xvz_found =
false;
9135 _(
"unable to read value of %s (%s)"),
9136 xvz_name, except.message);
9142 fixed_record_type =
copy_type (fixed_record_type);
9168 return fixed_record_type;
9205 struct type *fixed_type =
9236 static struct type *
9270 static struct type *
9285 if (raw_real_type ==
type)
9351 static struct value *
9357 if (
type == type0 && val0 != NULL)
9403 if (n >= OP_ATR_FIRST && n <= (
int) OP_ATR_VAL)
9419 error (
_(
"'POS only defined on discrete types"));
9422 error (
_(
"enumeration value is invalid: can't find 'POS"));
9427 static struct value *
9435 static struct value *
9439 error (
_(
"'VAL only defined on discrete types"));
9441 error (
_(
"'VAL requires integral argument"));
9448 error (
_(
"argument to 'VAL out of range"));
9475 return (
name != NULL
9478 && (strcmp (
name,
"character") == 0
9479 || strcmp (
name,
"wide_character") == 0
9480 || strcmp (
name,
"wide_wide_character") == 0
9481 || strcmp (
name,
"unsigned char") == 0));
9538 struct type *real_type_namer;
9539 struct type *raw_real_type;
9560 if (real_type_namer == NULL
9571 if (raw_real_type == NULL)
9574 return raw_real_type;
9615 static char *result;
9616 static size_t result_len = 0;
9628 tmp = strrchr (
name,
'.');
9633 while ((tmp = strstr (
name,
"__")) != NULL)
9635 if (isdigit (tmp[2]))
9646 if (
name[1] ==
'U' ||
name[1] ==
'W')
9648 if (sscanf (
name + 2,
"%x", &v) != 1)
9655 if (isascii (v) && isprint (v))
9656 xsnprintf (result, result_len,
"'%c'", v);
9657 else if (
name[1] ==
'U')
9658 xsnprintf (result, result_len,
"[\"%02x\"]", v);
9660 xsnprintf (result, result_len,
"[\"%04x\"]", v);
9666 tmp = strstr (
name,
"__");
9668 tmp = strstr (
name,
"$");
9672 strncpy (result,
name, tmp -
name);
9673 result[tmp -
name] =
'\0';
9685 static struct value *
9694 static struct value *
9711 struct type *raw_real_type =
9716 if ((
type == raw_real_type)
9728 static struct value *
9738 static struct value *
9766 error (
_(
"unable to determine array bounds"));
9776 return (hi1 - lo1 == hi2 - lo2);
9785 static struct value *
9804 error (
_(
"unable to determine array bounds"));
9809 for (i = 0; i < hi - lo + 1; i++)
9823 static struct value *
9845 error (
_(
"cannot assign arrays of different length"));
9859 error (
_(
"Incompatible types in assignment"));
9865 static struct value *
9869 struct type *type1, *type2;
9904 v += v > 0 ? -1 : 1;
9929 struct type *arg1_type, *arg2_type;
9944 error (
_(
"Attempt to compare array with non-array"));
9967 for (i = 0; i <
m; i += 1)
10028 static struct value *
10033 struct type *lhs_type;
10035 LONGEST low_index, high_index;
10038 int max_indices, num_indices;
10044 for (i = 0; i < n; i += 1)
10054 error (
_(
"Left operand of assignment is not a modifiable lvalue."));
10070 error (
_(
"Left-hand side must be array or record."));
10073 max_indices = 4 * num_specs + 4;
10074 indices = XALLOCAVEC (
LONGEST, max_indices);
10075 indices[0] = indices[1] = low_index - 1;
10076 indices[2] = indices[3] = high_index + 1;
10079 for (i = 0; i < n; i += 1)
10085 &num_indices, max_indices,
10086 low_index, high_index);
10088 case OP_POSITIONAL:
10090 &num_indices, max_indices,
10091 low_index, high_index);
10095 error (
_(
"Misplaced 'others' clause"));
10097 num_indices, low_index, high_index);
10100 error (
_(
"Internal error: bad aggregate clause"));
10116 int *pos,
LONGEST *indices,
int *num_indices,
10121 if (ind - 1 == high)
10122 warning (
_(
"Extra components in aggregate ignored."));
10141 int *pos,
LONGEST *indices,
int *num_indices,
10146 int choice_pos, expr_pc;
10149 choice_pos = *pos += 3;
10151 for (j = 0; j < n_choices; j += 1)
10156 for (j = 0; j < n_choices; j += 1)
10161 if (op == OP_DISCRETE_RANGE)
10189 error (
_(
"Invalid record component association."));
10194 NULL, NULL, NULL, NULL, &ind))
10195 error (
_(
"Unknown component name: %s."),
name);
10196 lower = upper = ind;
10199 if (lower <= upper && (lower < low || upper > high))
10200 error (
_(
"Index in component association out of bounds."));
10204 while (lower <= upper)
10223 int *pos,
LONGEST *indices,
int num_indices,
10227 int expr_pc = *pos + 1;
10229 for (i = 0; i < num_indices - 2; i += 2)
10233 for (ind = indices[i + 1] + 1; ind < indices[i + 2]; ind += 1)
10237 localpos = expr_pc;
10254 for (i = 0; i < *
size; i += 2) {
10255 if (high >= indices[i] && low <= indices[i + 1])
10259 for (kh = i + 2; kh < *
size; kh += 2)
10260 if (high < indices[kh])
10262 if (low < indices[i])
10264 indices[i + 1] = indices[kh - 1];
10265 if (high > indices[i + 1])
10266 indices[i + 1] = high;
10267 memcpy (indices + i + 2, indices + kh, *
size - kh);
10268 *
size -= kh - i - 2;
10271 else if (high < indices[i])
10275 if (*
size == max_size)
10276 error (
_(
"Internal error: miscounted aggregate components."));
10278 for (j = *
size-1; j >= i+2; j -= 1)
10279 indices[j] = indices[j - 2];
10281 indices[i + 1] = high;
10287 static struct value *
10566 if (exp->
elts[pc].
opcode == OP_VAR_MSYM_VALUE
10572 if (exp->
elts[pc].
opcode == OP_VAR_MSYM_VALUE)
10611 static struct value *
10619 struct value *arg1 = NULL, *arg2 = NULL, *arg3;
10622 struct value **argvec;
10645 if ((op == OP_FLOAT || op == OP_LONG) && expect_type != NULL)
10652 struct value *result;
10696 (
_(
"Fixed-point values must be assigned to fixed-point variables"));
10717 error (
_(
"Operands of fixed-point addition must have the same type"));
10743 error (
_(
"Operands of fixed-point subtraction " 10744 "must have the same type"));
10779 case BINOP_NOTEQUAL:
10791 if (op == BINOP_NOTEQUAL)
10808 case BINOP_LOGICAL_AND:
10809 case BINOP_LOGICAL_OR:
10810 case UNOP_LOGICAL_NOT:
10820 case BINOP_BITWISE_AND:
10821 case BINOP_BITWISE_IOR:
10822 case BINOP_BITWISE_XOR:
10846 error (
_(
"Unexpected unresolved symbol, %s, during evaluation"),
10882 struct type *actual_type;
10885 if (actual_type == NULL)
10891 actual_type =
type;
10932 argvec = XALLOCAVEC (
struct value *, nargs + 2);
10936 error (
_(
"Unexpected unresolved symbol, %s, during evaluation"),
10940 for (tem = 0; tem <= nargs; tem += 1)
10992 error (
_(
"cannot subscript or call something of type `%s'"),
11017 argvec[0], nargs, argvec + 1);
11026 error (
_(
"cannot subscript or call a record"));
11027 if (arity != nargs)
11028 error (
_(
"wrong number of subscripts; expecting %d"), arity);
11033 (argvec[0], nargs, argvec + 1));
11040 error (
_(
"element type of array unknown"));
11047 nargs, argvec + 1));
11054 error (
_(
"element type of array unknown"));
11060 nargs, argvec + 1));
11063 error (
_(
"Attempt to index or call something other than an " 11064 "array or function"));
11070 struct value *low_bound_val =
11072 struct value *high_bound_val =
11078 high_bound_val =
coerce_ref (high_bound_val);
11093 error (
_(
"cannot slice a packed array"));
11121 error (
_(
"cannot take slice of non-array"));
11132 struct type *arr_type0 =
11142 else if (high_bound < low_bound)
11149 case UNOP_IN_RANGE:
11160 lim_warning (
_(
"Membership test incompletely implemented; " 11161 "always returns true"));
11179 case BINOP_IN_BOUNDS:
11212 case TERNOP_IN_RANGE:
11232 case OP_ATR_LENGTH:
11234 struct type *type_arg;
11256 if (type_arg == NULL)
11263 if (op == OP_ATR_LENGTH)
11279 error (
_(
"unexpected attribute encountered"));
11286 case OP_ATR_LENGTH:
11304 error (
_(
"unexpected attribute encountered"));
11311 case OP_ATR_LENGTH:
11312 error (
_(
"the 'length attribute applies only to array types"));
11316 error (
_(
"unimplemented type attribute"));
11324 if (op == OP_ATR_LENGTH)
11339 error (
_(
"unexpected attribute encountered"));
11346 case OP_ATR_LENGTH:
11377 op == OP_ATR_MIN ? BINOP_MIN : BINOP_MAX);
11380 case OP_ATR_MODULUS:
11389 error (
_(
"'modulus must be applied to modular type"));
11473 preeval_pos = *pos;
11485 if (arrType == NULL)
11486 error (
_(
"Attempt to dereference null array pointer."));
11519 if (expect_type == NULL)
11530 error (
_(
"Attempt to take contents of a non-pointer value."));
11540 if (expect_type != NULL)
11554 case STRUCTOP_STRUCT:
11557 preeval_pos = *pos;
11609 error (
_(
"Attempt to use a type name as an expression"));
11614 case OP_DISCRETE_RANGE:
11615 case OP_POSITIONAL:
11621 error (
_(
"Undefined name, ambiguous name, or renaming used in " 11622 "component association: %s."), &exp->
elts[pc+2].
string);
11624 error (
_(
"Aggregates only allowed on the right of an assignment"));
11627 _(
"aggregate apparently mangled"));
11632 for (tem = 0; tem < nargs; tem += 1)
11648 static const char *
11656 const char *tail = strstr (
name,
"___XF_");
11690 static struct type *
11706 long long num, den;
11708 if (sscanf (encoding,
"_%lld_%lld", &num, &den) < 2)
11724 long long num0, den0, num1, den1;
11727 n = sscanf (encoding,
"_%lld_%lld_%lld_%lld",
11728 &num0, &den0, &num1, &den1);
11754 static char *bound_buffer = NULL;
11755 static size_t bound_buffer_len = 0;
11756 const char *pstart, *pend, *bound;
11757 struct value *bound_val;
11759 if (dval == NULL || str == NULL || str[k] ==
'\0')
11763 pend = strstr (pstart,
"__");
11767 k += strlen (bound);
11771 int len = pend - pstart;
11774 GROW_VECT (bound_buffer, bound_buffer_len, len + 1);
11775 strncpy (bound_buffer, pstart, len);
11776 bound_buffer[len] =
'\0';
11778 bound = bound_buffer;
11783 if (bound_val == NULL)
11787 if (pnew_k != NULL)
11796 static struct value *
11810 if (err_msg == NULL)
11813 error ((
"%s"), err_msg);
11847 static struct type *
11851 struct type *base_type;
11852 const char *subtype_info;
11860 base_type = raw_type;
11863 subtype_info = strstr (
name,
"___XD");
11864 if (subtype_info == NULL)
11869 if (L < INT_MIN || U >
INT_MAX)
11877 static char *name_buf = NULL;
11878 static size_t name_len = 0;
11879 int prefix_len = subtype_info -
name;
11882 const char *bounds_str;
11885 GROW_VECT (name_buf, name_len, prefix_len + 5);
11886 strncpy (name_buf,
name, prefix_len);
11887 name_buf[prefix_len] =
'\0';
11890 bounds_str = strchr (subtype_info,
'_');
11893 if (*subtype_info ==
'L')
11898 if (bounds_str[n] ==
'_')
11900 else if (bounds_str[n] ==
'.')
11906 strcpy (name_buf + prefix_len,
"___L");
11914 if (*subtype_info ==
'U')
11922 strcpy (name_buf + prefix_len,
"___U");
11925 lim_warning (
_(
"Unknown upper bound, using %ld."), (
long)
L);
11946 return (
name != NULL && strstr (
name,
"___XD"));
12014 "constraint_error",
12059 "__gnat_debug_raise_exception",
12060 "__gnat_unhandled_exception",
12061 "__gnat_debug_raise_assert_failure",
12062 "__gnat_begin_handler",
12072 "__gnat_raise_nodefer_with_msg",
12073 "__gnat_unhandled_exception",
12074 "system__assertions__raise_assert_failure",
12075 "__gnat_begin_handler",
12116 error (
_(
"Your Ada runtime appears to be missing some debugging " 12117 "information.\nCannot insert Ada exception catchpoint " 12118 "in this configuration."));
12126 error (
_(
"Symbol \"%s\" is not a function (class = %d)"),
12168 error (
_(
"Unable to insert catchpoint. Is this an Ada main program?"));
12176 error (
_(
"Unable to insert catchpoint. Try to start the program first."));
12185 error (
_(
"Cannot insert Ada exception catchpoints in this configuration."));
12198 const char *fullname;
12214 if (access (fullname, R_OK) != 0)
12236 if (func_name == NULL)
12242 if (re_exec (func_name.get ()))
12295 for (frame_level = 0; frame_level < 3; frame_level += 1)
12305 if (func_name != NULL)
12307 if (strcmp (func_name.get (),
12355 internal_error (__FILE__, __LINE__,
_(
"unexpected catchpoint type"));
12379 struct value *e_msg_val;
12380 char *e_msg = NULL;
12387 if (e_msg_val == NULL)
12396 if (e_msg_len <= 0)
12399 e_msg = (
char *)
xmalloc (e_msg_len + 1);
12402 e_msg[e_msg_len] =
'\0';
12414 char *e_msg = NULL;
12447 warning (
_(
"failed to get exception name: %s"), e.message);
12456 (
const char *excep_string,
12532 if (c->
loc == NULL)
12542 for (bl = c->
loc; bl != NULL; bl = bl->
next)
12561 warning (
_(
"failed to reevaluate internal exception condition " 12562 "for catchpoint %d: %s"),
12578 xfree (this->excep_string);
12624 if (ada_loc->excep_cond_expr == NULL)
12634 struct value *mark;
12643 _(
"Error in testing exception condition:\n"));
12667 char *exception_message;
12679 ?
"\nTemporary catchpoint " :
"\nCatchpoint ");
12681 uiout->
text (
", ");
12697 char exception_name[256];
12702 sizeof (exception_name) - 1);
12703 exception_name [
sizeof (exception_name) - 1] =
'\0';
12713 memcpy (exception_name,
"exception",
sizeof (
"exception"));
12721 uiout->
text (
"unhandled ");
12722 uiout->
field_string (
"exception-name", exception_name);
12731 uiout->
text (
"failed assertion");
12736 if (exception_message != NULL)
12740 uiout->
text (
" (");
12741 uiout->
field_string (
"exception-message", exception_message);
12747 uiout->
text (
" at ");
12772 *last_loc = b->
loc;
12789 uiout->
field_string (
"what",
"unhandled Ada exceptions");
12796 _(
"`%s' Ada exception handlers"),
12800 uiout->
field_string (
"what",
"all Ada exceptions handlers");
12804 uiout->
field_string (
"what",
"failed Ada assertions");
12808 internal_error (__FILE__, __LINE__,
_(
"unexpected catchpoint type"));
12824 :
_(
"Catchpoint "));
12826 uiout->
text (
": ");
12836 uiout->
text (info);
12840 uiout->
text (
_(
"all Ada exceptions"));
12844 uiout->
text (
_(
"unhandled Ada exceptions"));
12853 uiout->
text (info.c_str ());
12856 uiout->
text (
_(
"all Ada exceptions handlers"));
12860 uiout->
text (
_(
"failed Ada assertions"));
12864 internal_error (__FILE__, __LINE__,
_(
"unexpected catchpoint type"));
12899 internal_error (__FILE__, __LINE__,
_(
"unexpected catchpoint type"));
13101 const char *args = *argsp;
13106 if (args[0] ==
'\0')
13119 result = (
char *)
xmalloc (end - args + 1);
13120 strncpy (result, args, end - args);
13121 result[end - args] =
'\0';
13138 bool is_catch_handlers_cmd,
13140 char **excep_string,
13141 char **cond_string)
13144 char *exception_name;
13148 if (exception_name != NULL && strcmp (exception_name,
"if") == 0)
13153 xfree (exception_name);
13154 exception_name = NULL;
13163 && (isspace (args[2]) || args[2] ==
'\0'))
13168 if (args[0] ==
'\0')
13169 error (
_(
"Condition missing after `if' keyword"));
13170 cond = xstrdup (args);
13173 args += strlen (args);
13179 if (args[0] !=
'\0')
13180 error (
_(
"Junk at end of expression"));
13184 if (is_catch_handlers_cmd)
13188 *excep_string = exception_name;
13190 else if (exception_name == NULL)
13194 *excep_string = NULL;
13196 else if (strcmp (exception_name,
"unhandled") == 0)
13200 *excep_string = NULL;
13206 *excep_string = exception_name;
13208 *cond_string = cond;
13214 static const char *
13237 _(
"unexpected catchpoint kind (%d)"), ex);
13263 _(
"unexpected catchpoint kind (%d)"), ex);
13281 bool is_standard_exc =
false;
13282 const char *actual_exc_expr;
13283 char *ref_exc_expr;
13289 actual_exc_expr = (
"long_integer (GNAT_GCC_exception_Access" 13290 "(gcc_exception).all.occurrence.id)");
13293 actual_exc_expr =
"long_integer (e)";
13314 for (i = 0; i <
sizeof (
standard_exc) /
sizeof (
char *); i++)
13318 is_standard_exc =
true;
13323 if (is_standard_exc)
13324 ref_exc_expr =
xstrprintf (
"long_integer (&standard.%s)", excep_string);
13326 ref_exc_expr =
xstrprintf (
"long_integer (&%s)", excep_string);
13328 char *result =
xstrprintf (
"%s = %s", actual_exc_expr, ref_exc_expr);
13329 xfree (ref_exc_expr);
13347 const char *sym_name;
13368 *addr_string = xstrdup (sym_name);
13398 char *excep_string,
13404 const char *addr_string = NULL;
13411 ops, tempflag, disabled, from_tty);
13412 c->excep_string = excep_string;
13414 if (cond_string != NULL)
13425 const char *arg = arg_entry;
13429 char *excep_string = NULL;
13430 char *cond_string = NULL;
13439 excep_string, cond_string,
13450 const char *arg = arg_entry;
13454 char *excep_string = NULL;
13455 char *cond_string = NULL;
13464 excep_string, cond_string,
13484 && (isspace (args[2]) || args[2] ==
'\0'))
13488 if (args[0] ==
'\0')
13489 error (
_(
"condition missing after `if' keyword"));
13490 *cond_string = xstrdup (args);
13495 else if (args[0] !=
'\0')
13496 error (
_(
"Junk at end of arguments."));
13505 const char *arg = arg_entry;
13508 char *cond_string = NULL;
13532 && type_name != NULL && strcmp (type_name,
"exception") == 0);
13571 result = strcmp (
name, other.
name);
13574 if (result == 0 &&
addr < other.
addr)
13594 std::sort (exceptions->begin () + skip, exceptions->end ());
13595 exceptions->erase (std::unique (exceptions->begin () + skip, exceptions->end ()),
13596 exceptions->end ());
13611 std::vector<ada_exc_info> *exceptions)
13623 if (msymbol.
minsym != NULL)
13628 exceptions->push_back (info);
13647 std::vector<ada_exc_info> *exceptions)
13670 exceptions->push_back (info);
13685 return (preg == NULL
13710 std::vector<ada_exc_info> *exceptions)
13720 [&] (
const char *search_name)
13722 const char *decoded =
ada_decode (search_name);
13746 exceptions->push_back (info);
13758 static std::vector<ada_exc_info>
13761 std::vector<ada_exc_info> result;
13775 prev_len = result.size ();
13778 if (result.size () > prev_len)
13784 prev_len = result.size ();
13786 if (result.size () > prev_len)
13806 std::vector<ada_exc_info>
13809 if (regexp == NULL)
13825 if (regexp != NULL)
13827 (
_(
"All Ada exceptions matching regular expression \"%s\":\n"), regexp);
13840 #define ADA_OPERATORS \ 13841 OP_DEFN (OP_VAR_VALUE, 4, 0, 0) \ 13842 OP_DEFN (BINOP_IN_BOUNDS, 3, 2, 0) \ 13843 OP_DEFN (TERNOP_IN_RANGE, 1, 3, 0) \ 13844 OP_DEFN (OP_ATR_FIRST, 1, 2, 0) \ 13845 OP_DEFN (OP_ATR_LAST, 1, 2, 0) \ 13846 OP_DEFN (OP_ATR_LENGTH, 1, 2, 0) \ 13847 OP_DEFN (OP_ATR_IMAGE, 1, 2, 0) \ 13848 OP_DEFN (OP_ATR_MAX, 1, 3, 0) \ 13849 OP_DEFN (OP_ATR_MIN, 1, 3, 0) \ 13850 OP_DEFN (OP_ATR_MODULUS, 1, 1, 0) \ 13851 OP_DEFN (OP_ATR_POS, 1, 2, 0) \ 13852 OP_DEFN (OP_ATR_SIZE, 1, 1, 0) \ 13853 OP_DEFN (OP_ATR_TAG, 1, 1, 0) \ 13854 OP_DEFN (OP_ATR_VAL, 1, 2, 0) \ 13855 OP_DEFN (UNOP_QUAL, 3, 1, 0) \ 13856 OP_DEFN (UNOP_IN_RANGE, 3, 1, 0) \ 13857 OP_DEFN (OP_OTHERS, 1, 1, 0) \ 13858 OP_DEFN (OP_POSITIONAL, 3, 1, 0) \ 13859 OP_DEFN (OP_DISCRETE_RANGE, 1, 2, 0) 13871 #define OP_DEFN(op, len, args, binop) \ 13872 case op: *oplenp = len; *argsp = args; break; 13898 switch (elts[pos].opcode)
13900 case UNOP_IN_RANGE:
13918 static const char *
13926 #define OP_DEFN(op, len, args, binop) case op: return #op; 13931 return "OP_AGGREGATE";
13933 return "OP_CHOICES";
13945 int *oplenp,
int *argsp)
13950 *oplenp = *argsp = 0;
13953 #define OP_DEFN(op, len, args, binop) \ 13954 case op: *oplenp = len; *argsp = args; break; 13995 case OP_ATR_LENGTH:
13999 case OP_ATR_MODULUS:
14006 case UNOP_IN_RANGE:
14015 case BINOP_IN_BOUNDS:
14019 case TERNOP_IN_RANGE:
14024 case OP_DISCRETE_RANGE:
14025 case OP_POSITIONAL:
14044 for (i = 0; i < nargs; i += 1)
14056 int oplen, nargs, i;
14074 case BINOP_IN_BOUNDS:
14085 case TERNOP_IN_RANGE:
14100 case OP_ATR_LENGTH:
14104 case OP_ATR_MODULUS:
14123 for (tem = 1; tem < nargs; tem += 1)
14139 case UNOP_IN_RANGE:
14147 case OP_DISCRETE_RANGE:
14159 for (i = 0; i < nargs-1; i += 1)
14169 case OP_POSITIONAL:
14175 for (i = 0; i < nargs; i += 1)
14256 0,
"long_integer");
14259 0,
"short_integer");
14271 0,
"long_long_integer");
14288 =
"system__address";
14358 if (user_name[0] ==
'<')
14360 if (user_name.back () ==
'>')
14373 m_encoded_p = user_name.find (
"__") != std::string::npos;
14379 if (encoded != NULL)
14407 && user_name.find (
'.') == std::string::npos);
14439 if (comp_match_res != NULL)
14469 static struct value *
14473 const struct block *frame_block = NULL;
14474 struct symbol *renaming_sym = NULL;
14482 if (renaming_sym != NULL)
14492 ".adb",
".ads",
".a",
".ada",
".dg", NULL
14554 "\"set ada\" must be followed by the name of a setting.\n"));
14636 _(
"Prefix command for changing Ada-specfic settings"),
14640 _(
"Generic command for showing Ada-specific settings."),
14645 Enable or disable an optimization trusting PAD types over XVS types"),
_(
"\ 14646 Show whether an optimization trusting PAD types over XVS types is activated"),
14648 This is related to the encoding used by the GNAT compiler. The debugger\n\ 14649 should normally trust the contents of PAD types, but certain older versions\n\ 14650 of GNAT have a bug that sometimes causes the information in the PAD type\n\ 14651 to be incorrect. Turning this setting \"off\" allows the debugger to\n\ 14652 work around this bug. It is always safe to turn this option \"off\", but\n\ 14653 this incurs a slight performance penalty, so it is recommended to NOT change\n\ 14654 this option to \"off\" unless necessary."),
14659 Enable or disable the output of formal and return types for functions in the \ 14660 overloads selection menu"),
_(
"\ 14661 Show whether the output of formal and return types for functions in the \ 14662 overloads selection menu is activated"),
14666 Catch Ada exceptions, when raised.\n\ 14667 With an argument, catch only exceptions with the given name."),
14674 Catch Ada exceptions, when handled.\n\ 14675 With an argument, catch only exceptions with the given name."),
14681 Catch failed Ada assertions, when raised.\n\ 14682 With an argument, catch only exceptions with the given name."),
14692 List all Ada exception names.\n\ 14693 If a regular expression is passed as an argument, only those matching\n\ 14694 the regular expression are listed."));
14697 _(
"Set Ada maintenance-related variables."),
14702 _(
"Show Ada maintenance-related variables"),
14709 _(
"Set whether descriptive types generated by GNAT should be ignored."),
14710 _(
"Show whether descriptive types generated by GNAT should be ignored."),
14712 When enabled, the debugger will stop using the DW_AT_GNAT_descriptive_type\n\ 14713 DWARF attribute."),
14717 (256, htab_hash_string, (
int (*)(
const void *,
const void *))
streq,
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)
static int is_valid_name_for_wild_match(const char *name0)
struct value * value_zero(struct type *type, enum lval_type lv)
static struct type * template_to_fixed_record_type(struct type *type, const gdb_byte *valaddr, CORE_ADDR address, struct value *dval0)
const ada_lookup_name_info & ada() const
static void ada_remove_trailing_digits(const char *encoded, int *len)
union exp_element elts[1]
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)
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 print_mention_catch_exception_unhandled(struct breakpoint *b)
static void ada_operator_length(const struct expression *exp, int pc, int *oplenp, int *argsp)
struct symbol * language_lookup_primitive_type_as_symbol(const struct language_defn *la, struct gdbarch *gdbarch, const char *name)
static int ada_lookup_symbol_list_worker(const lookup_name_info &lookup_name, const struct block *block, domain_enum domain, struct block_symbol **results, int full_search)
static int ada_args_match(struct symbol *, struct value **, int)
static void ada_add_all_symbols(struct obstack *, const struct block *, const lookup_name_info &lookup_name, domain_enum, int, int *)
static struct value * ada_value_slice(struct value *array, int low, int high)
struct type * arch_type(struct gdbarch *gdbarch, enum type_code code, int bit, const char *name)
struct value * value_addr(struct value *arg1)
const struct floatformat ** gdbarch_double_format(struct gdbarch *gdbarch)
int ada_get_field_index(const struct type *type, const char *field_name, int maybe_missing)
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 * get_cmd_context(struct cmd_list_element *cmd)
static int old_renaming_is_invisible(const struct symbol *sym, const char *function_name)
struct type * create_static_range_type(struct type *result_type, struct type *index_type, LONGEST low_bound, LONGEST high_bound)
struct observer * observer_attach_free_objfile(observer_free_objfile_ftype *f)
struct type * builtin_long_double
void field_core_addr(const char *fldname, struct gdbarch *gdbarch, CORE_ADDR address)
#define SYMBOL_PRINT_NAME(symbol)
static void print_one_catch_exception_unhandled(struct breakpoint *b, struct bp_location **last_loc)
static int advance_wild_match(const char **, const char *, int)
struct type * ada_parent_type(struct type *type)
struct value * value_subscript(struct value *array, LONGEST index)
static const char * standard_exc[]
const char * ada_tag_name(struct value *tag)
#define MSYMBOL_LINKAGE_NAME(symbol)
#define MSYMBOL_LANGUAGE(symbol)
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)
void field_string(const char *fldname, const char *string)
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)
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)
unsigned int default_search_name_hash(const char *string0)
const struct lang_varobj_ops ada_varobj_ops
int ptid_get_pid(const ptid_t &ptid)
gdb::unique_xmalloc_ptr< expression > expression_up
const char multiple_symbols_cancel[]
char * ada_encode(const char *decoded)
static bool do_full_match(const char *symbol_search_name, const lookup_name_info &lookup_name, completion_match_result *comp_match_res)
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)
bool wild_match_p() const
struct obstack * obstackp
#define GDBARCH_OBSTACK_CALLOC(GDBARCH, NR, TYPE)
static void ada_add_exceptions_from_frame(compiled_regex *preg, struct frame_info *frame, std::vector< ada_exc_info > *exceptions)
struct frame_info * get_prev_frame(struct frame_info *this_frame)
static int parse(struct parser_state *ps)
char * command_line_input(const char *, int, const char *)
LONGEST value_as_long(struct value *val)
int gdbarch_int_bit(struct gdbarch *gdbarch)
static struct bp_location * allocate_location_catch_handlers(struct breakpoint *self)
#define BMSYMBOL_VALUE_ADDRESS(symbol)
void warning(const char *fmt,...)
static symbol_name_match_type name_match_type_from_name(const char *lookup_name)
value * evaluate_var_value(enum noside noside, const block *blk, symbol *var)
static struct breakpoint_ops catch_exception_unhandled_breakpoint_ops
void expand_symtabs_matching(gdb::function_view< expand_symtabs_file_matcher_ftype > file_matcher, const lookup_name_info &lookup_name, gdb::function_view< expand_symtabs_symbol_matcher_ftype > symbol_matcher, gdb::function_view< expand_symtabs_exp_notify_ftype > expansion_notify, enum search_domain kind)
static struct value * ada_search_struct_field(const char *, struct value *, int, struct type *)
static void catch_ada_exception_command(const char *arg_entry, int from_tty, struct cmd_list_element *command)
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)
const char * symbol_search_name(const struct general_symbol_info *gsymbol)
#define TYPE_NAME(thistype)
bool operator==(const ada_exc_info &) const
LONGEST value_bitsize(const struct value *value)
static void sort_choices(struct block_symbol syms[], int nsyms)
char * ada_fold_name(const char *name)
enum print_stop_action(* print_it)(struct bpstats *bs)
#define INIT_CPLUS_SPECIFIC(type)
struct type * ada_to_fixed_type(struct type *type, const gdb_byte *valaddr, CORE_ADDR address, struct value *dval, int check_tag)
int deprecated_value_modifiable(const struct value *value)
struct type * value_enclosing_type(const struct value *value)
struct value * value_at(struct type *type, CORE_ADDR addr)
int ada_in_variant(LONGEST val, struct type *type, int field_num)
const struct floatformat ** gdbarch_long_double_format(struct gdbarch *gdbarch)
static void print_recreate_catch_handlers(struct breakpoint *b, struct ui_file *fp)
#define TYPE_HIGH_BOUND(range_type)
void install_breakpoint(int internal, std::unique_ptr< breakpoint > &&arg, int update_gll)
~ada_catchpoint() override
static void ada_print_symbol_signature(struct ui_file *stream, struct symbol *sym, const struct type_print_options *flags)
bool completion_mode() const
void annotate_field(int num)
enum domain_enum_tag domain_enum
struct type * arch_character_type(struct gdbarch *gdbarch, int bit, int unsigned_p, const char *name)
static int num_visible_fields(struct type *type)
static void re_set_catch_handlers(struct breakpoint *b)
const struct type_print_options type_print_raw_options
const struct builtin_type * builtin_type(struct gdbarch *gdbarch)
int user_select_syms(struct block_symbol *syms, int nsyms, int max_results)
struct cmd_list_element * add_info(const char *name, cmd_const_cfunc_ftype *fun, const char *doc)
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)
void * memset(T *s, int c, size_t n)=delete
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
const struct language_defn * language_def(enum language lang)
static struct breakpoint_ops catch_assert_breakpoint_ops
int get_selections(int *choices, int n_choices, int max_results, int is_all_choice, const char *annotation_suffix)
const char * ada_decode(const char *encoded)
static int trust_pad_over_xvs
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)
static int remove_irrelevant_renamings(struct block_symbol *syms, int nsyms, const struct block *current_block)
static const char * ada_get_gdb_completer_word_break_characters(void)
void(* print_mention)(struct breakpoint *)
int operator_check_standard(struct expression *exp, int pos, int(*objfile_func)(struct objfile *objfile, void *data), void *data)
static int ada_type_match(struct type *, struct type *, int)
int value_lazy(const struct value *value)
void ada_print_type(struct type *, const char *, struct ui_file *, int, int, const struct type_print_options *)
void _initialize_ada_language(void)
bool() symbol_name_matcher_ftype(const char *symbol_search_name, const lookup_name_info &lookup_name, completion_match_result *comp_match_res)
struct value * default_read_var_value(struct symbol *var, const struct block *var_block, 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)
expression_up parse_exp_1(const char **, CORE_ADDR pc, const struct block *, int)
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 char * ada_exception_message(void)
static struct type * to_fixed_range_type(struct type *, struct value *)
static char * ada_get_next_arg(const char **argsp)
struct observer * observer_attach_inferior_exit(observer_inferior_exit_ftype *f)
struct type * create_array_type_with_stride(struct type *result_type, struct type *element_type, struct type *range_type, struct dynamic_prop *byte_stride_prop, unsigned int bit_stride)
#define BLOCKVECTOR_BLOCK(blocklist, n)
CORE_ADDR() ada_unhandled_exception_name_addr_ftype(void)
static LONGEST ada_array_length(struct value *arr, int n)
static char * ada_exception_message_1(void)
static void ada_add_block_symbols(struct obstack *, const struct block *, const lookup_name_info &lookup_name, domain_enum, struct objfile *)
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
#define GROW_VECT(v, s, m)
char * skip_spaces(char *chp)
static void check_status_catch_exception(bpstat bs)
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 symbol * block_iter_match_first(const struct block *block, const lookup_name_info &name, struct block_iterator *iterator)
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
#define SET_FIELD_BITPOS(thisfld, bitpos)
int ada_is_range_type_name(const char *name)
#define TYPE_FIELD(thistype, n)
static int scan_discrim_bound(const char *str, int k, struct value *dval, LONGEST *px, int *pnew_k)
#define bits(obj, st, fn)
static const char * known_auxiliary_function_name_patterns[]
struct type * ada_check_typedef(struct type *type)
static const char * ada_lookup_name(const lookup_name_info &lookup_name)
struct value * ada_value_struct_elt(struct value *arg, const char *name, int no_err)
static symbol_name_matcher_ftype * ada_get_symbol_name_matcher(const lookup_name_info &lookup_name)
static struct type * to_fixed_array_type(struct type *, struct value *, int)
static value * ada_evaluate_subexp_for_cast(expression *exp, int *pos, enum noside noside, struct type *to_type)
static int is_known_support_routine(struct frame_info *frame)
static struct type * ada_lookup_struct_elt_type(struct type *, const char *, int, int)
#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)
static void ada_unpack_from_contents(const gdb_byte *src, int bit_offset, int bit_size, gdb_byte *unpacked, int unpacked_len, int is_big_endian, int is_signed_type, int is_scalar)
#define TYPE_FIELD_TYPE(thistype, n)
struct cache_entry * next
const gdb_byte * ada_aligned_value_addr(struct type *type, const gdb_byte *valaddr)
static void catch_ada_exception_command_split(const char *args, bool is_catch_handlers_cmd, enum ada_exception_catchpoint_kind *ex, char **excep_string, char **cond_string)
int ada_is_string_type(struct type *type)
struct value * allocate_value(struct type *type)
static struct cmd_list_element * show_ada_list
void text(const char *string)
static struct type * desc_base_type(struct type *)
static bool literal_symbol_name_matcher(const char *symbol_search_name, const lookup_name_info &lookup_name, completion_match_result *comp_match_res)
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 c_get_string(struct value *value, gdb_byte **buffer, int *length, struct type **char_type, const char **charset)
static int equiv_types(struct type *, struct type *)
const struct block * block_for_pc(CORE_ADDR pc)
const char * ada_attribute_name(enum exp_opcode n)
static CORE_ADDR ada_unhandled_exception_name_addr(void)
static struct value * ada_read_var_value(struct symbol *var, const struct block *var_block, struct frame_info *frame)
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 char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)
static const char * ada_exception_sym_name(enum ada_exception_catchpoint_kind ex)
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 void create_excep_cond_exprs(struct ada_catchpoint *c, enum ada_exception_catchpoint_kind ex)
static int return_match(struct type *func_type, struct type *context_type)
static char * xget_renaming_scope(struct type *renaming_type)
struct type * arch_integer_type(struct gdbarch *gdbarch, int bit, int unsigned_p, const char *name)
static struct type * ada_index_type(struct type *type, int n, const char *name)
ada_lookup_name_info(const lookup_name_info &lookup_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)
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)
int ada_lookup_symbol_list(const char *name, const struct block *block, domain_enum domain, struct block_symbol **results)
struct cmd_list_element * add_prefix_cmd(const char *name, enum command_class theclass, cmd_const_cfunc_ftype *fun, const char *doc, struct cmd_list_element **prefixlist, const char *prefixname, int allow_unknown, struct cmd_list_element **list)
static int is_ada95_tag(struct value *tag)
symbol_name_match_type match_type() const
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 **)
mach_port_t kern_return_t mach_port_t msgports mach_port_t kern_return_t pid_t pid mach_port_t kern_return_t mach_port_t task mach_port_t kern_return_t int flags
static void ada_collect_symbol_completion_matches(completion_tracker &tracker, complete_symbol_mode mode, symbol_name_match_type name_match_type, const char *text, const char *word, enum type_code code)
void ada_yyerror(const char *)
static int symbols_are_identical_enums(struct block_symbol *syms, int nsyms)
void null_cleanup(void *arg)
static void re_set_catch_exception(struct breakpoint *b)
static struct value * unwrap_value(struct value *)
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)
static void ada_add_standard_exceptions(compiled_regex *preg, std::vector< ada_exc_info > *exceptions)
value * eval_skip_value(expression *exp)
bool get_int_var_value(const char *name, LONGEST &value)
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)
struct value * ada_scaling_factor(struct type *type)
value * evaluate_var_msym_value(enum noside noside, struct objfile *objfile, minimal_symbol *msymbol)
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)
static void catch_ada_assert_command_split(const char *args, char **cond_string)
char * ada_main_name(void)
struct type * check_typedef(struct type *type)
static enum print_stop_action print_it_catch_handlers(bpstat bs)
#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 *)
static int print_signatures
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)
struct symbol * block_iter_match_next(const lookup_name_info &name, struct block_iterator *iterator)
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
std::unique_ptr< T, xfree_deleter< T > > unique_xmalloc_ptr
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 const char * fixed_type_info(struct type *type)
#define SYMBOL_DOMAIN(symbol)
int ada_prefer_type(struct type *type0, struct type *type1)
struct bp_location * bp_location_at
objfile(bfd *, const char *, objfile_flags)
LONGEST ada_discrete_type_high_bound(struct type *type)
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 **)
static void show_ada_command(const char *args, int from_tty)
void fprintf_filtered(struct ui_file *stream, const char *format,...)
static struct block_symbol * defns_collected(struct obstack *, int)
ULONGEST ada_modulus(struct type *type)
static int encoded_ordered_before(const char *N0, const char *N1)
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 extract_unsigned_integer(const gdb_byte *addr, int len, enum bfd_endian byte_order)
struct type * arch_float_type(struct gdbarch *gdbarch, int bit, const char *name, const struct floatformat **floatformats)
const struct block * block
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)
struct value * value_cast_pointers(struct type *type, struct value *arg2, int subclass_check)
std::vector< ada_exc_info > ada_exceptions_list(const char *regexp)
expression_up excep_cond_expr
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 const lookup_name_info & match_any()
static struct symbol * find_old_style_renaming_symbol(const char *, const struct block *)
static int scalar_type_p(struct type *)
static struct htab * decoded_names_store
static void maint_show_ada_cmd(const char *args, 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 bool do_wild_match(const char *symbol_search_name, const lookup_name_info &lookup_name, completion_match_result *comp_match_res)
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)
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
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)
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
const char * op_string(enum exp_opcode op)
static int is_nonfunction(struct block_symbol *, int)
static void add_component_interval(LONGEST, LONGEST, LONGEST *, int *, int)
#define ALL_COMPUNITS(objfile, cu)
struct using_direct * block_using(const struct block *block)
static void ada_free_symbol_cache(struct ada_symbol_cache *sym_cache)
struct value * ada_delta(struct type *type)
static struct value * ada_value_cast(struct type *type, struct value *arg2)
static int ada_is_packed_array_type(struct type *)
struct type * ada_find_parallel_type(struct type *type, const char *suffix)
static bool completion_skip_symbol(complete_symbol_mode mode, Symbol *sym)
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 struct symbol * standard_lookup(const char *, const struct block *, domain_enum)
static bool ada_symbol_name_matches(const char *symbol_search_name, const lookup_name_info &lookup_name, completion_match_result *comp_match_res)
static int is_package_name(const char *name)
struct cache_entry * root[HASH_SIZE]
const struct block * block
#define BLOCK_SUPERBLOCK(bl)
union general_symbol_info::@172 language_specific
int ada_is_wrapper_field(struct type *type, int field_num)
struct gdbarch * get_type_arch(const struct type *type)
static int ada_is_unconstrained_packed_array_type(struct type *)
std::string m_encoded_name
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)
static void add_symbols_from_enclosing_procs(struct obstack *obstackp, const lookup_name_info &lookup_name, domain_enum domain)
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 int remove_extra_symbols(struct block_symbol *syms, int nsyms)
static LONGEST ada_array_bound(struct value *arr, int n, int which)
static int ada_value_equal(struct value *arg1, struct value *arg2)
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)
struct value * value_cast(struct type *type, struct value *arg2)
static void print_mention_catch_handlers(struct breakpoint *b)
const char * skip_to_space(const char *chp)
static struct type * to_record_with_fixed_variant_part(struct type *type, const gdb_byte *valaddr, CORE_ADDR address, struct value *dval0)
int ada_is_array_descriptor_type(struct type *type)
void set_value_offset(struct value *value, LONGEST offset)
char * xstrprintf(const char *format,...)
static struct type * template_to_static_fixed_type(struct type *type0)
void printf_unfiltered(const char *format,...)
#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)
LONGEST value_bitpos(const struct value *value)
static char * ada_encode_1(const char *decoded, bool throw_errors)
static enum print_stop_action print_it_exception(enum ada_exception_catchpoint_kind ex, bpstat bs)
#define TYPE_FIELDS(thistype)
static void ada_add_local_symbols(struct obstack *obstackp, const lookup_name_info &lookup_name, const struct block *block, domain_enum domain)
void read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
#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)
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
static void check_status_catch_handlers(bpstat bs)
struct breakpoint_ops bkpt_breakpoint_ops
static const char * ada_op_name(enum exp_opcode)
#define gdb_print_host_address(ADDR, STREAM)
static int fat_pntr_data_bitpos(struct type *)
unsigned int msymbol_hash(const char *string)
struct ada_symbol_cache * sym_cache
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)
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 std::string type_as_string(struct type *type)
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 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)
static void info_exceptions_command(const char *regexp, int from_tty)
int ada_is_tag_type(struct type *type)
#define ALL_OBJFILE_COMPUNITS(objfile, cu)
static void ada_add_global_exceptions(compiled_regex *preg, std::vector< ada_exc_info > *exceptions)
symtab_and_line find_frame_sal(frame_info *frame)
static void set_ada_command(const char *arg, int from_tty)
struct using_direct * next
static struct value * decode_constrained_packed_array(struct value *)
static struct value * ada_to_fixed_value_create(struct type *, CORE_ADDR, struct value *)
struct minimal_symbol * msymbol
int ada_scan_number(const char str[], int k, LONGEST *R, int *new_k)
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)
static int ada_sniff_from_mangled_name(const char *mangled, char **out)
struct breakpoint * breakpoint_at
struct value * value_ref(struct value *arg1, enum type_code refcode)
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)
static int ada_resolve_function(struct block_symbol *, int, struct value **, int, const char *, struct type *)
int ada_which_variant_applies(struct type *var_type, struct type *outer_type, const gdb_byte *outer_valaddr)
static const struct bp_location_ops ada_catchpoint_location_ops
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)
static struct bp_location * allocate_location_exception(enum ada_exception_catchpoint_kind ex, struct breakpoint *self)
int ada_array_arity(struct type *type)
gdb::unique_xmalloc_ptr< char > c_watch_location_expression(struct type *type, CORE_ADDR addr)
const char * ada_variant_discrim_name(struct type *type0)
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 void add_nonlocal_symbols(struct obstack *obstackp, const lookup_name_info &lookup_name, domain_enum domain, int global)
static const char ada_completer_word_break_characters[]
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)
bool matches(const char *symbol_search_name, symbol_name_match_type match_type, completion_match_result *comp_match_res) const
void value_fetch_lazy(struct value *val)
void set_match(const char *m, const char *m_for_lcd=NULL)
struct type * builtin_double
struct value * value_neg(struct value *arg1)
static int ada_add_block_renamings(struct obstack *obstackp, const struct block *block, const lookup_name_info &lookup_name, domain_enum domain)
struct type * ada_aligned_type(struct type *type)
static struct value * desc_data(struct value *)
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)
static void catch_assert_command(const char *arg_entry, int from_tty, struct cmd_list_element *command)
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
const std::string & name() const
const char * catch_handlers_sym
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)
static struct cmd_list_element * maint_show_ada_cmdlist
static int ada_is_non_standard_exception_sym(struct symbol *sym)
void error_call_unknown_return_type(const char *func_name)
void add_catch_command(const char *name, const char *docstring, cmd_const_sfunc_ftype *sfunc, completer_ftype *completer, void *user_data_catch, void *user_data_tcatch)
struct type * resolve_dynamic_type(struct type *type, const gdb_byte *valaddr, CORE_ADDR addr)
void field_int(const char *fldname, int value)
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)
static struct value * ada_index_struct_field(int, struct value *, int, struct type *)
#define TYPE_FIXED_INSTANCE(t)
int is_scalar_type(struct type *type)
struct minimal_symbol * minsym
static void replace_operator_with_call(expression_up *, int, int, int, struct symbol *, const struct block *)
const char * ada_type_name(struct type *type)
static void maint_set_ada_cmd(const char *args, int from_tty)
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)
static void ada_catchpoint_location_dtor(struct bp_location *bl)
bool operator<(const ada_exc_info &) const
struct value * ada_coerce_to_simple_array(struct value *arr)
void get_user_print_options(struct value_print_options *opts)
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_const_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
static int desc_arity(struct type *)
const struct ada_opname_map ada_opname_table[]
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)
static struct value * ada_promote_array_of_integrals(struct type *type, struct value *val)
static void print_one_catch_handlers(struct breakpoint *b, struct bp_location **last_loc)
static int is_nondebugging_type(struct type *type)
struct value * ada_value_tag(struct value *val)
int symbol_matches_domain(enum language symbol_language, domain_enum symbol_domain, domain_enum domain)
gdb::unique_xmalloc_ptr< char > find_frame_funname(struct frame_info *frame, enum language *funlang, struct symbol **funcp)
std::string string_printf(const char *fmt,...)
struct block_symbol ada_lookup_symbol(const char *name, const struct block *block0, domain_enum domain, int *is_a_field_of_this)
void value_free_to_mark(const struct value *mark)
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)
static const char * attribute_names[]
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)
void completion_list_add_name(completion_tracker &tracker, language symbol_language, const char *symname, const lookup_name_info &lookup_name, const char *text, const char *word)
const char * op_name_standard(enum exp_opcode opcode)
gdb::def_vector< gdb_byte > byte_vector
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)
const bp_location_ops * ops
static bool full_match(const char *sym_name, const char *search_name)
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)
struct dynamic_prop * get_dyn_prop(enum dynamic_prop_node_kind prop_kind, const struct type *type)
#define SYMBOL_NATURAL_NAME(symbol)
static struct value * coerce_for_assign(struct type *type, struct value *val)
void set_value_bitsize(struct value *value, LONGEST bit)
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)
const char * ada_enum_name(const char *name)
struct value * parse_and_eval(const char *exp)
int gdbarch_bits_big_endian(struct gdbarch *gdbarch)
unsigned long long ULONGEST
const char * catch_exception_sym
void ada_val_print(struct type *, int, CORE_ADDR, struct ui_file *, int, struct value *, const struct value_print_options *)
static char * ada_exception_catchpoint_cond_string(const char *excep_string, enum ada_exception_catchpoint_kind ex)
static CORE_ADDR value_pointer(struct value *value, struct type *type)
static PyObject * field_name(struct type *type, int field)
struct value * call_function_by_hand(struct value *function, type *default_return_type, int nargs, struct value **args)
void initialize_breakpoint_ops(void)
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)
static const char * bound_name[]
int is_dynamic_type(struct type *type)
static struct symtab_and_line ada_exception_sal(enum ada_exception_catchpoint_kind ex, char *excep_string, const char **addr_string, const struct breakpoint_ops **ops)
int ada_is_aligner_type(struct type *type)
struct observer * observer_attach_new_objfile(observer_new_objfile_ftype *f)
struct value * value_primitive_field(struct value *arg1, LONGEST offset, int fieldno, struct type *arg_type)
static int is_dynamic_field(struct type *, int)
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 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)
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)
const struct floatformat ** gdbarch_float_format(struct gdbarch *gdbarch)
#define LA_VALUE_PRINT(val, stream, options)
void value_contents_copy_raw(struct value *dst, LONGEST dst_offset, struct value *src, LONGEST src_offset, LONGEST length)
void(* map_matching_symbols)(struct objfile *, const char *name, domain_enum domain, int global, int(*callback)(struct block *, struct symbol *, void *), void *data, symbol_name_match_type match, symbol_compare_ftype *ordered_compare)
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 *)
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)
static void ada_iterate_over_symbols(const struct block *block, const lookup_name_info &name, domain_enum domain, gdb::function_view< symbol_found_callback_ftype > callback)
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)
void ada_lookup_encoded_symbol(const char *name, const struct block *block, domain_enum domain, struct block_symbol *info)
struct type * language_lookup_primitive_type(const struct language_defn *la, struct gdbarch *gdbarch, const char *name)
void init_ada_exception_breakpoint(struct breakpoint *b, struct gdbarch *gdbarch, struct symtab_and_line sal, const char *addr_string, const struct breakpoint_ops *ops, int tempflag, int enabled, int from_tty)
static int lookup_cached_symbol(const char *name, domain_enum domain, struct symbol **sym, const struct block **block)
const std::string & lookup_name() const
static struct breakpoint_ops catch_exception_breakpoint_ops
ada_catchpoint_location(const bp_location_ops *ops, breakpoint *owner)
static const char * ada_unqualified_name(const char *decoded_name)
static void catch_ada_handlers_command(const char *arg_entry, int from_tty, struct cmd_list_element *command)
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 re_set_catch_assert(struct breakpoint *b)
static int block_depth(struct block *)
static struct value * desc_bounds(struct value *)
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)
#define ALL_OBJFILES(obj)
static void ada_inferior_exit(struct inferior *inf)
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)
int gdbarch_long_double_bit(struct gdbarch *gdbarch)
const struct quick_symbol_functions * qf
void ada_printchar(int, struct type *, struct ui_file *)
CORE_ADDR value_address(const struct value *value)
static struct type * desc_data_target_type(struct type *)
int gdbarch_short_bit(struct gdbarch *gdbarch)
#define TYPE_DESCRIPTIVE_TYPE(thistype)
static struct value * resolve_subexp(expression_up *, int *, int, struct type *)
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 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 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)
void set_value_bitpos(struct value *value, LONGEST bit)
#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 block_symbol lookup_symbol_in_language(const char *name, const struct block *block, const domain_enum domain, enum language lang, struct field_of_this_result *is_a_field_of_this)
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 bool name_matches_regex(const char *name, compiled_regex *preg)
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[]
const struct language_defn ada_language_defn
void error(const char *fmt,...)
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)
static struct type * ada_scaling_type(struct type *type)
static void resolve(expression_up *expp, int void_context_p)
#define ALL_BLOCK_SYMBOLS(block, iter, sym)
struct type * lookup_pointer_type(struct type *type)
static struct breakpoint_ops catch_handlers_breakpoint_ops
static struct ada_symbol_cache * ada_get_symbol_cache(struct program_space *pspace)
static struct type * ada_typedef_target_type(struct type *type)
void throw_error(enum errors error, const char *fmt,...)
static struct block_symbol ada_lookup_symbol_nonlocal(const struct language_defn *langdef, const char *name, const struct block *block, const domain_enum domain)
static struct symbol * ada_find_any_type_symbol(const char *name)
void do_cleanups(struct cleanup *old_chain)
static void sort_remove_dups_ada_exceptions_list(std::vector< ada_exc_info > *exceptions, int skip)
static struct value * ada_value_assign(struct value *toval, struct value *fromval)
static const char * ada_decoded_op_name(enum exp_opcode)
static std::vector< ada_exc_info > ada_exceptions_list_1(compiled_regex *preg)
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 bool wild_match(const char *name, const char *patn)
const char * bpdisp_text(enum bpdisp disp)
const char * demangled_name
void field_fmt(const char *fldname, const char *format,...) ATTRIBUTE_PRINTF(3
__extension__ enum domain_enum_tag domain
static int fat_pntr_bounds_bitpos(struct type *)
static void store_unsigned_integer(gdb_byte *addr, int len, enum bfd_endian byte_order, ULONGEST val)
void modify_field(struct type *type, gdb_byte *addr, LONGEST fieldval, LONGEST bitpos, LONGEST bitsize)
static const char * ada_extensions[]
struct type * builtin_int
static int compare_names(const char *string1, const char *string2)
static struct value * get_var_value(const char *name, const char *err_msg)
int exec(const char *string, size_t nmatch, regmatch_t pmatch[], int eflags) const