constify struct block in some places
This makes some spots in gdb, particularly general_symbol_info, use a "const struct block", then fixes the fallout. The justification is that, ordinarily, blocks ought to be readonly. Note though that we can't add "const" in the blockvector due to block relocation. This can be done once blocks are made independent of the program space. 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.
This commit is contained in:
parent
5d376983ca
commit
3977b71f1d
32 changed files with 133 additions and 75 deletions
|
@ -1,3 +1,60 @@
|
|||
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.
|
||||
|
|
|
@ -110,7 +110,7 @@
|
|||
struct name_info {
|
||||
struct symbol *sym;
|
||||
struct minimal_symbol *msym;
|
||||
struct block *block;
|
||||
const struct block *block;
|
||||
struct stoken stoken;
|
||||
};
|
||||
|
||||
|
@ -145,7 +145,7 @@ static void write_name_assoc (struct parser_state *, struct 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);
|
||||
|
||||
|
@ -185,7 +185,7 @@ static struct type *type_system_address (struct parser_state *);
|
|||
} typed_val_float;
|
||||
struct type *tval;
|
||||
struct stoken sval;
|
||||
struct block *bval;
|
||||
const struct block *bval;
|
||||
struct internalvar *ivar;
|
||||
}
|
||||
|
||||
|
@ -1010,8 +1010,8 @@ write_object_renaming (struct parser_state *par_state,
|
|||
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;
|
||||
|
|
|
@ -4168,7 +4168,7 @@ parse_old_style_renaming (struct type *type,
|
|||
|
||||
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;
|
||||
|
@ -6133,7 +6133,7 @@ ada_make_symbol_completion_list (const char *text0, const char *word,
|
|||
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);
|
||||
|
@ -12758,7 +12758,7 @@ static void
|
|||
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)
|
||||
{
|
||||
|
@ -13444,7 +13444,7 @@ ada_get_symbol_name_cmp (const char *lookup_name)
|
|||
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
|
||||
|
|
|
@ -93,7 +93,7 @@
|
|||
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;
|
||||
|
|
|
@ -2188,7 +2188,7 @@ gen_expr (struct expression *exp, union exp_element **pc,
|
|||
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);
|
||||
|
|
10
gdb/block.c
10
gdb/block.c
|
@ -157,7 +157,7 @@ find_block_in_blockvector (struct blockvector *bl, CORE_ADDR pc)
|
|||
|
||||
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;
|
||||
|
@ -228,7 +228,7 @@ call_site_for_pc (struct gdbarch *gdbarch, CORE_ADDR pc)
|
|||
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);
|
||||
|
@ -237,11 +237,11 @@ blockvector_for_pc (CORE_ADDR pc, struct block **pblock)
|
|||
/* 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)
|
||||
|
@ -252,7 +252,7 @@ block_for_pc_sect (CORE_ADDR pc, struct obj_section *section)
|
|||
/* 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));
|
||||
|
|
|
@ -145,11 +145,12 @@ extern int block_inlined_p (const struct block *block);
|
|||
|
||||
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);
|
||||
|
@ -157,9 +158,9 @@ 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);
|
||||
|
||||
|
|
|
@ -52,11 +52,11 @@
|
|||
--- 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))
|
||||
|
@ -86,7 +86,7 @@ get_frame_block (struct frame_info *frame, CORE_ADDR *addr_in_block)
|
|||
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);
|
||||
|
@ -118,7 +118,7 @@ get_pc_function_start (CORE_ADDR 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;
|
||||
|
@ -136,7 +136,7 @@ get_frame_function (struct frame_info *frame)
|
|||
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;
|
||||
|
@ -338,7 +338,7 @@ block_innermost_frame (const struct block *block)
|
|||
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;
|
||||
|
||||
|
|
|
@ -10105,7 +10105,7 @@ resolve_sal_pc (struct symtab_and_line *sal)
|
|||
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);
|
||||
|
|
|
@ -158,7 +158,7 @@ static int type_aggregate_p (struct type *);
|
|||
struct ttype tsym;
|
||||
struct symtoken ssym;
|
||||
int voidval;
|
||||
struct block *bval;
|
||||
const struct block *bval;
|
||||
enum exp_opcode opcode;
|
||||
|
||||
struct stoken_vector svec;
|
||||
|
|
|
@ -277,7 +277,7 @@ dwarf2_find_location_expression (struct dwarf2_loclist_baton *baton,
|
|||
/* 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)
|
||||
|
@ -353,7 +353,7 @@ dwarf_expr_frame_base (void *baton, const gdb_byte **start, size_t * length)
|
|||
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."));
|
||||
|
@ -3087,7 +3087,7 @@ dwarf2_compile_expr_to_ax (struct agent_expr *expr, struct axs_value *loc,
|
|||
{
|
||||
const gdb_byte *datastart;
|
||||
size_t datalen;
|
||||
struct block *b;
|
||||
const struct block *b;
|
||||
struct symbol *framefunc;
|
||||
|
||||
b = block_for_pc (expr->scope);
|
||||
|
@ -3542,7 +3542,7 @@ locexpr_describe_location_piece (struct symbol *symbol, struct ui_file *stream,
|
|||
}
|
||||
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;
|
||||
|
|
|
@ -411,7 +411,7 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_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;
|
||||
|
@ -472,7 +472,7 @@ static void
|
|||
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
|
||||
|
|
|
@ -699,7 +699,7 @@ frame_id_inner (struct gdbarch *gdbarch, struct frame_id l, struct frame_id r)
|
|||
&& 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);
|
||||
|
||||
|
|
|
@ -665,8 +665,8 @@ extern void *frame_obstack_zalloc (unsigned long size);
|
|||
/* 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.
|
||||
|
@ -694,7 +694,7 @@ extern struct block *get_frame_block (struct frame_info *,
|
|||
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 *);
|
||||
|
||||
|
|
|
@ -674,7 +674,7 @@ static SCM
|
|||
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;
|
||||
|
|
|
@ -576,7 +576,7 @@ static SCM
|
|||
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;
|
||||
|
||||
|
|
|
@ -5620,7 +5620,7 @@ insert_longjmp_resume_breakpoint (struct gdbarch *gdbarch, CORE_ADDR pc)
|
|||
|
||||
static void
|
||||
insert_exception_resume_breakpoint (struct thread_info *tp,
|
||||
struct block *b,
|
||||
const struct block *b,
|
||||
struct frame_info *frame,
|
||||
struct symbol *sym)
|
||||
{
|
||||
|
@ -5717,7 +5717,7 @@ check_exception_resume (struct execution_control_state *ecs,
|
|||
|
||||
TRY_CATCH (e, RETURN_MASK_ERROR)
|
||||
{
|
||||
struct block *b;
|
||||
const struct block *b;
|
||||
struct block_iterator iter;
|
||||
struct symbol *sym;
|
||||
int argno = 0;
|
||||
|
|
|
@ -209,7 +209,7 @@ inline_frame_sniffer (const struct frame_unwind *self,
|
|||
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);
|
||||
|
@ -274,7 +274,7 @@ const struct frame_unwind inline_frame_unwind = {
|
|||
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;
|
||||
|
@ -304,7 +304,7 @@ void
|
|||
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;
|
||||
|
|
|
@ -1058,10 +1058,10 @@ iterate_over_all_matching_symtabs (struct linespec_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
|
||||
|
@ -1897,7 +1897,7 @@ create_sals_line_offset (struct linespec_state *self,
|
|||
{
|
||||
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;
|
||||
|
@ -1925,7 +1925,7 @@ create_sals_line_offset (struct linespec_state *self,
|
|||
|
||||
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)
|
||||
|
@ -3214,7 +3214,7 @@ find_label_symbols (struct linespec_state *self,
|
|||
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;
|
||||
|
|
|
@ -143,7 +143,7 @@ static int number_sign = 1;
|
|||
struct type *tval;
|
||||
struct stoken sval;
|
||||
int voidval;
|
||||
struct block *bval;
|
||||
const struct block *bval;
|
||||
enum exp_opcode opcode;
|
||||
struct internalvar *ivar;
|
||||
|
||||
|
|
|
@ -248,8 +248,8 @@ static struct blockvector *new_bvect (int);
|
|||
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 *);
|
||||
|
||||
|
@ -1928,7 +1928,7 @@ parse_procedure (PDR *pr, struct symtab *search_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". */
|
||||
|
@ -4570,7 +4570,7 @@ cross_ref (int fd, union aux_ext *ax, struct type **tpp,
|
|||
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;
|
||||
|
|
|
@ -559,7 +559,7 @@ static void
|
|||
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;
|
||||
|
|
|
@ -154,7 +154,7 @@ static char *uptok (const char *, int);
|
|||
struct ttype tsym;
|
||||
struct symtoken ssym;
|
||||
int voidval;
|
||||
struct block *bval;
|
||||
const struct block *bval;
|
||||
enum exp_opcode opcode;
|
||||
struct internalvar *ivar;
|
||||
|
||||
|
|
|
@ -371,7 +371,7 @@ PyObject *
|
|||
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;
|
||||
|
|
|
@ -242,7 +242,7 @@ static PyObject *
|
|||
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)
|
||||
|
|
12
gdb/stack.c
12
gdb/stack.c
|
@ -538,7 +538,7 @@ print_frame_args (struct symbol *func, struct frame_info *frame,
|
|||
|
||||
if (func)
|
||||
{
|
||||
struct block *b = SYMBOL_BLOCK_VALUE (func);
|
||||
const struct block *b = SYMBOL_BLOCK_VALUE (func);
|
||||
struct block_iterator iter;
|
||||
struct symbol *sym;
|
||||
|
||||
|
@ -1928,7 +1928,7 @@ backtrace_full_command (char *arg, int from_tty)
|
|||
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)
|
||||
{
|
||||
|
@ -2011,7 +2011,7 @@ print_block_frame_labels (struct gdbarch *gdbarch, struct block *b,
|
|||
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)
|
||||
{
|
||||
|
@ -2073,7 +2073,7 @@ print_frame_local_vars (struct frame_info *frame, int num_tabs,
|
|||
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))
|
||||
|
@ -2118,7 +2118,7 @@ locals_info (char *args, int from_tty)
|
|||
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)
|
||||
{
|
||||
|
@ -2221,7 +2221,7 @@ select_and_print_frame (struct frame_info *frame)
|
|||
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 ())
|
||||
|
|
|
@ -29,11 +29,11 @@ typedef void (*iterate_over_block_arg_local_vars_cb) (const char *print_name,
|
|||
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);
|
||||
|
||||
|
|
|
@ -2877,7 +2877,7 @@ skip_prologue_sal (struct symtab_and_line *sal)
|
|||
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. */
|
||||
|
@ -4313,7 +4313,7 @@ default_make_symbol_completion_list_break_on (const char *text,
|
|||
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. */
|
||||
|
@ -4923,7 +4923,7 @@ skip_prologue_using_sal (struct gdbarch *gdbarch, CORE_ADDR func_addr)
|
|||
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);
|
||||
|
|
|
@ -114,7 +114,7 @@ struct general_symbol_info
|
|||
{
|
||||
LONGEST ivalue;
|
||||
|
||||
struct block *block;
|
||||
const struct block *block;
|
||||
|
||||
const gdb_byte *bytes;
|
||||
|
||||
|
|
|
@ -1155,7 +1155,7 @@ add_local_symbols (struct collection_list *collect,
|
|||
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;
|
||||
|
@ -2705,7 +2705,7 @@ scope_info (char *args, int from_tty)
|
|||
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;
|
||||
|
|
|
@ -3712,7 +3712,7 @@ struct value *
|
|||
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)
|
||||
|
|
|
@ -299,7 +299,7 @@ varobj_create (char *objname,
|
|||
{
|
||||
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;
|
||||
|
|
Loading…
Reference in a new issue