b52cac6b76
before testing against reg_ptr. * eval.c (evaluate_subexp_standard): Cast type of TYPE_FN_FIELD_VOFFSET to int. * findvar.c (extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer): Cast type of sizeof to int. * values.c (unpack_field_as_long, modify_field): Ditto. * valops.c (value_assign, call_function_by_hand): Ditto. * infcmd.c (do_registers_info): Ditto. * ser-tcp.c (tcp_open): Ditto * remote.c (putpkt): Ditto. * dcache.c (dcache_peek): Ditto. * dcache.c (dcache_poke): Ditto. * m2-exp.y (yylex): Ditto. * gnu-regex.c (re_match_2): Ditto. * f-lang.c (ADD_BF_SYMNUM, saved_bf_list_end, tmp_bf_ptr): Ifdef out unused macro definition and variables. * inftarg.c (proc_wait): Move from main.c to here, and make static. * valprint.c (val_print_string): Change bufsize from int to unsigned. * main.c (wait.h): Include * top.c (command_line_input): Remove unused variable "c". * f-typeprint.c (f_type_print_varspec_prefix): Add missing enum value TYPE_CODE_TYPEDEF to switch statement. (f_type_print_varspec_suffix): Add missing enum value TYPE_CODE_TYPEDEF to switch statement. * ch-exp.c (parse_primval): Add remaining enumeration values to switch statement, with no specific action. (ch_lex): Add LOC_UNRESOLVED in switch statement. (pushback_token): Ifdef out, since code using it is ifdef'd out. * stabsread.c (cleanup_undefined_types): Remove unused label "badtype". * objfiles.h (print_symbol_bcache_statistics): Add prototype. * maint.c (objfiles.h): Include. (maintenance_print_statistics): Remove unused variable "temp". * minsyms.c (lookup_minimal_symbol_solib_trampoline): Remove unused variable "found_file_symbol". * m2-exp.y (yylex): Add LOC_UNRESOLVED case to switch. * language.c (lang_bool_type): Use existing function local type variable rather than create block local variables. * solib.c (disable_break): Enclose in ifndef SVR4_SHARED_LIBS. * infptrace.c (wait.h, command.h): Include. * ser-tcp.c (gdb_string.h): Include * i386-tdep.c (codestream_seek): Change "place" to CORE_ADDR. (i386_get_frame_setup): Change "pc" from int to CORE_ADDR. * command.c (complete_on_enum): Make assignment used as truth value explictly check against NULL. (wait.h): Include. * infrun.c (wait_for_inferior): Ifdef out prologue_pc since code that uses it is ifdef'd out. * parser-defs.h: Add prototype for write_dollar_variable. * infrun.c: Add prototype for write_pc_pid. * breakpoint.h: Add prototype for re_enable_breakpoints_in_shlibs. * symmisc.c (bcache.h): Include. * bcache.h: Add prototype for print_bcache_statistics. * symfile.c: Include <time.h>. * printcmd.c (print_scalar_formatted): Change len to unsigned int. * valarith.c (value_equal): Cast result of TYPE_LENGTH to int. * valarith.c (value_binop): Change result_len, promoted_len1, and promoted_len2 to unsigned int. * valarith.c (value_subscripted_rvalue): Change elt_offs and elt_size to unsigned int. * valops.c (value_array): Change typelength to unsigned int. (destructor_name_p): Change len to unsigned int. * scm-lang.h (scm_parse): Add prototype for scm_unpack. * symfile.c (decrement_reading_symtab): Change return type to void. * valarith.c (value_subscript): Remove unused variable "word". (value_subscript): Remove unused variable "tint". * valops.c (auto_abandon): Ifdef out, since code using it is also ifdef'd out. * eval.c (init_array_element): Remove unused variable "val". * Makefile.in (values.o): Depends on scm-lang.h. (command.o): Depends upon wait_h. (ser-tcp.o): Depends upon gdb_string.h. (infptrace.o): Depends upon wait_h and command_h. (maint.o): Depends on objfiles.h and symfile.h. * values.c (allocate_repeat_value): Remove unused variable "element_type". (scm-lang.h): Include. * breakpoint.c (create_longjmp_breakpoint): Enclose in GET_LONGJMP_TARGET define, unused otherwise. * config/i386/nm-linux.h: Add prototypes for i386_insert_watchpoint, i386_remove_watchpoint and i386_stopped_by_watchpoint.
192 lines
5.6 KiB
C
192 lines
5.6 KiB
C
/* Parser definitions for GDB.
|
||
Copyright (C) 1986, 1989, 1990, 1991 Free Software Foundation, Inc.
|
||
Modified from expread.y by the Department of Computer Science at the
|
||
State University of New York at Buffalo.
|
||
|
||
This file is part of GDB.
|
||
|
||
This program is free software; you can redistribute it and/or modify
|
||
it under the terms of the GNU General Public License as published by
|
||
the Free Software Foundation; either version 2 of the License, or
|
||
(at your option) any later version.
|
||
|
||
This program is distributed in the hope that it will be useful,
|
||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
GNU General Public License for more details.
|
||
|
||
You should have received a copy of the GNU General Public License
|
||
along with this program; if not, write to the Free Software
|
||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||
|
||
#if !defined (PARSER_DEFS_H)
|
||
#define PARSER_DEFS_H 1
|
||
|
||
struct std_regs {
|
||
char *name;
|
||
int regnum;
|
||
};
|
||
|
||
extern struct std_regs std_regs[];
|
||
extern unsigned num_std_regs;
|
||
|
||
extern struct expression *expout;
|
||
extern int expout_size;
|
||
extern int expout_ptr;
|
||
|
||
/* If this is nonzero, this block is used as the lexical context
|
||
for symbol names. */
|
||
|
||
extern struct block *expression_context_block;
|
||
|
||
/* The innermost context required by the stack and register variables
|
||
we've encountered so far. */
|
||
extern struct block *innermost_block;
|
||
|
||
/* The block in which the most recently discovered symbol was found.
|
||
FIXME: Should be declared along with lookup_symbol in symtab.h; is not
|
||
related specifically to parsing. */
|
||
extern struct block *block_found;
|
||
|
||
/* Number of arguments seen so far in innermost function call. */
|
||
extern int arglist_len;
|
||
|
||
/* A string token, either a char-string or bit-string. Char-strings are
|
||
used, for example, for the names of symbols. */
|
||
|
||
struct stoken
|
||
{
|
||
/* Pointer to first byte of char-string or first bit of bit-string */
|
||
char *ptr;
|
||
/* Length of string in bytes for char-string or bits for bit-string */
|
||
int length;
|
||
};
|
||
|
||
struct ttype
|
||
{
|
||
struct stoken stoken;
|
||
struct type *type;
|
||
};
|
||
|
||
struct symtoken
|
||
{
|
||
struct stoken stoken;
|
||
struct symbol *sym;
|
||
int is_a_field_of_this;
|
||
};
|
||
|
||
/* For parsing of complicated types.
|
||
An array should be preceded in the list by the size of the array. */
|
||
enum type_pieces
|
||
{tp_end = -1, tp_pointer, tp_reference, tp_array, tp_function};
|
||
/* The stack can contain either an enum type_pieces or an int. */
|
||
union type_stack_elt {
|
||
enum type_pieces piece;
|
||
int int_val;
|
||
};
|
||
extern union type_stack_elt *type_stack;
|
||
extern int type_stack_depth, type_stack_size;
|
||
|
||
extern void write_exp_elt PARAMS ((union exp_element));
|
||
|
||
extern void write_exp_elt_opcode PARAMS ((enum exp_opcode));
|
||
|
||
extern void write_exp_elt_sym PARAMS ((struct symbol *));
|
||
|
||
extern void write_exp_elt_longcst PARAMS ((LONGEST));
|
||
|
||
extern void write_exp_elt_dblcst PARAMS ((DOUBLEST));
|
||
|
||
extern void write_exp_elt_type PARAMS ((struct type *));
|
||
|
||
extern void write_exp_elt_intern PARAMS ((struct internalvar *));
|
||
|
||
extern void write_exp_string PARAMS ((struct stoken));
|
||
|
||
extern void write_exp_bitstring PARAMS ((struct stoken));
|
||
|
||
extern void write_exp_elt_block PARAMS ((struct block *));
|
||
|
||
extern void write_exp_msymbol PARAMS ((struct minimal_symbol *,
|
||
struct type *, struct type *));
|
||
|
||
extern void write_dollar_variable PARAMS ((struct stoken str));
|
||
|
||
extern void
|
||
start_arglist PARAMS ((void));
|
||
|
||
extern int
|
||
end_arglist PARAMS ((void));
|
||
|
||
extern char *
|
||
copy_name PARAMS ((struct stoken));
|
||
|
||
extern void
|
||
push_type PARAMS ((enum type_pieces));
|
||
|
||
extern void
|
||
push_type_int PARAMS ((int));
|
||
|
||
extern enum type_pieces
|
||
pop_type PARAMS ((void));
|
||
|
||
extern int
|
||
pop_type_int PARAMS ((void));
|
||
|
||
extern struct type *follow_types PARAMS ((struct type *));
|
||
|
||
/* During parsing of a C expression, the pointer to the next character
|
||
is in this variable. */
|
||
|
||
extern char *lexptr;
|
||
|
||
/* Tokens that refer to names do so with explicit pointer and length,
|
||
so they can share the storage that lexptr is parsing.
|
||
|
||
When it is necessary to pass a name to a function that expects
|
||
a null-terminated string, the substring is copied out
|
||
into a block of storage that namecopy points to.
|
||
|
||
namecopy is allocated once, guaranteed big enough, for each parsing. */
|
||
|
||
extern char *namecopy;
|
||
|
||
/* Current depth in parentheses within the expression. */
|
||
|
||
extern int paren_depth;
|
||
|
||
/* Nonzero means stop parsing on first comma (if not within parentheses). */
|
||
|
||
extern int comma_terminates;
|
||
|
||
/* These codes indicate operator precedences for expression printing,
|
||
least tightly binding first. */
|
||
/* Adding 1 to a precedence value is done for binary operators,
|
||
on the operand which is more tightly bound, so that operators
|
||
of equal precedence within that operand will get parentheses. */
|
||
/* PREC_HYPER and PREC_ABOVE_COMMA are not the precedence of any operator;
|
||
they are used as the "surrounding precedence" to force
|
||
various kinds of things to be parenthesized. */
|
||
enum precedence
|
||
{ PREC_NULL, PREC_COMMA, PREC_ABOVE_COMMA, PREC_ASSIGN, PREC_LOGICAL_OR,
|
||
PREC_LOGICAL_AND, PREC_BITWISE_IOR, PREC_BITWISE_AND, PREC_BITWISE_XOR,
|
||
PREC_EQUAL, PREC_ORDER, PREC_SHIFT, PREC_ADD, PREC_MUL, PREC_REPEAT,
|
||
PREC_HYPER, PREC_PREFIX, PREC_SUFFIX, PREC_BUILTIN_FUNCTION };
|
||
|
||
/* Table mapping opcodes into strings for printing operators
|
||
and precedences of the operators. */
|
||
|
||
struct op_print
|
||
{
|
||
char *string;
|
||
enum exp_opcode opcode;
|
||
/* Precedence of operator. These values are used only by comparisons. */
|
||
enum precedence precedence;
|
||
|
||
/* For a binary operator: 1 iff right associate.
|
||
For a unary operator: 1 iff postfix. */
|
||
int right_assoc;
|
||
};
|
||
|
||
#endif /* PARSER_DEFS_H */
|