39#include "gdbsupport/gdb_obstack.h"
74 return expr->evaluate ();
87 return expr->evaluate ();
105 gdb::optional<enable_thread_stack_temporaries> stack_temporaries;
111 struct value *retval =
op->evaluate (expect_type,
this,
noside);
113 if (stack_temporaries.has_value ()
146 std::vector<value_ref_ptr> *val_chain,
147 bool preserve_errors)
149 struct value *mark, *new_mark, *result;
165 catch (
const gdb_exception &ex)
173 if (!preserve_errors)
183 if (mark == new_mark)
192 if (!result->
lazy ())
202 catch (
const gdb_exception_error &except)
258 struct type *promoted_type = NULL;
268 if ((type1->
code () != TYPE_CODE_FLT
269 && type1->
code () != TYPE_CODE_DECFLOAT
271 || (type2->
code () != TYPE_CODE_FLT
272 && type2->
code () != TYPE_CODE_DECFLOAT
279 if (type1->
code () == TYPE_CODE_DECFLOAT
280 || type2->
code () == TYPE_CODE_DECFLOAT)
284 else if (type1->
code () == TYPE_CODE_FLT
285 || type2->
code () == TYPE_CODE_FLT)
310 else if (type1->
code () == TYPE_CODE_BOOL
311 && type2->
code () == TYPE_CODE_BOOL)
320 unsigned int promoted_len1 = type1->
length ();
321 unsigned int promoted_len2 = type2->
length ();
324 unsigned int result_len;
325 int unsigned_operation;
340 if (promoted_len1 > promoted_len2)
342 unsigned_operation = is_unsigned1;
343 result_len = promoted_len1;
345 else if (promoted_len2 > promoted_len1)
347 unsigned_operation = is_unsigned2;
348 result_len = promoted_len2;
352 unsigned_operation = is_unsigned1 || is_unsigned2;
353 result_len = promoted_len1;
379 promoted_type = (unsigned_operation
385 promoted_type = (unsigned_operation
391 promoted_type = (unsigned_operation
397 promoted_type = (unsigned_operation
426 case TYPE_CODE_ARRAY:
444 int num_types,
struct type **param_types);
456 int num_types,
struct type **param_types)
467 if (param_types[num_types - 1] == NULL)
477 gdb_assert (num_types == 0);
488 ((
struct field *) xzalloc (
sizeof (
struct field) * num_types));
490 while (num_types-- > 0)
508 std::vector<type *> &types = std::get<1> (
m_storage);
511 return std::get<2> (
m_storage)->evaluate (fake_expect_type.
type (),
531 struct value *ret = NULL;
538 catch (
const gdb_exception_error &except)
559 if (var->
type ()->
code () == TYPE_CODE_ERROR)
586 gdb::array_view<value *> argvec,
587 const char *function_name,
588 type *default_return_type)
591 error (_(
"Cannot evaluate function -- may be inlined"));
600 if (ftype->
code () == TYPE_CODE_INTERNAL_FUNCTION)
608 else if (ftype->
code () == TYPE_CODE_XMETHOD)
612 if (return_type == NULL)
613 error (_(
"Xmethod is missing return type."));
616 else if (ftype->
code () == TYPE_CODE_FUNC
617 || ftype->
code () == TYPE_CODE_METHOD)
621 CORE_ADDR address = callee->
address ();
624 if (resolved_type != NULL)
625 ftype = resolved_type;
630 if (return_type == NULL)
631 return_type = default_return_type;
633 if (return_type == NULL)
639 error (_(
"Expression of type other than "
640 "\"Function returning ...\" used as function"));
644 case TYPE_CODE_INTERNAL_FUNCTION:
646 callee, argvec.size (), argvec.data ());
647 case TYPE_CODE_XMETHOD:
661 const char *function_name,
662 const std::vector<operation_up> &args)
664 std::vector<value *> vals (args.size ());
670 for (
int i = 0; i < args.size (); ++i)
672 if (i < type->num_fields ())
675 vals[i] = args[i]->evaluate_with_coercion (exp,
noside);
679 function_name, expect_type);
686 const std::vector<operation_up> &args)
692 std::vector<value *> argvec (args.size ());
693 for (
int i = 0; i < args.size (); ++i)
699 NULL, &symp, NULL, 0,
noside);
701 if (symp->
type ()->
code () == TYPE_CODE_ERROR)
707 nullptr, expect_type);
714 const std::vector<operation_up> &args)
726 const char *function_name = NULL;
727 std::vector<value *> argvec (1 + args.size ());
728 if (
type->
code () == TYPE_CODE_NAMESPACE)
734 if (function == NULL)
735 error (_(
"No symbol \"%s\" in namespace \"%s\"."),
740 gdb_assert (
type->
code () == TYPE_CODE_STRUCT
741 ||
type->
code () == TYPE_CODE_UNION);
742 function_name =
name.c_str ();
748 for (
int i = 0; i < args.size (); ++i)
750 gdb::array_view<value *> arg_view = argvec;
752 value *callee =
nullptr;
753 if (function_name !=
nullptr)
758 &argvec[0],
nullptr, &callee,
nullptr,
759 &static_memfuncp, 0,
noside);
760 if (!static_memfuncp)
763 error (_(
"Call to overloaded function %s requires "
768 arg_view = arg_view.slice (1);
773 arg_view = arg_view.slice (1);
776 nullptr, &symp,
nullptr, 1,
noside);
781 nullptr, expect_type);
788 const std::vector<operation_up> &args)
792 if (
opcode () == STRUCTOP_MEMBER)
797 std::vector<value *> vals (args.size () + 1);
798 gdb::array_view<value *> val_view = vals;
807 if (a1_type->
code () == TYPE_CODE_METHODPTR)
816 else if (a1_type->
code () == TYPE_CODE_MEMBERPTR)
818 struct type *type_ptr
820 struct type *target_type_ptr
832 val_view = val_view.slice (1);
835 error (_(
"Non-pointer-to-member value used in pointer-to-member "
838 for (
int i = 0; i < args.size (); ++i)
842 nullptr, expect_type);
849 const std::vector<operation_up> &args)
853 std::vector<value *> vals (args.size () + 1);
856 if (op == STRUCTOP_STRUCT)
887 catch (
const gdb_exception_error &except)
889 if (except.error == NOT_FOUND_ERROR)
901 for (
int i = 0; i < args.size (); ++i)
905 gdb::array_view<value *> arg_view (vals);
909 const char *tstr = std::get<1> (
m_storage).c_str ();
915 value *val0 = vals[0];
917 &val0,
nullptr, &callee,
nullptr,
918 &static_memfuncp, 0,
noside);
924 struct value *temp = vals[0];
928 op == STRUCTOP_STRUCT
929 ?
"structure" :
"structure pointer");
940 arg_view = arg_view.slice (1);
943 nullptr, expect_type);
952 const char *fieldname,
int namelen,
const char *
prefix)
955 int computed_type_name = 0;
956 const char *type_name = NULL;
963 output, fieldname, namelen,
prefix);
977 output, fieldname, namelen,
prefix);
986 if (
name && ! strncmp (
name, fieldname, namelen))
988 if (!computed_type_name)
991 computed_type_name = 1;
994 if (!type_name || strcmp (type_name,
name))
995 output.emplace_back (concat (
prefix,
name,
nullptr));
1007 const std::string &fieldname = std::get<1> (
m_storage);
1020 if (
type->
code () == TYPE_CODE_UNION
1021 ||
type->
code () == TYPE_CODE_STRUCT)
1026 fieldname.length (),
prefix);
1045 return (
type !=
nullptr
1055 struct type *
type,
const char *
string)
1060 error (_(
"There is no field named %s"),
string);
1075 error (_(
"Symbol \"%s\" does not have any specific entry value"),
1093 if (
type->
code () == TYPE_CODE_ERROR
1110 error (_(
"No symbol \"%s\" in specified context."), var);
1126 error (_(
"Register $%s not available."),
name);
1139 error (_(
"Value of register %s not available."),
name);
1152 const std::string &str = std::get<0> (
m_storage);
1172 return value_slice (array, lowbound, upperbound - lowbound + 1);
1194 struct value *arg1,
const char *
string)
1208 struct value *arg1,
const char *
string)
1220 catch (
const gdb_exception_error &except)
1222 if (except.error == NOT_FOUND_ERROR)
1235 struct type *arg_type = arg1->
type ();
1236 struct type *real_type;
1237 int full, using_enc;
1253 NULL,
"structure pointer");
1272 case TYPE_CODE_METHODPTR:
1278 gdb_assert (arg2->
type ()->
code () == TYPE_CODE_PTR);
1282 case TYPE_CODE_MEMBERPTR:
1296 error (_(
"non-pointer-to-member value used "
1297 "in pointer-to-member construct"));
1368 || op == BINOP_INTDIV
1373 struct value *v_one;
1383 if ((op == BINOP_LSH || op == BINOP_RSH || op == BINOP_EXP)
1411 if (
type->
code () != TYPE_CODE_ARRAY
1415 error (_(
"cannot subscript something of type `%s'"),
1418 error (_(
"cannot subscript requested type"));
1563 &&
type->
code () != TYPE_CODE_ENUM)
1564 error (_(
"Non-integral right operand for \"@\" operator."));
1647 if (
type->
code () == TYPE_CODE_METHODPTR
1648 ||
type->
code () == TYPE_CODE_MEMBERPTR)
1649 error (_(
"Attempt to dereference pointer "
1650 "to member without an object"));
1667 ||
type->
code () == TYPE_CODE_ARRAY)
1670 else if (
type->
code () == TYPE_CODE_INT)
1675 error (_(
"Attempt to take contents of a non-pointer value."));
1683 if (
type->
code () == TYPE_CODE_INT)
1701 error (_(
"could not determine alignment of type"));
1738 struct value *tmp = arg1;
1769 struct value *tmp = arg1;
1802 struct value *tmp = arg1;
1836 struct value *tmp = arg1;
1857 error (_(
"Attempt to use a type name as an expression"));
1881 struct value *tmp = arg1;
1885 if ((op == BINOP_LSH || op == BINOP_RSH || op == BINOP_EXP)
1898static struct value *
1901 value *target, gdb::array_view<value *> args)
1903 CORE_ADDR responds_selector = 0;
1904 CORE_ADDR method_selector = 0;
1908 struct value *msg_send = NULL;
1909 struct value *msg_send_stret = NULL;
1910 int gnu_runtime = 0;
1912 struct value *method = NULL;
1913 struct value *called_method = NULL;
1915 struct type *selector_type = NULL;
1916 struct type *long_type;
1919 struct value *ret = NULL;
1943 type = selector_type;
1973 if (responds_selector == 0)
1977 if (responds_selector == 0)
1978 error (_(
"no 'respondsTo:' or 'respondsToSelector:' method"));
1982 if (method_selector == 0)
1986 if (method_selector == 0)
1987 error (_(
"no 'methodFor:' or 'methodForSelector:' method"));
1992 argvec[0] = msg_send;
2006 error (_(
"Target does not respond to this message selector."));
2014 argvec[0] = msg_send;
2032 struct symbol *sym = NULL;
2051 struct type *val_type;
2059 if ((val_type == NULL)
2060 || (val_type->
code () == TYPE_CODE_ERROR))
2062 if (expect_type != NULL)
2063 val_type = expect_type;
2069 else if (expect_type != NULL)
2090 if (method->
type ()->
code () != TYPE_CODE_FUNC)
2091 error (_(
"method address has symbol information "
2092 "with non-function type; skipping"));
2112 called_method = msg_send_stret;
2114 called_method = msg_send;
2128 struct type *callee_type = called_method->
type ();
2130 if (callee_type && callee_type->
code () == TYPE_CODE_PTR)
2136 if ((callee_type->
code () == TYPE_CODE_ERROR) && expect_type)
2142 error (_(
"Expression of type other than "
2143 "\"method returning ...\" used as a method"));
2153 if (gnu_runtime && (method != NULL))
2156 struct type *tem_type = called_method->
type ();
2167static struct value *
2170 gdb::array_view<value *> args)
2172 for (
value *arg2 : args)
2186 case TYPE_CODE_ARRAY:
2187 case TYPE_CODE_STRING:
2193 error (_(
"cannot subscript something of type `%s'"),
2196 error (_(
"cannot subscript requested type"));
2219 = std::get<1> (
m_storage)->evaluate (selector_type, exp, sub_no_side);
2225 std::vector<operation_up> &args = std::get<2> (
m_storage);
2226 value **argvec = XALLOCAVEC (
struct value *, args.size () + 3);
2227 argvec[0] =
nullptr;
2228 argvec[1] =
nullptr;
2229 for (
int i = 0; i < args.size (); ++i)
2231 argvec[args.size () + 2] =
nullptr;
2235 gdb::make_array_view (argvec,
2245 std::vector<operation_up> &values = std::get<1> (
m_storage);
2246 value **argvec = XALLOCAVEC (
struct value *, values.size ());
2247 for (
int ix = 0; ix < values.size (); ++ix)
2250 gdb::make_array_view (argvec, values.size ()));
2317 std::vector<operation_up> &arg_ops = std::get<2> (
m_storage);
2318 std::vector<value *> args (arg_ops.size ());
2319 for (
int i = 0; i < arg_ops.size (); ++i)
2326 nullptr, &symp,
nullptr, 0,
noside);
2327 if (symp->
type ()->
code () == TYPE_CODE_ERROR)
2331 nullptr, expect_type);
2343 const std::vector<operation_up> &in_args = std::get<2> (
m_storage);
2345 struct type *field_type;
2349 while (--nargs >= 0)
2351 struct value *val = NULL;
2352 int bitpos, bitsize;
2357 while (fieldno < struct_type->num_fields ()
2361 error (_(
"too many initializers"));
2362 field_type = struct_type->
field (fieldno).
type ();
2363 if (field_type->
code () == TYPE_CODE_UNION
2364 && struct_type->
field (fieldno).
name ()[0] ==
'0')
2365 error (_(
"don't know which variant you want to set"));
2376 field_type = struct_type->
field (fieldno).
type ();
2378 val = in_args[idx++]->evaluate (field_type, exp,
noside);
2383 if (val->
type () != field_type)
2393 memcpy (addr, val->
contents ().data (),
2405 const int provided_low_bound = std::get<0> (
m_storage);
2406 const std::vector<operation_up> &in_args = std::get<2> (
m_storage);
2407 const int nargs = std::get<1> (
m_storage) - provided_low_bound + 1;
2410 if (expect_type !=
nullptr
2411 &&
type->
code () == TYPE_CODE_STRUCT)
2419 if (expect_type !=
nullptr
2420 &&
type->
code () == TYPE_CODE_ARRAY)
2426 LONGEST low_bound, high_bound;
2431 high_bound = (
type->
length () / element_size) - 1;
2433 if (low_bound + nargs - 1 > high_bound)
2434 error (_(
"Too many array elements"));
2436 for (
int idx = 0; idx < nargs; ++idx)
2438 struct value *element;
2440 element = in_args[idx]->evaluate (element_type, exp,
noside);
2441 if (element->
type () != element_type)
2442 element =
value_cast (element_type, element);
2443 memcpy (array->
contents_raw ().data () + idx * element_size,
2450 if (expect_type !=
nullptr
2456 struct type *check_type = element_type;
2457 LONGEST low_bound, high_bound;
2460 while (check_type->
code () == TYPE_CODE_RANGE
2461 || check_type->
code () == TYPE_CODE_TYPEDEF)
2465 error (_(
"(power)set type with unknown size"));
2467 for (
int idx = 0; idx < nargs; idx++)
2469 LONGEST range_low, range_high;
2470 struct type *range_low_type, *range_high_type;
2471 struct value *elem_val;
2473 elem_val = in_args[idx]->evaluate (element_type, exp,
noside);
2474 range_low_type = range_high_type = elem_val->
type ();
2480 if (range_low_type->
code () == TYPE_CODE_RANGE)
2482 if (range_high_type->
code () == TYPE_CODE_RANGE)
2483 range_high_type = range_high_type->
target_type ();
2484 if ((range_low_type->
code () != range_high_type->
code ())
2485 || (range_low_type->
code () == TYPE_CODE_ENUM
2486 && (range_low_type != range_high_type)))
2488 error (_(
"POWERSET tuple elements of different mode"));
2489 if ((check_type->
code () != range_low_type->
code ())
2490 || (check_type->
code () == TYPE_CODE_ENUM
2491 && range_low_type != check_type))
2492 error (_(
"incompatible POWERSET tuple elements"));
2493 if (range_low > range_high)
2495 warning (_(
"empty POWERSET tuple range"));
2498 if (range_low < low_bound || range_high > high_bound)
2499 error (_(
"POWERSET tuple element out of range"));
2500 range_low -= low_bound;
2501 range_high -= low_bound;
2502 for (; range_low <= range_high; range_low++)
2504 int bit_index = (unsigned) range_low % TARGET_CHAR_BIT;
2507 bit_index = TARGET_CHAR_BIT - 1 - bit_index;
2508 valaddr[(unsigned) range_low / TARGET_CHAR_BIT]
2515 std::vector<value *> argvec (nargs);
2516 for (
int tem = 0; tem < nargs; tem++)
2520 argvec[tem] = in_args[tem]->evaluate_with_coercion (exp,
noside);
2534 error (_(
"length type is larger than the value type"));
2561 error (_(
"Attempt to take address of "
2562 "value not located in memory."));
2594 error (_(
"There is no field named %s"), std::get<1> (
m_storage).c_str ());
2641 value *typeval = std::get<0> (
m_storage)->evaluate (
nullptr, exp,
2667 error (_(
"Attempt to take address of register or constant."));
2681 if (
type->
code () == TYPE_CODE_ARRAY
2730 if (
type->
code () == TYPE_CODE_ERROR)
2747 if (
type->
code () == TYPE_CODE_ARRAY)
2750 if (
type->
code () == TYPE_CODE_ARRAY)
2759 struct type *size_type
2762 (size_type, (LONGEST) val->
type ()->
length ());
2779 &&
type->
code () != TYPE_CODE_ARRAY)
2780 error (_(
"Attempt to take contents of a non-pointer value."));
2800 value *typeval = std::get<0> (
m_storage)->evaluate (
nullptr, exp,
2814 if (
type->
code () == TYPE_CODE_ARRAY)
2879 char *tmp = (
char *) alloca (
length + 4);
2882 memcpy (tmp + 1, p,
length);
2890 error (_(
"Internal error in eval_type."));
const struct block * block_for_pc(CORE_ADDR pc)
struct symbol * find_pc_function(CORE_ADDR pc)
struct type * find_gnu_ifunc_target_type(CORE_ADDR resolver_funaddr)
void add_completions(completion_list &&list)
value * evaluate(struct type *expect_type, struct expression *exp, enum noside noside) override
struct value * evaluate_struct_tuple(struct value *struct_val, struct expression *exp, enum noside noside, int nargs)
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
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
virtual value * evaluate_for_address(struct expression *exp, enum noside noside)
virtual value * evaluate_funcall(struct type *expect_type, struct expression *exp, enum noside noside, const std::vector< operation_up > &args)
virtual value * evaluate_with_coercion(struct expression *exp, enum noside noside)
virtual value * evaluate_for_sizeof(struct expression *exp, enum noside noside)
virtual value * evaluate(struct type *expect_type, struct expression *exp, enum noside noside)=0
virtual enum exp_opcode opcode() const =0
virtual value * evaluate_for_cast(struct type *expect_type, struct expression *exp, enum noside noside)
value * evaluate_for_address(struct expression *exp, enum noside noside) override
value * evaluate_funcall(struct type *expect_type, struct expression *exp, enum noside noside, const std::vector< operation_up > &args) override
value * evaluate(struct type *expect_type, struct expression *exp, enum noside noside) override
value * evaluate_funcall(struct type *expect_type, struct expression *exp, enum noside noside, const std::vector< operation_up > &args) override
virtual bool complete(struct expression *exp, completion_tracker &tracker)
value * evaluate_funcall(struct type *expect_type, struct expression *exp, enum noside noside, const std::vector< operation_up > &args) override
value * evaluate_for_sizeof(struct expression *exp, enum noside noside) override
value * evaluate(struct type *expect_type, struct expression *exp, enum noside noside) override
std::tuple< Arg... > m_storage
value * evaluate(struct type *expect_type, struct expression *exp, enum noside noside) override
struct type * get_type() const
value * evaluate_for_sizeof(struct expression *exp, enum noside noside) override
value * evaluate_for_address(struct expression *exp, enum noside noside) override
value * evaluate_for_sizeof(struct expression *exp, enum noside noside) override
value * evaluate_for_address(struct expression *exp, enum noside noside) override
value * evaluate_for_sizeof(struct expression *exp, enum noside noside) override
value * evaluate_for_address(struct expression *exp, enum noside noside) override
value * evaluate_for_sizeof(struct expression *exp, enum noside noside) override
value * evaluate_for_address(struct expression *exp, enum noside noside) override
value * evaluate_for_cast(struct type *expect_type, struct expression *exp, enum noside noside) override
value * evaluate_funcall(struct type *expect_type, struct expression *exp, enum noside noside, const std::vector< operation_up > &args) override
value * evaluate_for_cast(struct type *expect_type, struct expression *exp, enum noside noside) override
value * evaluate_for_sizeof(struct expression *exp, enum noside noside) override
value * evaluate_with_coercion(struct expression *exp, enum noside noside) override
value * evaluate_for_address(struct expression *exp, enum noside noside) override
value * evaluate(struct type *expect_type, struct expression *exp, enum noside noside) override
fake_method(type_instance_flags flags, int num_types, struct type **param_types)
std::vector< gdb::unique_xmalloc_ptr< char > > completion_list
struct value * cplus_method_ptr_to_value(struct value **this_p, struct value *method_ptr)
struct block_symbol cp_lookup_symbol_namespace(const char *scope, const char *name, const struct block *block, const domain_enum domain)
int longest_to_int(LONGEST)
struct value * eval_op_var_msym_value(struct type *expect_type, struct expression *exp, enum noside noside, bool outermost_p, bound_minimal_symbol msymbol)
value * evaluate_var_value(enum noside noside, const block *blk, symbol *var)
struct value * eval_op_memval(struct type *expect_type, struct expression *exp, enum noside noside, struct value *arg1, struct type *type)
struct value * eval_op_func_static_var(struct type *expect_type, struct expression *exp, enum noside noside, value *func, const char *var)
struct value * eval_op_objc_selector(struct type *expect_type, struct expression *exp, enum noside noside, const char *sel)
struct value * parse_and_eval(const char *exp, parser_flags flags)
static value * evaluate_subexp_for_sizeof_base(struct expression *exp, struct type *type)
struct value * eval_op_var_entry_value(struct type *expect_type, struct expression *exp, enum noside noside, symbol *sym)
struct value * eval_op_geq(struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1, struct value *arg2)
struct value * eval_op_preinc(struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1)
struct value * eval_op_postdec(struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1)
static bool is_integral_or_integral_reference(struct type *type)
struct value * eval_op_less(struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1, struct value *arg2)
struct value * eval_op_lognot(struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1)
value * evaluate_subexp_do_call(expression *exp, enum noside noside, value *callee, gdb::array_view< value * > argvec, const char *function_name, type *default_return_type)
static value * evaluate_subexp_for_address_base(struct expression *exp, enum noside noside, value *x)
struct value * eval_op_gtr(struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1, struct value *arg2)
struct value * eval_op_neg(struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1)
struct value * eval_op_notequal(struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1, struct value *arg2)
value * evaluate_var_msym_value(enum noside noside, struct objfile *objfile, minimal_symbol *msymbol)
struct value * eval_op_structop_ptr(struct type *expect_type, struct expression *exp, enum noside noside, struct value *arg1, const char *string)
struct value * parse_to_comma_and_eval(const char **expp)
struct value * eval_op_alignof(struct type *expect_type, struct expression *exp, enum noside noside, struct value *arg1)
struct value * eval_op_register(struct type *expect_type, struct expression *exp, enum noside noside, const char *name)
struct value * eval_op_binary(struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1, struct value *arg2)
void binop_promote(const struct language_defn *language, struct gdbarch *gdbarch, struct value **arg1, struct value **arg2)
struct value * eval_op_complement(struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1)
struct value * eval_op_scope(struct type *expect_type, struct expression *exp, enum noside noside, struct type *type, const char *string)
struct value * eval_op_add(struct type *expect_type, struct expression *exp, enum noside noside, struct value *arg1, struct value *arg2)
LONGEST parse_and_eval_long(const char *exp)
struct value * eval_op_ind(struct type *expect_type, struct expression *exp, enum noside noside, struct value *arg1)
static struct value * eval_multi_subscript(struct type *expect_type, struct expression *exp, enum noside noside, value *arg1, gdb::array_view< value * > args)
void unop_promote(const struct language_defn *language, struct gdbarch *gdbarch, struct value **arg1)
static int ptrmath_type_p(const struct language_defn *lang, struct type *type)
struct value * eval_op_equal(struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1, struct value *arg2)
struct value * eval_op_structop_struct(struct type *expect_type, struct expression *exp, enum noside noside, struct value *arg1, const char *string)
struct type * parse_and_eval_type(const char *p, int length)
struct value * eval_op_plus(struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1)
struct value * eval_op_postinc(struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1)
struct value * eval_op_member(struct type *expect_type, struct expression *exp, enum noside noside, struct value *arg1, struct value *arg2)
void fetch_subexp_value(struct expression *exp, expr::operation *op, struct value **valp, struct value **resultp, std::vector< value_ref_ptr > *val_chain, bool preserve_errors)
struct value * eval_op_leq(struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1, struct value *arg2)
CORE_ADDR parse_and_eval_address(const char *exp)
struct value * eval_op_predec(struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1)
struct value * eval_op_subscript(struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1, struct value *arg2)
struct value * eval_op_sub(struct type *expect_type, struct expression *exp, enum noside noside, struct value *arg1, struct value *arg2)
struct value * eval_binop_assign_modify(struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1, struct value *arg2)
struct value * eval_op_type(struct type *expect_type, struct expression *exp, enum noside noside, struct type *type)
struct value * eval_op_repeat(struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1, struct value *arg2)
static struct value * eval_op_objc_msgcall(struct type *expect_type, struct expression *exp, enum noside noside, CORE_ADDR selector, value *target, gdb::array_view< value * > args)
std::unique_ptr< expression > expression_up
@ PARSER_COMMA_TERMINATES
expression_up parse_expression(const char *, innermost_block_tracker *=nullptr, parser_flags flags=0)
expression_up parse_exp_1(const char **, CORE_ADDR pc, const struct block *, parser_flags flags, innermost_block_tracker *=nullptr)
@ EVAL_AVOID_SIDE_EFFECTS
struct value * value_of_register(int regnum, frame_info_ptr frame)
frame_info_ptr get_selected_frame(const char *message)
const struct block * get_selected_block(CORE_ADDR *addr_in_block)
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
CORE_ADDR gdbarch_convert_from_func_ptr_addr(struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ)
int gdbarch_double_bit(struct gdbarch *gdbarch)
static int gdbarch_num_cooked_regs(gdbarch *arch)
bool value_in_thread_stack_temporaries(struct value *, struct thread_info *thr)
struct thread_info * inferior_thread(void)
bool thread_stack_temporaries_enabled_p(struct thread_info *tp)
struct type * lookup_pointer_type(struct type *type)
int is_integral_type(struct type *t)
int is_dynamic_type(struct type *type)
bool get_discrete_bounds(struct type *type, LONGEST *lowp, LONGEST *highp)
struct type * lookup_function_type(struct type *type)
struct type * lookup_unsigned_typename(const struct language_defn *language, const char *name)
const struct builtin_type * builtin_type(struct gdbarch *gdbarch)
int type_not_associated(const struct type *type)
unsigned type_align(struct type *type)
struct type * lookup_signed_typename(const struct language_defn *language, const char *name)
bool is_fixed_point_type(struct type *type)
int type_not_allocated(const struct type *type)
struct type * check_typedef(struct type *type)
#define TYPE_NFN_FIELDS(thistype)
#define TYPE_CHAIN(thistype)
#define TYPE_IS_REFERENCE(t)
#define TYPE_MAIN_TYPE(thistype)
#define TYPE_SELF_TYPE(thistype)
#define TYPE_BASECLASS(thistype, index)
#define TYPE_FN_FIELDLIST_NAME(thistype, n)
#define TYPE_N_BASECLASSES(thistype)
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
CORE_ADDR find_function_addr(struct value *function, struct type **retval_type, struct type **function_type)
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)
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)
#define CAST_IS_CONVERSION(LANG)
struct bound_minimal_symbol lookup_minimal_symbol(const char *name, const char *sfile, struct objfile *objf)
type * find_minsym_type_and_address(minimal_symbol *msymbol, struct objfile *objfile, CORE_ADDR *address_p)
static void add_struct_fields(struct type *type, completion_list &output, const char *fieldname, int namelen, const char *prefix)
CORE_ADDR lookup_child_selector(struct gdbarch *gdbarch, const char *selname)
#define prefix(a, b, R, do)
struct type * register_type(struct gdbarch *gdbarch, int regnum)
void(* func)(remote_target *remote, char *)
const struct block * block
struct minimal_symbol * minsym
struct type * builtin_long_long
struct type * builtin_double
struct type * builtin_uint128
struct type * builtin_long
struct type * builtin_data_ptr
struct type * builtin_long_double
struct type * builtin_unsigned_long_long
struct type * builtin_int
struct type * builtin_unsigned_int
struct type * builtin_int128
struct type * builtin_unsigned_long
dynamic_prop_kind kind() const
const struct language_defn * language_defn
struct value * evaluate(struct type *expect_type=nullptr, enum noside noside=EVAL_NORMAL)
bool uses_objfile(struct objfile *objfile) const
void set_type(struct type *type)
LONGEST loc_bitpos() const
const char * name() const
unsigned int bitsize() const
struct type * type() const
const char * print_name() const
enum language la_language
virtual bool c_style_arrays_p() const
struct objfile * separate_debug_objfile_backlink
unsigned int flag_bound_evaluated
address_class aclass() const
struct type * type() const
struct type * target_type() const
void set_is_prototyped(bool is_prototyped)
void set_code(type_code code)
struct field & field(int idx) const
void set_instance_flags(type_instance_flags flags)
void set_has_varargs(bool has_varargs)
bool is_gnu_ifunc() const
void set_num_fields(unsigned int num_fields)
unsigned int num_fields() const
void set_length(ULONGEST length)
bool is_pointer_or_reference() const
range_bounds * bounds() const
const char * name() const
type * index_type() const
void set_fields(struct field *fields)
static struct value * zero(struct type *type, enum lval_type lv)
static struct value * allocate_optimized_out(struct type *type)
void contents_copy(struct value *dst, LONGEST dst_offset, LONGEST src_offset, LONGEST length)
struct value * non_lval()
gdb::array_view< gdb_byte > contents_writeable()
static struct value * allocate(struct type *type)
void set_lval(lval_type val)
LONGEST embedded_offset() const
gdb::array_view< const gdb_byte > contents()
struct type * result_type_of_xmethod(gdb::array_view< value * > argv)
gdb::array_view< gdb_byte > contents_raw()
struct type * type() const
struct value * call_xmethod(gdb::array_view< value * > argv)
enum lval_type lval() const
void deprecated_set_type(struct type *type)
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)
#define SYMBOL_COMPUTED_OPS(symbol)
bool target_has_execution(inferior *inf)
void error_unknown_type(const char *sym_print_name)
int user_reg_map_name_to_regnum(struct gdbarch *gdbarch, const char *name, int len)
bool value_logical_not(struct value *arg1)
struct value * value_subscript(struct value *array, LONGEST index)
struct value * value_x_binop(struct value *arg1, struct value *arg2, enum exp_opcode op, enum exp_opcode otherop, enum noside noside)
struct value * value_neg(struct value *arg1)
struct value * value_x_unop(struct value *arg1, enum exp_opcode op, enum noside noside)
struct value * value_complement(struct value *arg1)
struct value * value_pos(struct value *arg1)
int binop_user_defined_p(enum exp_opcode op, struct value *arg1, struct value *arg2)
int value_equal(struct value *arg1, struct value *arg2)
int value_less(struct value *arg1, struct value *arg2)
struct value * value_ptradd(struct value *arg1, LONGEST arg2)
LONGEST value_ptrdiff(struct value *arg1, struct value *arg2)
struct value * value_binop(struct value *arg1, struct value *arg2, enum exp_opcode op)
int unop_user_defined_p(enum exp_opcode op, struct value *arg1)
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_slice(struct value *array, int lowbound, int length)
struct value * value_aggregate_elt(struct type *curtype, const char *name, struct type *expect_type, int want_address, enum noside noside)
struct type * value_rtti_indirect_type(struct value *v, int *full, LONGEST *top, int *using_enc)
struct value * value_one(struct type *type)
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_repeat(struct value *arg1, int count)
struct value * value_array(int lowbound, gdb::array_view< struct value * > elemvec)
struct value * find_function_in_inferior(const char *name, struct objfile **objf_p)
struct value * value_cast(struct type *type, struct value *arg2)
struct value * value_assign(struct value *toval, struct value *fromval)
bool value_must_coerce_to_target(struct value *val)
struct value * value_ind(struct value *arg1)
struct value * address_of_variable(struct symbol *var, const struct block *b)
int find_overload_match(gdb::array_view< value * > args, const char *name, enum oload_search_type method, struct value **objp, struct symbol *fsym, struct value **valp, struct symbol **symp, int *staticp, const int no_adl, const enum noside noside)
struct value * value_string(const gdb_byte *ptr, ssize_t count, struct type *char_type)
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)
CORE_ADDR value_as_address(struct value *val)
struct value * value_from_longest(struct type *type, LONGEST num)
struct value * coerce_ref(struct value *arg)
struct value * coerce_array(struct value *arg)
LONGEST value_as_long(struct value *val)
void modify_field(struct type *type, gdb_byte *addr, LONGEST fieldval, LONGEST bitpos, LONGEST bitsize)
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 value * value_mark(void)
int using_struct_return(struct gdbarch *gdbarch, struct value *function, struct type *value_type)
struct value * allocate_repeat_value(struct type *type, int count)