+2014-06-18 Tom Tromey <tromey@redhat.com>
+
+ * varobj.c (varobj_create): Update.
+ * valops.c (value_of_this): Update.
+ * tracepoint.c (add_local_symbols, scope_info): Update.
+ * symtab.h (struct general_symbol_info) <block>: Now const.
+ * symtab.c (skip_prologue_sal)
+ (default_make_symbol_completion_list_break_on)
+ (skip_prologue_using_sal): Update.
+ * stack.h (iterate_over_block_locals)
+ (iterate_over_block_local_vars): Update.
+ * stack.c (print_frame_args): Update.
+ (iterate_over_block_locals, iterate_over_block_local_vars): Make
+ parameter const.
+ (get_selected_block): Make return type const.
+ * python/py-frame.c (frapy_block): Update.
+ * python/py-block.c (gdbpy_block_for_pc): Update.
+ * p-exp.y (%union) <bval>: Now const.
+ * mi/mi-cmd-stack.c (list_args_or_locals): Update.
+ * mdebugread.c (mylookup_symbol, parse_procedure): Update.
+ * m2-exp.y (%union) <bval>: Now const.
+ * linespec.c (get_current_search_block): Make return type const.
+ (create_sals_line_offset, find_label_symbols): Update.
+ * inline-frame.c (inline_frame_sniffer, skip_inline_frames):
+ Update.
+ (block_starting_point_at): Make "block" const.
+ * infrun.c (insert_exception_resume_breakpoint): Make "b" const.
+ (check_exception_resume): Update.
+ * guile/scm-frame.c (gdbscm_frame_block): Update.
+ * guile/scm-block.c (gdbscm_lookup_block): Update.
+ * frame.h (get_frame_block): Update.
+ (get_selected_block): Make return type const.
+ * frame.c (frame_id_inner): Update.
+ * f-valprint.c (info_common_command_for_block)
+ (info_common_command): Update.
+ * dwarf2loc.c (dwarf2_find_location_expression)
+ (dwarf_expr_frame_base, dwarf2_compile_expr_to_ax)
+ (locexpr_describe_location_piece): Update.
+ * c-exp.y (%union) <bval>: Now const.
+ * breakpoint.c (resolve_sal_pc): Update.
+ * blockframe.c (get_frame_block):Make return type const.
+ (get_pc_function_start, get_frame_function, find_pc_sect_function)
+ (block_innermost_frame): Update.
+ * block.h (blockvector_for_pc, blockvector_for_pc_sect)
+ (block_for_pc, block_for_pc_sect): Update.
+ * block.c (blockvector_for_pc_sect, blockvector_for_pc): Make
+ 'pblock' const.
+ (block_for_pc_sect, block_for_pc): Make return type const.
+ * ax-gdb.c (gen_expr): Update.
+ * alpha-mdebug-tdep.c (find_proc_desc): Update.
+ * ada-lang.c (ada_read_renaming_var_value): Make 'block' const.
+ (ada_make_symbol_completion_list, ada_add_exceptions_from_frame)
+ (ada_read_var_value): Update.
+ * ada-exp.y (struct name_info) <block>: Now const.
+ (%union): Likewise.
+ (block_lookup): Constify.
+
2014-06-18 Gary Benson <gbenson@redhat.com>
* nat/i386-dregs.h: New file.
struct name_info {
struct symbol *sym;
struct minimal_symbol *msym;
- struct block *block;
+ const struct block *block;
struct stoken stoken;
};
static void write_exp_op_with_string (struct parser_state *, enum exp_opcode,
struct stoken);
-static struct block *block_lookup (struct block *, const char *);
+static const struct block *block_lookup (const struct block *, const char *);
static LONGEST convert_char_literal (struct type *, LONGEST);
} typed_val_float;
struct type *tval;
struct stoken sval;
- struct block *bval;
+ const struct block *bval;
struct internalvar *ivar;
}
error (_("Internal error in encoding of renaming declaration"));
}
-static struct block*
-block_lookup (struct block *context, const char *raw_name)
+static const struct block*
+block_lookup (const struct block *context, const char *raw_name)
{
const char *name;
struct ada_symbol_info *syms;
static struct value *
ada_read_renaming_var_value (struct symbol *renaming_sym,
- struct block *block)
+ const struct block *block)
{
const char *sym_name;
struct expression *expr;
struct symtab *s;
struct minimal_symbol *msymbol;
struct objfile *objfile;
- struct block *b, *surrounding_static_block = 0;
+ const struct block *b, *surrounding_static_block = 0;
int i;
struct block_iterator iter;
struct cleanup *old_chain = make_cleanup (null_cleanup, NULL);
ada_add_exceptions_from_frame (regex_t *preg, struct frame_info *frame,
VEC(ada_exc_info) **exceptions)
{
- struct block *block = get_frame_block (frame, 0);
+ const struct block *block = get_frame_block (frame, 0);
while (block != 0)
{
static struct value *
ada_read_var_value (struct symbol *var, struct frame_info *frame)
{
- struct block *frame_block = NULL;
+ const struct block *frame_block = NULL;
struct symbol *renaming_sym = NULL;
/* The only case where default_read_var_value is not sufficient
static struct mdebug_extra_func_info *
find_proc_desc (CORE_ADDR pc)
{
- struct block *b = block_for_pc (pc);
+ const struct block *b = block_for_pc (pc);
struct mdebug_extra_func_info *proc_desc = NULL;
struct symbol *sym = NULL;
const char *sh_name = NULL;
case OP_THIS:
{
struct symbol *sym, *func;
- struct block *b;
+ const struct block *b;
const struct language_defn *lang;
b = block_for_pc (ax->scope);
struct blockvector *
blockvector_for_pc_sect (CORE_ADDR pc, struct obj_section *section,
- struct block **pblock, struct symtab *symtab)
+ const struct block **pblock, struct symtab *symtab)
{
struct blockvector *bl;
struct block *b;
Backward compatibility, no section. */
struct blockvector *
-blockvector_for_pc (CORE_ADDR pc, struct block **pblock)
+blockvector_for_pc (CORE_ADDR pc, const struct block **pblock)
{
return blockvector_for_pc_sect (pc, find_pc_mapped_section (pc),
pblock, NULL);
/* Return the innermost lexical block containing the specified pc value
in the specified section, or 0 if there is none. */
-struct block *
+const struct block *
block_for_pc_sect (CORE_ADDR pc, struct obj_section *section)
{
struct blockvector *bl;
- struct block *b;
+ const struct block *b;
bl = blockvector_for_pc_sect (pc, section, &b, NULL);
if (bl)
/* Return the innermost lexical block containing the specified pc value,
or 0 if there is none. Backward compatibility, no section. */
-struct block *
+const struct block *
block_for_pc (CORE_ADDR pc)
{
return block_for_pc_sect (pc, find_pc_mapped_section (pc));
extern int contained_in (const struct block *, const struct block *);
-extern struct blockvector *blockvector_for_pc (CORE_ADDR, struct block **);
+extern struct blockvector *blockvector_for_pc (CORE_ADDR,
+ const struct block **);
extern struct blockvector *blockvector_for_pc_sect (CORE_ADDR,
struct obj_section *,
- struct block **,
+ const struct block **,
struct symtab *);
extern int blockvector_contains_pc (struct blockvector *bv, CORE_ADDR pc);
extern struct call_site *call_site_for_pc (struct gdbarch *gdbarch,
CORE_ADDR pc);
-extern struct block *block_for_pc (CORE_ADDR);
+extern const struct block *block_for_pc (CORE_ADDR);
-extern struct block *block_for_pc_sect (CORE_ADDR, struct obj_section *);
+extern const struct block *block_for_pc_sect (CORE_ADDR, struct obj_section *);
extern const char *block_scope (const struct block *block);
--- hopefully pointing us at the call instruction, or its delay
slot instruction. */
-struct block *
+const struct block *
get_frame_block (struct frame_info *frame, CORE_ADDR *addr_in_block)
{
CORE_ADDR pc;
- struct block *bl;
+ const struct block *bl;
int inline_count;
if (!get_frame_address_in_block_if_available (frame, &pc))
CORE_ADDR
get_pc_function_start (CORE_ADDR pc)
{
- struct block *bl;
+ const struct block *bl;
struct bound_minimal_symbol msymbol;
bl = block_for_pc (pc);
struct symbol *
get_frame_function (struct frame_info *frame)
{
- struct block *bl = get_frame_block (frame, 0);
+ const struct block *bl = get_frame_block (frame, 0);
if (bl == NULL)
return NULL;
struct symbol *
find_pc_sect_function (CORE_ADDR pc, struct obj_section *section)
{
- struct block *b = block_for_pc_sect (pc, section);
+ const struct block *b = block_for_pc_sect (pc, section);
if (b == 0)
return 0;
frame = get_current_frame ();
while (frame != NULL)
{
- struct block *frame_block = get_frame_block (frame, NULL);
+ const struct block *frame_block = get_frame_block (frame, NULL);
if (frame_block != NULL && contained_in (frame_block, block))
return frame;
if (sal->section == 0 && sal->symtab != NULL)
{
struct blockvector *bv;
- struct block *b;
+ const struct block *b;
struct symbol *sym;
bv = blockvector_for_pc_sect (sal->pc, 0, &b, sal->symtab);
struct ttype tsym;
struct symtoken ssym;
int voidval;
- struct block *bval;
+ const struct block *bval;
enum exp_opcode opcode;
struct stoken_vector svec;
/* This is entry PC record present only at entry point
of a function. Verify it is really the function entry point. */
- struct block *pc_block = block_for_pc (pc);
+ const struct block *pc_block = block_for_pc (pc);
struct symbol *pc_func = NULL;
if (pc_block)
this_base method. */
struct symbol *framefunc;
struct dwarf_expr_baton *debaton = (struct dwarf_expr_baton *) baton;
- struct block *bl = get_frame_block (debaton->frame, NULL);
+ const struct block *bl = get_frame_block (debaton->frame, NULL);
if (bl == NULL)
error (_("frame address is not available."));
{
const gdb_byte *datastart;
size_t datalen;
- struct block *b;
+ const struct block *b;
struct symbol *framefunc;
b = block_for_pc (expr->scope);
}
else if (data[0] == DW_OP_fbreg)
{
- struct block *b;
+ const struct block *b;
struct symbol *framefunc;
int frame_reg = 0;
int64_t frame_offset;
}
static void
-info_common_command_for_block (struct block *block, const char *comname,
+info_common_command_for_block (const struct block *block, const char *comname,
int *any_printed)
{
struct block_iterator iter;
info_common_command (char *comname, int from_tty)
{
struct frame_info *fi;
- struct block *block;
+ const struct block *block;
int values_printed = 0;
/* We have been told to display the contents of F77 COMMON
&& l.special_addr == r.special_addr)
{
/* Same function, different inlined functions. */
- struct block *lb, *rb;
+ const struct block *lb, *rb;
gdb_assert (l.code_addr_p && r.code_addr_p);
/* Create a regcache, and copy the frame's registers into it. */
struct regcache *frame_save_as_regcache (struct frame_info *this_frame);
-extern struct block *get_frame_block (struct frame_info *,
- CORE_ADDR *addr_in_block);
+extern const struct block *get_frame_block (struct frame_info *,
+ CORE_ADDR *addr_in_block);
/* Return the `struct block' that belongs to the selected thread's
selected frame. If the inferior has no state, return NULL.
it occurs in the CLI code and makes it possible for commands to
work, even when the inferior has no state. */
-extern struct block *get_selected_block (CORE_ADDR *addr_in_block);
+extern const struct block *get_selected_block (CORE_ADDR *addr_in_block);
extern struct symbol *get_frame_function (struct frame_info *);
gdbscm_lookup_block (SCM pc_scm)
{
CORE_ADDR pc;
- struct block *block = NULL;
+ const struct block *block = NULL;
struct obj_section *section = NULL;
struct symtab *symtab = NULL;
volatile struct gdb_exception except;
gdbscm_frame_block (SCM self)
{
frame_smob *f_smob;
- struct block *block = NULL, *fn_block;
+ const struct block *block = NULL, *fn_block;
struct frame_info *frame = NULL;
volatile struct gdb_exception except;
static void
insert_exception_resume_breakpoint (struct thread_info *tp,
- struct block *b,
+ const struct block *b,
struct frame_info *frame,
struct symbol *sym)
{
TRY_CATCH (e, RETURN_MASK_ERROR)
{
- struct block *b;
+ const struct block *b;
struct block_iterator iter;
struct symbol *sym;
int argno = 0;
void **this_cache)
{
CORE_ADDR this_pc;
- struct block *frame_block, *cur_block;
+ const struct block *frame_block, *cur_block;
int depth;
struct frame_info *next_frame;
struct inline_state *state = find_inline_frame_state (inferior_ptid);
before it). */
static int
-block_starting_point_at (CORE_ADDR pc, struct block *block)
+block_starting_point_at (CORE_ADDR pc, const struct block *block)
{
struct blockvector *bv;
struct block *new_block;
skip_inline_frames (ptid_t ptid)
{
CORE_ADDR this_pc;
- struct block *frame_block, *cur_block;
+ const struct block *frame_block, *cur_block;
struct symbol *last_sym = NULL;
int skip_count = 0;
struct inline_state *state;
/* Returns the block to be used for symbol searches from
the current location. */
-static struct block *
+static const struct block *
get_current_search_block (void)
{
- struct block *block;
+ const struct block *block;
enum language save_language;
/* get_selected_block can change the current language when there is
{
struct linetable_entry *best_entry = NULL;
int *filter;
- struct block **blocks;
+ const struct block **blocks;
struct cleanup *cleanup;
struct symtabs_and_lines intermediate_results;
int i, j;
filter = XNEWVEC (int, intermediate_results.nelts);
make_cleanup (xfree, filter);
- blocks = XNEWVEC (struct block *, intermediate_results.nelts);
+ blocks = XNEWVEC (const struct block *, intermediate_results.nelts);
make_cleanup (xfree, blocks);
for (i = 0; i < intermediate_results.nelts; ++i)
VEC (symbolp) **label_funcs_ret, const char *name)
{
int ix;
- struct block *block;
+ const struct block *block;
struct symbol *sym;
struct symbol *fn_sym;
VEC (symbolp) *result = NULL;
struct type *tval;
struct stoken sval;
int voidval;
- struct block *bval;
+ const struct block *bval;
enum exp_opcode opcode;
struct internalvar *ivar;
static struct type *parse_type (int, union aux_ext *, unsigned int, int *,
int, char *);
-static struct symbol *mylookup_symbol (char *, struct block *, domain_enum,
- enum address_class);
+static struct symbol *mylookup_symbol (char *, const struct block *,
+ domain_enum, enum address_class);
static void sort_blocks (struct symtab *);
struct partial_symtab *pst)
{
struct symbol *s, *i;
- struct block *b;
+ const struct block *b;
char *sh_name;
/* Simple rule to find files linked "-x". */
keeping the symtab sorted. */
static struct symbol *
-mylookup_symbol (char *name, struct block *block,
+mylookup_symbol (char *name, const struct block *block,
domain_enum domain, enum address_class class)
{
struct block_iterator iter;
list_args_or_locals (enum what_to_list what, enum print_values values,
struct frame_info *fi, int skip_unavailable)
{
- struct block *block;
+ const struct block *block;
struct symbol *sym;
struct block_iterator iter;
struct cleanup *cleanup_list;
struct ttype tsym;
struct symtoken ssym;
int voidval;
- struct block *bval;
+ const struct block *bval;
enum exp_opcode opcode;
struct internalvar *ivar;
gdbpy_block_for_pc (PyObject *self, PyObject *args)
{
gdb_py_ulongest pc;
- struct block *block = NULL;
+ const struct block *block = NULL;
struct obj_section *section = NULL;
struct symtab *symtab = NULL;
volatile struct gdb_exception except;
frapy_block (PyObject *self, PyObject *args)
{
struct frame_info *frame;
- struct block *block = NULL, *fn_block;
+ const struct block *block = NULL, *fn_block;
volatile struct gdb_exception except;
TRY_CATCH (except, RETURN_MASK_ALL)
if (func)
{
- struct block *b = SYMBOL_BLOCK_VALUE (func);
+ const struct block *b = SYMBOL_BLOCK_VALUE (func);
struct block_iterator iter;
struct symbol *sym;
CB_DATA. */
static void
-iterate_over_block_locals (struct block *b,
+iterate_over_block_locals (const struct block *b,
iterate_over_block_arg_local_vars_cb cb,
void *cb_data)
{
superblocks, stopping when the top-level block is reached. */
void
-iterate_over_block_local_vars (struct block *block,
+iterate_over_block_local_vars (const struct block *block,
iterate_over_block_arg_local_vars_cb cb,
void *cb_data)
{
struct ui_file *stream)
{
struct print_variable_and_value_data cb_data;
- struct block *block;
+ const struct block *block;
CORE_ADDR pc;
if (!get_frame_pc_if_available (frame, &pc))
Returns 1 if any argument was walked; 0 otherwise. */
void
-iterate_over_block_arg_vars (struct block *b,
+iterate_over_block_arg_vars (const struct block *b,
iterate_over_block_arg_local_vars_cb cb,
void *cb_data)
{
code address within the block returned. We use this to decide
which macros are in scope. */
-struct block *
+const struct block *
get_selected_block (CORE_ADDR *addr_in_block)
{
if (!has_stack_frames ())
struct symbol *sym,
void *cb_data);
-void iterate_over_block_arg_vars (struct block *block,
+void iterate_over_block_arg_vars (const struct block *block,
iterate_over_block_arg_local_vars_cb cb,
void *cb_data);
-void iterate_over_block_local_vars (struct block *block,
+void iterate_over_block_local_vars (const struct block *block,
iterate_over_block_arg_local_vars_cb cb,
void *cb_data);
const char *name;
struct objfile *objfile;
struct gdbarch *gdbarch;
- struct block *b, *function_block;
+ const struct block *b, *function_block;
int force_skip, skip;
/* Do not change the SAL if PC was specified explicitly. */
struct symtab *s;
struct minimal_symbol *msymbol;
struct objfile *objfile;
- struct block *b;
+ const struct block *b;
const struct block *surrounding_static_block, *surrounding_global_block;
struct block_iterator iter;
/* The symbol we are completing on. Points in same buffer as text. */
struct symtab_and_line prologue_sal;
CORE_ADDR start_pc;
CORE_ADDR end_pc;
- struct block *bl;
+ const struct block *bl;
/* Get an initial range for the function. */
find_pc_partial_function (func_addr, NULL, &start_pc, &end_pc);
{
LONGEST ivalue;
- struct block *block;
+ const struct block *block;
const gdb_byte *bytes;
long frame_regno, long frame_offset, int type,
int trace_string)
{
- struct block *block;
+ const struct block *block;
struct add_local_symbols_data cb_data;
cb_data.collect = collect;
struct symtabs_and_lines sals;
struct symbol *sym;
struct bound_minimal_symbol msym;
- struct block *block;
+ const struct block *block;
const char *symname;
char *save_args = args;
struct block_iterator iter;
value_of_this (const struct language_defn *lang)
{
struct symbol *sym;
- struct block *b;
+ const struct block *b;
struct frame_info *frame;
if (!lang->la_name_of_this)
{
struct frame_info *fi;
struct frame_id old_id = null_frame_id;
- struct block *block;
+ const struct block *block;
const char *p;
struct value *value = NULL;
volatile struct gdb_exception except;