GDB (xrefs)
Classes | Functions | Variables
/home/stan/gdb/src/gdb/parse.c File Reference
#include "defs.h"
#include <ctype.h>
#include "arch-utils.h"
#include "gdb_string.h"
#include "symtab.h"
#include "gdbtypes.h"
#include "frame.h"
#include "expression.h"
#include "value.h"
#include "command.h"
#include "language.h"
#include "f-lang.h"
#include "parser-defs.h"
#include "gdbcmd.h"
#include "symfile.h"
#include "inferior.h"
#include "doublest.h"
#include "gdb_assert.h"
#include "block.h"
#include "source.h"
#include "objfiles.h"
#include "exceptions.h"
#include "user-regs.h"

Go to the source code of this file.

Classes

struct  funcall

Functions

static void show_expressiondebug (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static void show_parserdebug (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static void free_funcalls (void *ignore)
static int prefixify_subexp (struct expression *, struct expression *, int, int)
static struct expressionparse_exp_in_context (const char **, CORE_ADDR, const struct block *, int, int, int *)
static struct expressionparse_exp_in_context_1 (const char **, CORE_ADDR, const struct block *, int, int, int *)
void _initialize_parse (void)
void start_arglist (void)
int end_arglist (void)
void initialize_expout (int initial_size, const struct language_defn *lang, struct gdbarch *gdbarch)
void reallocate_expout (void)
static void write_exp_elt (const union exp_element *expelt)
void write_exp_elt_opcode (enum exp_opcode expelt)
void write_exp_elt_sym (struct symbol *expelt)
void write_exp_elt_block (const struct block *b)
void write_exp_elt_objfile (struct objfile *objfile)
void write_exp_elt_longcst (LONGEST expelt)
void write_exp_elt_dblcst (DOUBLEST expelt)
void write_exp_elt_decfloatcst (gdb_byte expelt[16])
void write_exp_elt_type (struct type *expelt)
void write_exp_elt_intern (struct internalvar *expelt)
void write_exp_string (struct stoken str)
void write_exp_string_vector (int type, struct stoken_vector *vec)
void write_exp_bitstring (struct stoken str)
void write_exp_msymbol (struct bound_minimal_symbol bound_msym)
void mark_struct_expression (void)
void mark_completion_tag (enum type_code tag, const char *ptr, int length)
void write_dollar_variable (struct stoken str)
const char * find_template_name_end (const char *p)
char * copy_name (struct stoken token)
int prefixify_expression (struct expression *expr)
int length_of_subexp (struct expression *expr, int endpos)
void operator_length (const struct expression *expr, int endpos, int *oplenp, int *argsp)
void operator_length_standard (const struct expression *expr, int endpos, int *oplenp, int *argsp)
struct expressionparse_exp_1 (const char **stringptr, CORE_ADDR pc, const struct block *block, int comma)
struct expressionparse_expression (const char *string)
struct typeparse_expression_for_completion (const char *string, char **name, enum type_code *code)
void null_post_parser (struct expression **exp, int void_context_p)
int parse_float (const char *p, int len, DOUBLEST *d, const char **suffix)
int parse_c_float (struct gdbarch *gdbarch, const char *p, int len, DOUBLEST *d, struct type **t)
static void type_stack_reserve (struct type_stack *stack, int howmuch)
static void check_type_stack_depth (void)
static void insert_into_type_stack (int slot, union type_stack_elt element)
void insert_type (enum type_pieces tp)
void push_type (enum type_pieces tp)
void push_type_int (int n)
void insert_type_address_space (char *string)
enum type_pieces pop_type (void)
int pop_type_int (void)
static VEC (type_ptr)
static struct type_stackpop_type_stack (void)
struct type_stackappend_type_stack (struct type_stack *to, struct type_stack *from)
void push_type_stack (struct type_stack *stack)
struct type_stackget_type_stack (void)
void type_stack_cleanup (void *arg)
void push_typelist (VEC(type_ptr)*list)
struct typefollow_types (struct type *follow_type)
void parser_fprintf (FILE *x, const char *y,...)
int operator_check_standard (struct expression *exp, int pos, int(*objfile_func)(struct objfile *objfile, void *data), void *data)
static int exp_iterate (struct expression *exp, int(*objfile_func)(struct objfile *objfile, void *data), void *data)
static int exp_uses_objfile_iter (struct objfile *exp_objfile, void *objfile_voidp)
int exp_uses_objfile (struct expression *exp, struct objfile *objfile)

Variables

struct exp_descriptor exp_descriptor_standard
struct expressionexpout
int expout_size
int expout_ptr
struct blockexpression_context_block
CORE_ADDR expression_context_pc
struct blockinnermost_block
int arglist_len
static struct type_stack type_stack
const char * lexptr
const char * prev_lexptr
int paren_depth
int comma_terminates
int parse_completion
static int expout_last_struct = -1
static enum type_code expout_tag_completion_type = TYPE_CODE_UNDEF
static char * expout_completion_name
static unsigned int expressiondebug = 0
int parser_debug
static struct funcallfuncall_chain

Function Documentation

void _initialize_parse ( void  )
struct type_stack* append_type_stack ( struct type_stack to,
struct type_stack from 
) [read]

Definition at line 1573 of file parse.c.

References type_stack::depth, type_stack::elements, memcpy(), to, and type_stack_reserve().

static void check_type_stack_depth ( void  ) [static]
char* copy_name ( struct stoken  token)
int end_arglist ( void  )

Definition at line 162 of file parse.c.

References arglist_len, funcall::arglist_len, funcall_chain, funcall::next, and xfree().

static int exp_iterate ( struct expression exp,
int(*)(struct objfile *objfile, void *data)  objfile_func,
void *  data 
) [static]
int exp_uses_objfile ( struct expression exp,
struct objfile objfile 
)
static int exp_uses_objfile_iter ( struct objfile exp_objfile,
void *  objfile_voidp 
) [static]

Definition at line 1890 of file parse.c.

References objfile::separate_debug_objfile_backlink.

Referenced by exp_uses_objfile().

const char* find_template_name_end ( const char *  p)

Definition at line 737 of file parse.c.

Referenced by lex_one_token().

struct type* follow_types ( struct type follow_type) [read]
static void free_funcalls ( void *  ignore) [static]

Definition at line 177 of file parse.c.

References funcall::next, and xfree().

Referenced by parse_exp_in_context_1().

struct type_stack* get_type_stack ( void  ) [read]

Definition at line 1599 of file parse.c.

References type_stack::depth, type_stack::elements, type_stack::size, and type_stack.

void initialize_expout ( int  initial_size,
const struct language_defn lang,
struct gdbarch gdbarch 
)
static void insert_into_type_stack ( int  slot,
union type_stack_elt  element 
) [static]
void insert_type ( enum type_pieces  tp)
void insert_type_address_space ( char *  string)
int length_of_subexp ( struct expression expr,
int  endpos 
)

Definition at line 854 of file parse.c.

References length_of_subexp(), and operator_length().

Referenced by copy_exp(), length_of_subexp(), and prefixify_subexp().

void mark_completion_tag ( enum type_code  tag,
const char *  ptr,
int  length 
)
void mark_struct_expression ( void  )
void null_post_parser ( struct expression **  exp,
int  void_context_p 
)

Definition at line 1353 of file parse.c.

int operator_check_standard ( struct expression exp,
int  pos,
int(*)(struct objfile *objfile, void *data)  objfile_func,
void *  data 
)
void operator_length ( const struct expression expr,
int  endpos,
int oplenp,
int argsp 
)
void operator_length_standard ( const struct expression expr,
int  endpos,
int oplenp,
int argsp 
)
int parse_c_float ( struct gdbarch gdbarch,
const char *  p,
int  len,
DOUBLEST d,
struct type **  t 
)
struct expression* parse_exp_1 ( const char **  stringptr,
CORE_ADDR  pc,
const struct block block,
int  comma 
) [read]
static struct expression * parse_exp_in_context ( const char **  stringptr,
CORE_ADDR  pc,
const struct block block,
int  comma,
int  void_context_p,
int out_subexp 
) [static, read]

Definition at line 1141 of file parse.c.

References parse_exp_in_context_1().

Referenced by parse_exp_1(), and parse_expression_for_completion().

static struct expression * parse_exp_in_context_1 ( const char **  stringptr,
CORE_ADDR  pc,
const struct block block,
int  comma,
int  void_context_p,
int out_subexp 
) [static, read]
struct expression* parse_expression ( const char *  string) [read]
struct type* parse_expression_for_completion ( const char *  string,
char **  name,
enum type_code code 
) [read]
int parse_float ( const char *  p,
int  len,
DOUBLEST d,
const char **  suffix 
)

Definition at line 1365 of file parse.c.

References DOUBLEST_SCAN_FORMAT, len, memcpy(), xfree(), and xmalloc().

Referenced by parse_c_float(), and parse_number().

void parser_fprintf ( FILE *  x,
const char *  y,
  ... 
)

Definition at line 1757 of file parse.c.

References fprintf_unfiltered(), gdb_stderr, and vfprintf_unfiltered().

enum type_pieces pop_type ( void  )

Definition at line 1535 of file parse.c.

References type_stack::depth, type_stack::elements, type_stack_elt::piece, and tp_end.

Referenced by follow_types().

int pop_type_int ( void  )

Definition at line 1543 of file parse.c.

References type_stack::depth, type_stack::elements, and type_stack_elt::int_val.

Referenced by follow_types().

static struct type_stack* pop_type_stack ( void  ) [static, read]

Definition at line 1563 of file parse.c.

References type_stack::depth, type_stack::elements, gdb_assert, and type_stack_elt::stack_val.

Referenced by follow_types().

int prefixify_expression ( struct expression expr)

Definition at line 836 of file parse.c.

References len, memcpy(), expression::nelts, and prefixify_subexp().

Referenced by parse_exp_in_context_1(), and stap_parse_probe_arguments().

static int prefixify_subexp ( struct expression inexpr,
struct expression outexpr,
int  inend,
int  outbeg 
) [static]
void push_type ( enum type_pieces  tp)
void push_type_int ( int  n)
void push_type_stack ( struct type_stack stack)
void push_typelist ( VEC(type_ptr)*  list)
void reallocate_expout ( void  )

Definition at line 208 of file parse.c.

References EXP_ELEM_TO_BYTES, expout_ptr, expression::nelts, and xrealloc().

Referenced by parse_exp_in_context_1(), and stap_parse_argument().

static void show_expressiondebug ( struct ui_file file,
int  from_tty,
struct cmd_list_element c,
const char *  value 
) [static]

Definition at line 100 of file parse.c.

References _, and fprintf_filtered().

static void show_parserdebug ( struct ui_file file,
int  from_tty,
struct cmd_list_element c,
const char *  value 
) [static]

Definition at line 111 of file parse.c.

References _, and fprintf_filtered().

void start_arglist ( void  )

Definition at line 147 of file parse.c.

References arglist_len, funcall::arglist_len, funcall_chain, and xmalloc().

void type_stack_cleanup ( void *  arg)

Definition at line 1614 of file parse.c.

References type_stack::elements, and xfree().

static void type_stack_reserve ( struct type_stack stack,
int  howmuch 
) [static]
static VEC ( type_ptr  ) [static]

Definition at line 1553 of file parse.c.

References type_stack::depth, type_stack::elements, and gdb_assert.

void write_dollar_variable ( struct stoken  str)
void write_exp_bitstring ( struct stoken  str)
static void write_exp_elt ( const union exp_element expelt) [static]
void write_exp_elt_block ( const struct block b)
void write_exp_elt_dblcst ( DOUBLEST  expelt)

Definition at line 289 of file parse.c.

References exp_element::doubleconst, memset(), and write_exp_elt().

void write_exp_elt_decfloatcst ( gdb_byte  expelt[16])

Definition at line 299 of file parse.c.

References exp_element::decfloatconst, and write_exp_elt().

void write_exp_elt_intern ( struct internalvar expelt)

Definition at line 321 of file parse.c.

References exp_element::internalvar, memset(), and write_exp_elt().

Referenced by write_dollar_variable().

void write_exp_elt_longcst ( LONGEST  expelt)
void write_exp_elt_objfile ( struct objfile objfile)

Definition at line 269 of file parse.c.

References memset(), exp_element::objfile, and write_exp_elt().

Referenced by write_exp_msymbol().

void write_exp_elt_opcode ( enum exp_opcode  expelt)
void write_exp_elt_sym ( struct symbol expelt)
void write_exp_elt_type ( struct type expelt)
void write_exp_msymbol ( struct bound_minimal_symbol  bound_msym)
void write_exp_string ( struct stoken  str)
void write_exp_string_vector ( int  type,
struct stoken_vector vec 
)

Variable Documentation

Definition at line 76 of file parse.c.

Referenced by end_arglist(), and start_arglist().

Definition at line 81 of file parse.c.

Referenced by lex_one_token(), parse_exp_in_context_1(), and yylex().

struct expression* expout
char* expout_completion_name [static]
int expout_last_struct = -1 [static]

Definition at line 74 of file parse.c.

Referenced by c_parse(), and parse_exp_in_context_1().

unsigned int expressiondebug = 0 [static]

Definition at line 98 of file parse.c.

Referenced by parse_exp_in_context_1().

struct funcall* funcall_chain [static]

Definition at line 141 of file parse.c.

Referenced by end_arglist(), and start_arglist().

const char* lexptr

Definition at line 80 of file parse.c.

Referenced by lex_one_token(), parse_exp_in_context_1(), and yylex().

Definition at line 108 of file parse.c.

Referenced by c_parse(), and go_parse().

Definition at line 79 of file parse.c.

Referenced by cp_demangled_name_to_comp(), lex_one_token(), parse_exp_in_context_1(), and yylex().

struct type_stack type_stack [static]

Definition at line 77 of file parse.c.

Referenced by follow_types(), and get_type_stack().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines