(write_ambiguous_var, write_var_from_sym): Make blocks const.
* ada-lang.c (replace_operator_with_call)
(find_old_style_renaming_symbol): Make blocks const.
* ada-lang.h (ada_find_renaming_symbol): Update.
(struct ada_symbol_info) <block>: Now const.
* breakpoint.c (watch_command_1): Update.
* breakpoint.h (struct watchpoint) <exp_valid_block,
cond_exp_valid_block>: Now const.
* c-exp.y (classify_inner_name, classify_name): Make block
argument const.
* expprint.c (print_subexp_standard) <OP_VAR_VALUE>: Make 'b'
const.
* expression.h (innermost_block, parse_exp_1): Update.
(union exp_element) <block>: Now const.
* gdbtypes.c (lookup_template_type, lookup_enum, lookup_union)
(lookup_struct): Make block argument const.
* gdbtypes.h (lookup_template_type): Update.
* go-exp.y (classify_name, classify_packaged_name)
(package_name_p): Make block argument const.
* objc-lang.c (lookup_struct_typedef): Make block argument const.
* objc-lang.h (lookup_struct_typedef): Update.
* parse.c (parse_exp_in_context, parse_exp_1)
(write_exp_elt_block): Make block arguments const.
(expression_context_block, innermost_block): Now const.
* parser-defs.h (write_exp_elt_block): Update.
(expression_context_block, innermost_block, block_found): Now
const.
* printcmd.c (struct display) <block>: Now const.
* symtab.h (lookup_struct, lookup_union, lookup_enum): Update.
* valops.c (address_of_variable): Make block argument const.
* value.h (value_of_variable): Update.
* varobj.c (struct varobj_root) <valid_block>: Now const.
+2012-12-03 Tom Tromey <tromey@redhat.com>
+
+ * ada-exp.y (write_object_renaming, write_var_or_type)
+ (write_ambiguous_var, write_var_from_sym): Make blocks const.
+ * ada-lang.c (replace_operator_with_call)
+ (find_old_style_renaming_symbol): Make blocks const.
+ * ada-lang.h (ada_find_renaming_symbol): Update.
+ (struct ada_symbol_info) <block>: Now const.
+ * breakpoint.c (watch_command_1): Update.
+ * breakpoint.h (struct watchpoint) <exp_valid_block,
+ cond_exp_valid_block>: Now const.
+ * c-exp.y (classify_inner_name, classify_name): Make block
+ argument const.
+ * expprint.c (print_subexp_standard) <OP_VAR_VALUE>: Make 'b'
+ const.
+ * expression.h (innermost_block, parse_exp_1): Update.
+ (union exp_element) <block>: Now const.
+ * gdbtypes.c (lookup_template_type, lookup_enum, lookup_union)
+ (lookup_struct): Make block argument const.
+ * gdbtypes.h (lookup_template_type): Update.
+ * go-exp.y (classify_name, classify_packaged_name)
+ (package_name_p): Make block argument const.
+ * objc-lang.c (lookup_struct_typedef): Make block argument const.
+ * objc-lang.h (lookup_struct_typedef): Update.
+ * parse.c (parse_exp_in_context, parse_exp_1)
+ (write_exp_elt_block): Make block arguments const.
+ (expression_context_block, innermost_block): Now const.
+ * parser-defs.h (write_exp_elt_block): Update.
+ (expression_context_block, innermost_block, block_found): Now
+ const.
+ * printcmd.c (struct display) <block>: Now const.
+ * symtab.h (lookup_struct, lookup_union, lookup_enum): Update.
+ * valops.c (address_of_variable): Make block argument const.
+ * value.h (value_of_variable): Update.
+ * varobj.c (struct varobj_root) <valid_block>: Now const.
+
2012-11-30 Yao Qi <yao@codesourcery.com>
* breakpoint.c (print_one_breakpoint_location): Indent code.
static void write_int (LONGEST, struct type *);
-static void write_object_renaming (struct block *, const char *, int,
+static void write_object_renaming (const struct block *, const char *, int,
const char *, int);
-static struct type* write_var_or_type (struct block *, struct stoken);
+static struct type* write_var_or_type (const struct block *, struct stoken);
static void write_name_assoc (struct stoken);
static LONGEST convert_char_literal (struct type *, LONGEST);
-static void write_ambiguous_var (struct block *, char *, int);
+static void write_ambiguous_var (const struct block *, char *, int);
static struct type *type_int (void);
/* Emit expression to access an instance of SYM, in block BLOCK (if
* non-NULL), and with :: qualification ORIG_LEFT_CONTEXT. */
static void
-write_var_from_sym (struct block *orig_left_context,
- struct block *block,
+write_var_from_sym (const struct block *orig_left_context,
+ const struct block *block,
struct symbol *sym)
{
if (orig_left_context == NULL && symbol_read_needs_frame (sym))
* new encoding entirely (FIXME pnh 7/20/2007). */
static void
-write_object_renaming (struct block *orig_left_context,
+write_object_renaming (const struct block *orig_left_context,
const char *renamed_entity, int renamed_entity_len,
const char *renaming_expr, int max_depth)
{
a temporary symbol that is valid until the next call to ada_parse.
*/
static void
-write_ambiguous_var (struct block *block, char *name, int len)
+write_ambiguous_var (const struct block *block, char *name, int len)
{
struct symbol *sym =
obstack_alloc (&temp_parse_space, sizeof (struct symbol));
identifier). */
static struct type*
-write_var_or_type (struct block *block, struct stoken name0)
+write_var_or_type (const struct block *block, struct stoken name0)
{
int depth;
char *encoded_name;
struct type *);
static void replace_operator_with_call (struct expression **, int, int, int,
- struct symbol *, struct block *);
+ struct symbol *, const struct block *);
static int possible_user_operator_p (enum exp_opcode, struct value **);
const char **);
static struct symbol *find_old_style_renaming_symbol (const char *,
- struct block *);
+ const struct block *);
static struct type *ada_lookup_struct_elt_type (struct type *, char *,
int, int, int *);
static void
replace_operator_with_call (struct expression **expp, int pc, int nargs,
int oplen, struct symbol *sym,
- struct block *block)
+ const struct block *block)
{
/* A new expression, with 6 more elements (3 for funcall, 4 for function
symbol, -oplen for operator being replaced). */
static void
cache_symbol (const char *name, domain_enum namespace, struct symbol *sym,
- struct block *block)
+ const struct block *block)
{
}
\f
for (i = 0; i < nsyms; i += 1)
{
struct symbol *sym = syms[i].sym;
- struct block *block = syms[i].block;
+ const struct block *block = syms[i].block;
const char *name;
const char *suffix;
Return symbol if found, and NULL otherwise. */
struct symbol *
-ada_find_renaming_symbol (struct symbol *name_sym, struct block *block)
+ada_find_renaming_symbol (struct symbol *name_sym, const struct block *block)
{
const char *name = SYMBOL_LINKAGE_NAME (name_sym);
struct symbol *sym;
}
static struct symbol *
-find_old_style_renaming_symbol (const char *name, struct block *block)
+find_old_style_renaming_symbol (const char *name, const struct block *block)
{
const struct symbol *function_sym = block_linkage_function (block);
char *rename;
struct symbol *sym;
/* The block where the symbol was found. */
- struct block *block;
+ const struct block *block;
};
/* Denotes a type of renaming symbol (see ada_parse_renaming). */
extern LONGEST get_int_var_value (char *, int *);
extern struct symbol *ada_find_renaming_symbol (struct symbol *name_sym,
- struct block *block);
+ const struct block *block);
extern int ada_prefer_type (struct type *, struct type *);
volatile struct gdb_exception e;
struct breakpoint *b, *scope_breakpoint = NULL;
struct expression *exp;
- struct block *exp_valid_block = NULL, *cond_exp_valid_block = NULL;
+ const struct block *exp_valid_block = NULL, *cond_exp_valid_block = NULL;
struct value *val, *mark, *result;
struct frame_info *frame;
char *exp_start = NULL;
struct expression *exp;
/* The largest block within which it is valid, or NULL if it is
valid anywhere (e.g. consists just of global symbols). */
- struct block *exp_valid_block;
+ const struct block *exp_valid_block;
/* The conditional expression if any. */
struct expression *cond_exp;
/* The largest block within which it is valid, or NULL if it is
valid anywhere (e.g. consists just of global symbols). */
- struct block *cond_exp_valid_block;
+ const struct block *cond_exp_valid_block;
/* Value of the watchpoint the last time we checked it, or NULL when
we do not know the value yet or the value was not readable. VAL
is never lazy. */
in which lookups start; this can be NULL to mean the global
scope. */
static int
-classify_name (struct block *block)
+classify_name (const struct block *block)
{
struct symbol *sym;
char *copy;
in `yylval' is the first component of a name, false otherwise. */
static int
-classify_inner_name (struct block *block, int first_name)
+classify_inner_name (const struct block *block, int first_name)
{
struct type *type, *new_type;
char *copy;
case OP_VAR_VALUE:
{
- struct block *b;
+ const struct block *b;
(*pos) += 3;
b = exp->elts[pc + 1].block;
char string;
struct type *type;
struct internalvar *internalvar;
- struct block *block;
+ const struct block *block;
struct objfile *objfile;
};
extern struct type *parse_field_expression (char *, char **);
-extern struct expression *parse_exp_1 (char **, CORE_ADDR pc, struct block *,
- int);
+extern struct expression *parse_exp_1 (char **, CORE_ADDR pc,
+ const struct block *, int);
/* For use by parsers; set if we want to parse an expression and
attempt to complete a field name. */
/* The innermost context required by the stack and register variables
we've encountered so far. To use this, set it to NULL, then call
parse_<whatever>, then look at it. */
-extern struct block *innermost_block;
+extern const struct block *innermost_block;
/* From eval.c */
visible in lexical block BLOCK. */
struct type *
-lookup_struct (const char *name, struct block *block)
+lookup_struct (const char *name, const struct block *block)
{
struct symbol *sym;
visible in lexical block BLOCK. */
struct type *
-lookup_union (const char *name, struct block *block)
+lookup_union (const char *name, const struct block *block)
{
struct symbol *sym;
struct type *t;
visible in lexical block BLOCK. */
struct type *
-lookup_enum (const char *name, struct block *block)
+lookup_enum (const char *name, const struct block *block)
{
struct symbol *sym;
struct type *
lookup_template_type (char *name, struct type *type,
- struct block *block)
+ const struct block *block)
{
struct symbol *sym;
char *nam = (char *)
const struct block *, int);
extern struct type *lookup_template_type (char *, struct type *,
- struct block *);
+ const struct block *);
extern int get_vptr_fieldno (struct type *, struct type **);
to mean the global scope. */
static int
-package_name_p (const char *name, struct block *block)
+package_name_p (const char *name, const struct block *block)
{
struct symbol *sym;
int is_a_field_of_this;
The result is one of NAME, NAME_OR_INT, or TYPENAME. */
static int
-classify_packaged_name (struct block *block)
+classify_packaged_name (const struct block *block)
{
char *copy;
struct symbol *sym;
The result is one of NAME, NAME_OR_INT, or TYPENAME. */
static int
-classify_name (struct block *block)
+classify_name (const struct block *block)
{
struct type *type;
struct symbol *sym;
suitably defined. */
struct symbol *
-lookup_struct_typedef (char *name, struct block *block, int noerr)
+lookup_struct_typedef (char *name, const struct block *block, int noerr)
{
struct symbol *sym;
extern void add_msglist (struct stoken *str, int addcolon);
extern int end_msglist (void);
-struct symbol *lookup_struct_typedef (char *name, struct block *block,
+struct symbol *lookup_struct_typedef (char *name, const struct block *block,
int noerr);
#endif
struct expression *expout;
int expout_size;
int expout_ptr;
-struct block *expression_context_block;
+const struct block *expression_context_block;
CORE_ADDR expression_context_pc;
-struct block *innermost_block;
+const struct block *innermost_block;
int arglist_len;
static struct type_stack type_stack;
char *lexptr;
int);
static struct expression *parse_exp_in_context (char **, CORE_ADDR,
- struct block *, int,
+ const struct block *, int,
int, int *);
void _initialize_parse (void);
}
void
-write_exp_elt_block (struct block *b)
+write_exp_elt_block (const struct block *b)
{
union exp_element tmp;
If COMMA is nonzero, stop if a comma is reached. */
struct expression *
-parse_exp_1 (char **stringptr, CORE_ADDR pc, struct block *block, int comma)
+parse_exp_1 (char **stringptr, CORE_ADDR pc, const struct block *block,
+ int comma)
{
return parse_exp_in_context (stringptr, pc, block, comma, 0, NULL);
}
is left untouched. */
static struct expression *
-parse_exp_in_context (char **stringptr, CORE_ADDR pc, struct block *block,
+parse_exp_in_context (char **stringptr, CORE_ADDR pc, const struct block *block,
int comma, int void_context_p, int *out_subexp)
{
volatile struct gdb_exception except;
/* If this is nonzero, this block is used as the lexical context
for symbol names. */
-extern struct block *expression_context_block;
+extern const struct block *expression_context_block;
/* If expression_context_block is non-zero, then this is the PC within
the block that we want to evaluate expressions at. When debugging
/* The innermost context required by the stack and register variables
we've encountered so far. */
-extern struct block *innermost_block;
+extern const 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;
+extern const struct block *block_found;
/* Number of arguments seen so far in innermost function call. */
extern int arglist_len;
extern void write_exp_bitstring (struct stoken);
-extern void write_exp_elt_block (struct block *);
+extern void write_exp_elt_block (const struct block *);
extern void write_exp_elt_objfile (struct objfile *objfile);
struct program_space *pspace;
/* Innermost block required by this expression when evaluated. */
- struct block *block;
+ const struct block *block;
/* Status of this display (enabled or disabled). */
int enabled_p;
#include "macroscope.h"
#include "psymtab.h"
+#include "parser-defs.h"
/* Prototypes for local functions */
/* lookup a [struct, union, enum] by name, within a specified block. */
-extern struct type *lookup_struct (const char *, struct block *);
+extern struct type *lookup_struct (const char *, const struct block *);
-extern struct type *lookup_union (const char *, struct block *);
+extern struct type *lookup_union (const char *, const struct block *);
-extern struct type *lookup_enum (const char *, struct block *);
+extern struct type *lookup_enum (const char *, const struct block *);
/* from blockframe.c: */
}
struct value *
-address_of_variable (struct symbol *var, struct block *b)
+address_of_variable (struct symbol *var, const struct block *b)
{
struct type *type = SYMBOL_TYPE (var);
struct value *val;
extern struct value *value_of_variable (struct symbol *var,
const struct block *b);
-extern struct value *address_of_variable (struct symbol *var, struct block *b);
+extern struct value *address_of_variable (struct symbol *var,
+ const struct block *b);
extern struct value *value_of_register (int regnum, struct frame_info *frame);
struct expression *exp;
/* Block for which this expression is valid. */
- struct block *valid_block;
+ const struct block *valid_block;
/* The frame for this expression. This field is set iff valid_block is
not NULL. */