23#include "gdbsupport/gdb_regex.h"
38#include "gdbsupport/gdb_obstack.h"
58#include "gdbsupport/function-view.h"
59#include "gdbsupport/byte-vector.h"
60#include "gdbsupport/selftest.h"
104 const struct block *,
108static int is_nonfunction (
const std::vector<struct block_symbol> &);
112 const struct block *);
136 CORE_ADDR,
struct value *);
186 struct type **,
int *,
int *,
int *,
int *);
189 struct value **,
int,
const char *,
190 struct type *,
bool);
206 (
const std::vector<struct block_symbol> &syms);
245 " \t\n!@#%^&*()+=|~`}{[]\";:?/,-";
247 " \t\n!@#$%^&*()+=|~`}{[]\";:?/,-";
252 =
"__gnat_ada_main_program_name";
357 return htab_hash_string (
name);
367 return htab_hash_string (entry->name.c_str ());
397 htab_delete_entry<cache_entry>,
437 while (
type->
code () == TYPE_CODE_TYPEDEF)
455 if (decoded_name[0] ==
'<')
458 result = strrchr (decoded_name,
'.');
462 result = decoded_name;
472 return string_printf (
"<%s>", str);
481 int len = strlen (target);
507 for (fieldno = 0; fieldno < struct_type->
num_fields (); fieldno++)
512 error (_(
"Unable to find field %s in struct %s. Aborting"),
527 const char *p = strstr (
name,
"___");
530 return strlen (
name);
547 len2 = strlen (suffix);
548 return (len1 >= len2 && strcmp (str + len1 - len2, suffix) == 0);
562 struct value *result;
566 else if (val->
lazy ()
585static const gdb_byte *
617 va_start (args, format);
629 LONGEST top_bit = (LONGEST) 1 << (
size * 8 - 2);
631 return top_bit | (top_bit - 1);
645 ULONGEST top_bit = (ULONGEST) 1 << (
size * 8 - 1);
647 return top_bit | (top_bit - 1);
677 case TYPE_CODE_RANGE:
701 error (_(
"Unexpected type in ada_discrete_type_high_bound."));
712 case TYPE_CODE_RANGE:
736 error (_(
"Unexpected type in ada_discrete_type_low_bound."));
746 while (
type != NULL &&
type->
code () == TYPE_CODE_RANGE)
769 if (
type->
code () == TYPE_CODE_TYPEDEF)
806 static gdb::unique_xmalloc_ptr<char> main_program_name;
818 if (main_program_name_addr == 0)
819 error (_(
"Invalid address for Ada main program name."));
826 scoped_restore save_trust_readonly
829 return main_program_name.get ();
842 {
"Oadd",
"\"+\"", BINOP_ADD},
843 {
"Osubtract",
"\"-\"", BINOP_SUB},
844 {
"Omultiply",
"\"*\"", BINOP_MUL},
845 {
"Odivide",
"\"/\"", BINOP_DIV},
846 {
"Omod",
"\"mod\"", BINOP_MOD},
847 {
"Orem",
"\"rem\"", BINOP_REM},
848 {
"Oexpon",
"\"**\"", BINOP_EXP},
849 {
"Olt",
"\"<\"", BINOP_LESS},
850 {
"Ole",
"\"<=\"", BINOP_LEQ},
851 {
"Ogt",
"\">\"", BINOP_GTR},
852 {
"Oge",
"\">=\"", BINOP_GEQ},
853 {
"Oeq",
"\"=\"", BINOP_EQUAL},
854 {
"One",
"\"/=\"", BINOP_NOTEQUAL},
855 {
"Oand",
"\"and\"", BINOP_BITWISE_AND},
856 {
"Oor",
"\"or\"", BINOP_BITWISE_IOR},
857 {
"Oxor",
"\"xor\"", BINOP_BITWISE_XOR},
858 {
"Oconcat",
"\"&\"", BINOP_CONCAT},
859 {
"Oabs",
"\"abs\"", UNOP_ABS},
860 {
"Onot",
"\"not\"", UNOP_LOGICAL_NOT},
861 {
"Oadd",
"\"+\"", UNOP_PLUS},
862 {
"Osubtract",
"\"-\"", UNOP_NEG},
873 gdb_assert (*str ==
'[');
875 while (*str !=
'\0' && isalpha (*str))
878 return *str ==
'\0' || (str[0] ==
']' && str[1] ==
'\0');
885 if (one_char <= 0xff)
888 result.append (phex (one_char, 1));
890 else if (one_char <= 0xffff)
893 result.append (phex (one_char, 2));
897 result.append (
"WW");
898 result.append (phex (one_char, 4));
910 const T *chars = (
T *) obstack_base (storage);
911 int num_chars = obstack_object_size (storage) /
sizeof (
T);
913 for (
int i = 0; i < num_chars; ++i)
915 if (chars[i] <= 0x7f)
919 result.push_back (chars[i]);
937 std::string encoding_buffer;
938 bool saw_non_ascii =
false;
939 for (
const char *p =
decoded; *p !=
'\0'; p += 1)
941 if ((*p & 0x80) != 0)
942 saw_non_ascii =
true;
945 encoding_buffer.append (
"__");
948 encoding_buffer = encoding_buffer +
"." + (p + 1);
949 if (encoding_buffer.back () ==
']')
950 encoding_buffer.pop_back ();
964 error (_(
"invalid Ada operator name: %s"), p);
968 encoding_buffer.append (
mapping->encoded);
972 encoding_buffer.push_back (*p);
980 auto_obstack storage;
987 (
const gdb_byte *) encoding_buffer.c_str (),
988 encoding_buffer.length (), 1,
991 catch (
const gdb_exception &)
993 static bool warned =
false;
1000 warning (_(
"charset conversion failure for '%s'.\n"
1001 "You may have the wrong value for 'set ada source-charset'."),
1002 encoding_buffer.c_str ());
1006 return encoding_buffer;
1010 return copy_and_hex_encode<uint32_t> (&storage);
1011 return copy_and_hex_encode<gdb_byte> (&storage);
1014 return encoding_buffer;
1040 static std::string fold_storage;
1042 if (!
name.empty () &&
name[0] ==
'\'')
1043 fold_storage = gdb::to_string (
name.substr (1,
name.size () - 2));
1061 auto_obstack storage;
1066 (
const gdb_byte *)
name.data (),
1070 catch (
const gdb_exception &)
1075 static bool warned =
false;
1082 warning (_(
"could not convert '%s' from the host encoding (%s) to UTF-32.\n"
1083 "This normally should not happen, please file a bug report."),
1089 fold_storage = gdb::to_string (
name);
1090 return fold_storage.c_str ();
1094 uint32_t *chars = (uint32_t *) obstack_base (&storage);
1095 int num_chars = obstack_object_size (&storage) /
sizeof (uint32_t);
1096 for (
int i = 0; i < num_chars; ++i)
1099 if (entry !=
nullptr)
1101 uint32_t low = chars[i] + entry->lower_delta;
1102 if (!is_utf8 || low <= 0xff)
1105 chars[i] = chars[i] + entry->upper_delta;
1110 auto_obstack reconverted;
1115 (
const gdb_byte *) chars,
1116 num_chars *
sizeof (uint32_t),
1120 obstack_1grow (&reconverted,
'\0');
1121 fold_storage = std::string ((
const char *) obstack_base (&reconverted));
1123 catch (
const gdb_exception &)
1128 static bool warned =
false;
1136 warning (_(
"could not convert the lower-cased variant of '%s'\n"
1137 "from UTF-32 to the host encoding (%s)."),
1143 fold_storage = gdb::to_string (
name);
1147 return fold_storage.c_str ();
1157 if (fold && decoded[0] !=
'<')
1167 return (isdigit (c) || (isalpha (c) && islower (c)));
1185 if (*len > 1 && isdigit (encoded[*len - 1]))
1189 while (i > 0 && isdigit (encoded[i]))
1191 if (i >= 0 && encoded[i] ==
'.')
1193 else if (i >= 0 && encoded[i] ==
'$')
1195 else if (i >= 2 && startswith (encoded + i - 2,
"___"))
1197 else if (i >= 1 && startswith (encoded + i - 1,
"__"))
1219 && encoded[*len - 1] ==
'N'
1220 && (isdigit (encoded[*len - 2]) || islower (encoded[*len - 2])))
1231 int offset = *len - 1;
1232 while (offset > 0 && isalpha (encoded[offset]))
1234 if (offset > 0 && encoded[offset] ==
'.')
1248 uint32_t result = 0;
1250 for (
int i = 0; i < n; ++i)
1252 if (!isxdigit (str[i]))
1255 result |= fromhex (str[i]);
1283 gdb_byte one_char = (gdb_byte)
value;
1287 sizeof (one_char),
sizeof (one_char),
1292 (
const gdb_byte *) &
value,
1295 obstack_1grow (&bytes,
'\0');
1296 out.append ((
const char *) obstack_base (&bytes));
1298 catch (
const gdb_exception &)
1317 std::string decoded;
1322 if (encoded[0] ==
'.')
1328 if (startswith (encoded,
"_ada_"))
1333 if (startswith (encoded,
"___ghost_"))
1339 if (encoded[0] ==
'_' || encoded[0] ==
'<')
1342 len0 = strlen (encoded);
1353 p = strstr (encoded,
"___");
1354 if (p != NULL && p - encoded < len0 - 3)
1366 if (len0 > 3 && startswith (encoded + len0 - 3,
"TKB"))
1373 if (len0 > 2 && startswith (encoded + len0 - 2,
"TB"))
1379 if (len0 > 1 && startswith (encoded + len0 - 1,
"B"))
1384 if (len0 > 1 && isdigit (encoded[len0 - 1]))
1387 while ((i >= 0 && isdigit (encoded[i]))
1388 || (i >= 1 && encoded[i] ==
'_' && isdigit (encoded[i - 1])))
1390 if (i > 1 && encoded[i] ==
'_' && encoded[i - 1] ==
'_')
1392 else if (i >= 0 && encoded[i] ==
'$')
1399 for (i = 0; i < len0 && !isalpha (encoded[i]); i += 1)
1400 decoded.push_back (encoded[i]);
1406 if (operators && at_start_name && encoded[i] ==
'O')
1415 && !isalnum (encoded[i + op_len]))
1431 if (i < len0 - 4 && startswith (encoded + i,
"TK__"))
1438 if (len0 - i > 5 && encoded [i] ==
'_' && encoded [i+1] ==
'_'
1439 && encoded [i+2] ==
'B' && encoded [i+3] ==
'_'
1440 && isdigit (encoded [i+4]))
1444 while (k < len0 && isdigit (encoded[k]))
1449 if (len0 - k > 2 && encoded [k] ==
'_' && encoded [k+1] ==
'_')
1466 if (len0 - i > 3 && encoded [i] ==
'_' && encoded[i+1] ==
'E'
1467 && isdigit (encoded[i+2]))
1471 while (k < len0 && isdigit (encoded[k]))
1475 && (encoded[k] ==
'b' || encoded[k] ==
's'))
1482 || (k < len0 && encoded[k] ==
'_'))
1491 && encoded[i] ==
'N' && encoded[i+1] ==
'_' && encoded[i+2] ==
'_')
1496 const char *ptr = encoded + i - 1;
1501 || (ptr > encoded && ptr[0] ==
'_' && ptr[-1] ==
'_'))
1505 if (i < len0 + 3 && encoded[i] ==
'U' && isxdigit (encoded[i + 1]))
1513 else if (i < len0 + 5 && encoded[i] ==
'W' && isxdigit (encoded[i + 1]))
1521 else if (i < len0 + 10 && encoded[i] ==
'W' && encoded[i + 1] ==
'W'
1522 && isxdigit (encoded[i + 2]))
1531 if (encoded[i] ==
'X' && i != 0 && isalnum (encoded[i - 1]))
1542 while (i < len0 && (encoded[i] ==
'b' || encoded[i] ==
'n'));
1546 else if (i < len0 - 2 && encoded[i] ==
'_' && encoded[i + 1] ==
'_')
1549 decoded.push_back (
'.');
1557 decoded.push_back (encoded[i]);
1567 for (i = 0; i < decoded.length(); ++i)
1568 if (isupper (decoded[i]) || decoded[i] ==
' ')
1574 decoded = decoded +
"[" + &encoded[suffix] +
"]";
1582 if (encoded[0] ==
'<')
1585 decoded =
'<' + std::string(encoded) +
'>';
1622 const char **resultp =
1632 if (obstack != NULL)
1633 *resultp = obstack_strdup (obstack, decoded.c_str ());
1642 decoded.c_str (), INSERT);
1645 *slot = xstrdup (decoded.c_str ());
1685 if (index_desc_type == NULL)
1687 gdb_assert (index_desc_type->
num_fields () > 0);
1698 index_desc_type->
field (0).
name ()) == 0)
1702 for (i = 0; i < index_desc_type->
num_fields (); i++)
1724 if (
type->
code () == TYPE_CODE_TYPEDEF)
1729 ||
type->
code () == TYPE_CODE_REF))
1752 if (base_type == NULL)
1760 if (alt_type == NULL)
1769static struct value *
1777 if (
type->
code () == TYPE_CODE_PTR)
1789 return (
type != NULL &&
type->
code () == TYPE_CODE_STRUCT
1814 else if (
type->
code () == TYPE_CODE_STRUCT)
1826static struct value *
1833 struct type *bounds_type =
1837 if (bounds_type == NULL)
1838 error (_(
"Bad GNAT array descriptor"));
1843 if (
type->
code () == TYPE_CODE_PTR)
1850 addr - bounds_type->
length ());
1856 _(
"Bad GNAT array descriptor"));
1857 struct type *p_bounds_type = p_bounds->
type ();
1860 && p_bounds_type->
code () == TYPE_CODE_PTR)
1870 error (_(
"Bad GNAT array descriptor"));
1929static struct value *
1938 _(
"Bad GNAT array descriptor"));
1971static struct value *
1974 char bound_name[20];
1975 xsnprintf (bound_name,
sizeof (bound_name),
"%cB%d",
1976 which ?
'U' :
'L', i - 1);
1978 _(
"Bad GNAT array descriptor bounds"));
2014 if (
type->
code () == TYPE_CODE_STRUCT)
2016 char bound_name[20];
2017 xsnprintf (bound_name,
sizeof (bound_name),
"LB%d", i - 1);
2047 return (
type->
code () == TYPE_CODE_ARRAY
2059 ||
type->
code () == TYPE_CODE_REF))
2072 return (
type->
code () == TYPE_CODE_ARRAY
2075 == TYPE_CODE_ARRAY)));
2088 return (data_type != NULL
2089 && data_type->
code () == TYPE_CODE_ARRAY
2108 return arr->
type ();
2112 struct type *array_type =
2123 struct type *elt_type;
2125 struct value *descriptor;
2130 if (elt_type == NULL || arity == 0)
2143 struct type *range_type
2168 elt_type->
set_length ((array_bitsize + 7) / 8);
2189 if (arrType == NULL)
2211 error (_(
"Bounds unavailable for null array pointer."));
2281 if (
type->
code () == TYPE_CODE_TYPEDEF)
2297 || (
type->
code () == TYPE_CODE_ARRAY
2307 const char *raw_name;
2314 if (
type->
code () == TYPE_CODE_TYPEDEF)
2324 tail = strstr (raw_name,
"___XP");
2325 if (tail ==
nullptr)
2335 if (sscanf (tail +
sizeof (
"___XP") - 1,
"%ld", &
bits) != 1)
2338 (_(
"could not understand bit size information on packed array"));
2365 struct type *new_elt_type;
2367 struct type *index_type_desc;
2369 LONGEST low_bound, high_bound;
2372 if (
type->
code () != TYPE_CODE_ARRAY)
2376 if (index_type_desc)
2393 low_bound = high_bound = 0;
2394 if (high_bound < low_bound)
2401 *elt_bits *= (high_bound - low_bound + 1);
2418 struct type *shadow_type;
2427 name = (
char *) alloca (strlen (raw_name) + 1);
2428 tail = strstr (raw_name,
"___XP");
2431 memcpy (
name, raw_name, tail - raw_name);
2432 name[tail - raw_name] =
'\000';
2436 if (shadow_type == NULL)
2438 lim_warning (_(
"could not find bounds information on packed array"));
2443 if (shadow_type->
code () != TYPE_CODE_ARRAY)
2446 "information on packed array"));
2461 gdb_assert (
type->
code () == TYPE_CODE_ARRAY);
2467 LONGEST our_len = high - low + 1;
2470 if (elt_type->
code () == TYPE_CODE_ARRAY)
2473 LONGEST elt_bitsize = elt_len * elt_type->
field (0).
bitsize ();
2489static struct value *
2508 error (_(
"can't unpack array"));
2518 CORE_ADDR address = arr->
address ();
2519 gdb::array_view<const gdb_byte> view
2520 = gdb::make_array_view (valaddr,
type->
length ());
2543 bit_pos / HOST_CHAR_BIT,
2544 bit_pos % HOST_CHAR_BIT,
2556static struct value *
2560 int bits, elt_off, bit_off;
2561 long elt_total_bit_offset;
2562 struct type *elt_type;
2566 elt_total_bit_offset = 0;
2568 for (i = 0; i < arity; i += 1)
2570 if (elt_type->
code () != TYPE_CODE_ARRAY
2573 (_(
"attempt to do packed indexing of "
2574 "something other than a packed array"));
2578 LONGEST lowerbound, upperbound;
2584 lowerbound = upperbound = 0;
2588 if (idx < lowerbound || idx > upperbound)
2589 lim_warning (_(
"packed array index %ld out of bounds"),
2592 elt_total_bit_offset += (idx - lowerbound) *
bits;
2596 elt_off = elt_total_bit_offset / HOST_CHAR_BIT;
2597 bit_off = elt_total_bit_offset % HOST_CHAR_BIT;
2615 case TYPE_CODE_RANGE:
2636 gdb_byte *unpacked,
int unpacked_len,
2637 int is_big_endian,
int is_signed_type,
2648 int unpacked_bytes_left;
2650 unsigned long accum;
2656 int delta = is_big_endian ? -1 : 1;
2660 if ((
bit_size + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT > unpacked_len)
2661 error (_(
"Cannot unpack %d bits into buffer of %d bytes"),
2665 src_bytes_left = src_len;
2666 unpacked_bytes_left = unpacked_len;
2671 src_idx = src_len - 1;
2673 && ((src[0] <<
bit_offset) & (1 << (HOST_CHAR_BIT - 1))))
2683 unpacked_idx = unpacked_len - 1;
2689 (HOST_CHAR_BIT -
bit_size % HOST_CHAR_BIT) % HOST_CHAR_BIT;
2692 unpacked_idx = (
bit_size + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT - 1;
2693 unpacked_bytes_left = unpacked_idx + 1;
2700 src_idx = unpacked_idx = 0;
2704 if (is_signed_type && (src[src_len - 1] & (1 << sign_bit_offset)))
2709 while (src_bytes_left > 0)
2713 unsigned int unusedMSMask =
2714 (1 << (srcBitsLeft >= HOST_CHAR_BIT ? HOST_CHAR_BIT : srcBitsLeft)) -
2717 unsigned int signMask = sign & ~unusedMSMask;
2720 (((src[src_idx] >> unusedLS) & unusedMSMask) | signMask) << accumSize;
2721 accumSize += HOST_CHAR_BIT - unusedLS;
2722 if (accumSize >= HOST_CHAR_BIT)
2724 unpacked[unpacked_idx] = accum & ~(~0UL << HOST_CHAR_BIT);
2725 accumSize -= HOST_CHAR_BIT;
2726 accum >>= HOST_CHAR_BIT;
2727 unpacked_bytes_left -= 1;
2728 unpacked_idx += delta;
2730 srcBitsLeft -= HOST_CHAR_BIT - unusedLS;
2732 src_bytes_left -= 1;
2735 while (unpacked_bytes_left > 0)
2737 accum |= sign << accumSize;
2738 unpacked[unpacked_idx] = accum & ~(~0UL << HOST_CHAR_BIT);
2739 accumSize -= HOST_CHAR_BIT;
2742 accum >>= HOST_CHAR_BIT;
2743 unpacked_bytes_left -= 1;
2744 unpacked_idx += delta;
2759 long offset,
int bit_offset,
int bit_size,
2763 const gdb_byte *src;
2767 gdb::byte_vector staging;
2785 int staging_len = (bit_size + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT;
2786 staging.resize (staging_len);
2789 staging.data (), staging.size (),
2793 if (
type->
length () < (bit_size + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT)
2813 int src_len = (bit_size + bit_offset + HOST_CHAR_BIT - 1) / 8;
2817 buf = (gdb_byte *) alloca (src_len);
2829 long new_offset =
offset;
2834 if (v->
bitpos () >= HOST_CHAR_BIT)
2860 memcpy (unpacked, staging.data (), staging.size ());
2875static struct value *
2890 error (_(
"Left operand of assignment is not a modifiable lvalue."));
2895 ||
type->
code () == TYPE_CODE_STRUCT))
2897 int len = (toval->
bitpos ()
2898 +
bits + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT;
2900 gdb_byte *buffer = (gdb_byte *) alloca (len);
2902 CORE_ADDR to_addr = toval->
address ();
2904 if (
type->
code () == TYPE_CODE_FLT)
2908 from_size = fromval->
bitsize ();
2910 from_size = fromval->
type ()->
length () * TARGET_CHAR_BIT;
2913 ULONGEST from_offset = 0;
2915 from_offset = from_size -
bits;
2917 fromval->
contents ().data (), from_offset,
2918 bits, is_big_endian);
2921 val = toval->
copy ();
2949 LONGEST offset_in_container =
2951 int bit_offset_in_container =
2957 if (component->
bitsize () == 0)
2972 + offset_in_container),
2973 container->
bitpos () + bit_offset_in_container,
2978 + offset_in_container),
2979 container->
bitpos () + bit_offset_in_container,
2988 return (
type->
code () == TYPE_CODE_TYPEDEF
3001 struct type *elt_type;
3006 if (elt_type->
code () == TYPE_CODE_ARRAY
3010 for (k = 0; k < arity; k += 1)
3014 if (elt_type->
code () != TYPE_CODE_ARRAY)
3015 error (_(
"too many subscripts (%d expected)"), k);
3020 && elt->
type ()->
code () != TYPE_CODE_TYPEDEF)
3055static struct value *
3063 if (
type->
code () == TYPE_CODE_ARRAY
3067 for (k = 0; k < arity; k += 1)
3071 if (
type->
code () != TYPE_CODE_ARRAY)
3072 error (_(
"too many subscripts (%d expected)"), k);
3087static struct value *
3101 gdb::optional<LONGEST> base_low_pos, low_pos;
3107 if (!low_pos.has_value () || !base_low_pos.has_value ())
3109 warning (_(
"unable to get positions in slice, use bounds instead"));
3111 base_low_pos = base_low;
3114 ULONGEST stride = slice_type->
field (0).
bitsize () / 8;
3123static struct value *
3135 gdb::optional<LONGEST> low_pos, high_pos;
3141 if (!low_pos.has_value () || !high_pos.has_value ())
3143 warning (_(
"unable to get positions in slice, use bounds instead"));
3149 value_slice (array, low, *high_pos - *low_pos + 1));
3168 if (
type->
code () == TYPE_CODE_STRUCT)
3171 while (
type->
code () == TYPE_CODE_ARRAY)
3190 if (
type->
code () == TYPE_CODE_STRUCT)
3193 struct type *p_array_type;
3202 if (nindices >= 0 && k > nindices)
3204 while (k > 0 && p_array_type != NULL)
3209 return p_array_type;
3211 else if (
type->
code () == TYPE_CODE_ARRAY)
3213 while (nindices != 0 &&
type->
code () == TYPE_CODE_ARRAY)
3235 struct type *result_type;
3240 error (_(
"invalid dimension number to '%s"),
name);
3246 for (i = 1; i < n; i += 1)
3261 if (result_type == NULL)
3262 error (_(
"attempt to take bound of something that is not an array"));
3280 gdb_assert (which == 0 || which == 1);
3288 if (arr_type->
code () == TYPE_CODE_PTR)
3298 index_type_desc = NULL;
3306 if (index_type_desc != NULL)
3313 for (i = 1; i < n; i++)
3332 struct type *arr_type;
3380 struct type *base_type;
3389 return high - low + 1;
3396static struct value *
3404 high < low ? low - 1 : high);
3426 error (_(
"Could not find operator name for opcode"));
3440 else if (N0 == NULL)
3446 for (k0 = strlen (N0) - 1; k0 > 0 && isdigit (N0[k0]); k0 -= 1)
3448 for (k1 = strlen (N1) - 1; k1 > 0 && isdigit (N1[k1]); k1 -= 1)
3450 if ((N0[k0] ==
'_' || N0[k0] ==
'$') && N0[k0 + 1] !=
'\000'
3451 && (N1[k1] ==
'_' || N1[k1] ==
'$') && N1[k1 + 1] !=
'\000')
3456 while (N0[n0] ==
'_' && n0 > 0 && N0[n0 - 1] ==
'_')
3459 while (N1[
n1] ==
'_' &&
n1 > 0 && N1[
n1 - 1] ==
'_')
3461 if (n0 ==
n1 && strncmp (N0, N1, n0) == 0)
3462 return (atoi (N0 + k0 + 1) < atoi (N1 + k1 + 1));
3464 return (strcmp (N0, N1) < 0);
3476 for (i = 1; i < nsyms; i += 1)
3481 for (j = i - 1; j >= 0; j -= 1)
3486 syms[j + 1] = syms[j];
3510 ||
type->
code () != TYPE_CODE_FUNC)
3553 int is_all_choice,
const char *annotation_suffix)
3558 int first_choice = is_all_choice ? 2 : 1;
3560 prompt = getenv (
"PS2");
3579 args = skip_spaces (args);
3580 if (*args ==
'\0' && n_chosen == 0)
3582 else if (*args ==
'\0')
3585 choice = strtol (args, &args2, 10);
3586 if (args == args2 || choice < 0
3587 || choice > n_choices + first_choice - 1)
3588 error (_(
"Argument must be choice number"));
3592 error (_(
"cancelled"));
3594 if (choice < first_choice)
3596 n_chosen = n_choices;
3597 for (j = 0; j < n_choices; j += 1)
3601 choice -= first_choice;
3603 for (j = n_chosen - 1; j >= 0 && choice < choices[j]; j -= 1)
3607 if (j < 0 || choice != choices[j])
3611 for (k = n_chosen - 1; k > j; k -= 1)
3612 choices[k + 1] = choices[k];
3613 choices[j + 1] = choice;
3618 if (n_chosen > max_results)
3619 error (_(
"Select no more than %d of the above"), max_results);
3636 int *chosen = XALLOCAVEC (
int , nsyms);
3638 int first_choice = (max_results == 1) ? 1 : 2;
3641 if (max_results < 1)
3642 error (_(
"Request to select 0 symbols!"));
3648canceled because the command is ambiguous\n\
3649See set/show multiple-symbol."));
3658 if (max_results > 1)
3663 for (i = 0; i < nsyms; i += 1)
3665 if (syms[i].
symbol == NULL)
3677 gdb_printf (_(
" at %p[<no source file available>%p]:%d\n"),
3707 else if (is_enumeral
3724 ? _(
" in %s (enumeral)\n")
3729 ? _(
" (enumeral)\n")
3735 n_chosen =
get_selections (chosen, nsyms, max_results, max_results > 1,
3738 for (i = 0; i < n_chosen; i += 1)
3739 syms[i] = syms[chosen[i]];
3748 int nargs,
value *argvec[])
3752 std::vector<struct block_symbol> candidates
3760 return candidates[i];
3769 struct type *context_type,
3770 bool parse_completion,
3771 int nargs,
value *argvec[],
3774 std::vector<struct block_symbol> candidates
3778 if (candidates.size () == 1)
3786 context_type, parse_completion);
3788 error (_(
"Could not find a match for %s"), sym->
print_name ());
3791 tracker->
update (candidates[i]);
3792 return candidates[i];
3800 const char *
name,
struct type *context_type,
3801 bool parse_completion)
3803 gdb_assert (context_type->
code () == TYPE_CODE_ENUM);
3808 struct type *type1 = context_type;
3809 for (
int i = 0; i < syms.size (); ++i)
3816 for (
int i = 0; i < syms.size (); ++i)
3821 if (strcmp (type1->
name (), type2->
name ()) != 0)
3827 error (_(
"No name '%s' in enumeration type '%s'"),
name,
3835 struct type *context_type,
3836 bool parse_completion,
3840 std::vector<struct block_symbol> candidates
3843 if (std::any_of (candidates.begin (),
3847 switch (bsym.symbol->aclass ())
3852 case LOC_REGPARM_ADDR:
3866 (candidates.begin (),
3870 return bsym.symbol->aclass () == LOC_TYPEDEF;
3878 (candidates.begin (),
3882 return bsym.symbol->is_artificial ();
3887 if (candidates.empty ())
3888 error (_(
"No definition found for %s"), sym->print_name ());
3889 else if (candidates.size () == 1)
3891 else if (context_type !=
nullptr
3892 && context_type->code () == TYPE_CODE_ENUM)
3895 else if (context_type ==
nullptr
3910 candidates.resize (1);
3916 (candidates, NULL, 0,
3917 sym->linkage_name (),
3918 context_type, parse_completion);
3920 error (_(
"Could not find a match for %s"), sym->print_name ());
3924 gdb_printf (_(
"Multiple matches for %s\n"), sym->print_name ());
3929 tracker->update (candidates[i]);
3930 return candidates[i];
3943 if (ftype->
code () == TYPE_CODE_REF)
3945 if (atype->
code () == TYPE_CODE_REF)
3948 switch (ftype->
code ())
3951 return ftype->
code () == atype->
code ();
3953 if (atype->
code () != TYPE_CODE_PTR)
3957 if (atype->
code () == TYPE_CODE_INT && atype->
length () == 0)
3961 case TYPE_CODE_ENUM:
3962 case TYPE_CODE_RANGE:
3963 switch (atype->
code ())
3966 case TYPE_CODE_ENUM:
3967 case TYPE_CODE_RANGE:
3973 case TYPE_CODE_ARRAY:
3974 return (atype->
code () == TYPE_CODE_ARRAY
3977 case TYPE_CODE_STRUCT:
3979 return (atype->
code () == TYPE_CODE_ARRAY
3982 return (atype->
code () == TYPE_CODE_STRUCT
3985 case TYPE_CODE_UNION:
3987 return (atype->
code () == ftype->
code ());
4003 &&
func_type->code () == TYPE_CODE_ENUM)
4004 return (n_actuals == 0);
4008 if (
func_type->num_fields () != n_actuals)
4011 for (i = 0; i < n_actuals; i += 1)
4013 if (actuals[i] == NULL)
4035 struct type *return_type;
4040 if (
func_type->code () == TYPE_CODE_FUNC)
4044 if (return_type == NULL)
4049 if (return_type->code () == TYPE_CODE_ENUM)
4050 return context_type == NULL || return_type == context_type;
4051 else if (context_type == NULL)
4052 return return_type->code () != TYPE_CODE_VOID;
4054 return return_type->code () == context_type->
code ();
4072 struct value **args,
int nargs,
4073 const char *
name,
struct type *context_type,
4074 bool parse_completion)
4084 for (fallback = 0; m == 0 && fallback < 2; fallback++)
4086 for (k = 0; k < syms.size (); k += 1)
4105 else if (m > 1 && !parse_completion)
4130 case TYPE_CODE_FIXED_POINT:
4132 case TYPE_CODE_RANGE:
4154 case TYPE_CODE_RANGE:
4175 case TYPE_CODE_RANGE:
4176 case TYPE_CODE_ENUM:
4178 case TYPE_CODE_FIXED_POINT:
4200 case TYPE_CODE_RANGE:
4201 case TYPE_CODE_ENUM:
4202 case TYPE_CODE_BOOL:
4203 case TYPE_CODE_CHAR:
4218 struct type *type0 =
4220 struct type *type1 =
4239 case BINOP_BITWISE_AND:
4240 case BINOP_BITWISE_IOR:
4241 case BINOP_BITWISE_XOR:
4245 case BINOP_NOTEQUAL:
4260 case UNOP_LOGICAL_NOT:
4302 const char **renamed_entity,
int *len,
4303 const char **renaming_expr)
4345 if (renamed_entity != NULL)
4346 *renamed_entity = info;
4347 suffix = strstr (info,
"___XE");
4348 if (suffix == NULL || suffix == info)
4351 *len = strlen (info) - strlen (suffix);
4353 if (renaming_expr != NULL)
4354 *renaming_expr = suffix;
4362static struct value *
4366 const char *sym_name;
4370 return expr->evaluate ();
4380static struct value *
4387 const CORE_ADDR addr =
4410static struct value *
4413 struct type *t, *t1;
4419 if (t->
code () == TYPE_CODE_REF)
4425 if (t1->
code () == TYPE_CODE_PTR)
4432 while (t->
code () == TYPE_CODE_PTR)
4438 if (t1->
code () == TYPE_CODE_PTR)
4447 if (t1->
code () != TYPE_CODE_STRUCT && t1->
code () != TYPE_CODE_UNION)
4454 int bit_offset, bit_size, byte_offset;
4455 struct type *field_type;
4458 if (t->
code () == TYPE_CODE_PTR)
4470 || (t1->
code () == TYPE_CODE_REF
4477 nullptr,
nullptr,
nullptr,
4489 address, NULL, check_tag);
4501 if (t->
code () == TYPE_CODE_REF)
4514 if (v != NULL || no_err)
4517 error (_(
"There is no member named %s."),
name);
4523 error (_(
"Attempt to extract a component of "
4524 "a value that is not a record."));
4537 struct type *formal_target =
4538 formal_type->
code () == TYPE_CODE_PTR
4540 struct type *actual_target =
4541 actual_type->
code () == TYPE_CODE_PTR
4545 && actual_target->
code () == TYPE_CODE_ARRAY)
4547 else if (formal_type->
code () == TYPE_CODE_PTR
4548 || formal_type->
code () == TYPE_CODE_REF)
4550 struct value *result;
4552 if (formal_target->
code () == TYPE_CODE_ARRAY
4555 else if (formal_type->
code () != TYPE_CODE_PTR)
4572 else if (actual_type->
code () == TYPE_CODE_PTR)
4597 gdb_byte *buf = (gdb_byte *) alloca (len);
4613static struct value *
4655 if (
type->
code () == TYPE_CODE_PTR)
4702 if (
block !=
nullptr)
4736 void **slot = htab_find_slot_with_hash (tab, &search,
4737 search.
hash (), INSERT);
4759 return (strstr (lookup_name,
"__") == NULL
4789 if (sym.symbol->type ()->code () != TYPE_CODE_FUNC
4790 && (sym.symbol->type ()->code () != TYPE_CODE_ENUM
4805 if (type0 == NULL || type1 == NULL
4806 || type0->
code () != type1->
code ())
4808 if ((type0->
code () == TYPE_CODE_STRUCT
4809 || type0->
code () == TYPE_CODE_ENUM)
4835 struct type *type0 = sym0->
type ();
4836 struct type *type1 = sym1->
type ();
4839 int len0 = strlen (name0);
4844 || (len0 < strlen (name1) && strncmp (name0, name1, len0) == 0
4845 && startswith (name1 + len0,
"___XV")));
4855 return (strcmp (name0, name1) == 0
4881 for (
int i = result.size () - 1; i >= 0; i -= 1)
4887 result[i].symbol = sym;
4888 result[i].block =
block;
4896 result.push_back (info);
4918 [&result, lookup_name, match_name] (
struct objfile *obj)
4922 if (match_name (msymbol->linkage_name (), lookup_name,
nullptr)
4945 return (
name != NULL && strcmp (
name,
"<variable, no debug info>") == 0);
4974 const char *name_1 = type1->
field (i).
name ();
4975 const char *name_2 = type2->
field (i).
name ();
4976 int len_1 = strlen (name_1);
4977 int len_2 = strlen (name_2);
5024 for (i = 0; i < syms.size (); i++)
5029 for (i = 1; i < syms.size (); i++)
5034 for (i = 1; i < syms.size (); i++)
5036 != syms[0].symbol->type ()->num_fields ())
5042 for (i = 1; i < syms.size (); i++)
5044 syms[0].symbol->type ()))
5064 if (syms.size () < 2)
5068 while (i < syms.size ())
5070 bool remove_p =
false;
5076 && syms[i].symbol->linkage_name () != NULL)
5078 for (j = 0; !remove_p && j < syms.size (); j++)
5082 && syms[j].symbol->linkage_name () != NULL
5084 syms[j].symbol->linkage_name ()) == 0)
5096 for (j = 0; !remove_p && j < syms.size (); j += 1)
5101 syms[j].symbol->linkage_name ()) == 0
5102 && (syms[i].symbol->aclass ()
5103 == syms[j].symbol->aclass ())
5104 && syms[i].symbol->value_address ()
5105 == syms[j].symbol->value_address ())
5114 for (j = 0; !remove_p && j < syms.size (); j += 1)
5118 && (syms[i].symbol->value_block ()
5119 == syms[j].symbol->value_block ()))
5125 syms.erase (syms.begin () + i);
5144 const char *
name = renaming_type->
name ();
5145 const char *suffix = strstr (
name,
"___XR");
5151 for (last = suffix - 3; last >
name; last--)
5152 if (last[0] ==
'_' && last[1] ==
'_')
5156 return std::string (
name, last);
5180 if (strstr (
name,
"__") != NULL)
5183 std::string fun_name = string_printf (
"_ada_%s",
name);
5210 if (startswith (function_name,
"_ada_"))
5213 return !startswith (function_name, scope.c_str ());
5255 const struct block *current_block)
5257 struct symbol *current_function;
5258 const char *current_function_name;
5260 int is_new_style_renaming;
5265 is_new_style_renaming = 0;
5266 for (i = 0; i < syms->size (); i += 1)
5269 const struct block *
block = (*syms)[i].block;
5276 suffix = strstr (
name,
"___XR");
5280 int name_len = suffix -
name;
5283 is_new_style_renaming = 1;
5284 for (j = 0; j < syms->size (); j += 1)
5285 if (i != j && (*syms)[j].
symbol != NULL
5288 &&
block == (*syms)[j].block)
5289 (*syms)[j].symbol = NULL;
5292 if (is_new_style_renaming)
5296 for (j = k = 0; j < syms->size (); j += 1)
5297 if ((*syms)[j].
symbol != NULL)
5299 (*syms)[k] = (*syms)[j];
5309 if (current_block == NULL)
5313 if (current_function == NULL)
5316 current_function_name = current_function->
linkage_name ();
5317 if (current_function_name == NULL)
5325 while (i < syms->
size ())
5330 current_function_name))
5331 syms->erase (syms->begin () + i);
5347 while (
block != NULL)
5422 int defns_mark = result.size ();
5429 renaming = renaming->
next)
5453 r_name = (renaming->
alias != NULL
5456 if (name_match (r_name, lookup_name, NULL))
5465 return result.size () != defns_mark;
5475 while (*string1 !=
'\0' && *string2 !=
'\0')
5479 if (isspace (*string1) || isspace (*string2))
5484 c1 = tolower (*string1);
5485 c2 = tolower (*string2);
5504 if (*string2 ==
'\0')
5513 if (*string2 ==
'(')
5518 return tolower (*string1) - tolower (*string2);
5520 return *string1 - *string2;
5582 =
symtab->blockvector ()->block (block_kind);
5615 data.found_sym =
true;
5619 if (result.empty () && global && !is_wild_match)
5622 std::string bracket_name = std::string (
"<_ada_") +
name +
'>';
5653 int *made_global_lookup_p)
5657 if (made_global_lookup_p)
5658 *made_global_lookup_p = 0;
5683 if (!result.empty () || !full_search)
5699 if (made_global_lookup_p)
5700 *made_global_lookup_p = 1;
5709 if (result.empty ())
5728static std::vector<struct block_symbol>
5734 int syms_from_global_search;
5735 std::vector<struct block_symbol> results;
5738 domain, full_search, &syms_from_global_search);
5742 if (results.empty () && full_search && syms_from_global_search)
5745 if (results.size () == 1 && full_search && syms_from_global_search)
5758std::vector<struct block_symbol>
5788 gdb_assert (info != NULL);
5801 std::vector<struct block_symbol> candidates
5804 if (candidates.empty ())
5807 return candidates[0];
5830 const char *matching;
5831 const int len = strlen (str);
5835 if (len > 3 && str[0] ==
'_' && str[1] ==
'_' && isdigit (str[2]))
5838 while (isdigit (str[0]))
5844 if (str[0] ==
'.' || str[0] ==
'$')
5847 while (isdigit (matching[0]))
5849 if (matching[0] ==
'\0')
5855 if (len > 3 && str[0] ==
'_' && str[1] ==
'_' && str[2] ==
'_')
5858 while (isdigit (matching[0]))
5860 if (matching[0] ==
'\0')
5866 if (strcmp (str,
"TKB") == 0)
5882 if (len == 1 && str [0] ==
'N')
5887 if (len > 3 && str[0] ==
'_' && str [1] ==
'E' && isdigit (str[2]))
5890 while (isdigit (matching[0]))
5892 if ((matching[0] ==
'b' || matching[0] ==
's')
5893 && matching [1] ==
'\0')
5905 while (str[0] !=
'_' && str[0] !=
'\0')
5907 if (str[0] !=
'n' && str[0] !=
'b')
5913 if (str[0] ==
'\000')
5918 if (str[1] !=
'_' || str[2] ==
'\000')
5922 if (strcmp (str + 3,
"JM") == 0)
5929 if (strcmp (str + 3,
"LJM") == 0)
5933 if (str[4] ==
'F' || str[4] ==
'D' || str[4] ==
'B'
5934 || str[4] ==
'U' || str[4] ==
'P')
5936 if (str[4] ==
'R' && str[5] !=
'T')
5940 if (!isdigit (str[2]))
5942 for (k = 3; str[k] !=
'\0'; k += 1)
5943 if (!isdigit (str[k]) && str[k] !=
'_')
5947 if (str[0] ==
'$' && isdigit (str[1]))
5949 for (k = 2; str[k] !=
'\0'; k += 1)
5950 if (!isdigit (str[k]) && str[k] !=
'_')
5963 std::string decoded_name =
ada_decode (name0);
5969 if (decoded_name[0] ==
'<')
5972 for (i=0; decoded_name[i] !=
'\0'; i++)
5973 if (isalpha (decoded_name[i]) && !islower (decoded_name[i]))
5986 const char *
name = *namep;
5996 if ((t1 >=
'a' && t1 <=
'z') || (t1 >=
'0' && t1 <=
'9'))
5999 if (
name == name0 + 5 && startswith (name0,
"_ada"))
6004 else if (t1 ==
'_' && ((
name[2] >=
'a' &&
name[2] <=
'z')
6005 ||
name[2] == target0))
6010 else if (t1 ==
'_' &&
name[2] ==
'B' &&
name[3] ==
'_')
6020 else if ((t0 >=
'a' && t0 <=
'z') || (t0 >=
'0' && t0 <=
'9'))
6039 const char *name0 =
name;
6041 if (startswith (
name,
"___ghost_"))
6046 const char *match =
name;
6050 for (
name += 1, p = patn + 1; *p !=
'\0';
name += 1, p += 1)
6056 if (
name[-1] ==
'_')
6082 if (sym->matches (
domain))
6086 if (sym->is_argument ())
6102 if (!found_sym && arg_sym != NULL)
6117 if (sym->matches (
domain))
6121 cmp = (int)
'_' - (
int) sym->linkage_name ()[0];
6124 cmp = !startswith (sym->linkage_name (),
"_ada_");
6126 cmp = strncmp (
name, sym->linkage_name () + 5,
6135 if (sym->is_argument ())
6149 if (!found_sym && arg_sym != NULL)
6163 (
const char *sym_name,
6173 if (strncmp (sym_name, text, text_len) == 0)
6176 std::string decoded_name =
ada_decode (sym_name);
6184 bool has_angle_bracket = (decoded_name[0] ==
'<');
6197 for (tmp = sym_name; *tmp !=
'\0' && !isupper (*tmp); tmp++);
6211 if (strncmp (sym_name, text, text_len) == 0)
6220 if (comp_match_res != NULL)
6222 std::string &match_str = comp_match_res->
match.
storage ();
6231 match_str = sym_name;
6235 comp_match_res->
set_match (match_str.c_str ());
6251 if (
type->
code () != TYPE_CODE_PTR)
6258 return (strcmp (
name,
"ada__tags__dispatch_table") == 0);
6271 return (strcmp (
name,
"ada__tags__interface_tag") == 0);
6300 if (
name[0] ==
'_' && !startswith (
name,
"_parent"))
6308 if (
name[0] ==
'S' ||
name[0] ==
'R' ||
name[0] ==
'O')
6312 else if (isupper (
name[0]))
6349 return (
name != NULL
6350 && strcmp (
name,
"ada__tags__dispatch_table") == 0);
6373static struct value *
6383static struct value *
6385 const gdb_byte *valaddr,
6388 int tag_byte_offset;
6389 struct type *tag_type;
6391 gdb::array_view<const gdb_byte> contents;
6392 if (valaddr !=
nullptr)
6393 contents = gdb::make_array_view (valaddr,
type->
length ());
6398 const gdb_byte *valaddr1 = ((valaddr == NULL)
6400 : valaddr + tag_byte_offset);
6401 CORE_ADDR address1 = (address == 0) ? 0 : address + tag_byte_offset;
6411 gdb::unique_xmalloc_ptr<char> type_name =
ada_tag_name (tag);
6413 if (type_name != NULL)
6428 LONGEST offset_to_top = 0;
6429 struct type *ptr_type, *obj_type;
6431 CORE_ADDR base_address;
6433 obj_type = obj->
type ();
6437 if (obj_type->
code () == TYPE_CODE_PTR || obj_type->
code () == TYPE_CODE_REF)
6467 catch (
const gdb_exception_error &e)
6474 if (offset_to_top == 0)
6481 if (offset_to_top == -1)
6487 ULONGEST last = (((ULONGEST) 1) << (8 *
offset_type->length () - 1)) - 1;
6488 if (offset_to_top == last)
6496 if (offset_to_top > 0)
6505 offset_to_top = -offset_to_top;
6508 base_address = obj->
address () + offset_to_top;
6533 if (data->tsd_type == 0)
6535 return data->tsd_type;
6543static struct value *
6578static gdb::unique_xmalloc_ptr<char>
6586 gdb::unique_xmalloc_ptr<char> buffer
6588 if (buffer ==
nullptr)
6597 return make_unique_xstrdup (folded);
6599 catch (
const gdb_exception &)
6611gdb::unique_xmalloc_ptr<char>
6614 gdb::unique_xmalloc_ptr<char>
name;
6635 catch (
const gdb_exception_error &e)
6660 if (parent_type->
code () == TYPE_CODE_PTR)
6680 return (
name != NULL
6681 && (startswith (
name,
"PARENT")
6682 || startswith (
name,
"_parent")));
6696 if (
name != NULL && strcmp (
name,
"RETVAL") == 0)
6707 return (
name != NULL
6708 && (startswith (
name,
"PARENT")
6709 || strcmp (
name,
"REP") == 0
6710 || startswith (
name,
"_parent")
6711 ||
name[0] ==
'S' ||
name[0] ==
'R' ||
name[0] ==
'O'));
6727 return (field_type->
code () == TYPE_CODE_UNION
6730 == TYPE_CODE_UNION)));
6755 return (
name != NULL &&
name[0] ==
'O');
6765 static std::string result;
6768 const char *discrim_end;
6769 const char *discrim_start;
6771 if (type0->
code () == TYPE_CODE_PTR)
6778 if (
name == NULL ||
name[0] ==
'\000')
6781 for (discrim_end =
name + strlen (
name) - 6; discrim_end !=
name;
6784 if (startswith (discrim_end,
"___XVN"))
6787 if (discrim_end ==
name)
6790 for (discrim_start = discrim_end; discrim_start !=
name + 3;
6793 if (discrim_start ==
name + 1)
6795 if ((discrim_start >
name + 3
6796 && startswith (discrim_start - 3,
"___"))
6797 || discrim_start[-1] ==
'.')
6801 result = std::string (discrim_start, discrim_end - discrim_start);
6802 return result.c_str ();
6818 if (!isdigit (str[k]))
6825 while (isdigit (str[k]))
6827 RU = RU * 10 + (str[k] -
'0');
6834 *
R = (-(LONGEST) (RU - 1)) - 1;
6885 if (val >=
L && val <= U)
6906 struct type *arg_type)
6923 offset + bit_pos / 8,
6997 struct type **field_type_p,
6998 int *byte_offset_p,
int *bit_offset_p,
int *bit_size_p,
7002 int parent_offset = -1;
7006 if (field_type_p != NULL)
7007 *field_type_p = NULL;
7008 if (byte_offset_p != NULL)
7010 if (bit_offset_p != NULL)
7012 if (bit_size_p != NULL)
7020 int bit_pos = 0, fld_offset = 0;
7021 if (byte_offset_p !=
nullptr || bit_offset_p !=
nullptr)
7024 fld_offset = offset + bit_pos / 8;
7029 if (t_field_name == NULL)
7050 if (field_type_p != NULL)
7052 if (byte_offset_p != NULL)
7053 *byte_offset_p = fld_offset;
7054 if (bit_offset_p != NULL)
7055 *bit_offset_p = bit_pos % 8;
7056 if (bit_size_p != NULL)
7063 field_type_p, byte_offset_p, bit_offset_p,
7064 bit_size_p, index_p))
7072 struct type *field_type
7075 for (j = 0; j < field_type->
num_fields (); j += 1)
7080 field_type_p, byte_offset_p,
7081 bit_offset_p, bit_size_p, index_p))
7085 else if (index_p != NULL)
7092 if (parent_offset != -1)
7095 int fld_offset = offset;
7096 if (byte_offset_p !=
nullptr || bit_offset_p !=
nullptr)
7099 fld_offset += bit_pos / 8;
7103 fld_offset, field_type_p, byte_offset_p,
7104 bit_offset_p, bit_size_p, index_p))
7132static struct value *
7137 int parent_offset = -1;
7144 if (t_field_name == NULL)
7182 for (j = 0; j < field_type->
num_fields (); j += 1)
7199 if (parent_offset != -1)
7213 int,
struct type *);
7221static struct value *
7233static struct value *
7259 error (_(
"Cannot assign this kind of variant record"));
7261 else if (*index_p == 0)
7305 if (refok &&
type != NULL)
7315 || (
type->
code () != TYPE_CODE_STRUCT
7316 &&
type->
code () != TYPE_CODE_UNION))
7321 error (_(
"Type %s is not a structure or union type"),
7327 struct type *result;
7330 if (result !=
nullptr)
7336 const char *name_str =
name != NULL ?
name : _(
"<null>");
7338 error (_(
"Type %s has no component named %s"),
7369 struct value *discrim;
7370 LONGEST discrim_val;
7376 if (discrim == NULL)
7381 for (i = 0; i < var_type->
num_fields (); i += 1)
7389 return others_clause;
7447static struct value *
7450 if (val0->
type ()->
code () == TYPE_CODE_REF)
7452 struct value *val = val0;
7480 len = strlen (
name);
7482 if (!isdigit (
name[len - 1]))
7485 if (isdigit (
name[len - 2]))
7486 align_offset = len - 2;
7488 align_offset = len - 1;
7490 if (align_offset < 7 || !startswith (
name + align_offset - 6,
"___XV"))
7491 return TARGET_CHAR_BIT;
7493 return atoi (
name + align_offset) * TARGET_CHAR_BIT;
7521 return sym->
type ();
7536 return strstr (
name,
"___XR") != NULL;
7549 else if (type0 == NULL)
7551 else if (type1->
code () == TYPE_CODE_VOID)
7553 else if (type0->
code () == TYPE_CODE_VOID)
7555 else if (type1->
name () == NULL && type0->
name () != NULL)
7564 const char *type0_name = type0->
name ();
7565 const char *type1_name = type1->
name ();
7567 if (type0_name != NULL && strstr (type0_name,
"___XR") != NULL
7568 && (type1_name == NULL || strstr (type1_name,
"___XR") == NULL))
7591 struct type *result, *tmp;
7602 while (result != NULL)
7606 if (result_name == NULL)
7608 warning (_(
"unexpected null name on descriptive type"));
7613 if (strcmp (result_name,
name) == 0)
7652 struct type *result = NULL;
7672 if (type_name == NULL)
7675 len = strlen (type_name);
7677 name = (
char *) alloca (len + strlen (suffix) + 1);
7679 strcpy (
name, type_name);
7680 strcpy (
name + len, suffix);
7716 && templ_type->
field (field_num).
type ()->
code () == TYPE_CODE_PTR
7717 && strstr (
name,
"___XVL") != NULL;
7772 const gdb_byte *valaddr,
7773 CORE_ADDR address,
struct value *dval0,
7774 int keep_dynamic_fields)
7778 int nfields, bit_len;
7789 if (keep_dynamic_fields)
7801 rtype->
set_code (TYPE_CODE_STRUCT);
7811 for (
f = 0;
f < nfields;
f += 1)
7825 const gdb_byte *field_valaddr = valaddr;
7826 CORE_ADDR field_address = address;
7838 rtype = dval->
type ();
7858 off / TARGET_CHAR_BIT);
7860 off / TARGET_CHAR_BIT);
7870 field_address, dval, 0);
7909 if (field_type->
code () == TYPE_CODE_TYPEDEF)
7916 if (off + fld_bit_len > bit_len)
7917 bit_len = off + fld_bit_len;
7919 rtype->
set_length (align_up (bit_len, TARGET_CHAR_BIT) / TARGET_CHAR_BIT);
7928 struct type *branch_type;
7939 rtype = dval->
type ();
7949 if (branch_type == NULL)
7961 if (off + fld_bit_len > bit_len)
7962 bit_len = off + fld_bit_len;
7965 (align_up (bit_len, TARGET_CHAR_BIT) / TARGET_CHAR_BIT);
7978 warning (_(
"Invalid type size for `%s' detected: %s."),
7981 warning (_(
"Invalid type size for <unnamed> detected: %s."),
7995 CORE_ADDR address,
struct value *dval0)
8033 for (
f = 0;
f < nfields;
f += 1)
8079 CORE_ADDR address,
struct value *dval0)
8083 struct type *branch_type;
8100 rtype->
set_code (TYPE_CODE_STRUCT);
8115 / TARGET_CHAR_BIT), dval);
8116 if (branch_type == NULL)
8158 CORE_ADDR address,
struct value *dval)
8160 struct type *templ_type;
8167 if (templ_type != NULL)
8171 if (dval == NULL && valaddr == NULL && address == 0)
8194 CORE_ADDR address,
struct value *dval)
8197 struct type *templ_type;
8198 struct type *var_type;
8200 if (var_type0->
code () == TYPE_CODE_PTR)
8203 var_type = var_type0;
8207 if (templ_type != NULL)
8208 var_type = templ_type;
8222 (var_type->
field (which).
type (), valaddr, address, dval);
8233 struct type *encoding_type)
8235 const char *bounds_str;
8239 gdb_assert (range_type->
code () == TYPE_CODE_RANGE);
8255 if (encoding_type->
name () == NULL)
8258 bounds_str = strstr (encoding_type->
name (),
"___XDLU_");
8259 if (bounds_str == NULL)
8283 struct type *desc_type)
8288 for (i = 0; i < desc_type->
num_fields (); i++)
8311 struct type *index_type_desc;
8312 struct type *result;
8313 int constrained_packed_array_p;
8314 static const char *xa_suffix =
"___XA";
8321 if (constrained_packed_array_p)
8324 if (type0 ==
nullptr)
8325 error (_(
"could not decode constrained packed array type"));
8334 if (index_type_desc == NULL)
8338 if (type_name != NULL)
8340 const int len = strlen (type_name);
8341 char *
name = (
char *) alloca (len + strlen (xa_suffix));
8343 if (type_name[len - 1] ==
'P')
8345 strcpy (
name, type_name);
8346 strcpy (
name + len - 1, xa_suffix);
8353 if (index_type_desc != NULL
8361 index_type_desc = NULL;
8364 if (index_type_desc == NULL)
8384 if (elt_type0 == elt_type && !constrained_packed_array_p)
8395 struct type *elt_type0;
8398 for (i = index_type_desc->
num_fields (); i > 0; i -= 1)
8416 for (i = index_type_desc->
num_fields () - 1; i >= 0; i -= 1)
8418 struct type *range_type =
8432 if (constrained_packed_array_p)
8442 result->
set_length (len * elt_bitsize / HOST_CHAR_BIT);
8443 if (result->
length () * HOST_CHAR_BIT < len * elt_bitsize)
8466 CORE_ADDR address,
struct value *dval,
int check_tag)
8478 case TYPE_CODE_STRUCT:
8481 struct type *fixed_record_type =
8503 fixed_record_type = obj->
type ();
8504 if (real_type != NULL)
8516 = (
char *) alloca (strlen (
name) + 7 );
8517 bool xvz_found =
false;
8520 xsnprintf (xvz_name, strlen (
name) + 7,
"%s___XVZ",
name);
8525 catch (
const gdb_exception_error &except)
8532 throw_error (except.error,
8533 _(
"unable to read value of %s (%s)"),
8534 xvz_name, except.what ());
8537 if (xvz_found && fixed_record_type->
length () !=
size)
8539 fixed_record_type =
copy_type (fixed_record_type);
8565 return fixed_record_type;
8567 case TYPE_CODE_ARRAY:
8569 case TYPE_CODE_UNION:
8599 CORE_ADDR address,
struct value *dval,
int check_tag)
8602 struct type *fixed_type =
8622 if (
type->
code () == TYPE_CODE_TYPEDEF
8646 switch (type0->
code ())
8650 case TYPE_CODE_STRUCT:
8656 case TYPE_CODE_UNION:
8682 if (raw_real_type ==
type)
8735 if (type1->
code () == TYPE_CODE_TYPEDEF)
8748static struct value *
8754 if (
type == type0 && val0 != NULL)
8792 error (_(
"'POS only defined on discrete types"));
8795 if (!result.has_value ())
8796 error (_(
"enumeration value is invalid: can't find 'POS"));
8815static struct value *
8819 if (
type->
code () == TYPE_CODE_RANGE)
8821 if (
type->
code () == TYPE_CODE_ENUM)
8824 error (_(
"argument to 'VAL out of range"));
8838 error (_(
"'VAL only defined on discrete types"));
8840 error (_(
"'VAL requires integral argument"));
8854 if (
type->
code () == TYPE_CODE_RANGE)
8856 if (
type->
code () != TYPE_CODE_ENUM)
8857 error (_(
"'Enum_Rep only defined on enum types"));
8859 error (_(
"'Enum_Rep requires argument to have same type as enum"));
8873 if (
type->
code () == TYPE_CODE_RANGE)
8875 if (
type->
code () != TYPE_CODE_ENUM)
8876 error (_(
"'Enum_Val only defined on enum types"));
8878 error (_(
"'Enum_Val requires integral argument"));
8887 error (_(
"value %s not found in enum"), plongest (
value));
8905 if (
type->
code () == TYPE_CODE_CHAR)
8911 return (
name != NULL
8913 ||
type->
code () == TYPE_CODE_RANGE)
8914 && (strcmp (
name,
"character") == 0
8915 || strcmp (
name,
"wide_character") == 0
8916 || strcmp (
name,
"wide_wide_character") == 0
8917 || strcmp (
name,
"unsigned char") == 0));
8963 return (
type->
code () == TYPE_CODE_STRUCT
8974 struct type *real_type_namer;
8975 struct type *raw_real_type;
8977 if (raw_type == NULL || raw_type->
code () != TYPE_CODE_STRUCT)
8996 if (real_type_namer == NULL
8997 || real_type_namer->
code () != TYPE_CODE_STRUCT
9001 if (real_type_namer->
field (0).
type ()->
code () != TYPE_CODE_REF)
9007 if (raw_real_type == NULL)
9010 return raw_real_type;
9050 static std::string storage;
9062 tmp = strrchr (
name,
'.');
9067 while ((tmp = strstr (
name,
"__")) != NULL)
9069 if (isdigit (tmp[2]))
9080 if (
name[1] ==
'U' ||
name[1] ==
'W')
9083 if (
name[1] ==
'W' &&
name[2] ==
'W')
9088 if (sscanf (
name + offset,
"%x", &v) != 1)
9091 else if (((
name[1] >=
'0' &&
name[1] <=
'9')
9092 || (
name[1] >=
'a' &&
name[1] <=
'z'))
9095 storage = string_printf (
"'%c'",
name[1]);
9096 return storage.c_str ();
9101 if (isascii (v) && isprint (v))
9102 storage = string_printf (
"'%c'", v);
9103 else if (
name[1] ==
'U')
9104 storage = string_printf (
"'[\"%02x\"]'", v);
9105 else if (
name[2] !=
'W')
9106 storage = string_printf (
"'[\"%04x\"]'", v);
9108 storage = string_printf (
"'[\"%06x\"]'", v);
9110 return storage.c_str ();
9114 tmp = strstr (
name,
"__");
9116 tmp = strstr (
name,
"$");
9119 storage = std::string (
name, tmp -
name);
9120 return storage.c_str ();
9133 struct type *raw_real_type
9137 if (
type == raw_real_type
9141 return raw_real_type;
9147static struct value *
9165 if (raw_real_type ==
nullptr)
9182 LONGEST lo1, hi1, lo2, hi2;
9188 error (_(
"unable to determine array bounds"));
9198 return (hi1 - lo1 == hi2 - lo2);
9207static struct value *
9217 gdb_assert (
type->
code () == TYPE_CODE_ARRAY);
9219 gdb_assert (val->
type ()->
code () == TYPE_CODE_ARRAY);
9225 error (_(
"unable to determine array bounds"));
9231 for (i = 0; i < hi - lo + 1; i++)
9234 int elt_len = elt_type->
length ();
9245static struct value *
9256 if (type2->
code () == TYPE_CODE_PTR
9257 &&
type->
code () == TYPE_CODE_ARRAY)
9260 type2 = val->
type ();
9263 if (type2->
code () == TYPE_CODE_ARRAY
9264 &&
type->
code () == TYPE_CODE_ARRAY)
9267 error (_(
"cannot assign arrays of different length"));
9279 error (_(
"Incompatible types in assignment"));
9285static struct value *
9288 struct type *type1, *type2;
9295 if (type1->
code () != TYPE_CODE_INT
9296 || type2->
code () != TYPE_CODE_INT)
9313 if (op == BINOP_MOD)
9315 else if (op == BINOP_DIV)
9319 gdb_assert (op == BINOP_REM);
9323 error (_(
"second operand of %s must not be zero."),
name);
9343 gdb_assert_not_reached (
"invalid operator");
9355 struct type *arg1_type, *arg2_type;
9368 if (arg1_type->
code () != TYPE_CODE_ARRAY
9369 || arg2_type->
code () != TYPE_CODE_ARRAY)
9370 error (_(
"Attempt to compare array with non-array"));
9375 && memcmp (arg1->
contents ().data (),
9377 arg1_type->
length ()) == 0);
9389 return comp->uses_objfile (
objfile);
9406 if (lhs_type->
code () == TYPE_CODE_ARRAY)
9421 if (ag_op !=
nullptr)
9425 arg->evaluate (
nullptr, exp,
9433 if (item->uses_objfile (
objfile))
9441 gdb_printf (stream, _(
"%*sAggregate\n"), depth,
"");
9443 item->dump (stream, depth + 1);
9449 std::vector<LONGEST> &indices,
9450 LONGEST low, LONGEST high)
9453 item->assign (container, lhs, exp, indices, low, high);
9463 struct type *lhs_type;
9464 LONGEST low_index, high_index;
9471 error (_(
"Left operand of assignment is not a modifiable lvalue."));
9481 else if (lhs_type->
code () == TYPE_CODE_STRUCT)
9487 error (_(
"Left-hand side must be array or record."));
9489 std::vector<LONGEST> indices (4);
9490 indices[0] = indices[1] = low_index - 1;
9491 indices[2] = indices[3] = high_index + 1;
9493 std::get<0> (
m_storage)->assign (container, lhs, exp, indices,
9494 low_index, high_index);
9508 gdb_printf (stream, _(
"%*sPositional, index = %d\n"),
9510 m_op->dump (stream, depth + 1);
9520 std::vector<LONGEST> &indices,
9521 LONGEST low, LONGEST high)
9525 if (ind - 1 == high)
9526 warning (_(
"Extra components in aggregate ignored."));
9543 gdb_printf (stream, _(
"%*sDiscrete range:\n"), depth,
"");
9544 m_low->dump (stream, depth + 1);
9545 m_high->dump (stream, depth + 1);
9552 std::vector<LONGEST> &indices,
9553 LONGEST low, LONGEST high,
9559 if (lower <= upper && (lower < low || upper > high))
9560 error (_(
"Index in component association out of bounds."));
9563 while (lower <= upper)
9579 gdb_printf (stream, _(
"%*sName:\n"), depth,
"");
9580 m_val->dump (stream, depth + 1);
9587 std::vector<LONGEST> &indices,
9588 LONGEST low, LONGEST high,
9602 if (strop !=
nullptr)
9609 error (_(
"Invalid record component association."));
9622 NULL, NULL, NULL, NULL, &index))
9623 error (_(
"Unknown component name: %s."),
name);
9636 if (item->uses_objfile (
objfile))
9644 gdb_printf (stream, _(
"%*sChoices:\n"), depth,
"");
9645 m_op->dump (stream, depth + 1);
9647 item->dump (stream, depth + 1);
9657 std::vector<LONGEST> &indices,
9658 LONGEST low, LONGEST high)
9661 item->assign (container, lhs, exp, indices, low, high,
m_op);
9673 gdb_printf (stream, _(
"%*sOthers:\n"), depth,
"");
9674 m_op->dump (stream, depth + 1);
9684 std::vector<LONGEST> &indices,
9685 LONGEST low, LONGEST high)
9687 int num_indices = indices.size ();
9688 for (
int i = 0; i < num_indices - 2; i += 2)
9690 for (LONGEST ind = indices[i + 1] + 1; ind < indices[i + 2]; ind += 1)
9701 scoped_restore save_lhs = make_scoped_restore (&
m_current, arg1);
9705 if (ag_op !=
nullptr)
9739 std::vector<LONGEST> &indices)
9743 int size = indices.size ();
9744 for (i = 0; i <
size; i += 2) {
9745 if (high >= indices[i] && low <= indices[i + 1])
9749 for (kh = i + 2; kh <
size; kh += 2)
9750 if (high < indices[kh])
9752 if (low < indices[i])
9754 indices[i + 1] = indices[kh - 1];
9755 if (high > indices[i + 1])
9756 indices[i + 1] = high;
9757 memcpy (indices.data () + i + 2, indices.data () + kh,
size - kh);
9758 indices.resize (kh - i - 2);
9761 else if (high < indices[i])
9765 indices.resize (indices.size () + 2);
9766 for (j = indices.size () - 1; j >= i + 2; j -= 1)
9767 indices[j] = indices[j - 2];
9769 indices[i + 1] = high;
9775static struct value *
10062 struct value *arg1)
10076 struct value *arg2, *arg3;
10080 lim_warning (_(
"Membership test incompletely implemented; "
10081 "always returns true"));
10085 case TYPE_CODE_RANGE:
10108 struct value *arg1)
10122 struct value *arg1)
10129 if (
type->
code () == TYPE_CODE_REF)
10145 struct value *arg1)
10190 if (op == BINOP_NOTEQUAL)
10201 struct value *array,
struct value *low_bound_val,
10202 struct value *high_bound_val)
10205 LONGEST high_bound;
10208 high_bound_val =
coerce_ref (high_bound_val);
10214 if (array->
type ()->
code () == TYPE_CODE_REF
10220 error (_(
"cannot slice a packed array"));
10224 if (array->
type ()->
code () == TYPE_CODE_REF
10225 || (array->
type ()->
code () == TYPE_CODE_ARRAY
10239 while (array->
type ()->
code () == TYPE_CODE_PTR
10249 error (_(
"cannot take slice of non-array"));
10260 struct type *arr_type0 =
10270 else if (high_bound < low_bound)
10281 struct value *arg1,
struct value *arg2,
int n)
10311 struct value *arg1,
struct type *type_arg,
int tem)
10313 const char *attr_name =
nullptr;
10314 if (op == OP_ATR_FIRST)
10315 attr_name =
"first";
10316 else if (op == OP_ATR_LAST)
10317 attr_name =
"last";
10321 if (type_arg == NULL)
10322 type_arg = arg1->
type ();
10332 error (_(
"unexpected attribute encountered"));
10338 case OP_ATR_LENGTH:
10346 else if (type_arg == NULL)
10354 if (op == OP_ATR_LENGTH)
10367 error (_(
"unexpected attribute encountered"));
10374 case OP_ATR_LENGTH:
10381 struct type *range_type;
10385 if (
name != NULL && type_arg->
code () != TYPE_CODE_ENUM)
10387 if (range_type == NULL)
10388 range_type = type_arg;
10392 error (_(
"unexpected attribute encountered"));
10399 case OP_ATR_LENGTH:
10400 error (_(
"the 'length attribute applies only to array types"));
10403 else if (type_arg->
code () == TYPE_CODE_FLT)
10404 error (_(
"unimplemented type attribute"));
10413 if (op == OP_ATR_LENGTH)
10425 error (_(
"unexpected attribute encountered"));
10432 case OP_ATR_LENGTH:
10488 bool deprocedure_p,
10489 bool parse_completion,
10491 struct type *context_type)
10493 if (
resolve (exp, deprocedure_p, parse_completion, tracker, context_type))
10494 return (make_operation<ada_funcall_operation>
10495 (std::move (owner),
10496 std::vector<operation_up> ()));
10497 return std::move (owner);
10514 if (
type->
code () != TYPE_CODE_ENUM)
10517 if ((val >=
'a' && val <=
'z') || (val >=
'0' && val <=
'9'))
10518 xsnprintf (
name,
sizeof (
name),
"Q%c", (
int) val);
10519 else if (val >= 0 && val < 256)
10520 xsnprintf (
name,
sizeof (
name),
"QU%02x", (
unsigned) val);
10521 else if (val >= 0 && val < 0x10000)
10522 xsnprintf (
name,
sizeof (
name),
"QW%04x", (
unsigned) val);
10524 xsnprintf (
name,
sizeof (
name),
"QWW%08lx", (
unsigned long) val);
10525 size_t len = strlen (
name);
10533 size_t elen = strlen (ename);
10535 if (elen >= len && strcmp (
name, ename + elen - len) == 0)
10547 if (expect_type !=
nullptr)
10557 bool deprocedure_p,
10558 bool parse_completion,
10560 struct type *context_type)
10564 if (context_type !=
nullptr && context_type->
code () == TYPE_CODE_ENUM)
10567 gdb_assert (result.get () ==
this);
10568 std::get<0> (
m_storage) = context_type;
10592 if ((
opcode () == OP_FLOAT ||
opcode () == OP_LONG) && expect_type != NULL)
10602 struct type *cast_type)
10604 std::get<0> (
m_storage)->generate_ax (exp, ax,
value, cast_type);
10608 error (_(
"Aligner types cannot be handled in agent expressions"));
10610 error (_(
"Dynamic types cannot be handled in agent expressions"));
10618 struct type *char_type;
10624 const std::string &str = std::get<0> (
m_storage);
10625 const char *encoding;
10626 switch (char_type->
length ())
10633 struct type *stringtype
10643 encoding =
"UTF-16BE";
10645 encoding =
"UTF-16LE";
10650 encoding =
"UTF-32BE";
10652 encoding =
"UTF-32LE";
10656 error (_(
"unexpected character type size %s"),
10657 pulongest (char_type->
length ()));
10660 auto_obstack converted;
10662 (
const gdb_byte *) str.c_str (),
10666 struct type *stringtype
10668 obstack_object_size (&converted)
10669 / char_type->
length ());
10672 obstack_base (&converted),
10673 obstack_object_size (&converted));
10690 rhs = rhs_expr->evaluate (
nullptr, exp,
noside);
10691 lhs = lhs_expr->evaluate (rhs->
type (), exp,
noside);
10695 rhs = rhs_expr->evaluate (
nullptr, exp,
noside);
10697 struct type *elt_type =
nullptr;
10698 if (rhs_type->
code () == TYPE_CODE_ARRAY)
10700 lhs = lhs_expr->evaluate (elt_type, exp,
noside);
10704 lhs = lhs_expr->evaluate (
nullptr, exp,
noside);
10705 rhs = rhs_expr->evaluate (lhs->
type (), exp,
noside);
10709 lhs = lhs_expr->evaluate (
nullptr, exp,
noside);
10711 struct type *elt_type =
nullptr;
10712 if (lhs_type->
code () == TYPE_CODE_ARRAY)
10714 rhs = rhs_expr->evaluate (elt_type, exp,
noside);
10750 auto do_op = [
this] (LONGEST x, LONGEST y)
10752 if (std::get<0> (
m_storage) == BINOP_ADD)
10757 if (arg1->
type ()->
code () == TYPE_CODE_PTR)
10761 if (arg2->
type ()->
code () == TYPE_CODE_PTR)
10769 while (
type->
code () == TYPE_CODE_REF)
10777 if (
type->
code () == TYPE_CODE_RANGE)
10787 struct type *type_arg =
nullptr;
10788 value *val =
nullptr;
10794 type_arg = tem->
type ();
10800 val, type_arg, std::get<2> (
m_storage));
10860 error (_(
"Unexpected unresolved symbol, %s, during evaluation"),
10872 || (
type->
code () == TYPE_CODE_REF
10894 if (
type->
code () != TYPE_CODE_REF)
10896 struct type *actual_type;
10899 if (actual_type == NULL)
10905 actual_type =
type;
10915 return value_ref (arg1, TYPE_CODE_REF);
10927 if ((
type->
code () == TYPE_CODE_STRUCT
10929 || (
type->
code () == TYPE_CODE_UNION
10940 bool deprocedure_p,
10941 bool parse_completion,
10943 struct type *context_type)
10950 context_type, parse_completion,
10951 deprocedure_p, tracker);
10957 == TYPE_CODE_FUNC))
10967 struct type *cast_type)
10972 error (_(
"Unexpected unresolved symbol, %s, during evaluation"),
10977 || (
type->
code () == TYPE_CODE_REF
10979 error (_(
"Tagged types cannot be handled in agent expressions"));
10981 if ((
type->
code () == TYPE_CODE_STRUCT
10983 || (
type->
code () == TYPE_CODE_UNION
10985 error (_(
"Dynamic types cannot be handled in agent expressions"));
11005 if (arrType == NULL)
11006 error (_(
"Attempt to dereference null array pointer."));
11009 else if (
type->
code () == TYPE_CODE_PTR
11012 ||
type->
code () == TYPE_CODE_ARRAY)
11019 if ((
type->
code () == TYPE_CODE_REF
11020 ||
type->
code () == TYPE_CODE_PTR)
11023 arg1 = std::get<0> (
m_storage)->evaluate (
nullptr, exp,
11035 else if (
type->
code () == TYPE_CODE_INT)
11038 if (expect_type == NULL)
11049 error (_(
"Attempt to take contents of a non-pointer value."));
11054 if (
type->
code () == TYPE_CODE_INT)
11059 if (expect_type != NULL)
11080 const char *str = std::get<1> (
m_storage).c_str ();
11084 struct type *type1 = arg1->
type ();
11096 arg1 = std::get<0> (
m_storage)->evaluate (
nullptr, exp,
11121 const std::vector<operation_up> &args_up = std::get<1> (
m_storage);
11122 int nargs = args_up.size ();
11123 std::vector<value *> argvec (nargs);
11130 error (_(
"Unexpected unresolved symbol, %s, during evaluation"),
11133 value *callee = callee_op->evaluate (
nullptr, exp,
noside);
11134 for (
int i = 0; i < args_up.size (); ++i)
11135 argvec[i] = args_up[i]->evaluate (
nullptr, exp,
noside);
11140 else if (callee->
type ()->
code () == TYPE_CODE_ARRAY
11146 else if (callee->
type ()->
code () == TYPE_CODE_REF)
11154 else if (callee->
type ()->
code () == TYPE_CODE_ARRAY
11163 if (
type->
code () == TYPE_CODE_TYPEDEF)
11166 if (
type->
code () == TYPE_CODE_PTR)
11170 case TYPE_CODE_FUNC:
11173 case TYPE_CODE_ARRAY:
11175 case TYPE_CODE_STRUCT:
11181 error (_(
"cannot subscript or call something of type `%s'"),
11189 case TYPE_CODE_FUNC:
11197 case TYPE_CODE_INTERNAL_FUNCTION:
11209 case TYPE_CODE_STRUCT:
11216 error (_(
"cannot subscript or call a record"));
11217 if (arity != nargs)
11218 error (_(
"wrong number of subscripts; expecting %d"), arity);
11223 (callee, nargs, argvec.data ()));
11225 case TYPE_CODE_ARRAY:
11230 error (_(
"element type of array unknown"));
11237 nargs, argvec.data ()));
11238 case TYPE_CODE_PTR:
11244 error (_(
"element type of array unknown"));
11253 error (_(
"Attempt to index or call something other than an "
11254 "array or function"));
11260 bool deprocedure_p,
11261 bool parse_completion,
11263 struct type *context_type)
11269 if (avv ==
nullptr)
11276 const std::vector<operation_up> &args_up = std::get<1> (
m_storage);
11277 int nargs = args_up.size ();
11278 std::vector<value *> argvec (nargs);
11280 for (
int i = 0; i < args_up.size (); ++i)
11286 context_type, parse_completion,
11287 nargs, argvec.data (),
11291 = make_operation<ada_var_value_operation> (resolved);
11297 bool deprocedure_p,
11298 bool parse_completion,
11300 struct type *context_type)
11304 value *v = std::get<0> (
m_storage)->evaluate (context_type, exp,
11307 error (_(
"cannot slice a packed array"));
11337 static std::string storage;
11338 const char *pstart, *pend, *bound;
11339 struct value *bound_val;
11341 if (dval == NULL || str == NULL || str[k] ==
'\0')
11345 pend = strstr (pstart,
"__");
11349 k += strlen (bound);
11353 int len = pend - pstart;
11356 storage = std::string (pstart, len);
11357 bound = storage.c_str ();
11362 if (bound_val == NULL)
11366 if (pnew_k != NULL)
11375static struct value *
11382 std::vector<struct block_symbol> syms
11387 if (syms.size () != 1)
11389 if (err_msg == NULL)
11392 error ((
"%s"), err_msg);
11424static struct type *
11428 struct type *base_type;
11429 const char *subtype_info;
11431 gdb_assert (raw_type != NULL);
11432 gdb_assert (raw_type->
name () != NULL);
11434 if (raw_type->
code () == TYPE_CODE_RANGE)
11437 base_type = raw_type;
11440 subtype_info = strstr (
name,
"___XD");
11441 if (subtype_info == NULL)
11446 if (L < INT_MIN || U > INT_MAX)
11456 int prefix_len = subtype_info -
name;
11459 const char *bounds_str;
11463 bounds_str = strchr (subtype_info,
'_');
11466 if (*subtype_info ==
'L')
11471 if (bounds_str[n] ==
'_')
11473 else if (bounds_str[n] ==
'.')
11479 std::string name_buf = std::string (
name, prefix_len) +
"___L";
11482 lim_warning (_(
"Unknown lower bound, using 1."));
11487 if (*subtype_info ==
'U')
11495 std::string name_buf = std::string (
name, prefix_len) +
"___U";
11498 lim_warning (_(
"Unknown upper bound, using %ld."), (
long)
L);
11519 return (
name != NULL && strstr (
name,
"___XD"));
11532 return (subranged_type != NULL &&
type->
code () == TYPE_CODE_RANGE
11533 && subranged_type->
code () == TYPE_CODE_INT
11545 return (ULONGEST) high.
const_val () + 1;
11594 "constraint_error",
11639 "__gnat_debug_raise_exception",
11640 "__gnat_unhandled_exception",
11641 "__gnat_debug_raise_assert_failure",
11642 "__gnat_begin_handler_v1",
11652 "__gnat_debug_raise_exception",
11653 "__gnat_unhandled_exception",
11654 "__gnat_debug_raise_assert_failure",
11655 "__gnat_begin_handler",
11665 "__gnat_raise_nodefer_with_msg",
11666 "__gnat_unhandled_exception",
11667 "system__assertions__raise_assert_failure",
11668 "__gnat_begin_handler",
11709 error (_(
"Your Ada runtime appears to be missing some debugging "
11710 "information.\nCannot insert Ada exception catchpoint "
11711 "in this configuration."));
11719 error (_(
"Symbol \"%s\" is not a function (class = %d)"),
11729 error (_(
"Your Ada runtime appears to be missing some debugging "
11730 "information.\nCannot insert Ada exception catchpoint "
11731 "in this configuration."));
11739 error (_(
"Symbol \"%s\" is not a function (class = %d)"),
11757 if (data->exception_info != NULL)
11781 throw_error (NOT_FOUND_ERROR,
11782 _(
"Could not find Ada runtime exception support"));
11795 const char *fullname;
11811 if (access (fullname, R_OK) != 0)
11831 gdb::unique_xmalloc_ptr<char> func_name
11833 if (func_name == NULL)
11839 if (re_exec (func_name.get ()))
11892 for (frame_level = 0; frame_level < 3; frame_level += 1)
11900 gdb::unique_xmalloc_ptr<char> func_name
11902 if (func_name != NULL)
11904 if (strcmp (func_name.get (),
11905 data->exception_info->catch_exception_sym) == 0)
11938 return data->exception_info->unhandled_exception_name_addr ();
11951 internal_error (_(
"unexpected catchpoint type"));
11970static gdb::unique_xmalloc_ptr<char>
11973 struct value *e_msg_val;
11979 if (e_msg_val == NULL)
11983 gdb_assert (e_msg_val != NULL);
11988 if (e_msg_len <= 0)
11991 gdb::unique_xmalloc_ptr<char> e_msg ((
char *)
xmalloc (e_msg_len + 1));
11994 e_msg.get ()[e_msg_len] =
'\0';
12002static gdb::unique_xmalloc_ptr<char>
12005 gdb::unique_xmalloc_ptr<char> e_msg;
12011 catch (
const gdb_exception_error &e)
12013 e_msg.reset (
nullptr);
12027 CORE_ADDR result = 0;
12034 catch (
const gdb_exception_error &e)
12036 warning (_(
"failed to get exception name: %s"), e.what ());
12044 (
const char *excep_string,
12070 std::string &&excep_string_)
12085 void re_set ()
override;
12132 std::vector<symtab_and_line> sals;
12136 sals.push_back (sal);
12138 catch (
const gdb_exception_error &ex)
12141 if (ex.error != NOT_FOUND_ERROR)
12171 if (!bl.shlib_disabled)
12180 catch (
const gdb_exception_error &e)
12182 warning (_(
"failed to reevaluate internal exception condition "
12183 "for catchpoint %d: %s"),
12221 expr = (
"GNAT_GCC_exception_Access(gcc_exception)"
12222 ".all.occurrence.id");
12229 catch (
const gdb_exception_error &ex)
12252 catch (
const gdb_exception_error &ex)
12255 _(
"Error in testing exception condition:\n"));
12288 ?
"\nTemporary catchpoint " :
"\nCatchpoint ");
12290 uiout->
text (
", ");
12306 char exception_name[256];
12311 sizeof (exception_name) - 1);
12312 exception_name [
sizeof (exception_name) - 1] =
'\0';
12322 memcpy (exception_name,
"exception",
sizeof (
"exception"));
12330 uiout->
text (
"unhandled ");
12331 uiout->
field_string (
"exception-name", exception_name);
12340 uiout->
text (
"failed assertion");
12345 if (exception_message != NULL)
12347 uiout->
text (
" (");
12348 uiout->
field_string (
"exception-message", exception_message.get ());
12352 uiout->
text (
" at ");
12369 if (opts.addressprint)
12378 std::string msg = string_printf (_(
"`%s' Ada exception"),
12389 uiout->
field_string (
"what",
"unhandled Ada exceptions");
12396 _(
"`%s' Ada exception handlers"),
12400 uiout->
field_string (
"what",
"all Ada exceptions handlers");
12404 uiout->
field_string (
"what",
"failed Ada assertions");
12408 internal_error (_(
"unexpected catchpoint type"));
12424 : _(
"Catchpoint "));
12426 uiout->
text (
": ");
12433 std::string info = string_printf (_(
"`%s' Ada exception"),
12435 uiout->
text (info);
12438 uiout->
text (_(
"all Ada exceptions"));
12442 uiout->
text (_(
"unhandled Ada exceptions"));
12449 = string_printf (_(
"`%s' Ada exception handlers"),
12451 uiout->
text (info);
12454 uiout->
text (_(
"all Ada exceptions handlers"));
12458 uiout->
text (_(
"failed Ada assertions"));
12462 internal_error (_(
"unexpected catchpoint type"));
12482 gdb_printf (fp,
"catch exception unhandled");
12494 internal_error (_(
"unexpected catchpoint type"));
12519 bool is_catch_handlers_cmd,
12521 std::string *excep_string,
12522 std::string *cond_string)
12524 std::string exception_name;
12527 if (exception_name ==
"if")
12532 exception_name.clear ();
12538 args = skip_spaces (args);
12539 if (startswith (args,
"if")
12540 && (isspace (args[2]) || args[2] ==
'\0'))
12543 args = skip_spaces (args);
12545 if (args[0] ==
'\0')
12546 error (_(
"Condition missing after `if' keyword"));
12547 *cond_string = args;
12549 args += strlen (args);
12555 if (args[0] !=
'\0')
12556 error (_(
"Junk at end of expression"));
12558 if (is_catch_handlers_cmd)
12562 *excep_string = exception_name;
12564 else if (exception_name.empty ())
12568 excep_string->clear ();
12570 else if (exception_name ==
"unhandled")
12574 excep_string->clear ();
12580 *excep_string = exception_name;
12592 gdb_assert (data->exception_info != NULL);
12597 return (data->exception_info->catch_exception_sym);
12600 return (data->exception_info->catch_exception_unhandled_sym);
12603 return (data->exception_info->catch_assert_sym);
12606 return (data->exception_info->catch_handlers_sym);
12609 internal_error (_(
"unexpected catchpoint kind (%d)"), ex);
12623 bool is_standard_exc =
false;
12624 std::string result;
12630 result = (
"long_integer (GNAT_GCC_exception_Access"
12631 "(gcc_exception).all.occurrence.id)");
12634 result =
"long_integer (e)";
12657 if (strcmp (
name, excep_string) == 0)
12659 is_standard_exc =
true;
12666 if (is_standard_exc)
12667 string_appendf (result,
"long_integer (&standard.%s)", excep_string);
12669 string_appendf (result,
"long_integer (&%s)", excep_string);
12680 const char *sym_name;
12692 throw_error (NOT_FOUND_ERROR, _(
"Catchpoint symbol not found: %s"),
12696 error (_(
"Unable to insert catchpoint. %s is not a function."), sym_name);
12719 std::string &&excep_string,
12720 const std::string &cond_string,
12725 std::unique_ptr<ada_catchpoint> c
12727 cond_string.empty () ?
nullptr : cond_string.c_str (),
12728 tempflag, enabled, from_tty,
12729 std::move (excep_string)));
12739 const char *arg = arg_entry;
12743 std::string excep_string;
12744 std::string cond_string;
12753 std::move (excep_string), cond_string,
12764 const char *arg = arg_entry;
12768 std::string excep_string;
12769 std::string cond_string;
12778 std::move (excep_string), cond_string,
12787 const char *text,
const char *word)
12793 if (startswith (
info.name, word))
12809 args = skip_spaces (args);
12812 if (startswith (args,
"if")
12813 && (isspace (args[2]) || args[2] ==
'\0'))
12816 args = skip_spaces (args);
12817 if (args[0] ==
'\0')
12818 error (_(
"condition missing after `if' keyword"));
12819 cond_string.assign (args);
12824 else if (args[0] !=
'\0')
12825 error (_(
"Junk at end of arguments."));
12834 const char *arg = arg_entry;
12837 std::string cond_string;
12855 const char *type_name = sym->
type ()->
name ();
12861 && type_name != NULL && strcmp (type_name,
"exception") == 0);
12881 if (strcmp (sym->
linkage_name (),
"numeric_error") == 0)
12898 result = strcmp (
name, other.
name);
12901 if (result == 0 &&
addr < other.
addr)
12921 std::sort (exceptions->begin () + skip, exceptions->end ());
12922 exceptions->erase (std::unique (exceptions->begin () + skip, exceptions->end ()),
12923 exceptions->end ());
12938 std::vector<ada_exc_info> *exceptions)
12942 if (preg == NULL || preg->exec (
name, 0, NULL, 0) == 0)
12957 if (match_name (msymbol->linkage_name (), lookup_name,
12964 exceptions->push_back (
info);
12985 std::vector<ada_exc_info> *exceptions)
12993 switch (sym->aclass ())
13003 sym->value_address ()};
13005 exceptions->push_back (info);
13020 return (preg == NULL
13045 std::vector<ada_exc_info> *exceptions)
13052 [&] (
const char *search_name)
13054 std::string decoded =
ada_decode (search_name);
13067 const struct blockvector *bv = s->blockvector ();
13079 = {sym->print_name (), sym->value_address ()};
13081 exceptions->push_back (info);
13094static std::vector<ada_exc_info>
13097 std::vector<ada_exc_info> result;
13111 prev_len = result.size ();
13114 if (result.size () > prev_len)
13120 prev_len = result.size ();
13122 if (result.size () > prev_len)
13142std::vector<ada_exc_info>
13145 if (regexp == NULL)
13148 compiled_regex reg (regexp, REG_NOSUB, _(
"invalid regular expression"));
13161 if (regexp != NULL)
13163 (_(
"All Ada exceptions matching regular expression \"%s\":\n"), regexp);
13165 gdb_printf (_(
"All defined Ada exceptions:\n"));
13197 if (startswith (symbol_search_name,
"_ada_")
13198 && !startswith (lname,
"_ada"))
13199 symbol_search_name += 5;
13201 if (startswith (symbol_search_name,
"___ghost_")
13202 && !startswith (lname,
"___ghost_"))
13203 symbol_search_name += 9;
13205 int uscore_count = 0;
13206 while (*lname !=
'\0')
13208 if (*symbol_search_name != *lname)
13210 if (*symbol_search_name ==
'B' && uscore_count == 2
13211 && symbol_search_name[1] ==
'_')
13213 symbol_search_name += 2;
13214 while (isdigit (*symbol_search_name))
13215 ++symbol_search_name;
13216 if (symbol_search_name[0] ==
'_'
13217 && symbol_search_name[1] ==
'_')
13219 symbol_search_name += 2;
13226 if (*symbol_search_name ==
'_')
13231 ++symbol_search_name;
13245 return strcmp (symbol_search_name,
ada_lookup_name (lookup_name)) == 0;
13252 gdb::string_view user_name =
lookup_name.name ();
13254 if (!user_name.empty () && user_name[0] ==
'<')
13256 if (user_name.back () ==
'>')
13258 = gdb::to_string (user_name.substr (1, user_name.size () - 2));
13261 = gdb::to_string (user_name.substr (1, user_name.size () - 1));
13271 m_encoded_p = user_name.find (
"__") != gdb::string_view::npos;
13303 && user_name.find (
'.') == std::string::npos);
13315 return lookup_name.
ada ().
matches (symbol_search_name,
13328 gdb::string_view name_view = lookup_name.
name ();
13331 ? (strncmp (symbol_search_name, name_view.data (),
13332 name_view.size ()) == 0)
13333 : symbol_search_name == name_view)
13335 if (comp_match_res != NULL)
13336 comp_match_res->
set_match (symbol_search_name);
13388 static const std::vector<const char *> extensions
13389 = {
".adb",
".ads",
".a",
".ada",
".dg" };
13400 struct value *index_value =
val_atr (index_type, index);
13409 const struct block *var_block,
13414 if (frame !=
nullptr)
13434 const char *ptr, ssize_t len)
const override
13440 gdb_assert (val->
type ()->
code () == TYPE_CODE_STRING);
13452 auto add = [&] (
struct type *t)
13461 0,
"long_integer"));
13463 0,
"short_integer"));
13475 0,
"long_long_integer"));
13487 struct type *system_addr_ptr
13490 system_addr_ptr->
set_name (
"system__address");
13491 add (system_addr_ptr);
13496 unsigned int addr_length = system_addr_ptr->
length ();
13498 "storage_offset"));
13508 gdb::function_view<symbol_found_callback_ftype> callback)
const override
13510 std::vector<struct block_symbol> results
13514 if (!callback (&sym))
13523 (
const char *mangled,
13524 gdb::unique_xmalloc_ptr<char> *out)
const override
13526 std::string demangled =
ada_decode (mangled);
13530 if (demangled != mangled && demangled[0] !=
'<')
13563 int options)
const override
13565 return make_unique_xstrdup (
ada_decode (mangled).c_str ());
13571 struct ui_file *stream,
int show,
int level,
13589 const char *text,
const char *word,
13592 const struct block *b, *surrounding_static_block = 0;
13620 language symbol_language = msymbol->language ();
13639 msymbol->linkage_name (),
13640 lookup_name, text, word);
13650 surrounding_static_block = b;
13659 sym->linkage_name (),
13660 lookup_name, text, word);
13680 sym->linkage_name (),
13681 lookup_name, text, word);
13693 if (b == surrounding_static_block)
13702 sym->linkage_name (),
13703 lookup_name, text, word);
13712 (
struct type *
type, CORE_ADDR addr)
const override
13716 return xstrprintf (
"{%s} %s",
name.c_str (), core_addr_to_string (addr));
13730 (
struct value *val,
struct ui_file *stream,
int recurse,
13792 struct ui_file *stream,
int quoter)
const override
13800 struct ui_file *stream)
const override
13808 const gdb_byte *
string,
unsigned int length,
13809 const char *encoding,
int force_ellipses,
13812 ada_printstr (stream, elttype,
string, length, encoding,
13813 force_ellipses, options);
13819 struct ui_file *stream)
const override
13847 {
return "(...)"; }
13924 _(
"Prefix command for changing Ada-specific settings."),
13925 _(
"Generic command for showing Ada-specific settings."),
13931Enable or disable an optimization trusting PAD types over XVS types."), _(
"\
13932Show whether an optimization trusting PAD types over XVS types is activated."),
13934This is related to the encoding used by the GNAT compiler. The debugger\n\
13935should normally trust the contents of PAD types, but certain older versions\n\
13936of GNAT have a bug that sometimes causes the information in the PAD type\n\
13937to be incorrect. Turning this setting \"off\" allows the debugger to\n\
13938work around this bug. It is always safe to turn this option \"off\", but\n\
13939this incurs a slight performance penalty, so it is recommended to NOT change\n\
13940this option to \"off\" unless necessary."),
13945Enable or disable the output of formal and return types for functions in the \
13946overloads selection menu."), _(
"\
13947Show whether the output of formal and return types for functions in the \
13948overloads selection menu is activated."),
13955Set the Ada source character set."), _(
"\
13956Show the Ada source character set."), _(
"\
13957The character set used for Ada source files.\n\
13958This must correspond to the '-gnati' or '-gnatW' option passed to GNAT."),
13963Catch Ada exceptions, when raised.\n\
13964Usage: catch exception [ARG] [if CONDITION]\n\
13965Without any argument, stop when any Ada exception is raised.\n\
13966If ARG is \"unhandled\" (without the quotes), only stop when the exception\n\
13967being raised does not have a handler (and will therefore lead to the task's\n\
13969Otherwise, the catchpoint only stops when the name of the exception being\n\
13970raised is the same as ARG.\n\
13971CONDITION is a boolean expression that is evaluated to see whether the\n\
13972exception should cause a stop."),
13979Catch Ada exceptions, when handled.\n\
13980Usage: catch handlers [ARG] [if CONDITION]\n\
13981Without any argument, stop when any Ada exception is handled.\n\
13982With an argument, catch only exceptions with the given name.\n\
13983CONDITION is a boolean expression that is evaluated to see whether the\n\
13984exception should cause a stop."),
13990Catch failed Ada assertions, when raised.\n\
13991Usage: catch assert [if CONDITION]\n\
13992CONDITION is a boolean expression that is evaluated to see whether the\n\
13993exception should cause a stop."),
14001List all Ada exception names.\n\
14002Usage: info exceptions [REGEXP]\n\
14003If a regular expression is passed as an argument, only those matching\n\
14004the regular expression are listed."));
14007 _(
"Set Ada maintenance-related variables."),
14008 _(
"Show Ada maintenance-related variables."),
14015 _(
"Set whether descriptive types generated by GNAT should be ignored."),
14016 _(
"Show whether descriptive types generated by GNAT should be ignored."),
14018When enabled, the debugger will stop using the DW_AT_GNAT_descriptive_type\n\
14033#ifdef GDB_SELF_TEST
14034 selftests::register_test (
"ada-decode", ada_decode_tests);
#define bits(obj, st, fn)
int ada_parse(struct parser_state *par_state)
std::string ada_decode(const char *encoded, bool wrap, bool operators)
static struct value * ensure_lval(struct value *val)
bool is_ada_exception_catchpoint(breakpoint *bp)
static struct type * to_fixed_array_type(struct type *, struct value *, int)
static struct type * template_to_static_fixed_type(struct type *type0)
static int remove_compiler_suffix(const char *encoded, int *len)
static value * ada_unop_atr(struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1, struct type *type_arg, int tem)
static struct type * ada_typedef_target_type(struct type *type)
struct value * ada_pos_atr(struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg)
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)
static void ada_add_global_exceptions(compiled_regex *preg, std::vector< ada_exc_info > *exceptions)
value * ada_unop_in_range(struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1, struct type *type)
static struct value * ada_value_assign(struct value *toval, struct value *fromval)
static int lesseq_defined_than(struct symbol *, struct symbol *)
static void ada_clear_symbol_cache(program_space *pspace)
static int ada_is_gnat_encoded_packed_array_type(struct type *type)
static void ada_free_objfile_observer(struct objfile *objfile)
static const utf8_entry ada_case_fold[]
static std::string ada_exception_catchpoint_cond_string(const char *excep_string, enum ada_exception_catchpoint_kind ex)
static struct type * ada_lookup_struct_elt_type(struct type *, const char *, int, int)
static struct value * ada_coerce_ref(struct value *)
static value * eval_ternop_in_range(struct type *expect_type, struct expression *exp, enum noside noside, value *arg1, value *arg2, value *arg3)
struct type * ada_index_type(struct type *type, int n, const char *name)
const gdb_byte * ada_aligned_value_addr(struct type *type, const gdb_byte *valaddr)
struct type * ada_array_element_type(struct type *type, int nindices)
struct bound_minimal_symbol ada_lookup_simple_minsym(const char *name, struct objfile *objfile)
static bool trust_pad_over_xvs
static CORE_ADDR value_pointer(struct value *value, struct type *type)
static void ada_add_all_symbols(std::vector< struct block_symbol > &, const struct block *, const lookup_name_info &lookup_name, domain_enum, int, int *)
static struct value * desc_bounds(struct value *)
static const char *const gnat_source_charsets[]
value * ada_atr_size(struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1)
static struct type * desc_data_target_type(struct type *)
static int ada_same_array_size_p(struct type *t1, struct type *t2)
int ada_prefer_type(struct type *type0, struct type *type1)
static struct type * thin_descriptor_type(struct type *type)
struct value * ada_get_decoded_value(struct value *value)
struct value * ada_coerce_to_simple_array(struct value *arr)
static int ada_is_redundant_index_type_desc(struct type *array_type, struct type *desc_type)
static std::string ada_encode_1(const char *decoded, bool throw_errors)
block_symbol ada_resolve_funcall(struct symbol *sym, const struct block *block, struct type *context_type, bool parse_completion, int nargs, value *argvec[], innermost_block_tracker *tracker)
std::string ada_encode(const char *decoded, bool fold)
static int ada_is_direct_array_type(struct type *)
static int compare_names(const char *string1, const char *string2)
static int ada_is_non_standard_exception_sym(struct symbol *sym)
static int desc_bound_bitsize(struct type *, int, int)
static int is_thin_pntr(struct type *type)
static int discrete_type_p(struct type *)
static struct type * desc_index_type(struct type *, int)
static symbol_name_match_type name_match_type_from_name(const char *lookup_name)
static int ada_in_variant(LONGEST val, struct type *type, int field_num)
static const char ada_completer_word_break_characters[]
static int ada_is_interface_tag(struct type *type)
static struct type * ada_find_any_type(const char *name)
static LONGEST recursively_update_array_bitsize(struct type *type)
static struct type * decode_constrained_packed_array_type(struct type *)
static void add_nonlocal_symbols(std::vector< struct block_symbol > &result, const lookup_name_info &lookup_name, domain_enum domain, int global)
static int return_match(struct type *func_type, struct type *context_type)
static struct type * find_parallel_type_by_descriptive_type(struct type *type, const char *name)
static const char * ada_lookup_name(const lookup_name_info &lookup_name)
static struct value * ada_read_renaming_var_value(struct symbol *renaming_sym, const struct block *block)
static void ada_remove_po_subprogram_suffix(const char *encoded, int *len)
static int scalar_type_p(struct type *)
static bool ada_ignore_descriptive_types_p
struct value * ada_atr_enum_val(struct expression *exp, enum noside noside, struct type *type, struct value *arg)
static struct symbol * ada_find_any_type_symbol(const char *name)
static std::string xget_renaming_scope(struct type *renaming_type)
ULONGEST ada_modulus(struct type *type)
static void append_hex_encoded(std::string &result, uint32_t one_char)
static struct value * ada_promote_array_of_integrals(struct type *type, struct value *val)
static const struct exception_support_info exception_support_info_v0
int ada_is_variant_part(struct type *type, int field_num)
static struct value * ada_value_slice(struct value *array, int low, int high)
static LONGEST ada_array_bound_from_type(struct type *arr_type, int n, int which)
static struct value * value_tag_from_contents_and_address(struct type *type, const gdb_byte *valaddr, CORE_ADDR address)
static struct value * coerce_unspec_val_to_type(struct value *, struct type *)
static bool ada_symbol_name_matches(const char *symbol_search_name, const lookup_name_info &lookup_name, completion_match_result *comp_match_res)
static void lim_warning(const char *format,...) ATTRIBUTE_PRINTF(1
value * ada_abs(struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1)
static struct value * unwrap_value(struct value *)
int ada_is_modular_type(struct type *type)
struct value * ada_binop_exp(struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1, struct value *arg2)
static struct value * ada_index_struct_field_1(int *, struct value *, int, struct type *)
block_symbol ada_find_operator_symbol(enum exp_opcode op, bool parse_completion, int nargs, value *argvec[])
static struct type * to_fixed_range_type(struct type *, struct value *)
static struct type * static_unwrap_type(struct type *type)
struct type * ada_coerce_to_simple_array_type(struct type *type)
bool get_int_var_value(const char *name, LONGEST &value)
static const char ada_utf8[]
static int eq_cache_entry(const void *a, const void *b)
value * ada_unop_neg(struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1)
static struct type * ada_get_tsd_type(struct inferior *inf)
static struct value * make_array_descriptor(struct type *, struct value *)
static std::string add_angle_brackets(const char *str)
static const char * ada_source_charset
static gdb::unique_xmalloc_ptr< char > ada_exception_message_1(void)
static int ada_resolve_function(std::vector< struct block_symbol > &, struct value **, int, const char *, struct type *, bool)
static void remove_extra_symbols(std::vector< struct block_symbol > &syms)
static const registry< inferior >::key< ada_inferior_data > ada_inferior_data
static const char *const known_runtime_file_name_patterns[]
static int ada_is_redundant_range_encoding(struct type *range_type, struct type *encoding_type)
static int fat_pntr_bounds_bitsize(struct type *)
std::string copy_and_hex_encode(struct obstack *storage)
static const struct exception_support_info default_exception_support_info
static int ada_has_this_exception_support(const struct exception_support_info *einfo)
static htab_t get_ada_pspace_data(struct program_space *pspace)
static const char *const known_auxiliary_function_name_patterns[]
static void catch_ada_assert_command_split(const char *args, std::string &cond_string)
bool ada_is_access_to_unconstrained_array(struct type *type)
static int warnings_issued
static void catch_ada_exception_command_split(const char *args, bool is_catch_handlers_cmd, enum ada_exception_catchpoint_kind *ex, std::string *excep_string, std::string *cond_string)
static struct value * val_atr(struct type *, LONGEST)
int ada_which_variant_applies(struct type *var_type, struct value *outer)
static struct cmd_list_element * maint_set_ada_cmdlist
static struct cmd_list_element * maint_show_ada_cmdlist
static void ada_add_block_symbols(std::vector< struct block_symbol > &, const struct block *, const lookup_name_info &lookup_name, domain_enum, struct objfile *)
static int is_dynamic_field(struct type *, int)
static int lookup_cached_symbol(const char *name, domain_enum domain, struct symbol **sym, const struct block **block)
struct value * ada_atr_enum_rep(struct expression *exp, enum noside noside, struct type *type, struct value *arg)
static int symbols_are_identical_enums(const std::vector< struct block_symbol > &syms)
static void value_assign_to_component(struct value *container, struct value *component, struct value *val)
static struct value * desc_one_bound(struct value *, int, int)
static struct value * thin_data_pntr(struct value *val)
static LONGEST ada_array_bound(struct value *arr, int n, int which)
static long decode_packed_array_bitsize(struct type *)
static struct value * coerce_for_assign(struct type *type, struct value *val)
static struct cmd_list_element * set_ada_list
static const char * ada_unqualified_name(const char *decoded_name)
static const struct exception_support_info exception_support_info_fallback
static int numeric_type_p(struct type *)
static std::string type_as_string(struct type *type)
static bool ada_is_any_packed_array_type(struct type *type)
static struct value * ada_index_struct_field(int, struct value *, int, struct type *)
static struct type * desc_bounds_type(struct type *)
struct value * ada_value_subscript(struct value *arr, int arity, struct value **ind)
static struct type * type_from_tag(struct value *tag)
bool ada_is_string_type(struct type *type)
static void map_matching_symbols(struct objfile *objfile, const lookup_name_info &lookup_name, bool is_wild_match, domain_enum domain, int global, match_data &data)
value * ada_ternop_slice(struct expression *exp, enum noside noside, struct value *array, struct value *low_bound_val, struct value *high_bound_val)
static struct value * ada_value_tag(struct value *val)
static struct value * ada_value_cast(struct type *type, struct value *arg2)
static CORE_ADDR ada_exception_name_addr_1(enum ada_exception_catchpoint_kind ex)
struct value * ada_val_atr(struct expression *exp, enum noside noside, struct type *type, struct value *arg)
static void catch_ada_exception_command(const char *arg_entry, int from_tty, struct cmd_list_element *command)
static struct type * ada_tag_type(struct value *val)
static void add_defn_to_vec(std::vector< struct block_symbol > &, struct symbol *, const struct block *)
static int ada_resolve_enum(std::vector< struct block_symbol > &syms, const char *name, struct type *context_type, bool parse_completion)
struct value * ada_coerce_to_simple_array_ptr(struct value *arr)
static int ada_identical_enum_types_p(struct type *type1, struct type *type2)
static struct type * find_base_type(struct type *type)
int ada_is_array_descriptor_type(struct type *type)
static int advance_wild_match(const char **, const char *, char)
static void ada_add_exceptions_from_frame(compiled_regex *preg, frame_info_ptr frame, std::vector< ada_exc_info > *exceptions)
static void ada_print_symbol_signature(struct ui_file *stream, struct symbol *sym, const struct type_print_options *flags)
static void catch_ada_completer(struct cmd_list_element *cmd, completion_tracker &tracker, const char *text, const char *word)
static int has_negatives(struct type *type)
static gdb::unique_xmalloc_ptr< char > ada_tag_name_from_tsd(struct value *tsd)
static CORE_ADDR ada_unhandled_exception_name_addr_from_raise(void)
static int fat_pntr_data_bitpos(struct type *)
static int is_unchecked_variant(struct type *var_type, struct type *outer_type)
static void ada_exception_support_info_sniffer(void)
static bool convert_from_hex_encoded(std::string &out, const char *str, int n)
static int ada_is_others_clause(struct type *type, int field_num)
static int is_thick_pntr(struct type *type)
static int integer_type_p(struct type *)
static std::vector< struct block_symbol > ada_lookup_symbol_list_worker(const lookup_name_info &lookup_name, const struct block *block, domain_enum domain, int full_search)
static struct type * empty_record(struct type *templ)
static CORE_ADDR cond_offset_target(CORE_ADDR address, long offset)
static int is_valid_name_for_wild_match(const char *name0)
enum ada_renaming_category ada_parse_renaming(struct symbol *sym, const char **renamed_entity, int *len, const char **renaming_expr)
const char * ada_type_name(struct type *type)
static void catch_ada_handlers_command(const char *arg_entry, int from_tty, struct cmd_list_element *command)
static CORE_ADDR ada_unhandled_exception_name_addr(void)
void ada_lookup_encoded_symbol(const char *name, const struct block *block, domain_enum domain, struct block_symbol *info)
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)
static bool do_full_match(const char *symbol_search_name, const lookup_name_info &lookup_name, completion_match_result *comp_match_res)
void ada_find_printable_frame(frame_info_ptr fi)
static bool name_matches_regex(const char *name, compiled_regex *preg)
static int desc_bound_bitpos(struct type *, int, int)
static bool do_wild_match(const char *symbol_search_name, const lookup_name_info &lookup_name, completion_match_result *comp_match_res)
static int is_lower_alphanum(const char c)
static int ada_is_exception_sym(struct symbol *sym)
struct type * ada_find_parallel_type(struct type *type, const char *suffix)
static struct type * to_record_with_fixed_variant_part(struct type *type, const gdb_byte *valaddr, CORE_ADDR address, struct value *dval0)
static bool convert_hex(const char *str, int n, uint32_t *out)
struct type * ada_get_base_type(struct type *raw_type)
void create_ada_exception_catchpoint(struct gdbarch *gdbarch, enum ada_exception_catchpoint_kind ex_kind, std::string &&excep_string, const std::string &cond_string, int tempflag, int enabled, int from_tty)
static struct value * desc_data(struct value *)
static symbol_name_matcher_ftype * ada_get_symbol_name_matcher(const lookup_name_info &lookup_name)
static void remove_irrelevant_renamings(std::vector< struct block_symbol > *syms, const struct block *current_block)
static const char * ada_decoded_op_name(enum exp_opcode)
value * ada_binop_in_bounds(struct expression *exp, enum noside noside, struct value *arg1, struct value *arg2, int n)
static struct type * to_fixed_record_type(struct type *type0, const gdb_byte *valaddr, CORE_ADDR address, struct value *dval)
value * ada_equal_binop(struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1, struct value *arg2)
static int ada_is_dispatch_table_ptr_type(struct type *type)
std::vector< ada_exc_info > ada_exceptions_list(const char *regexp)
static struct value * decode_constrained_packed_array(struct value *)
static LONGEST ada_array_length(struct value *arr, int n)
static struct type * ada_find_parallel_type_with_name(struct type *, const char *)
CORE_ADDR ada_unhandled_exception_name_addr_ftype(void)
static ada_language ada_language_defn
static struct value * ada_value_binop(struct value *arg1, struct value *arg2, enum exp_opcode op)
static struct type * dynamic_template_type(struct type *type)
static int get_selections(int *choices, int n_choices, int max_results, int is_all_choice, const char *annotation_suffix)
static struct type * ada_type_of_array(struct value *arr, int bounds)
static LONGEST max_of_size(int size)
static void add_component_interval(LONGEST, LONGEST, std::vector< LONGEST > &)
static void ada_new_objfile_observer(struct objfile *objfile)
bool ada_is_character_type(struct type *type)
static void sort_remove_dups_ada_exceptions_list(std::vector< ada_exc_info > *exceptions, int skip)
struct type * ada_parent_type(struct type *type)
int ada_is_simple_array_type(struct type *type)
static LONGEST min_of_size(int size)
int ada_is_system_address_type(struct type *type)
static struct type * to_static_fixed_type(struct type *)
LONGEST ada_discrete_type_high_bound(struct type *type)
static void ada_inferior_exit(struct inferior *inf)
int ada_is_parent_field(struct type *type, int field_num)
static LONGEST pos_atr(struct value *)
struct type * ada_get_decoded_type(struct type *type)
int ada_is_constrained_packed_array_type(struct type *type)
const char * ada_main_name()
value * ada_mult_binop(struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1, struct value *arg2)
static struct value * get_var_value(const char *name, const char *err_msg)
static int num_visible_fields(struct type *type)
int ada_name_prefix_len(const char *name)
static struct type * desc_base_type(struct type *)
static const char * ada_exception_sym_name(enum ada_exception_catchpoint_kind ex)
static int ada_is_unconstrained_packed_array_type(struct type *)
std::vector< struct block_symbol > ada_lookup_symbol_list(const char *name, const struct block *block, domain_enum domain)
static hashval_t hash_cache_entry(const void *v)
struct type * ada_aligned_type(struct type *type)
static const registry< program_space >::key< htab, htab_deleter > ada_pspace_data_handle
struct value * ada_tag_value_at_base_address(struct value *obj)
static int ada_value_equal(struct value *arg1, struct value *arg2)
static bool ada_is_renaming_symbol(struct symbol *name_sym)
struct type * ada_check_typedef(struct type *type)
struct value * ada_convert_actual(struct value *actual, struct type *formal_type0)
static struct value * ada_value_slice_from_ptr(struct value *array_ptr, struct type *type, int low, int high)
static struct cmd_list_element * show_ada_list
int ada_is_range_type_name(const char *name)
block_symbol ada_resolve_variable(struct symbol *sym, const struct block *block, struct type *context_type, bool parse_completion, int deprocedure_p, innermost_block_tracker *tracker)
int ada_is_wrapper_field(struct type *type, int field_num)
static struct type * constrained_packed_array_type(struct type *, long *)
static void info_exceptions_command(const char *regexp, int from_tty)
static struct value * ada_get_tsd_from_tag(struct value *tag)
static unsigned int field_alignment(struct type *type, int f)
int ada_is_tagged_type(struct type *type, int refok)
static struct value * value_subscript_packed(struct value *, int, struct value **)
struct block_symbol ada_lookup_symbol(const char *name, const struct block *block0, domain_enum domain)
static struct value * ada_value_ptr_subscript(struct value *arr, int arity, struct value **ind)
static int fat_pntr_data_bitsize(struct type *)
value * ada_atr_tag(struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1)
static const char *const standard_exc[]
struct type * ada_to_fixed_type(struct type *type, const gdb_byte *valaddr, CORE_ADDR address, struct value *dval, int check_tag)
static struct htab * decoded_names_store
static struct ada_inferior_data * get_ada_inferior_data(struct inferior *inf)
static void ada_add_standard_exceptions(compiled_regex *preg, std::vector< ada_exc_info > *exceptions)
static int ada_type_match(struct type *ftype, struct type *atype)
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)
const char * ada_decode_symbol(const struct general_symbol_info *arg)
static int equiv_types(struct type *, struct type *)
int ada_is_tag_type(struct type *type)
static int is_name_suffix(const char *)
static gdb::unique_xmalloc_ptr< char > ada_exception_message(void)
int ada_is_aligner_type(struct type *type)
static void catch_assert_command(const char *arg_entry, int from_tty, struct cmd_list_element *command)
static bool literal_symbol_name_matcher(const char *symbol_search_name, const lookup_name_info &lookup_name, completion_match_result *comp_match_res)
static ULONGEST umax_of_size(int size)
static struct type * ada_to_fixed_type_1(struct type *type, const gdb_byte *valaddr, CORE_ADDR address, struct value *dval, int check_tag)
int ada_scan_number(const char str[], int k, LONGEST *R, int *new_k)
static struct value * ada_value_struct_elt(struct value *arg, const char *name, int no_err)
static const utf8_entry * find_case_fold_entry(uint32_t c)
static struct value * ada_to_fixed_value_create(struct type *type0, CORE_ADDR address, struct value *val0)
int ada_get_field_index(const struct type *type, const char *field_name, int maybe_missing)
const struct ada_opname_map ada_opname_table[]
static int desc_arity(struct type *)
static struct type * template_to_fixed_record_type(struct type *type, const gdb_byte *valaddr, CORE_ADDR address, struct value *dval0)
struct value * ada_value_ind(struct value *val0)
LONGEST ada_discrete_type_low_bound(struct type *type)
const char * ada_enum_name(const char *name)
static int variant_field_index(struct type *type)
static int fat_pntr_bounds_bitpos(struct type *)
struct value * ada_value_primitive_field(struct value *arg1, int offset, int fieldno, struct type *arg_type)
static struct symbol * standard_lookup(const char *, const struct block *, domain_enum)
void ada_fixup_array_indexes_type(struct type *index_desc_type)
static void cache_symbol(const char *name, domain_enum domain, struct symbol *sym, const struct block *block)
int ada_is_ignored_field(struct type *type, int field_num)
static LONGEST max_of_type(struct type *t)
static int possible_user_operator_p(enum exp_opcode, struct value **)
static int is_known_support_routine(frame_info_ptr frame)
static const gdb_byte * cond_offset_host(const gdb_byte *valaddr, long offset)
static struct symtab_and_line ada_exception_sal(enum ada_exception_catchpoint_kind ex)
static int user_select_syms(struct block_symbol *syms, int nsyms, int max_results)
static int ada_add_block_renamings(std::vector< struct block_symbol > &result, const struct block *block, const lookup_name_info &lookup_name, domain_enum domain)
static void ada_add_local_symbols(std::vector< struct block_symbol > &result, const lookup_name_info &lookup_name, const struct block *block, domain_enum domain)
static int find_struct_field(const char *, struct type *, int, struct type **, int *, int *, int *, int *)
static std::vector< ada_exc_info > ada_exceptions_list_1(compiled_regex *preg)
static int ada_args_match(struct symbol *, struct value **, int)
static struct value * ada_search_struct_field(const char *, struct value *, int, struct type *)
static bool wild_match(const char *name, const char *patn)
static int is_nondebugging_type(struct type *type)
static LONGEST min_of_type(struct type *t)
static void ada_remove_trailing_digits(const char *encoded, int *len)
int ada_array_arity(struct type *type)
static int compare_names_with_case(const char *string1, const char *string2, enum case_sensitivity casing)
gdb::unique_xmalloc_ptr< char > ada_tag_name(struct value *tag)
static int is_nonfunction(const std::vector< struct block_symbol > &)
static void sort_choices(struct block_symbol syms[], int nsyms)
struct type * ada_variant_discrim_type(struct type *var_type, struct type *outer_type)
static bool print_signatures
static struct type * get_base_type(struct type *type)
static int ada_is_array_type(struct type *type)
struct value * ada_binop_minmax(struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1, struct value *arg2)
static CORE_ADDR ada_exception_name_addr(enum ada_exception_catchpoint_kind ex)
const char * ada_variant_discrim_name(struct type *type0)
static struct type * to_fixed_variant_branch_type(struct type *, const gdb_byte *, CORE_ADDR, struct value *)
static int old_renaming_is_invisible(const struct symbol *sym, const char *function_name)
static bool is_compiler_suffix(const char *str)
void _initialize_ada_language()
static const char * ada_fold_name(gdb::string_view name, bool throw_on_error=false)
static const char ADA_MAIN_PROGRAM_SYMBOL_NAME[]
struct value * ada_to_fixed_value(struct value *val)
static int is_suffix(const char *str, const char *suffix)
static int encoded_ordered_before(const char *N0, const char *N1)
static struct value * empty_array(struct type *arr_type, int low, int high)
static int field_name_match(const char *field_name, const char *target)
static int is_package_name(const char *name)
static int scan_discrim_bound(const char *str, int k, struct value *dval, LONGEST *px, int *pnew_k)
static bool do_exact_match(const char *symbol_search_name, const lookup_name_info &lookup_name, completion_match_result *comp_match_res)
static int is_ada95_tag(struct value *tag)
#define ADA_KNOWN_RUNTIME_FILE_NAME_PATTERNS
void ada_value_print(struct value *, struct ui_file *, const struct value_print_options *)
void ada_print_type(struct type *, const char *, struct ui_file *, int, int, const struct type_print_options *)
void ada_printchar(int, struct type *, struct ui_file *)
void ada_emit_char(int, struct type *, struct ui_file *, int, int)
void ada_print_typedef(struct type *type, struct symbol *new_symbol, struct ui_file *stream)
@ ADA_SUBPROGRAM_RENAMING
void ada_value_print_inner(struct value *, struct ui_file *, int, const struct value_print_options *)
void ada_printstr(struct ui_file *, struct type *, const gdb_byte *, unsigned int, const char *, int, const struct value_print_options *)
#define ADA_KNOWN_AUXILIARY_FUNCTION_NAME_PATTERNS
ada_exception_catchpoint_kind
@ ada_catch_exception_unhandled
const struct lang_varobj_ops ada_varobj_ops
void * xcalloc(size_t number, size_t size)
void annotate_field(int num)
void annotate_catchpoint(int num)
struct gdbarch * get_current_arch(void)
struct gdbarch * target_gdbarch(void)
const struct block * block_for_pc(CORE_ADDR pc)
iterator_range< block_iterator_wrapper > block_iterator_range
const struct block * get_frame_block(frame_info_ptr frame, CORE_ADDR *addr_in_block)
void add_catch_command(const char *name, const char *docstring, cmd_func_ftype *func, completer_ftype *completer, void *user_data_catch, void *user_data_tcatch)
const char * bpdisp_text(enum bpdisp disp)
breakpoint * install_breakpoint(int internal, std::unique_ptr< breakpoint > &&arg, int update_gll)
void print_num_locno(const bpstat *bs, struct ui_out *uiout)
void update_breakpoint_locations(code_breakpoint *b, struct program_space *filter_pspace, gdb::array_view< const symtab_and_line > sals, gdb::array_view< const symtab_and_line > sals_end)
@ bp_loc_software_breakpoint
const char * host_charset(void)
void convert_between_encodings(const char *from, const char *to, const gdb_byte *bytes, unsigned int num_bytes, int width, struct obstack *output, enum transliterations translit)
expression_up excep_cond_expr
ada_catchpoint_location(ada_catchpoint *owner)
bool is_array_like(struct type *type) const override
void printstr(struct ui_file *stream, struct type *elttype, const gdb_byte *string, unsigned int length, const char *encoding, int force_ellipses, const struct value_print_options *options) const override
void print_array_index(struct type *index_type, LONGEST index, struct ui_file *stream, const value_print_options *options) const override
bool c_style_arrays_p() const override
void emitchar(int ch, struct type *chtype, struct ui_file *stream, int quoter) const override
const char * struct_too_deep_ellipsis() const override
bool symbol_printing_suppressed(struct symbol *symbol) const override
const char * word_break_characters(void) const override
gdb::unique_xmalloc_ptr< char > demangle_symbol(const char *mangled, int options) const override
bool store_sym_names_in_linkage_form_p() const override
bool is_string_type_p(struct type *type) const override
struct value * read_var_value(struct symbol *var, const struct block *var_block, frame_info_ptr frame) const override
int parser(struct parser_state *ps) const override
symbol_name_matcher_ftype * get_symbol_name_matcher_inner(const lookup_name_info &lookup_name) const override
const char * name() const override
const std::vector< const char * > & filename_extensions() const override
void print_typedef(struct type *type, struct symbol *new_symbol, struct ui_file *stream) const override
struct value * to_array(struct value *val) const override
struct value * value_string(struct gdbarch *gdbarch, const char *ptr, ssize_t len) const override
void language_arch_info(struct gdbarch *gdbarch, struct language_arch_info *lai) const override
void value_print(struct value *val, struct ui_file *stream, const struct value_print_options *options) const override
void value_print_inner(struct value *val, struct ui_file *stream, int recurse, const struct value_print_options *options) const override
gdb::unique_xmalloc_ptr< char > watch_location_expression(struct type *type, CORE_ADDR addr) const override
bool iterate_over_symbols(const struct block *block, const lookup_name_info &name, domain_enum domain, gdb::function_view< symbol_found_callback_ftype > callback) const override
void printchar(int ch, struct type *chtype, struct ui_file *stream) const override
const struct lang_varobj_ops * varobj_ops() const override
bool sniff_from_mangled_name(const char *mangled, gdb::unique_xmalloc_ptr< char > *out) const override
void 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) const override
const char * natural_name() const override
void print_type(struct type *type, const char *varstring, struct ui_file *stream, int show, int level, const struct type_print_options *flags) const override
struct block_symbol lookup_symbol_nonlocal(const char *name, const struct block *block, const domain_enum domain) const override
bool matches(const char *symbol_search_name, symbol_name_match_type match_type, completion_match_result *comp_match_res) const
const std::string & lookup_name() const
bool wild_match_p() const
ada_lookup_name_info(const lookup_name_info &lookup_name)
std::string m_encoded_name
ui_file_style style() const
void add_completion(gdb::unique_xmalloc_ptr< char > name, completion_match_for_lcd *match_for_lcd=NULL, const char *text=NULL, const char *word=NULL)
std::vector< ada_component_up > m_components
bool uses_objfile(struct objfile *objfile) override
void assign(struct value *container, struct value *lhs, struct expression *exp, std::vector< LONGEST > &indices, LONGEST low, LONGEST high) override
void dump(ui_file *stream, int depth) override
value * assign_aggregate(struct value *container, struct value *lhs, struct expression *exp)
value * evaluate(struct type *expect_type, struct expression *exp, enum noside noside) override
value * evaluate(struct type *expect_type, struct expression *exp, enum noside noside) override
value * evaluate(struct type *expect_type, struct expression *exp, enum noside noside) override
operation_up replace(operation_up &&owner, struct expression *exp, bool deprocedure_p, bool parse_completion, innermost_block_tracker *tracker, struct type *context_type) override
void dump(ui_file *stream, int depth) override
std::vector< ada_association_up > m_assocs
void assign(struct value *container, struct value *lhs, struct expression *exp, std::vector< LONGEST > &indices, LONGEST low, LONGEST high) override
bool uses_objfile(struct objfile *objfile) override
value * evaluate(struct type *expect_type, struct expression *exp, enum noside noside) override
bool uses_objfile(struct objfile *objfile) override
void assign(struct value *container, struct value *lhs, struct expression *exp, std::vector< LONGEST > &indices, LONGEST low, LONGEST high, operation_up &op) override
void dump(ui_file *stream, int depth) override
bool resolve(struct expression *exp, bool deprocedure_p, bool parse_completion, innermost_block_tracker *tracker, struct type *context_type) override
value * evaluate(struct type *expect_type, struct expression *exp, enum noside noside) override
void dump(ui_file *stream, int depth) override
void assign(struct value *container, struct value *lhs, struct expression *exp, std::vector< LONGEST > &indices, LONGEST low, LONGEST high, operation_up &op) override
bool uses_objfile(struct objfile *objfile) override
bool uses_objfile(struct objfile *objfile) override
void assign(struct value *container, struct value *lhs, struct expression *exp, std::vector< LONGEST > &indices, LONGEST low, LONGEST high) override
void dump(ui_file *stream, int depth) override
void assign(struct value *container, struct value *lhs, struct expression *exp, std::vector< LONGEST > &indices, LONGEST low, LONGEST high) override
bool uses_objfile(struct objfile *objfile) override
void dump(ui_file *stream, int depth) override
value * evaluate(struct type *expect_type, struct expression *exp, enum noside noside) override
const char * get_name() const
value * evaluate(struct type *expect_type, struct expression *exp, enum noside noside) override
value * evaluate(struct type *expect_type, struct expression *exp, enum noside noside) override
value * evaluate(struct type *expect_type, struct expression *exp, enum noside noside) override
bool resolve(struct expression *exp, bool deprocedure_p, bool parse_completion, innermost_block_tracker *tracker, struct type *context_type) override
enum exp_opcode opcode() const override
value * evaluate(struct type *expect_type, struct expression *exp, enum noside noside) override
value * evaluate(struct type *expect_type, struct expression *exp, enum noside noside) override
value * evaluate_for_cast(struct type *expect_type, struct expression *exp, enum noside noside) override
bool resolve(struct expression *exp, bool deprocedure_p, bool parse_completion, innermost_block_tracker *tracker, struct type *context_type) override
value * evaluate(struct type *expect_type, struct expression *exp, enum noside noside) override
void do_generate_ax(struct expression *exp, struct agent_expr *ax, struct axs_value *value, struct type *cast_type) override
const block * get_block() const
value * evaluate_for_cast(struct type *expect_type, struct expression *exp, enum noside noside) override
value * evaluate(struct type *expect_type, struct expression *exp, enum noside noside) override
void do_generate_ax(struct expression *exp, struct agent_expr *ax, struct axs_value *value, struct type *cast_type) override
enum exp_opcode opcode() const override
value * evaluate(struct type *expect_type, struct expression *exp, enum noside noside) override
LONGEST as_longest() const
value * evaluate(struct type *expect_type, struct expression *exp, enum noside noside) override
std::tuple< Arg... > m_storage
symbol * get_symbol() const
value * evaluate(struct type *expect_type, struct expression *exp, enum noside noside) override
void do_generate_ax(struct expression *exp, struct agent_expr *ax, struct axs_value *value, struct type *cast_type) override
void update(const struct block *b, innermost_block_tracker_types t)
static const lookup_name_info & match_any()
const ada_lookup_name_info & ada() const
symbol_name_match_type match_type() const
gdb::string_view name() const
bool completion_mode() const
void set(unsigned key, void *datum)
void field_string(const char *fldname, const char *string, const ui_file_style &style=ui_file_style())
void field_fmt(const char *fldname, const char *format,...) ATTRIBUTE_PRINTF(3
void field_signed(const char *fldname, LONGEST value)
void field_skip(const char *fldname)
void text(const char *string)
bool is_mi_like_p() const
struct cmd_list_element * showlist
void error_no_arg(const char *why)
struct cmd_list_element * setlist
struct cmd_list_element * maintenance_show_cmdlist
struct cmd_list_element * maintenance_set_cmdlist
set_show_commands add_setshow_enum_cmd(const char *name, enum command_class theclass, const char *const *enumlist, const char **var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_func_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
set_show_commands add_setshow_prefix_cmd(const char *name, command_class theclass, const char *set_doc, const char *show_doc, cmd_list_element **set_subcommands_list, cmd_list_element **show_subcommands_list, cmd_list_element **set_list, cmd_list_element **show_list)
set_show_commands add_setshow_boolean_cmd(const char *name, enum command_class theclass, bool *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_func_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
struct cmd_list_element * add_info(const char *name, cmd_simple_func_ftype *fun, const char *doc)
cli_style_option file_name_style
cli_style_option metadata_style
std::string extract_arg(const char **arg)
void write_memory(CORE_ADDR memaddr, const bfd_byte *myaddr, ssize_t len)
void read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
void write_memory_with_notification(CORE_ADDR memaddr, const bfd_byte *myaddr, ssize_t len)
EXTERN_C char * re_comp(const char *)
int longest_to_int(LONGEST)
const char * command_line_input(std::string &cmd_line_buffer, const char *, const char *)
static ULONGEST extract_unsigned_integer(gdb::array_view< const gdb_byte > buf, enum bfd_endian byte_order)
value * evaluate_var_value(enum noside noside, const block *blk, symbol *var)
struct value * parse_and_eval(const char *exp, parser_flags flags)
value * evaluate_var_msym_value(enum noside noside, struct objfile *objfile, minimal_symbol *msymbol)
void binop_promote(const struct language_defn *language, struct gdbarch *gdbarch, struct value **arg1, struct value **arg2)
void unop_promote(const struct language_defn *language, struct gdbarch *gdbarch, struct value **arg1)
CORE_ADDR parse_and_eval_address(const char *exp)
void exception_fprintf(struct ui_file *file, const struct gdb_exception &e, const char *prefix,...)
std::unique_ptr< expression > expression_up
expression_up parse_exp_1(const char **, CORE_ADDR pc, const struct block *, parser_flags flags, innermost_block_tracker *=nullptr)
@ EVAL_AVOID_SIDE_EFFECTS
void select_frame(frame_info_ptr fi)
frame_info_ptr get_selected_frame(const char *message)
frame_info_ptr get_current_frame(void)
frame_info_ptr get_prev_frame(frame_info_ptr this_frame)
symtab_and_line find_frame_sal(frame_info_ptr frame)
const struct block * get_selected_block(CORE_ADDR *addr_in_block)
static void ATTRIBUTE_PRINTF(1, 0)
void gdbarch_iterate_over_objfiles_in_search_order(struct gdbarch *gdbarch, iterate_over_objfiles_in_search_order_cb_ftype cb, struct objfile *current_objfile)
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
int gdbarch_long_long_bit(struct gdbarch *gdbarch)
int gdbarch_short_bit(struct gdbarch *gdbarch)
int gdbarch_int_bit(struct gdbarch *gdbarch)
int gdbarch_float_bit(struct gdbarch *gdbarch)
const struct floatformat ** gdbarch_double_format(struct gdbarch *gdbarch)
void gdbarch_address_to_pointer(struct gdbarch *gdbarch, struct type *type, gdb_byte *buf, CORE_ADDR addr)
int gdbarch_long_double_bit(struct gdbarch *gdbarch)
const struct floatformat ** gdbarch_float_format(struct gdbarch *gdbarch)
const struct floatformat ** gdbarch_long_double_format(struct gdbarch *gdbarch)
int gdbarch_long_bit(struct gdbarch *gdbarch)
int gdbarch_double_bit(struct gdbarch *gdbarch)
enum bfd_endian type_byte_order(const struct type *type)
struct type * lookup_pointer_type(struct type *type)
struct type * init_character_type(type_allocator &alloc, int bit, int unsigned_p, const char *name)
struct type * init_integer_type(type_allocator &alloc, int bit, int unsigned_p, const char *name)
struct type * create_static_range_type(type_allocator &alloc, struct type *index_type, LONGEST low_bound, LONGEST high_bound)
int is_integral_type(struct type *t)
struct type * lookup_struct_elt_type(struct type *type, const char *name, int noerr)
int is_scalar_type(struct type *type)
int is_dynamic_type(struct type *type)
struct type * lookup_array_range_type(struct type *element_type, LONGEST low_bound, LONGEST high_bound)
bool get_discrete_bounds(struct type *type, LONGEST *lowp, LONGEST *highp)
struct type * resolve_dynamic_type(struct type *type, gdb::array_view< const gdb_byte > valaddr, CORE_ADDR addr, const frame_info_ptr *in_frame)
struct type * init_float_type(type_allocator &alloc, int bit, const char *name, const struct floatformat **floatformats, enum bfd_endian byte_order)
gdb::optional< LONGEST > discrete_position(struct type *type, LONGEST val)
bool get_array_bounds(struct type *type, LONGEST *low_bound, LONGEST *high_bound)
const struct builtin_type * builtin_type(struct gdbarch *gdbarch)
struct type * create_array_type(type_allocator &alloc, struct type *element_type, struct type *range_type)
bool types_equal(struct type *a, struct type *b)
struct type * create_array_type_with_stride(type_allocator &alloc, struct type *element_type, struct type *range_type, struct dynamic_prop *byte_stride_prop, unsigned int bit_stride)
struct type * copy_type(const struct type *type)
struct type * check_typedef(struct type *type)
#define TYPE_DESCRIPTIVE_TYPE(thistype)
#define INIT_NONE_SPECIFIC(type)
#define TYPE_MAIN_TYPE(thistype)
#define INIT_GNAT_SPECIFIC(type)
#define HAVE_GNAT_AUX_INFO(type)
mach_port_t kern_return_t mach_port_t mach_msg_type_name_t msgportsPoly 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
void error_call_unknown_return_type(const char *func_name)
struct value * call_function_by_hand(struct value *function, type *default_return_type, gdb::array_view< value * > args)
struct inferior * current_inferior(void)
const struct language_defn * language_def(enum language lang)
struct type * language_lookup_primitive_type(const struct language_defn *la, struct gdbarch *gdbarch, const char *name)
struct type * language_bool_type(const struct language_defn *la, struct gdbarch *gdbarch)
struct type * language_string_char_type(const struct language_defn *la, struct gdbarch *gdbarch)
struct symbol * language_lookup_primitive_type_as_symbol(const struct language_defn *la, struct gdbarch *gdbarch, const char *name)
#define R(name, type, sim_num)
static struct type * new_type(char *)
const char * async_reason_lookup(enum async_reply_reason reason)
@ EXEC_ASYNC_BREAKPOINT_HIT
struct bound_minimal_symbol lookup_minimal_symbol(const char *name, const char *sfile, struct objfile *objf)
static LONGEST convert_char_literal(struct type *type, LONGEST val)
static void assign_component(struct value *container, struct value *lhs, LONGEST index, struct expression *exp, operation_up &arg)
std::unique_ptr< operation > operation_up
bool check_objfile(const std::unique_ptr< ada_component > &comp, struct objfile *objfile)
observable< struct inferior * > inferior_exit
observable< struct objfile * > free_objfile
observable< struct objfile * > new_objfile
observable< program_space * > all_objfiles_removed
const char * objfile_name(const struct objfile *objfile)
struct program_space * current_program_space
static gdbpy_ref field_name(struct type *type, int field)
static struct symbol * new_symbol(struct die_info *, struct type *, struct dwarf2_cu *, struct symbol *=NULL)
void(* func)(remote_target *remote, char *)
const char * symtab_to_fullname(struct symtab *s)
const char * symtab_to_filename_for_display(struct symtab *symtab)
gdb::unique_xmalloc_ptr< char > find_frame_funname(frame_info_ptr frame, enum language *funlang, struct symbol **funcp)
bool print_one(const bp_location **) const override
enum ada_exception_catchpoint_kind m_kind
ada_catchpoint(struct gdbarch *gdbarch_, enum ada_exception_catchpoint_kind kind, const char *cond_string, bool tempflag, bool enabled, bool from_tty, std::string &&excep_string_)
std::string m_excep_string
void print_recreate(struct ui_file *fp) const override
bool should_stop_exception(const struct bp_location *bl) const
struct bp_location * allocate_location() override
void print_mention() const override
void check_status(struct bpstat *bs) override
enum print_stop_action print_it(const bpstat *bs) const override
bool operator<(const ada_exc_info &) const
bool operator==(const ada_exc_info &) const
const struct exception_support_info * exception_info
const struct block * block
const block * superblock() const
const struct block * global_block() const
struct gdbarch * gdbarch() const
const struct block * static_block() const
symbol * function() const
struct symbol * linkage_function() const
struct using_direct * get_using() const
struct block * block(size_t i)
struct block * static_block()
struct block * global_block()
CORE_ADDR value_address() const
struct minimal_symbol * minsym
bp_location_ref_ptr bp_location_at
bp_location_range locations() const
gdb::unique_xmalloc_ptr< char > cond_string
void print_recreate_thread(struct ui_file *fp) const
bool has_locations() const
struct type * builtin_bool
struct type * builtin_int
struct type * builtin_void
const struct block * block
void set_match(const char *m, const char *m_for_lcd=NULL)
struct blockvector * blockvector()
struct objfile * objfile() const
LONGEST const_val() const
dynamic_prop_kind kind() const
ada_unhandled_exception_name_addr_ftype * unhandled_exception_name_addr
const char * catch_handlers_sym
const char * catch_assert_sym
const char * catch_exception_unhandled_sym
const char * catch_exception_sym
virtual operation_up replace(operation_up &&owner, struct expression *exp, bool deprocedure_p, bool parse_completion, innermost_block_tracker *tracker, struct type *context_type)
const struct language_defn * language_defn
void set_type(struct type *type)
void set_loc_bitpos(LONGEST bitpos)
LONGEST loc_bitpos() const
void set_bitsize(unsigned int bitsize)
LONGEST loc_enumval() const
void set_name(const char *name)
const char * name() const
unsigned int bitsize() const
struct type * type() const
const char * natural_name() const
union general_symbol_info::@183 language_specific
const char * demangled_name
const char * print_name() const
const char * linkage_name() const
void set_string_char_type(struct type *type)
void add_primitive_type(struct type *type)
void set_bool_type(struct type *type, const char *name=nullptr)
virtual struct value * read_var_value(struct symbol *var, const struct block *var_block, frame_info_ptr frame) const
match_data(std::vector< struct block_symbol > *rp)
bool operator()(struct block_symbol *bsym)
DISABLE_COPY_AND_ASSIGN(match_data)
std::vector< struct block_symbol > * resultp
minimal_symbol_type type() const
struct program_space * pspace
struct gdbarch * arch() const
objfile(gdb_bfd_ref_ptr, const char *, objfile_flags)
compunit_symtab_range compunits()
void expand_matching_symbols(const lookup_name_info &name, domain_enum domain, int global, symbol_compare_ftype *ordered_compare)
msymbols_range msymbols()
objfiles_range objfiles()
address_class aclass() const
struct type * type() const
domain_enum domain() const
LONGEST value_longest() const
bool is_objfile_owned() const
unsigned int line() const
CORE_ADDR value_address() const
bool is_artificial() const
struct compunit_symtab * compunit() const
struct type * target_type() const
dynamic_prop * dyn_prop(dynamic_prop_node_kind kind) const
void copy_fields(struct type *src)
void set_code(type_code code)
bool is_fixed_instance() const
struct field & field(int idx) const
void set_target_type(struct type *target_type)
void set_is_stub(bool is_stub)
void set_num_fields(unsigned int num_fields)
unsigned int num_fields() const
void set_name(const char *name)
void alloc_fields(unsigned int nfields, bool init=true)
void set_length(ULONGEST length)
range_bounds * bounds() const
void set_is_fixed_instance(bool is_fixed_instance)
const char * name() const
type * index_type() const
unsigned short bit_offset() const
unsigned short bit_size() const
const ui_file_style * ptr() const
struct using_direct * next
bool operator<(uint32_t val) const
static struct value * zero(struct type *type, enum lval_type lv)
void set_parent(struct value *parent)
struct value * primitive_field(LONGEST offset, int fieldno, struct type *arg_type)
static struct value * allocate_optimized_out(struct type *type)
gdb::array_view< const gdb_byte > contents_all()
void contents_copy(struct value *dst, LONGEST dst_offset, LONGEST src_offset, LONGEST length)
void set_bitpos(LONGEST bit)
bool deprecated_modifiable() const
struct value * copy() const
gdb::array_view< gdb_byte > contents_writeable()
static struct value * allocate(struct type *type)
struct type * enclosing_type() const
void set_lval(lval_type val)
void set_bitsize(LONGEST bit)
gdb::array_view< const gdb_byte > contents()
void set_address(CORE_ADDR)
void set_component_location(const struct value *whole)
gdb::array_view< gdb_byte > contents_raw()
struct type * type() const
void set_offset(LONGEST offset)
enum lval_type lval() const
void deprecated_set_type(struct type *type)
static struct value * allocate_lazy(struct type *type)
gdb::array_view< const gdb_byte > contents_for_printing()
bool 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, block_search_flags search_flags, enum search_domain kind)
const char multiple_symbols_all[]
const char multiple_symbols_cancel[]
bool iterate_over_symbols_terminated(const struct block *block, const lookup_name_info &name, const domain_enum domain, gdb::function_view< symbol_found_callback_ftype > callback)
symtab_and_line find_function_start_sal(CORE_ADDR func_addr, obj_section *section, bool funfirstline)
const char * multiple_symbols_select_mode(void)
bool 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)
bool symbol_name_matcher_ftype(const char *symbol_search_name, const lookup_name_info &lookup_name, completion_match_result *comp_match_res)
static bool completion_skip_symbol(complete_symbol_mode mode, Symbol *sym)
symtab_and_line find_function_start_sal(symbol *sym, bool funfirstline)
int target_read_string(CORE_ADDR addr, int len, int width, unsigned int fetchlimit, gdb::unique_xmalloc_ptr< gdb_byte > *buffer, int *bytes_read)
const struct type_print_options type_print_raw_options
std::string type_to_string(struct type *type)
void type_print(struct type *type, const char *varstring, struct ui_file *stream, int show)
static styled_string_s * styled_string(const ui_file_style &style, const char *str, styled_string_s &&tmp={})
const char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)
int strcmp_iw_ordered(const char *string1, const char *string2)
void copy_bitwise(gdb_byte *dest, ULONGEST dest_offset, const gdb_byte *source, ULONGEST source_offset, ULONGEST nbits, int bits_big_endian)
void gdb_printf(struct ui_file *stream, const char *format,...)
void vwarning(const char *string, va_list args)
struct value * value_subscript(struct value *array, LONGEST index)
struct value * value_neg(struct value *arg1)
int value_equal(struct value *arg1, struct value *arg2)
int value_less(struct value *arg1, struct value *arg2)
struct value * value_concat(struct value *arg1, struct value *arg2)
struct value * value_ptradd(struct value *arg1, LONGEST arg2)
struct value * value_binop(struct value *arg1, struct value *arg2, enum exp_opcode op)
struct value * value_cast_pointers(struct type *type, struct value *arg2, int subclass_check)
struct value * value_at_lazy(struct type *type, CORE_ADDR addr, frame_info_ptr frame)
struct value * value_at(struct type *type, CORE_ADDR addr)
struct value * value_slice(struct value *array, int lowbound, int length)
struct value * value_allocate_space_in_inferior(int len)
struct value * value_struct_elt(struct value **argp, gdb::optional< gdb::array_view< value * > > args, const char *name, int *static_memfuncp, const char *err)
struct value * value_of_variable(struct symbol *var, const struct block *b)
struct value * value_addr(struct value *arg1)
struct value * value_cast(struct type *type, struct value *arg2)
struct value * value_assign(struct value *toval, struct value *fromval)
struct value * value_ind(struct value *arg1)
struct value * value_ref(struct value *arg1, enum type_code refcode)
void get_user_print_options(struct value_print_options *opts)
struct value * call_internal_function(struct gdbarch *gdbarch, const struct language_defn *language, struct value *func, int argc, struct value **argv)
void clear_internalvar(struct internalvar *var)
CORE_ADDR value_as_address(struct value *val)
struct value * value_from_contents_and_address_unresolved(struct type *type, const gdb_byte *valaddr, CORE_ADDR address)
struct value * value_from_longest(struct type *type, LONGEST num)
struct value * coerce_ref(struct value *arg)
struct value * value_from_contents(struct type *type, const gdb_byte *contents)
void set_internalvar(struct internalvar *var, struct value *val)
struct internalvar * lookup_internalvar(const char *name)
LONGEST value_as_long(struct value *val)
void modify_field(struct type *type, gdb_byte *addr, LONGEST fieldval, LONGEST bitpos, LONGEST bitsize)
gdb_mpz value_as_mpz(struct value *val)
struct value * value_from_mpz(struct type *type, const gdb_mpz &v)
struct value * value_from_contents_and_address(struct type *type, const gdb_byte *valaddr, CORE_ADDR address, frame_info_ptr frame)
static bool value_true(struct value *val)