118 const struct block *,
int,
121 const struct block *,
int,
149 funcall_chain = newobj;
161 funcall_chain = call->
next;
175 for (call = funcall_chain; call; call =
next)
301 for (index = 0; index < 16; index++)
371 memcpy (strdata, str.
ptr, len);
372 *(strdata +
len) =
'\0';
400 for (i = 0; i < vec->
len; ++i)
420 for (i = 0; i < vec->
len; ++i)
465 memcpy (strdata, str.
ptr, len);
496 if (ifunc_msym.
minsym != NULL
541 ->nodebug_text_gnu_ifunc_symbol);
582 && expout_completion_name == NULL
583 && expout_last_struct == -1);
587 expout_tag_completion_type = tag;
588 expout_completion_name =
xmalloc (length + 1);
589 memcpy (expout_completion_name, ptr, length);
590 expout_completion_name[length] =
'\0';
618 struct symbol *sym = NULL;
629 if (str.
length >= 2 && str.
ptr[1] ==
'$')
641 for (; i < str.
length; i++)
642 if (!(str.
ptr[i] >=
'0' && str.
ptr[i] <=
'9'))
646 i = atoi (str.
ptr + 1 + negate);
657 goto handle_register;
715 int just_seen_right = 0;
716 int just_seen_colon = 0;
717 int just_seen_space = 0;
719 if (!p || (*p !=
'<'))
734 if (just_seen_colon || just_seen_right || just_seen_space)
738 if (just_seen_colon || just_seen_right)
745 if (just_seen_space || (just_seen_colon > 1))
752 if (!((*p >=
'a' && *p <=
'z') ||
753 (*p >=
'A' && *p <=
'Z') ||
754 (*p >=
'0' && *p <=
'9') ||
755 (*p ==
'_') || (*p ==
',') ||
756 (*p ==
'&') || (*p ==
'*') ||
757 (*p ==
'(') || (*p ==
')') ||
758 (*p ==
'[') || (*p ==
']')))
791 static char *namecopy;
792 static size_t namecopy_size;
795 if (namecopy_size < token.
length + 1)
797 namecopy_size = token.
length + 1;
801 memcpy (namecopy, token.
ptr, token.
length);
802 namecopy[token.
length] = 0;
813 int len =
sizeof (
struct expression) + EXP_ELEM_TO_BYTES (expr->nelts);
815 int inpos = expr->
nelts, outpos = 0;
820 memcpy (temp, expr, len);
860 int *oplenp,
int *argsp)
868 error (
_(
"?error in operator_length_standard"));
891 case OP_VAR_ENTRY_VALUE:
901 case OP_F77_UNDETERMINED_ARGLIST:
911 case OP_OBJC_MSGCALL:
922 case UNOP_DYNAMIC_CAST:
923 case UNOP_REINTERPRET_CAST:
924 case UNOP_MEMVAL_TYPE:
936 case UNOP_MEMVAL_TLS:
963 case STRUCTOP_STRUCT:
970 case OP_OBJC_NSSTRING:
972 case OP_OBJC_SELECTOR:
991 case MULTI_SUBSCRIPT:
996 case BINOP_ASSIGN_MODIFY:
1027 args = 1 + (i < (
int) BINOP_END);
1043 struct expression *outexpr,
int inend,
int outbeg)
1056 memcpy (&outexpr->
elts[outbeg], &inexpr->
elts[inend],
1060 if (expout_last_struct == inend)
1061 result = outbeg - oplen;
1064 arglens = (
int *) alloca (args *
sizeof (
int));
1065 for (i = args - 1; i >= 0; i--)
1078 for (i = 0; i < args; i++)
1118 int comma,
int void_context_p,
int *out_subexp)
1121 void_context_p, out_subexp);
1134 int comma,
int void_context_p,
int *out_subexp)
1136 struct cleanup *old_chain, *inner_chain;
1141 lexptr = *stringptr;
1146 expout_last_struct = -1;
1148 xfree (expout_completion_name);
1149 expout_completion_name = NULL;
1151 comma_terminates = comma;
1153 if (lexptr == 0 || *lexptr == 0)
1159 expression_context_block = block;
1162 if (!expression_context_block)
1165 expression_context_pc =
BLOCK_START (expression_context_block);
1167 expression_context_pc = pc;
1171 if (!expression_context_block)
1175 expression_context_block
1178 if (expression_context_block)
1179 expression_context_pc =
BLOCK_START (expression_context_block);
1224 if (! parse_completion)
1237 if (expressiondebug)
1239 "before conversion to prefix form");
1243 *out_subexp = subexp;
1247 if (expressiondebug)
1267 error (
_(
"Junk after end of expression."));
1277 struct cleanup *old_chain = NULL;
1288 if (old_chain != NULL)
1311 parse_completion = 1;
1320 parse_completion = 0;
1328 expout_completion_name = NULL;
1332 if (expout_last_struct == -1)
1349 *name = xstrdup (*name);
1376 memcpy (copy, p, len);
1408 suffix_len = p + len - suffix;
1410 if (suffix_len == 0)
1412 else if (suffix_len == 1)
1415 if (tolower (*suffix) ==
'f')
1417 else if (tolower (*suffix) ==
'l')
1436 if (stack->
depth + howmuch >= stack->
size)
1439 if (stack->
size < howmuch)
1440 stack->
size = howmuch;
1647 int make_volatile = 0;
1648 int make_addr_space = 0;
1664 if (make_addr_space)
1667 make_const = make_volatile = 0;
1668 make_addr_space = 0;
1689 if (make_addr_space)
1692 make_const = make_volatile = 0;
1693 make_addr_space = 0;
1705 if (make_addr_space)
1708 make_const = make_volatile = 0;
1709 make_addr_space = 0;
1717 0, array_size >= 0 ? array_size - 1 : 0);
1789 struct objfile *objfile = NULL;
1793 gdb_assert (elts[pos].opcode < OP_EXTENDED0);
1797 switch (elts[pos].opcode)
1810 type = elts[pos + 1].
type;
1817 for (arg = 0; arg < nargs; arg++)
1819 struct type *type = elts[pos + 2 + arg].
type;
1822 if (objfile && (*objfile_func) (objfile, data))
1828 case UNOP_MEMVAL_TLS:
1829 objfile = elts[pos + 1].
objfile;
1830 type = elts[pos + 2].
type;
1856 if (objfile && (*objfile_func) (objfile, data))
1876 for (endpos = exp->
nelts; endpos > 0; )
1878 int pos, args, oplen = 0;
1883 pos = endpos - oplen;
1885 objfile_func, data))
1904 return exp_objfile == objfile;
1943 _(
"Set expression debugging."),
1944 _(
"Show expression debugging."),
1945 _(
"When non-zero, the internal representation "
1946 "of expressions will be printed."),
1952 _(
"Set parser debugging."),
1953 _(
"Show parser debugging."),
1954 _(
"When non-zero, expression parser "
1955 "tracing will be enabled."),
void error_no_arg(const char *why)
#define TYPE_HIGH_BOUND_KIND(range_type)
union exp_element elts[1]
int address_space_name_to_int(struct gdbarch *gdbarch, char *space_identifier)
void initialize_expout(struct parser_state *ps, size_t initial_size, const struct language_defn *lang, struct gdbarch *gdbarch)
struct type * lookup_array_range_type(struct type *element_type, LONGEST low_bound, LONGEST high_bound)
struct internalvar * create_internalvar(const char *name)
void write_exp_elt_decfloatcst(struct parser_state *ps, gdb_byte expelt[16])
struct value * evaluate_subexpression_type(struct expression *exp, int subexp)
int exp_uses_objfile(struct expression *exp, struct objfile *objfile)
void write_exp_elt_sym(struct parser_state *ps, struct symbol *expelt)
struct type * builtin_long_double
void add_setshow_zuinteger_cmd(const char *name, enum command_class theclass, unsigned int *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
const struct block * innermost_block
void push_type_stack(struct type_stack *stack)
#define parse_gdbarch(ps)
void type_stack_cleanup(void *arg)
enum type_pieces pop_type(void)
int(* operator_check)(struct expression *exp, int pos, int(*objfile_func)(struct objfile *objfile, void *data), void *data)
struct expression * parse_expression_with_language(const char *string, enum language lang)
struct objfile * separate_debug_objfile_backlink
CORE_ADDR expression_context_pc
static struct funcall * funcall_chain
static void show_parserdebug(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
struct bfd_section * the_bfd_section
#define BMSYMBOL_VALUE_ADDRESS(symbol)
struct type_stack * stack_val
static void write_exp_elt(struct parser_state *ps, const union exp_element *expelt)
struct internalvar * lookup_only_internalvar(const char *name)
enum language set_language(enum language lang)
struct symtab_and_line get_current_source_symtab_and_line(void)
static int exp_uses_objfile_iter(struct objfile *exp_objfile, void *objfile_voidp)
const struct builtin_type * builtin_type(struct gdbarch *gdbarch)
static struct type_stack * pop_type_stack(void)
void dump_raw_expression(struct expression *exp, struct ui_file *stream, char *note)
const struct language_defn * language_defn
const struct language_defn * language_def(enum language lang)
struct type * parse_expression_for_completion(const char *string, char **name, enum type_code *code)
static struct expression * parse_exp_in_context(const char **, CORE_ADDR, const struct block *, int, int, int *)
struct symbol * block_linkage_function(const struct block *bl)
enum language la_language
#define BLOCKVECTOR_BLOCK(blocklist, n)
void push_type(enum type_pieces tp)
static int expout_last_struct
#define bits(obj, st, fn)
#define BYTES_TO_EXP_ELEM(bytes)
int parse_c_float(struct gdbarch *gdbarch, const char *p, int len, DOUBLEST *d, struct type **t)
struct objfile * symbol_objfile(const struct symbol *symbol)
int longest_to_int(LONGEST)
struct internalvar * internalvar
void push_type_int(int n)
#define MSYMBOL_OBJ_SECTION(objfile, symbol)
const struct block * block
void write_exp_elt_block(struct parser_state *ps, const struct block *b)
#define SYMTAB_BLOCKVECTOR(symtab)
const struct exp_descriptor * la_exp_desc
void write_exp_elt_longcst(struct parser_state *ps, LONGEST expelt)
static unsigned int expressiondebug
union type_stack_elt * elements
void insert_type(enum type_pieces tp)
#define CATCH(EXCEPTION, MASK)
void increase_expout_size(struct parser_state *ps, size_t lenelt)
void null_post_parser(struct expression **exp, int void_context_p)
static char * expout_completion_name
struct target_ops current_target
struct type * follow_types(struct type *follow_type)
static struct parser_state * pstate
void dump_prefix_expression(struct expression *exp, struct ui_file *stream)
int prefixify_expression(struct expression *expr)
void fprintf_filtered(struct ui_file *stream, const char *format,...)
CORE_ADDR gdbarch_convert_from_func_ptr_addr(struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ)
void write_exp_elt_dblcst(struct parser_state *ps, DOUBLEST expelt)
void fprintf_unfiltered(struct ui_file *stream, const char *format,...)
void vfprintf_unfiltered(struct ui_file *stream, const char *format, va_list args)
#define gdb_assert_not_reached(message)
struct cleanup * make_cleanup(make_cleanup_ftype *function, void *arg)
struct gdbarch * get_objfile_arch(const struct objfile *objfile)
int length_of_subexp(struct expression *expr, int endpos)
const struct block * block_found
CORE_ADDR symbol_overlayed_address(CORE_ADDR address, struct obj_section *section)
void write_dollar_variable(struct parser_state *ps, struct stoken str)
struct gdbarch * get_current_arch(void)
const char * find_template_name_end(const char *p)
int dump_subexp_body_standard(struct expression *exp, struct ui_file *stream, int elt)
void push_typelist(VEC(type_ptr)*list)
void mark_struct_expression(struct parser_state *ps)
struct type_stack * get_type_stack(void)
struct expression * parse_expression(const char *string)
int(* la_parser)(struct parser_state *)
struct expression * expout
struct cmd_list_element * setdebuglist
char * op_name_standard(enum exp_opcode opcode)
int user_reg_map_name_to_regnum(struct gdbarch *gdbarch, const char *name, int len)
static void type_stack_reserve(struct type_stack *stack, int howmuch)
struct ui_file * gdb_stdlog
#define EXP_ELEM_TO_BYTES(elements)
void write_exp_msymbol(struct parser_state *ps, struct bound_minimal_symbol bound_msym)
static struct type_stack type_stack
#define DOUBLEST_SCAN_FORMAT
static int prefixify_subexp(struct expression *, struct expression *, int, int)
char * extract_field_op(struct expression *exp, int *subexp)
PTR xrealloc(PTR ptr, size_t size)
void write_exp_elt_opcode(struct parser_state *ps, enum exp_opcode expelt)
gdb_byte decfloatconst[16]
void throw_exception(struct gdb_exception exception)
const char const char int
void write_exp_elt_objfile(struct parser_state *ps, struct objfile *objfile)
void insert_type_address_space(struct parser_state *pstate, char *string)
#define MSYMBOL_TYPE(msymbol)
struct type * make_cv_type(int cnst, int voltl, struct type *type, struct type **typeptr)
void discard_cleanups(struct cleanup *old_chain)
const struct language_defn * current_language
struct type * builtin_double
struct bound_minimal_symbol lookup_minimal_symbol_by_pc(CORE_ADDR pc)
void operator_length(const struct expression *expr, int endpos, int *oplenp, int *argsp)
static void insert_into_type_stack(int slot, union type_stack_elt element)
void print_subexp_standard(struct expression *exp, int *pos, struct ui_file *stream, enum precedence prec)
static void check_type_stack_depth(void)
static int exp_iterate(struct expression *exp, int(*objfile_func)(struct objfile *objfile, void *data), void *data)
void(* operator_length)(const struct expression *, int, int *, int *)
#define TYPE_INDEX_TYPE(type)
struct ui_file * gdb_stderr
struct minimal_symbol * minsym
void parser_fprintf(FILE *x, const char *y,...)
static void free_funcalls(void *ignore)
int operator_check_standard(struct expression *exp, int pos, int(*objfile_func)(struct objfile *objfile, void *data), void *data)
struct symbol * lookup_symbol(const char *name, const struct block *block, domain_enum domain, struct field_of_this_result *is_a_field_of_this)
static enum type_code expout_tag_completion_type
struct bound_minimal_symbol lookup_bound_minimal_symbol(const char *name)
struct type * make_type_with_address_space(struct type *type, int space_flag)
#define SYMBOL_LANGUAGE(symbol)
#define VEC_address(T, V)
struct type_stack * append_type_stack(struct type_stack *to, struct type_stack *from)
struct value * evaluate_subexp_standard(struct type *expect_type, struct expression *exp, int *pos, enum noside noside)
void operator_length_standard(const struct expression *expr, int endpos, int *oplenp, int *argsp)
struct expression * parse_exp_1(const char **stringptr, CORE_ADDR pc, const struct block *block, int comma)
static struct expression * parse_exp_in_context_1(const char **, CORE_ADDR, const struct block *, int, int, int *)
const struct block * get_selected_block(CORE_ADDR *addr_in_block)
const struct block * expression_context_block
enum overlay_debugging_state overlay_debugging
struct typed_stoken * tokens
static void show_expressiondebug(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static int ignore(struct target_ops *ops, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
struct objfile * lookup_objfile_from_block(const struct block *block)
struct type * lookup_function_type_with_arguments(struct type *type, int nparams, struct type **param_types)
struct type * value_type(const struct value *value)
#define SYMBOL_TYPE(symbol)
struct type * lookup_reference_type(struct type *type)
struct cmd_list_element * showdebuglist
void mark_completion_tag(enum type_code tag, const char *ptr, int length)
void _initialize_parse(void)
void reallocate_expout(struct parser_state *ps)
void write_exp_elt_intern(struct parser_state *ps, struct internalvar *expelt)
void write_exp_string(struct parser_state *ps, struct stoken str)
void write_exp_elt_type(struct parser_state *ps, struct type *expelt)
void write_exp_bitstring(struct parser_state *ps, struct stoken str)
struct cleanup * make_cleanup_restore_current_language(void)
void error(const char *fmt,...)
void(* la_post_parser)(struct expression **expp, int void_context_p)
void write_exp_string_vector(struct parser_state *ps, int type, struct stoken_vector *vec)
struct type * lookup_pointer_type(struct type *type)
void do_cleanups(struct cleanup *old_chain)
void add_setshow_boolean_cmd(const char *name, enum command_class theclass, int *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
struct type * lookup_function_type(struct type *type)
char * copy_name(struct stoken token)
struct type * builtin_float
const ULONGEST const LONGEST len
int parse_float(const char *p, int len, DOUBLEST *d, const char **suffix)