47#include "gdbsupport/selftest.h"
48#include "gdbsupport/array-view.h"
101 LONGEST offset2, LONGEST len2)
105 l = std::max (
offset1, offset2);
106 h = std::min (
offset1 + len1, offset2 + len2);
154 auto i = std::lower_bound (ranges.begin (), ranges.end (), what);
156 if (i > ranges.begin ())
158 const struct range &bef = *(i - 1);
164 if (i < ranges.end ())
166 const struct range &r = *i;
392 LONGEST offset, LONGEST length)
395 offset * TARGET_CHAR_BIT,
396 length * TARGET_CHAR_BIT);
426 const std::vector<range> &ranges)
433 if (ranges.size () == 1)
435 const struct range &t = ranges[0];
438 && t.
length == (TARGET_CHAR_BIT
553 auto i = std::lower_bound (vectorp->begin (), vectorp->end (), newr);
554 if (i > vectorp->begin ())
556 struct range &bef = *(i - 1);
577 i = vectorp->insert (i, newr);
583 i = vectorp->insert (i, newr);
588 if (i != vectorp->end () && i + 1 < vectorp->end ())
594 struct range &t = *i;
598 for (; i < vectorp->end (); i++)
600 struct range &r = *i;
623 vectorp->erase (next, next + removed);
640 length * TARGET_CHAR_BIT);
654 for (i = pos; i < ranges->size (); i++)
656 const range &r = (*ranges)[i];
678 const gdb_byte *ptr2,
size_t offset2_bits,
681 gdb_assert (offset1_bits % TARGET_CHAR_BIT
682 == offset2_bits % TARGET_CHAR_BIT);
684 if (offset1_bits % TARGET_CHAR_BIT != 0)
687 gdb_byte mask, b1, b2;
693 bits = TARGET_CHAR_BIT - offset1_bits % TARGET_CHAR_BIT;
694 gdb_assert (
bits <
sizeof (mask) * TARGET_CHAR_BIT);
695 mask = (1 <<
bits) - 1;
697 if (length_bits <
bits)
699 mask &= ~(gdb_byte) ((1 << (
bits - length_bits)) - 1);
704 b1 = *(ptr1 + offset1_bits / TARGET_CHAR_BIT) & mask;
705 b2 = *(ptr2 + offset2_bits / TARGET_CHAR_BIT) & mask;
713 offset1_bits +=
bits;
714 offset2_bits +=
bits;
717 if (length_bits % TARGET_CHAR_BIT != 0)
721 gdb_byte mask, b1, b2;
728 bits = length_bits % TARGET_CHAR_BIT;
729 o1 = offset1_bits + length_bits -
bits;
730 o2 = offset2_bits + length_bits -
bits;
732 gdb_assert (
bits <
sizeof (mask) * TARGET_CHAR_BIT);
733 mask = ((1 <<
bits) - 1) << (TARGET_CHAR_BIT -
bits);
735 gdb_assert (o1 % TARGET_CHAR_BIT == 0);
736 gdb_assert (o2 % TARGET_CHAR_BIT == 0);
738 b1 = *(ptr1 + o1 / TARGET_CHAR_BIT) & mask;
739 b2 = *(ptr2 + o2 / TARGET_CHAR_BIT) & mask;
752 gdb_assert (offset1_bits % TARGET_CHAR_BIT == 0);
753 gdb_assert (offset2_bits % TARGET_CHAR_BIT == 0);
754 gdb_assert (length_bits % TARGET_CHAR_BIT == 0);
756 return memcmp (ptr1 + offset1_bits / TARGET_CHAR_BIT,
757 ptr2 + offset2_bits / TARGET_CHAR_BIT,
758 length_bits / TARGET_CHAR_BIT);
788 LONGEST
offset1, LONGEST offset2,
789 LONGEST length, ULONGEST *l, ULONGEST *h)
796 if (rp1->
idx == -1 && rp2->
idx == -1)
802 else if (rp1->
idx == -1 || rp2->
idx == -1)
806 const range *r1, *r2;
819 l2 = std::max (offset2, r2->
offset);
820 h2 = std::min (offset2 + length, offset2 + r2->
length);
831 if (l1 != l2 || h1 != h2)
849 const struct value *val2,
int offset2,
857 gdb_assert (!val1->
lazy && !val2->
lazy);
862 gdb_assert (offset2 + length
865 memset (&rp1, 0,
sizeof (rp1));
866 memset (&rp2, 0,
sizeof (rp2));
874 ULONGEST l = 0, h = 0;
877 for (i = 0; i < 2; i++)
879 ULONGEST l_tmp, h_tmp;
889 if (i == 0 || l_tmp < l)
898 val2->
contents.get (), offset2, l) != 0)
911 const struct value *val2, LONGEST offset2,
915 val2, offset2 * TARGET_CHAR_BIT,
916 length * TARGET_CHAR_BIT);
960 val =
new struct value (type);
983#define MIN_VALUE_FOR_MAX_VALUE_SIZE 16
997 error (_(
"max-value-size set too low, increasing to %d bytes"),
1009 gdb_printf (file, _(
"Maximum value size is unlimited.\n"));
1011 gdb_printf (file, _(
"Maximum value size is %d bytes.\n"),
1029 error (_(
"value of type `%s' requires %s bytes, which is more "
1030 "than max-value-size"),
type->
name (), pulongest (length));
1032 error (_(
"value requires %s bytes, which is more than "
1033 "max-value-size"), pulongest (length));
1074 struct type *array_type
1166gdb::array_view<gdb_byte>
1175 return gdb::make_array_view
1179gdb::array_view<gdb_byte>
1185 return gdb::make_array_view (
value->
contents.get (), length);
1198 int *real_type_found)
1201 struct type *result;
1205 if (real_type_found)
1206 *real_type_found = 0;
1208 if (opts.objectprint)
1214 == TYPE_CODE_STRUCT)
1217 struct type *real_type;
1222 if (real_type_found)
1223 *real_type_found = 1;
1227 else if (resolve_simple_types)
1229 if (real_type_found)
1230 *real_type_found = 1;
1241 throw_error (OPTIMIZED_OUT_ERROR, _(
"value has been optimized out"));
1250 throw_error (OPTIMIZED_OUT_ERROR,
1251 _(
"register has not been saved in frame"));
1261 throw_error (NOT_AVAILABLE_ERROR, _(
"value is not available"));
1264gdb::array_view<const gdb_byte>
1274gdb::array_view<const gdb_byte>
1283gdb::array_view<const gdb_byte>
1297 const std::vector<range> &src_range,
int src_bit_offset,
1300 for (
const range &r : src_range)
1304 l = std::max (r.
offset, (LONGEST) src_bit_offset);
1306 (LONGEST) src_bit_offset + bit_length);
1310 dst_bit_offset + (l - src_bit_offset),
1320 const struct value *src,
int src_bit_offset,
1343 struct value *src, LONGEST src_offset, LONGEST
length)
1345 LONGEST src_bit_offset, dst_bit_offset, bit_length;
1353 gdb_assert (!dst->
lazy && !src->
lazy);
1360 TARGET_CHAR_BIT * dst_offset,
1361 TARGET_CHAR_BIT * length));
1364 gdb::array_view<gdb_byte> dst_contents
1366 length * unit_size);
1367 gdb::array_view<const gdb_byte> src_contents
1369 length * unit_size);
1370 copy (src_contents, dst_contents);
1373 src_bit_offset = src_offset * unit_size * HOST_CHAR_BIT;
1374 dst_bit_offset = dst_offset * unit_size * HOST_CHAR_BIT;
1375 bit_length = length * unit_size * HOST_CHAR_BIT;
1378 src, src_bit_offset,
1387 struct value *src, LONGEST src_bit_offset,
1394 gdb_assert (!dst->
lazy && !src->
lazy);
1399 LONGEST dst_offset = dst_bit_offset / TARGET_CHAR_BIT;
1400 LONGEST length = bit_length / TARGET_CHAR_BIT;
1409 src_contents.data (), src_bit_offset,
1415 src, src_bit_offset,
1431 struct value *src, LONGEST src_offset, LONGEST length)
1463gdb::array_view<const gdb_byte>
1472gdb::array_view<gdb_byte>
1502 catch (
const gdb_exception_error &ex)
1507 case OPTIMIZED_OUT_ERROR:
1508 case NOT_AVAILABLE_ERROR:
1529 offset * TARGET_CHAR_BIT,
1530 length * TARGET_CHAR_BIT);
1537 LONGEST offset, LONGEST length)
1544 LONGEST offset, LONGEST length)
1719 std::vector<value_ref_ptr>::reverse_iterator iter;
1733 return value_ref_ptr::new_reference (val);
1738std::vector<value_ref_ptr>
1741 std::vector<value_ref_ptr> result;
1748 std::move (iter + 1,
all_values.end (), std::back_inserter (result));
1751 std::reverse (result.begin (), result.end ());
1787 gdb_assert (arg->
contents !=
nullptr);
1789 const auto &arg_view
1790 = gdb::make_array_view (arg->
contents.get (), length);
1859 const struct value *whole)
1957 error (_(
"The history is empty."));
1959 error (_(
"There is only one value in the history."));
1961 error (_(
"History does not go back to $$%d."), -num);
1964 error (_(
"History has not yet reached $%d."), absnum);
1990 if (num_exp[0] !=
'+' || num_exp[1] !=
'\0')
2002 for (i = num; i < num + 10 && i <=
value_history.size (); i++)
2019 if (from_tty && num_exp)
2117 if (
expr->first_opcode () != BINOP_ASSIGN)
2118 error (_(
"Init-if-undefined requires an assignment expression."));
2123 if (assign !=
nullptr)
2128 if (ivarop !=
nullptr)
2132 if (intvar ==
nullptr)
2133 error (_(
"The first parameter to init-if-undefined "
2134 "should be a GDB variable."));
2170 len = strlen (
name);
2173 if (strncmp (var->
name,
name, len) == 0)
2305 internal_error (_(
"bad kind"));
2348 if (
type->
code () == TYPE_CODE_INT)
2375 LONGEST offset, LONGEST bitpos,
2376 LONGEST bitsize,
struct value *newval)
2393 memcpy (addr + offset * unit_size,
value_contents (newval).data (),
2399 internal_error (_(
"set_internalvar_component"));
2410 error (_(
"Cannot overwrite convenience function %s"), var->
name);
2415 case TYPE_CODE_VOID:
2419 case TYPE_CODE_INTERNAL_FUNCTION:
2459 var->
kind = new_kind;
2482 var->
u.
string = xstrdup (
string);
2545 gdb_assert (result);
2560 gdb_assert (result);
2603 gdb::unique_xmalloc_ptr<char> &&doc,
2619 htab_t copied_types)
2633 htab_t copied_types)
2638 if (
var->u.integer.type
2639 &&
var->u.integer.type->objfile_owner () ==
objfile)
2656 htab_t copied_types)
2694 copied_types.get ());
2725 catch (
const gdb_exception_error &ex)
2728 _(
"<error: %s>"), ex.what ());
2739 gdb_printf (_(
"No debugger convenience variables now defined.\n"
2740 "Convenience variables have "
2741 "names starting with \"$\";\n"
2742 "use \"set\" as in \"set "
2743 "$foo = 5\" to define them.\n"));
2897 if (!
value_type (val)->is_pointer_or_reference ()
2933 case TYPE_CODE_TYPEDEF:
2935 case TYPE_CODE_ENUM:
2936 case TYPE_CODE_FLAGS:
2937 case TYPE_CODE_BOOL:
2939 case TYPE_CODE_CHAR:
2940 case TYPE_CODE_RANGE:
2941 case TYPE_CODE_MEMBERPTR:
2965 if (
code == TYPE_CODE_RANGE)
2971 case TYPE_CODE_DECFLOAT:
2974 case TYPE_CODE_FIXED_POINT:
2982 mpz_tdiv_q (vz.
val, mpq_numref (vq.
val), mpq_denref (vq.
val));
2988 case TYPE_CODE_RVALUE_REF:
2994 error (_(
"Value can't be converted to integer."));
3027 error (_(
"Invalid floating value found in program."));
3041 struct value *retval;
3073 gdb_assert_not_reached (
"unexpected field location kind");
3093 new_encl_type->
length ()));
3106 int fieldno,
struct type *arg_type)
3136 LONGEST container_bitsize =
type->
length () * 8;
3140 if ((bitpos % container_bitsize) + v->
bitsize <= container_bitsize
3141 &&
type->
length () <= (
int) sizeof (LONGEST))
3142 v->
bitpos = bitpos % container_bitsize;
3147 + (bitpos - v->
bitpos) / 8);
3191 gdb_assert (0 == offset);
3202 / (HOST_CHAR_BIT * unit_size));
3298 LONGEST bitpos, LONGEST bitsize)
3311 bytes_read = ((bitpos % 8) + bitsize + 7) / 8;
3314 bytes_read = field_type->
length ();
3315 bitsize = 8 * bytes_read;
3321 bytes_read, byte_order);
3325 if (byte_order == BFD_ENDIAN_BIG)
3326 lsbcount = (bytes_read * 8 - bitpos % 8 - bitsize);
3328 lsbcount = (bitpos % 8);
3334 if (bitsize < 8 * (
int)
sizeof (val))
3336 valmask = (((ULONGEST) 1) << bitsize) - 1;
3340 if (val & (valmask ^ (valmask >> 1)))
3357 LONGEST embedded_offset,
int fieldno,
3358 const struct value *val, LONGEST *result)
3365 gdb_assert (val != NULL);
3367 bit_offset = embedded_offset * TARGET_CHAR_BIT + bitpos;
3400 LONGEST bitpos, LONGEST bitsize,
3401 const gdb_byte *valaddr, LONGEST embedded_offset,
3402 const struct value *val)
3404 enum bfd_endian byte_order;
3416 if (valaddr != NULL)
3423 field_type->
length (), byte_order, num);
3428 src_bit_offset = embedded_offset * TARGET_CHAR_BIT + bitpos;
3429 if (byte_order == BFD_ENDIAN_BIG)
3430 dst_bit_offset = field_type->
length () * TARGET_CHAR_BIT - bitsize;
3434 val, src_bit_offset, bitsize);
3445 const gdb_byte *valaddr,
3471 ULONGEST mask = (ULONGEST) -1 >> (8 *
sizeof (ULONGEST) -
bitsize);
3480 if ((~fieldval & ~(mask >> 1)) == 0)
3484 if (0 != (fieldval & ~mask))
3488 warning (_(
"Value does not fit in %s bits."), plongest (
bitsize));
3501 if (byte_order == BFD_ENDIAN_BIG)
3504 oword &= ~(mask <<
bitpos);
3505 oword |= fieldval <<
bitpos;
3523 case TYPE_CODE_RANGE:
3527 case TYPE_CODE_CHAR:
3528 case TYPE_CODE_ENUM:
3529 case TYPE_CODE_FLAGS:
3530 case TYPE_CODE_BOOL:
3531 case TYPE_CODE_MEMBERPTR:
3536 num &= ((ULONGEST) 1 << bit_size) - 1;
3543 case TYPE_CODE_RVALUE_REF:
3549 case TYPE_CODE_DECFLOAT:
3554 error (_(
"Unexpected type (%d) encountered for integer constant."),
3566 enum bfd_endian byte_order;
3575 case TYPE_CODE_CHAR:
3576 case TYPE_CODE_ENUM:
3577 case TYPE_CODE_FLAGS:
3578 case TYPE_CODE_BOOL:
3579 case TYPE_CODE_RANGE:
3580 case TYPE_CODE_MEMBERPTR:
3585 num &= ((ULONGEST) 1 << bit_size) - 1;
3592 case TYPE_CODE_RVALUE_REF:
3598 case TYPE_CODE_DECFLOAT:
3603 error (_(
"Unexpected type (%d) encountered "
3604 "for unsigned integer constant."),
3668 gdb_assert (
type->
code () == TYPE_CODE_FLT);
3683 const gdb_byte *valaddr,
3688 if (valaddr == NULL)
3704 const gdb_byte *valaddr,
3707 gdb::array_view<const gdb_byte> view;
3708 if (valaddr !=
nullptr)
3709 view = gdb::make_array_view (valaddr,
type->
length ());
3714 if (valaddr == NULL)
3732 struct value *result;
3757 for (; isdigit (h[len]); len++)
3761 if (h[len] ==
'_' || isalpha (h[len]))
3778 index = -strtol (&h[2], &local_end, 10);
3794 index = strtol (&h[1], &local_end, 10);
3829 LONGEST bit_offset, LONGEST bit_length)
3836 if ((bit_offset % TARGET_CHAR_BIT) == 0
3837 && (bit_length % TARGET_CHAR_BIT) == 0
3838 && bit_length == TARGET_CHAR_BIT *
type->
length ())
3845 dst_offset += TARGET_CHAR_BIT *
type->
length () - bit_length;
3878 const struct type *original_type,
3879 struct value *original_value,
3880 CORE_ADDR original_value_address)
3885 gdb::array_view<const gdb_byte> view;
3886 struct type *resolved_original_target_type
3888 original_value_address);
3905 struct value *retval;
3906 struct type *enc_type;
3935 case TYPE_CODE_ARRAY:
3939 case TYPE_CODE_FUNC:
3956 if (
code == TYPE_CODE_ERROR)
3957 error (_(
"Function return type unknown."));
4056 gdb_assert (next_frame != NULL);
4087 internal_error (_(
"infinite loop while fetching a register"));
4113 "(frame=%d, regnum=%d(%s), ...) ",
4185 internal_error (_(
"Unexpected lazy value type."));
4192static struct value *
4195 void *cookie,
int argc,
struct value **argv)
4200 error (_(
"You must provide one argument for $_isvoid."));
4210static struct value *
4213 void *cookie,
int argc,
struct value **argv)
4216 error (_(
"You must provide one argument for $_creal."));
4218 value *cval = argv[0];
4220 if (ctype->
code () != TYPE_CODE_COMPLEX)
4221 error (_(
"expected a complex number"));
4228static struct value *
4231 void *cookie,
int argc,
4232 struct value **argv)
4235 error (_(
"You must provide one argument for $_cimag."));
4237 value *cval = argv[0];
4239 if (ctype->
code () != TYPE_CODE_COMPLEX)
4240 error (_(
"expected a complex number"));
4251test_ranges_contain ()
4253 std::vector<range> ranges;
4259 ranges.push_back (r);
4264 ranges.push_back (r);
4295check_ranges_vector (gdb::array_view<const range> ranges,
4296 gdb::array_view<const range> expected)
4298 return ranges == expected;
4304test_insert_into_bit_range_vector ()
4306 std::vector<range> ranges;
4311 static const range expected[] = {
4314 SELF_CHECK (check_ranges_vector (ranges, expected));
4320 static const range expected = {10, 5};
4321 SELF_CHECK (check_ranges_vector (ranges, expected));
4327 static const range expected[] = {
4331 SELF_CHECK (check_ranges_vector (ranges, expected));
4337 static const range expected[] = {
4341 SELF_CHECK (check_ranges_vector (ranges, expected));
4347 static const range expected[] = {
4352 SELF_CHECK (check_ranges_vector (ranges, expected));
4358 static const range expected[] = {
4362 SELF_CHECK (check_ranges_vector (ranges, expected));
4368 static const range expected[] = {
4372 SELF_CHECK (check_ranges_vector (ranges, expected));
4378 static const range expected = {2, 32};
4379 SELF_CHECK (check_ranges_vector (ranges, expected));
4406Debugger convenience (\"$foo\") variables and functions.\n\
4407Convenience variables are created when you assign them values;\n\
4408thus, \"set $foo=1\" gives \"$foo\" the value 1. Values may be any type.\n\
4410A few convenience variables are given values automatically:\n\
4411\"$_\"holds the last address examined with \"x\" or \"info lines\",\n\
4412\"$__\" holds the contents of the last address examined with \"x\"."
4415Convenience functions are defined via the Python API."
4421Elements of value history around item number IDX (or last ten)."),
4425Initialize a convenience variable if necessary.\n\
4426init-if-undefined VARIABLE = EXPRESSION\n\
4427Set an internal VARIABLE to the result of the EXPRESSION if it does not\n\
4428exist or does not contain a value. The EXPRESSION is not evaluated if the\n\
4429VARIABLE is already initialized."));
4432Placeholder command for showing help on convenience functions."),
4436Check whether an expression is void.\n\
4437Usage: $_isvoid (expression)\n\
4438Return 1 if the expression is void, zero otherwise."),
4442Extract the real part of a complex number.\n\
4443Usage: $_creal (expression)\n\
4444Return the real part of a complex number, the type depends on the\n\
4445type of a complex number."),
4449Extract the imaginary part of a complex number.\n\
4450Usage: $_cimag (expression)\n\
4451Return the imaginary part of a complex number, the type depends on the\n\
4452type of a complex number."),
4457Set maximum sized value gdb will load from the inferior."), _(
"\
4458Show maximum sized value gdb will load from the inferior."), _(
"\
4459Use this to control the maximum size, in bytes, of a value that gdb\n\
4460will load from the inferior. Setting this value to 'unlimited'\n\
4461disables checking.\n\
4462Setting this does not invalidate already allocated values, it only\n\
4463prevents future values, larger than this size, from being allocated."),
4470Set the maximum number of bytes allowed in a variable-size object."), _(
"\
4471Show the maximum number of bytes allowed in a variable-size object."), _(
"\
4472Attempts to access an object whose size is not a compile-time constant\n\
4473and exceeds this limit will cause an error."),
4478 selftests::register_test (
"ranges_contain", selftests::test_ranges_contain);
4479 selftests::register_test (
"insert_into_bit_range_vector",
4480 selftests::test_insert_into_bit_range_vector);
4481 selftests::register_test (
"value_copy", selftests::test_value_copy);
constexpr string_view get()
#define bits(obj, st, fn)
void * xrealloc(void *ptr, size_t size)
struct gdbarch * get_current_arch(void)
struct gdbarch * target_gdbarch(void)
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)
operation * get_lhs() const
internalvar * get_internalvar() const
const char * c_str() const
struct cmd_list_element * showlist
struct cmd_list_element * cmdlist
struct cmd_list_element * setlist
struct cmd_list_element * add_alias_cmd(const char *name, cmd_list_element *target, enum command_class theclass, int abbrev_flag, struct cmd_list_element **list)
struct cmd_list_element * add_cmd(const char *name, enum command_class theclass, const char *doc, struct cmd_list_element **list)
struct cmd_list_element * add_com(const char *name, enum command_class theclass, cmd_simple_func_ftype *fun, const char *doc)
set_show_commands add_setshow_zuinteger_unlimited_cmd(const char *name, enum command_class theclass, int *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 * deprecate_cmd(struct cmd_list_element *cmd, const char *replacement)
struct cmd_list_element * add_prefix_cmd(const char *name, enum command_class theclass, cmd_simple_func_ftype *fun, const char *doc, struct cmd_list_element **subcommands, int allow_unknown, struct cmd_list_element **list)
cli_style_option metadata_style
void set_repeat_arguments(const char *args)
void write_memory(CORE_ADDR memaddr, const bfd_byte *myaddr, ssize_t len)
int baseclass_offset(struct type *type, int index, const gdb_byte *valaddr, LONGEST embedded_offset, CORE_ADDR address, const struct value *val)
static void store_signed_integer(gdb_byte *addr, int len, enum bfd_endian byte_order, LONGEST val)
static void store_unsigned_integer(gdb_byte *addr, int len, enum bfd_endian byte_order, ULONGEST val)
void store_typed_address(gdb_byte *buf, struct type *type, CORE_ADDR addr)
CORE_ADDR extract_typed_address(const gdb_byte *buf, struct type *type)
@ lval_internalvar_component
static LONGEST extract_signed_integer(gdb::array_view< const gdb_byte > buf, enum bfd_endian byte_order)
static ULONGEST extract_unsigned_integer(gdb::array_view< const gdb_byte > buf, enum bfd_endian byte_order)
@ RETURN_VALUE_REGISTER_CONVENTION
struct value * evaluate_expression(struct expression *exp, struct type *expect_type)
LONGEST parse_and_eval_long(const char *exp)
ssize_t read(int fd, void *buf, size_t count)
std::unique_ptr< expression > expression_up
expression_up parse_expression(const char *, innermost_block_tracker *=nullptr, bool void_context_p=false)
void preserve_ext_lang_values(struct objfile *objfile, htab_t copied_types)
std::unique_ptr< xmethod_worker > xmethod_worker_up
int frame_relative_level(frame_info_ptr fi)
frame_info_ptr get_prev_frame_always(frame_info_ptr this_frame)
struct gdbarch * get_frame_arch(frame_info_ptr this_frame)
struct value * frame_unwind_register_value(frame_info_ptr next_frame, int regnum)
frame_info_ptr frame_find_by_id(struct frame_id id)
#define frame_debug_printf(fmt,...)
enum return_value_convention gdbarch_return_value(struct gdbarch *gdbarch, struct value *function, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
CORE_ADDR gdbarch_integer_to_address(struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
bool gdbarch_integer_to_address_p(struct gdbarch *gdbarch)
int gdbarch_addressable_memory_unit_size(struct gdbarch *gdbarch)
int gdbarch_convert_register_p(struct gdbarch *gdbarch, int regnum, struct type *type)
CORE_ADDR gdbarch_addr_bits_remove(struct gdbarch *gdbarch, CORE_ADDR addr)
CORE_ADDR gdbarch_convert_from_func_ptr_addr(struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ)
struct type * copy_type_recursive(struct type *type, htab_t copied_types)
struct type * resolve_dynamic_type(struct type *type, gdb::array_view< const gdb_byte > valaddr, CORE_ADDR addr)
enum bfd_endian type_byte_order(const struct type *type)
struct type * lookup_pointer_type(struct type *type)
int is_floating_type(struct type *t)
htab_up create_copied_types_hash()
int is_scalar_type(struct type *type)
struct type * lookup_array_range_type(struct type *element_type, LONGEST low_bound, LONGEST high_bound)
struct type * make_cv_type(int cnst, int voltl, struct type *type, struct type **typeptr)
unsigned int type_length_units(struct type *type)
bool is_fixed_point_type(struct type *type)
struct type * check_typedef(struct type *type)
#define TYPE_FN_FIELD_PHYSNAME(thisfn, n)
#define TYPE_DATA_LOCATION(thistype)
#define TYPE_IS_REFERENCE(t)
@ FIELD_LOC_KIND_PHYSNAME
@ FIELD_LOC_KIND_PHYSADDR
#define TYPE_DATA_LOCATION_KIND(thistype)
#define TYPE_DATA_LOCATION_ADDR(thistype)
#define TYPE_FN_FIELD_TYPE(thisfn, n)
#define TYPE_FIELD_BITSIZE(thistype, n)
#define BASETYPE_VIA_VIRTUAL(thistype, index)
#define TYPE_N_BASECLASSES(thistype)
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t int status
struct inferior * current_inferior(void)
const struct language_defn * current_language
LONGEST read_offset(bfd *abfd, const gdb_byte *buf, unsigned int offset_size)
struct bound_minimal_symbol lookup_minimal_symbol(const char *name, const char *sfile, struct objfile *objf)
struct bound_minimal_symbol lookup_bound_minimal_symbol(const char *name)
int register_size(struct gdbarch *gdbarch, int regnum)
void(* func)(remote_target *remote, char *)
const struct block * block
CORE_ADDR entry_pc() const
CORE_ADDR value_address() const
struct minimal_symbol * minsym
struct type * builtin_int
unsigned int doc_allocated
gdb::optional< setting > var
unsigned int name_allocated
CORE_ADDR loc_physaddr() const
LONGEST loc_bitpos() const
const char * loc_physname() const
field_loc_kind loc_kind() const
struct type * type() const
void read_fixed_point(gdb::array_view< const gdb_byte > buf, enum bfd_endian byte_order, bool unsigned_p, const gdb_mpq &scaling_factor)
internal_function_fn handler
void(* compile_to_ax)(struct internalvar *var, struct agent_expr *expr, struct axs_value *value, void *data)
struct value *(* make_value)(struct gdbarch *arch, struct internalvar *var, void *data)
struct internalvar * next
enum internalvar_kind kind
virtual char string_lower_bound() const
virtual bool c_style_arrays_p() const
void(* read)(struct value *v)
bool(* is_optimized_out)(struct value *v)
void *(* copy_closure)(const struct value *v)
void(* free_closure)(struct value *v)
struct value *(* coerce_ref)(const struct value *value)
int(* check_synthetic_pointer)(const struct value *value, LONGEST offset, int length)
struct gdbarch * arch() const
bool operator==(const range &other) const
bool operator<(const range &other) const
const std::vector< range > * ranges
const block * value_block() const
struct type * target_type() const
void remove_dyn_prop(dynamic_prop_node_kind kind)
struct field & field(int idx) const
struct objfile * objfile_owner() const
bool bit_size_differs_p() const
const gdb_mpq & fixed_point_scaling_factor()
bool is_pointer_or_reference() const
range_bounds * bounds() const
const char * name() const
struct type * fixed_point_type_base_type()
unsigned short bit_offset() const
bool is_objfile_owned() const
unsigned short bit_size() const
const struct lval_funcs * funcs
struct frame_id next_frame_id
std::vector< range > unavailable
gdb::unique_xmalloc_ptr< gdb_byte > contents
struct type * enclosing_type
struct internalvar * internalvar
struct xmethod_worker * xm_worker
struct value::@195::@196 reg
std::vector< range > optimized_out
LONGEST pointed_to_offset
union value::@195 location
DISABLE_COPY_AND_ASSIGN(value)
value(struct type *type_)
struct value::@195::@197 computed
virtual value * invoke(value *obj, gdb::array_view< value * > args)=0
type * get_result_type(value *object, gdb::array_view< value * > args)
struct block_symbol lookup_symbol(const char *name, const struct block *block, domain_enum domain, struct field_of_this_result *is_a_field_of_this)
LONGEST target_float_to_longest(const gdb_byte *addr, const struct type *type)
bool target_float_is_valid(const gdb_byte *addr, const struct type *type)
void target_float_from_longest(gdb_byte *addr, const struct type *type, LONGEST val)
void target_float_from_host_double(gdb_byte *addr, const struct type *type, double val)
void target_float_from_ulongest(gdb_byte *addr, const struct type *type, ULONGEST val)
bool target_get_trace_state_variable_value(int tsv, LONGEST *val)
struct trace_state_variable * find_trace_state_variable(const char *name)
struct internalvar_data::@198 make_value
struct internalvar_data::@200 integer
const struct internalvar_funcs * functions
struct internalvar_data::@199 fn
struct internal_function * function
const char * user_reg_map_regnum_to_name(struct gdbarch *gdbarch, int regnum)
const char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)
void copy_bitwise(gdb_byte *dest, ULONGEST dest_offset, const gdb_byte *source, ULONGEST source_offset, ULONGEST nbits, int bits_big_endian)
void fprintf_styled(struct ui_file *stream, const ui_file_style &style, const char *format,...)
void gdb_printf(struct ui_file *stream, const char *format,...)
struct value * value_cstring(const char *ptr, ssize_t len, struct type *char_type)
struct type * value_rtti_indirect_type(struct value *v, int *full, LONGEST *top, int *using_enc)
struct value * value_at_lazy(struct type *type, CORE_ADDR addr)
struct value * value_full_object(struct value *argp, struct type *rtype, int xfull, int xtop, int xusing_enc)
struct value * value_coerce_array(struct value *arg1)
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_real_part(struct value *value)
struct value * value_coerce_function(struct value *arg1)
struct value * value_ind(struct value *arg1)
void read_value_memory(struct value *val, LONGEST bit_offset, int stack, CORE_ADDR memaddr, gdb_byte *buffer, size_t length)
struct value * value_imaginary_part(struct value *value)
void value_print(struct value *val, struct ui_file *stream, const struct value_print_options *options)
void val_print_optimized_out(const struct value *val, struct ui_file *stream)
void get_user_print_options(struct value_print_options *opts)
static struct value * isvoid_internal_fn(struct gdbarch *gdbarch, const struct language_defn *language, void *cookie, int argc, struct value **argv)
struct value * call_internal_function(struct gdbarch *gdbarch, const struct language_defn *language, struct value *func, int argc, struct value **argv)
int value_bytes_available(const struct value *value, LONGEST offset, LONGEST length)
struct type * value_type(const struct value *value)
enum return_value_convention struct_return_convention(struct gdbarch *gdbarch, struct value *function, struct type *value_type)
struct value * value_from_component(struct value *whole, struct type *type, LONGEST offset)
int value_entirely_optimized_out(struct value *value)
void set_internalvar_string(struct internalvar *var, const char *string)
struct value * value_zero(struct type *type, enum lval_type lv)
LONGEST value_embedded_offset(const struct value *value)
struct value * value_of_internalvar(struct gdbarch *gdbarch, struct internalvar *var)
static void allocate_value_contents(struct value *val)
static void set_internalvar_function(struct internalvar *var, struct internal_function *f)
static void require_available(const struct value *value)
void unpack_value_bitfield(struct value *dest_val, LONGEST bitpos, LONGEST bitsize, const gdb_byte *valaddr, LONGEST embedded_offset, const struct value *val)
struct value * allocate_value_lazy(struct type *type)
static int max_value_size
int value_entirely_available(struct value *value)
LONGEST value_offset(const struct value *value)
gdb::array_view< const gdb_byte > value_contents_all(struct value *value)
LONGEST value_bitsize(const struct value *value)
struct value * value_parent(const struct value *value)
const struct lval_funcs * value_computed_funcs(const struct value *v)
bool is_floating_value(struct value *val)
struct value * coerce_ref_if_computed(const struct value *arg)
static struct internal_function * create_internal_function(const char *name, internal_function_fn handler, void *cookie)
int value_lazy(const struct value *value)
void clear_internalvar(struct internalvar *var)
gdb::array_view< const gdb_byte > value_contents_for_printing_const(const struct value *value)
struct value * value_field(struct value *arg1, int fieldno)
void value_contents_copy(struct value *dst, LONGEST dst_offset, struct value *src, LONGEST src_offset, LONGEST length)
static void value_fetch_lazy_bitfield(struct value *val)
void set_value_initialized(struct value *val, int status)
struct value * allocate_value(struct type *type)
CORE_ADDR unpack_pointer(struct type *type, const gdb_byte *valaddr)
CORE_ADDR value_as_address(struct value *val)
struct gdbarch * get_value_arch(const struct value *value)
void set_value_embedded_offset(struct value *value, LONGEST val)
void set_value_stack(struct value *value, int val)
static int find_first_range_overlap(const std::vector< range > *ranges, int pos, LONGEST offset, LONGEST length)
void set_value_address(struct value *value, CORE_ADDR addr)
int compile_internalvar_to_ax(struct internalvar *var, struct agent_expr *expr, struct axs_value *value)
static int ranges_contain(const std::vector< range > &ranges, LONGEST offset, LONGEST length)
static void value_contents_copy_raw_bitwise(struct value *dst, LONGEST dst_bit_offset, struct value *src, LONGEST src_bit_offset, LONGEST bit_length)
const char * internalvar_name(const struct internalvar *var)
void set_value_component_location(struct value *component, const struct value *whole)
void value_fetch_lazy(struct value *val)
int value_initialized(const struct value *val)
static struct value * creal_internal_fn(struct gdbarch *gdbarch, const struct language_defn *language, void *cookie, int argc, struct value **argv)
struct internalvar * create_internalvar(const char *name)
static void init_if_undefined_command(const char *args, int from_tty)
struct value * value_primitive_field(struct value *arg1, LONGEST offset, int fieldno, struct type *arg_type)
static bool value_contents_bits_eq(const struct value *val1, int offset1, const struct value *val2, int offset2, int length)
static void require_not_optimized_out(const struct value *value)
void set_value_offset(struct value *value, LONGEST offset)
struct value * value_from_xmethod(xmethod_worker_up &&worker)
static std::vector< value_ref_ptr > value_history
struct value * value_from_ulongest(struct type *type, ULONGEST num)
void preserve_one_value(struct value *value, struct objfile *objfile, htab_t copied_types)
static struct cmd_list_element * functionlist
struct value * allocate_optimized_out_value(struct type *type)
struct value * value_from_contents_and_address_unresolved(struct type *type, const gdb_byte *valaddr, CORE_ADDR address)
void mark_value_bytes_unavailable(struct value *value, LONGEST offset, LONGEST length)
void error_value_optimized_out(void)
void set_value_parent(struct value *value, struct value *parent)
struct value * value_static_field(struct type *type, int fieldno)
struct internalvar * create_internalvar_type_lazy(const char *name, const struct internalvar_funcs *funcs, void *data)
static void pack_unsigned_long(gdb_byte *buf, struct type *type, ULONGEST num)
struct internalvar * lookup_only_internalvar(const char *name)
ULONGEST value_history_count()
static void preserve_one_internalvar(struct internalvar *var, struct objfile *objfile, htab_t copied_types)
struct value * value_from_component_bitsize(struct value *whole, struct type *type, LONGEST bit_offset, LONGEST bit_length)
CORE_ADDR value_address(const struct value *value)
void set_value_bitsize(struct value *value, LONGEST bit)
static struct cmd_list_element * do_add_internal_function(const char *name, const char *doc, internal_function_fn handler, void *cookie)
int record_latest_value(struct value *val)
int unpack_value_field_as_long(struct type *type, const gdb_byte *valaddr, LONGEST embedded_offset, int fieldno, const struct value *val, LONGEST *result)
struct value * value_from_longest(struct type *type, LONGEST num)
struct value * value_non_lval(struct value *arg)
struct value * value_from_history_ref(const char *h, const char **endp)
gdb::array_view< gdb_byte > value_contents_raw(struct value *value)
struct value * coerce_ref(struct value *arg)
struct value * value_from_contents(struct type *type, const gdb_byte *contents)
int * deprecated_value_regnum_hack(struct value *value)
struct value * coerce_array(struct value *arg)
static void value_contents_copy_raw(struct value *dst, LONGEST dst_offset, struct value *src, LONGEST src_offset, LONGEST length)
static int get_internalvar_function(struct internalvar *var, struct internal_function **result)
void mark_value_bits_unavailable(struct value *value, LONGEST offset, LONGEST length)
void add_internal_function(const char *name, const char *doc, internal_function_fn handler, void *cookie)
void set_internalvar(struct internalvar *var, struct value *val)
void complete_internalvar(completion_tracker &tracker, const char *name)
void set_internalvar_component(struct internalvar *var, LONGEST offset, LONGEST bitpos, LONGEST bitsize, struct value *newval)
gdb::array_view< const gdb_byte > value_contents(struct value *value)
gdb::array_view< gdb_byte > value_contents_writeable(struct value *value)
void preserve_values(struct objfile *objfile)
void mark_value_bits_optimized_out(struct value *value, LONGEST offset, LONGEST length)
static struct internalvar * internalvars
int value_bits_any_optimized_out(const struct value *value, int bit_offset, int bit_length)
enum lval_type * deprecated_value_lval_hack(struct value *value)
int value_bits_available(const struct value *value, LONGEST offset, LONGEST length)
struct type * result_type_of_xmethod(struct value *method, gdb::array_view< value * > argv)
static void show_max_value_size(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static struct value * cimag_internal_fn(struct gdbarch *gdbarch, const struct language_defn *language, void *cookie, int argc, struct value **argv)
void value_incref(struct value *val)
const char * value_internal_function_name(struct value *val)
struct internalvar * lookup_internalvar(const char *name)
struct internalvar ** deprecated_value_internalvar_hack(struct value *value)
gdb::array_view< gdb_byte > value_contents_all_raw(struct value *value)
struct value * value_fn_field(struct value **arg1p, struct fn_field *f, int j, struct type *type, LONGEST offset)
LONGEST value_as_long(struct value *val)
static int find_first_range_overlap_and_match(struct ranges_and_idx *rp1, struct ranges_and_idx *rp2, LONGEST offset1, LONGEST offset2, LONGEST length, ULONGEST *l, ULONGEST *h)
struct value * make_cv_value(int cnst, int voltl, struct value *v)
static void preserve_one_varobj(struct varobj *varobj, struct objfile *objfile, htab_t copied_types)
static void show_convenience(const char *ignore, int from_tty)
bool value_contents_eq(const struct value *val1, LONGEST offset1, const struct value *val2, LONGEST offset2, LONGEST length)
void modify_field(struct type *type, gdb_byte *addr, LONGEST fieldval, LONGEST bitpos, LONGEST bitsize)
void set_value_bitpos(struct value *value, LONGEST bit)
struct value * value_copy(const value *arg)
void set_value_pointed_to_offset(struct value *value, LONGEST val)
LONGEST value_pointed_to_offset(const struct value *value)
enum lval_type value_lval_const(const struct value *value)
static void value_fetch_lazy_register(struct value *val)
int value_stack(const struct value *value)
void pack_long(gdb_byte *buf, struct type *type, LONGEST num)
void set_internalvar_integer(struct internalvar *var, LONGEST l)
int value_optimized_out(struct value *value)
struct frame_id * deprecated_value_next_frame_id_hack(struct value *value)
struct value * allocate_computed_value(struct type *type, const struct lval_funcs *funcs, void *closure)
static void ranges_copy_adjusted(std::vector< range > *dst_range, int dst_bit_offset, const std::vector< range > &src_range, int src_bit_offset, int bit_length)
gdb::array_view< const gdb_byte > value_contents_for_printing(struct value *value)
void set_value_enclosing_type(struct value *val, struct type *new_encl_type)
struct value * value_from_host_double(struct type *type, double d)
void mark_value_bytes_optimized_out(struct value *value, int offset, int length)
struct value * value_field_bitfield(struct type *type, int fieldno, const gdb_byte *valaddr, LONGEST embedded_offset, const struct value *val)
std::vector< value_ref_ptr > value_release_to_mark(const struct value *mark)
struct value * value_from_pointer(struct type *type, CORE_ADDR addr)
struct type * value_enclosing_type(const struct value *value)
struct type * value_actual_type(struct value *value, int resolve_simple_types, int *real_type_found)
#define MIN_VALUE_FOR_MAX_VALUE_SIZE
int deprecated_value_modifiable(const struct value *value)
static std::vector< value_ref_ptr > all_values
struct value * readjust_indirect_value_type(struct value *value, struct type *enc_type, const struct type *original_type, struct value *original_value, CORE_ADDR original_value_address)
struct value * value_mark(void)
static void insert_into_bit_range_vector(std::vector< range > *vectorp, LONGEST offset, LONGEST length)
CORE_ADDR value_raw_address(const struct value *value)
void deprecated_set_value_type(struct value *value, struct type *type)
int value_bits_synthetic_pointer(const struct value *value, LONGEST offset, LONGEST length)
static void check_type_length_before_alloc(const struct type *type)
static void value_fetch_lazy_memory(struct value *val)
static int value_entirely_covered_by_range_vector(struct value *value, const std::vector< range > &ranges)
static void show_values(const char *num_exp, int from_tty)
struct value * access_value_history(int num)
void value_free_to_mark(const struct value *mark)
LONGEST unpack_bits_as_long(struct type *field_type, const gdb_byte *valaddr, LONGEST bitpos, LONGEST bitsize)
value_ref_ptr release_value(struct value *val)
struct value * value_from_contents_and_address(struct type *type, const gdb_byte *valaddr, CORE_ADDR address)
int value_entirely_unavailable(struct value *value)
int using_struct_return(struct gdbarch *gdbarch, struct value *function, struct type *value_type)
void value_force_lval(struct value *v, CORE_ADDR addr)
LONGEST value_bitpos(const struct value *value)
int get_internalvar_integer(struct internalvar *var, LONGEST *result)
static void function_command(const char *command, int from_tty)
void set_value_lazy(struct value *value, int val)
struct value * allocate_repeat_value(struct type *type, int count)
void * value_computed_closure(const struct value *v)
static void set_max_value_size(const char *args, int from_tty, struct cmd_list_element *c)
static void value_ranges_copy_adjusted(struct value *dst, int dst_bit_offset, const struct value *src, int src_bit_offset, int bit_length)
static int memcmp_with_bit_offsets(const gdb_byte *ptr1, size_t offset1_bits, const gdb_byte *ptr2, size_t offset2_bits, size_t length_bits)
void value_decref(struct value *val)
gdb_static_assert(sizeof(LONGEST)<=MIN_VALUE_FOR_MAX_VALUE_SIZE)
struct value * call_xmethod(struct value *method, gdb::array_view< value * > argv)
LONGEST unpack_field_as_long(struct type *type, const gdb_byte *valaddr, int fieldno)
static int ranges_overlap(LONGEST offset1, LONGEST len1, LONGEST offset2, LONGEST len2)
LONGEST unpack_long(struct type *type, const gdb_byte *valaddr)
void _initialize_values()
#define VALUE_NEXT_FRAME_ID(val)
#define VALUE_REGNUM(val)
#define VALUE_INTERNALVAR(val)
struct value *(* internal_function_fn)(struct gdbarch *gdbarch, const struct language_defn *language, void *cookie, int argc, struct value **argv)
gdb::ref_ptr< struct value, value_ref_policy > value_ref_ptr
void all_root_varobjs(gdb::function_view< void(struct varobj *var)> func)