More block constification
I noticed that there are still many places referring to non-const blocks. This constifies all the remaining ones that I found that could be constified. In a few spots, this search found unused variables or fields. I removed these. I've also removed some unnecessary casts to "struct block *". gdb/ChangeLog 2019-03-24 Tom Tromey <tom@tromey.com> * c-exp.y (typebase): Remove casts. * gdbtypes.c (lookup_unsigned_typename, ) (lookup_signed_typename): Remove cast. * eval.c (parse_to_comma_and_eval): Remove cast. * parse.c (write_dollar_variable): Remove cast. * block.h (struct block) <superblock>: Now const. * symfile-debug.c (debug_qf_map_matching_symbols): Update. * psymtab.c (psym_map_matching_symbols): Make "block" const. (map_block): Make "block" const. * symfile.h (struct quick_symbol_functions) <map_matching_symbols>: Constify block argument to "callback". * symtab.c (basic_lookup_transparent_type_quick): Make "block" const. (find_pc_sect_compunit_symtab): Make "b" const. (find_symbol_at_address): Likewise. (search_symbols): Likewise. * dwarf2read.c (dw2_lookup_symbol): Make "block" const. (dw2_debug_names_lookup_symbol): Likewise. (dw2_map_matching_symbols): Update. * p-valprint.c (pascal_val_print): Remove "block". * ada-lang.c (ada_add_global_exceptions): Make "b" const. (aux_add_nonlocal_symbols): Make "block" const. (resolve_subexp): Remove cast. * linespec.c (iterate_over_all_matching_symtabs): Make "block" const. (iterate_over_file_blocks): Likewise. * f-exp.y (%union) <bval>: Remove. * coffread.c (patch_opaque_types): Make "b" const. * spu-tdep.c (spu_catch_start): Make "block" const. * c-valprint.c (print_unpacked_pointer): Remove "block". * symmisc.c (dump_symtab_1): Make "b" const. (block_depth): Make "block" const. * d-exp.y (%union) <bval>: Remove. * cp-support.h (cp_lookup_rtti_type): Update. * cp-support.c (cp_lookup_rtti_type): Make "block" const. * psymtab.c (psym_lookup_symbol): Make "block" const. (maintenance_check_psymtabs): Make "b" const. * python/py-framefilter.c (extract_sym): Make "sym_block" const. (enumerate_locals, enumerate_args): Update. * python/py-symtab.c (stpy_global_block): Make "block" const. (stpy_static_block): Likewise. * inline-frame.c (block_starting_point_at): Make "new_block" const. * block.c (find_block_in_blockvector): Make return type const. (blockvector_for_pc_sect): Make "b" const. (find_block_in_blockvector): Make "b" const.
This commit is contained in:
parent
258876ee34
commit
582942f456
26 changed files with 99 additions and 53 deletions
|
@ -1,3 +1,52 @@
|
||||||
|
2019-03-24 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
|
* c-exp.y (typebase): Remove casts.
|
||||||
|
* gdbtypes.c (lookup_unsigned_typename, )
|
||||||
|
(lookup_signed_typename): Remove cast.
|
||||||
|
* eval.c (parse_to_comma_and_eval): Remove cast.
|
||||||
|
* parse.c (write_dollar_variable): Remove cast.
|
||||||
|
* block.h (struct block) <superblock>: Now const.
|
||||||
|
* symfile-debug.c (debug_qf_map_matching_symbols): Update.
|
||||||
|
* psymtab.c (psym_map_matching_symbols): Make "block" const.
|
||||||
|
(map_block): Make "block" const.
|
||||||
|
* symfile.h (struct quick_symbol_functions)
|
||||||
|
<map_matching_symbols>: Constify block argument to "callback".
|
||||||
|
* symtab.c (basic_lookup_transparent_type_quick): Make "block"
|
||||||
|
const.
|
||||||
|
(find_pc_sect_compunit_symtab): Make "b" const.
|
||||||
|
(find_symbol_at_address): Likewise.
|
||||||
|
(search_symbols): Likewise.
|
||||||
|
* dwarf2read.c (dw2_lookup_symbol): Make "block" const.
|
||||||
|
(dw2_debug_names_lookup_symbol): Likewise.
|
||||||
|
(dw2_map_matching_symbols): Update.
|
||||||
|
* p-valprint.c (pascal_val_print): Remove "block".
|
||||||
|
* ada-lang.c (ada_add_global_exceptions): Make "b" const.
|
||||||
|
(aux_add_nonlocal_symbols): Make "block" const.
|
||||||
|
(resolve_subexp): Remove cast.
|
||||||
|
* linespec.c (iterate_over_all_matching_symtabs): Make "block"
|
||||||
|
const.
|
||||||
|
(iterate_over_file_blocks): Likewise.
|
||||||
|
* f-exp.y (%union) <bval>: Remove.
|
||||||
|
* coffread.c (patch_opaque_types): Make "b" const.
|
||||||
|
* spu-tdep.c (spu_catch_start): Make "block" const.
|
||||||
|
* c-valprint.c (print_unpacked_pointer): Remove "block".
|
||||||
|
* symmisc.c (dump_symtab_1): Make "b" const.
|
||||||
|
(block_depth): Make "block" const.
|
||||||
|
* d-exp.y (%union) <bval>: Remove.
|
||||||
|
* cp-support.h (cp_lookup_rtti_type): Update.
|
||||||
|
* cp-support.c (cp_lookup_rtti_type): Make "block" const.
|
||||||
|
* psymtab.c (psym_lookup_symbol): Make "block" const.
|
||||||
|
(maintenance_check_psymtabs): Make "b" const.
|
||||||
|
* python/py-framefilter.c (extract_sym): Make "sym_block" const.
|
||||||
|
(enumerate_locals, enumerate_args): Update.
|
||||||
|
* python/py-symtab.c (stpy_global_block): Make "block" const.
|
||||||
|
(stpy_static_block): Likewise.
|
||||||
|
* inline-frame.c (block_starting_point_at): Make "new_block"
|
||||||
|
const.
|
||||||
|
* block.c (find_block_in_blockvector): Make return type const.
|
||||||
|
(blockvector_for_pc_sect): Make "b" const.
|
||||||
|
(find_block_in_blockvector): Make "b" const.
|
||||||
|
|
||||||
2019-03-23 Tom Tromey <tom@tromey.com>
|
2019-03-23 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
* varobj.c (varobj_create): Update.
|
* varobj.c (varobj_create): Update.
|
||||||
|
|
|
@ -3562,7 +3562,7 @@ resolve_subexp (expression_up *expp, int *pos, int deprocedure_p,
|
||||||
|
|
||||||
n_candidates =
|
n_candidates =
|
||||||
ada_lookup_symbol_list (ada_decoded_op_name (op),
|
ada_lookup_symbol_list (ada_decoded_op_name (op),
|
||||||
(struct block *) NULL, VAR_DOMAIN,
|
NULL, VAR_DOMAIN,
|
||||||
&candidates);
|
&candidates);
|
||||||
|
|
||||||
i = ada_resolve_function (candidates.data (), n_candidates, argvec,
|
i = ada_resolve_function (candidates.data (), n_candidates, argvec,
|
||||||
|
@ -5416,7 +5416,8 @@ struct match_data
|
||||||
other has been found. */
|
other has been found. */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
aux_add_nonlocal_symbols (struct block *block, struct symbol *sym, void *data0)
|
aux_add_nonlocal_symbols (const struct block *block, struct symbol *sym,
|
||||||
|
void *data0)
|
||||||
{
|
{
|
||||||
struct match_data *data = (struct match_data *) data0;
|
struct match_data *data = (struct match_data *) data0;
|
||||||
|
|
||||||
|
@ -13560,7 +13561,7 @@ ada_add_global_exceptions (compiled_regex *preg,
|
||||||
|
|
||||||
for (i = GLOBAL_BLOCK; i <= STATIC_BLOCK; i++)
|
for (i = GLOBAL_BLOCK; i <= STATIC_BLOCK; i++)
|
||||||
{
|
{
|
||||||
struct block *b = BLOCKVECTOR_BLOCK (bv, i);
|
const struct block *b = BLOCKVECTOR_BLOCK (bv, i);
|
||||||
struct block_iterator iter;
|
struct block_iterator iter;
|
||||||
struct symbol *sym;
|
struct symbol *sym;
|
||||||
|
|
||||||
|
|
|
@ -131,16 +131,16 @@ block_inlined_p (const struct block *bl)
|
||||||
/* A helper function that checks whether PC is in the blockvector BL.
|
/* A helper function that checks whether PC is in the blockvector BL.
|
||||||
It returns the containing block if there is one, or else NULL. */
|
It returns the containing block if there is one, or else NULL. */
|
||||||
|
|
||||||
static struct block *
|
static const struct block *
|
||||||
find_block_in_blockvector (const struct blockvector *bl, CORE_ADDR pc)
|
find_block_in_blockvector (const struct blockvector *bl, CORE_ADDR pc)
|
||||||
{
|
{
|
||||||
struct block *b;
|
const struct block *b;
|
||||||
int bot, top, half;
|
int bot, top, half;
|
||||||
|
|
||||||
/* If we have an addrmap mapping code addresses to blocks, then use
|
/* If we have an addrmap mapping code addresses to blocks, then use
|
||||||
that. */
|
that. */
|
||||||
if (BLOCKVECTOR_MAP (bl))
|
if (BLOCKVECTOR_MAP (bl))
|
||||||
return (struct block *) addrmap_find (BLOCKVECTOR_MAP (bl), pc);
|
return (const struct block *) addrmap_find (BLOCKVECTOR_MAP (bl), pc);
|
||||||
|
|
||||||
/* Otherwise, use binary search to find the last block that starts
|
/* Otherwise, use binary search to find the last block that starts
|
||||||
before PC.
|
before PC.
|
||||||
|
@ -186,7 +186,7 @@ blockvector_for_pc_sect (CORE_ADDR pc, struct obj_section *section,
|
||||||
struct compunit_symtab *cust)
|
struct compunit_symtab *cust)
|
||||||
{
|
{
|
||||||
const struct blockvector *bl;
|
const struct blockvector *bl;
|
||||||
struct block *b;
|
const struct block *b;
|
||||||
|
|
||||||
if (cust == NULL)
|
if (cust == NULL)
|
||||||
{
|
{
|
||||||
|
|
|
@ -107,7 +107,7 @@ struct block
|
||||||
case of C) is the STATIC_BLOCK. The superblock of the
|
case of C) is the STATIC_BLOCK. The superblock of the
|
||||||
STATIC_BLOCK is the GLOBAL_BLOCK. */
|
STATIC_BLOCK is the GLOBAL_BLOCK. */
|
||||||
|
|
||||||
struct block *superblock;
|
const struct block *superblock;
|
||||||
|
|
||||||
/* This is used to store the symbols in the block. */
|
/* This is used to store the symbols in the block. */
|
||||||
|
|
||||||
|
|
|
@ -1391,13 +1391,13 @@ typebase
|
||||||
{ $$ = lookup_typename (parse_language (pstate),
|
{ $$ = lookup_typename (parse_language (pstate),
|
||||||
parse_gdbarch (pstate),
|
parse_gdbarch (pstate),
|
||||||
"double",
|
"double",
|
||||||
(struct block *) NULL,
|
NULL,
|
||||||
0); }
|
0); }
|
||||||
| LONG DOUBLE_KEYWORD
|
| LONG DOUBLE_KEYWORD
|
||||||
{ $$ = lookup_typename (parse_language (pstate),
|
{ $$ = lookup_typename (parse_language (pstate),
|
||||||
parse_gdbarch (pstate),
|
parse_gdbarch (pstate),
|
||||||
"long double",
|
"long double",
|
||||||
(struct block *) NULL,
|
NULL,
|
||||||
0); }
|
0); }
|
||||||
| STRUCT name
|
| STRUCT name
|
||||||
{ $$ = lookup_struct (copy_name ($2),
|
{ $$ = lookup_struct (copy_name ($2),
|
||||||
|
|
|
@ -197,7 +197,6 @@ print_unpacked_pointer (struct type *type, struct type *elttype,
|
||||||
struct value *vt_val;
|
struct value *vt_val;
|
||||||
struct symbol *wsym = NULL;
|
struct symbol *wsym = NULL;
|
||||||
struct type *wtype;
|
struct type *wtype;
|
||||||
struct block *block = NULL;
|
|
||||||
|
|
||||||
if (want_space)
|
if (want_space)
|
||||||
fputs_filtered (" ", stream);
|
fputs_filtered (" ", stream);
|
||||||
|
@ -206,7 +205,7 @@ print_unpacked_pointer (struct type *type, struct type *elttype,
|
||||||
{
|
{
|
||||||
const char *search_name
|
const char *search_name
|
||||||
= MSYMBOL_SEARCH_NAME (msymbol.minsym);
|
= MSYMBOL_SEARCH_NAME (msymbol.minsym);
|
||||||
wsym = lookup_symbol_search_name (search_name, block,
|
wsym = lookup_symbol_search_name (search_name, NULL,
|
||||||
VAR_DOMAIN).symbol;
|
VAR_DOMAIN).symbol;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1496,7 +1496,7 @@ patch_type (struct type *type, struct type *real_type)
|
||||||
static void
|
static void
|
||||||
patch_opaque_types (struct symtab *s)
|
patch_opaque_types (struct symtab *s)
|
||||||
{
|
{
|
||||||
struct block *b;
|
const struct block *b;
|
||||||
struct block_iterator iter;
|
struct block_iterator iter;
|
||||||
struct symbol *real_sym;
|
struct symbol *real_sym;
|
||||||
|
|
||||||
|
|
|
@ -1422,7 +1422,7 @@ add_symbol_overload_list_qualified (const char *func_name,
|
||||||
/* Lookup the rtti type for a class name. */
|
/* Lookup the rtti type for a class name. */
|
||||||
|
|
||||||
struct type *
|
struct type *
|
||||||
cp_lookup_rtti_type (const char *name, struct block *block)
|
cp_lookup_rtti_type (const char *name, const struct block *block)
|
||||||
{
|
{
|
||||||
struct symbol * rtti_sym;
|
struct symbol * rtti_sym;
|
||||||
struct type * rtti_type;
|
struct type * rtti_type;
|
||||||
|
|
|
@ -118,7 +118,7 @@ extern void add_symbol_overload_list_adl
|
||||||
std::vector<symbol *> *overload_list);
|
std::vector<symbol *> *overload_list);
|
||||||
|
|
||||||
extern struct type *cp_lookup_rtti_type (const char *name,
|
extern struct type *cp_lookup_rtti_type (const char *name,
|
||||||
struct block *block);
|
const struct block *block);
|
||||||
|
|
||||||
/* Produce an unsigned hash value from SEARCH_NAME that is compatible
|
/* Produce an unsigned hash value from SEARCH_NAME that is compatible
|
||||||
with cp_symbol_name_matches. Only the last component in
|
with cp_symbol_name_matches. Only the last component in
|
||||||
|
|
|
@ -97,7 +97,6 @@ static int type_aggregate_p (struct type *);
|
||||||
struct symtoken ssym;
|
struct symtoken ssym;
|
||||||
int ival;
|
int ival;
|
||||||
int voidval;
|
int voidval;
|
||||||
struct block *bval;
|
|
||||||
enum exp_opcode opcode;
|
enum exp_opcode opcode;
|
||||||
struct stoken_vector svec;
|
struct stoken_vector svec;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4082,7 +4082,7 @@ dw2_lookup_symbol (struct objfile *objfile, int block_index,
|
||||||
struct symbol *sym, *with_opaque = NULL;
|
struct symbol *sym, *with_opaque = NULL;
|
||||||
struct compunit_symtab *stab = dw2_instantiate_symtab (per_cu, false);
|
struct compunit_symtab *stab = dw2_instantiate_symtab (per_cu, false);
|
||||||
const struct blockvector *bv = COMPUNIT_BLOCKVECTOR (stab);
|
const struct blockvector *bv = COMPUNIT_BLOCKVECTOR (stab);
|
||||||
struct block *block = BLOCKVECTOR_BLOCK (bv, block_index);
|
const struct block *block = BLOCKVECTOR_BLOCK (bv, block_index);
|
||||||
|
|
||||||
sym = block_find_symbol (block, name, domain,
|
sym = block_find_symbol (block, name, domain,
|
||||||
block_find_non_opaque_type_preferred,
|
block_find_non_opaque_type_preferred,
|
||||||
|
@ -4227,7 +4227,7 @@ static void
|
||||||
dw2_map_matching_symbols (struct objfile *objfile,
|
dw2_map_matching_symbols (struct objfile *objfile,
|
||||||
const char * name, domain_enum domain,
|
const char * name, domain_enum domain,
|
||||||
int global,
|
int global,
|
||||||
int (*callback) (struct block *,
|
int (*callback) (const struct block *,
|
||||||
struct symbol *, void *),
|
struct symbol *, void *),
|
||||||
void *data, symbol_name_match_type match,
|
void *data, symbol_name_match_type match,
|
||||||
symbol_compare_ftype *ordered_compare)
|
symbol_compare_ftype *ordered_compare)
|
||||||
|
@ -6083,7 +6083,7 @@ dw2_debug_names_lookup_symbol (struct objfile *objfile, int block_index_int,
|
||||||
struct symbol *sym, *with_opaque = NULL;
|
struct symbol *sym, *with_opaque = NULL;
|
||||||
struct compunit_symtab *stab = dw2_instantiate_symtab (per_cu, false);
|
struct compunit_symtab *stab = dw2_instantiate_symtab (per_cu, false);
|
||||||
const struct blockvector *bv = COMPUNIT_BLOCKVECTOR (stab);
|
const struct blockvector *bv = COMPUNIT_BLOCKVECTOR (stab);
|
||||||
struct block *block = BLOCKVECTOR_BLOCK (bv, block_index);
|
const struct block *block = BLOCKVECTOR_BLOCK (bv, block_index);
|
||||||
|
|
||||||
sym = block_find_symbol (block, name, domain,
|
sym = block_find_symbol (block, name, domain,
|
||||||
block_find_non_opaque_type_preferred,
|
block_find_non_opaque_type_preferred,
|
||||||
|
|
|
@ -123,7 +123,7 @@ parse_and_eval (const char *exp)
|
||||||
struct value *
|
struct value *
|
||||||
parse_to_comma_and_eval (const char **expp)
|
parse_to_comma_and_eval (const char **expp)
|
||||||
{
|
{
|
||||||
expression_up expr = parse_exp_1 (expp, 0, (struct block *) 0, 1);
|
expression_up expr = parse_exp_1 (expp, 0, nullptr, 1);
|
||||||
|
|
||||||
return evaluate_expression (expr.get ());
|
return evaluate_expression (expr.get ());
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,7 +105,6 @@ static struct type *convert_to_kind_type (struct type *basetype, int kind);
|
||||||
struct ttype tsym;
|
struct ttype tsym;
|
||||||
struct symtoken ssym;
|
struct symtoken ssym;
|
||||||
int voidval;
|
int voidval;
|
||||||
struct block *bval;
|
|
||||||
enum exp_opcode opcode;
|
enum exp_opcode opcode;
|
||||||
struct internalvar *ivar;
|
struct internalvar *ivar;
|
||||||
|
|
||||||
|
|
|
@ -1528,7 +1528,7 @@ lookup_unsigned_typename (const struct language_defn *language,
|
||||||
|
|
||||||
strcpy (uns, "unsigned ");
|
strcpy (uns, "unsigned ");
|
||||||
strcpy (uns + 9, name);
|
strcpy (uns + 9, name);
|
||||||
return lookup_typename (language, gdbarch, uns, (struct block *) NULL, 0);
|
return lookup_typename (language, gdbarch, uns, NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct type *
|
struct type *
|
||||||
|
@ -1540,11 +1540,11 @@ lookup_signed_typename (const struct language_defn *language,
|
||||||
|
|
||||||
strcpy (uns, "signed ");
|
strcpy (uns, "signed ");
|
||||||
strcpy (uns + 7, name);
|
strcpy (uns + 7, name);
|
||||||
t = lookup_typename (language, gdbarch, uns, (struct block *) NULL, 1);
|
t = lookup_typename (language, gdbarch, uns, NULL, 1);
|
||||||
/* If we don't find "signed FOO" just try again with plain "FOO". */
|
/* If we don't find "signed FOO" just try again with plain "FOO". */
|
||||||
if (t != NULL)
|
if (t != NULL)
|
||||||
return t;
|
return t;
|
||||||
return lookup_typename (language, gdbarch, name, (struct block *) NULL, 0);
|
return lookup_typename (language, gdbarch, name, NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Lookup a structure type named "struct NAME",
|
/* Lookup a structure type named "struct NAME",
|
||||||
|
|
|
@ -266,13 +266,14 @@ static int
|
||||||
block_starting_point_at (CORE_ADDR pc, const struct block *block)
|
block_starting_point_at (CORE_ADDR pc, const struct block *block)
|
||||||
{
|
{
|
||||||
const struct blockvector *bv;
|
const struct blockvector *bv;
|
||||||
struct block *new_block;
|
const struct block *new_block;
|
||||||
|
|
||||||
bv = blockvector_for_pc (pc, NULL);
|
bv = blockvector_for_pc (pc, NULL);
|
||||||
if (BLOCKVECTOR_MAP (bv) == NULL)
|
if (BLOCKVECTOR_MAP (bv) == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
new_block = (struct block *) addrmap_find (BLOCKVECTOR_MAP (bv), pc - 1);
|
new_block = (const struct block *) addrmap_find (BLOCKVECTOR_MAP (bv),
|
||||||
|
pc - 1);
|
||||||
if (new_block == NULL)
|
if (new_block == NULL)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
|
|
@ -1159,7 +1159,7 @@ iterate_over_all_matching_symtabs
|
||||||
|
|
||||||
if (include_inline)
|
if (include_inline)
|
||||||
{
|
{
|
||||||
struct block *block;
|
const struct block *block;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = FIRST_LOCAL_BLOCK;
|
for (i = FIRST_LOCAL_BLOCK;
|
||||||
|
@ -1203,7 +1203,7 @@ iterate_over_file_blocks
|
||||||
(struct symtab *symtab, const lookup_name_info &name,
|
(struct symtab *symtab, const lookup_name_info &name,
|
||||||
domain_enum domain, gdb::function_view<symbol_found_callback_ftype> callback)
|
domain_enum domain, gdb::function_view<symbol_found_callback_ftype> callback)
|
||||||
{
|
{
|
||||||
struct block *block;
|
const struct block *block;
|
||||||
|
|
||||||
for (block = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (symtab), STATIC_BLOCK);
|
for (block = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (symtab), STATIC_BLOCK);
|
||||||
block != NULL;
|
block != NULL;
|
||||||
|
|
|
@ -248,7 +248,6 @@ pascal_val_print (struct type *type,
|
||||||
struct value *vt_val;
|
struct value *vt_val;
|
||||||
struct symbol *wsym = NULL;
|
struct symbol *wsym = NULL;
|
||||||
struct type *wtype;
|
struct type *wtype;
|
||||||
struct block *block = NULL;
|
|
||||||
|
|
||||||
if (want_space)
|
if (want_space)
|
||||||
fputs_filtered (" ", stream);
|
fputs_filtered (" ", stream);
|
||||||
|
@ -257,7 +256,7 @@ pascal_val_print (struct type *type,
|
||||||
{
|
{
|
||||||
const char *search_name
|
const char *search_name
|
||||||
= MSYMBOL_SEARCH_NAME (msymbol.minsym);
|
= MSYMBOL_SEARCH_NAME (msymbol.minsym);
|
||||||
wsym = lookup_symbol_search_name (search_name, block,
|
wsym = lookup_symbol_search_name (search_name, NULL,
|
||||||
VAR_DOMAIN).symbol;
|
VAR_DOMAIN).symbol;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -648,8 +648,7 @@ write_dollar_variable (struct parser_state *ps, struct stoken str)
|
||||||
/* On some systems, such as HP-UX and hppa-linux, certain system routines
|
/* On some systems, such as HP-UX and hppa-linux, certain system routines
|
||||||
have names beginning with $ or $$. Check for those, first. */
|
have names beginning with $ or $$. Check for those, first. */
|
||||||
|
|
||||||
sym = lookup_symbol (copy_name (str), (struct block *) NULL,
|
sym = lookup_symbol (copy_name (str), NULL, VAR_DOMAIN, NULL);
|
||||||
VAR_DOMAIN, NULL);
|
|
||||||
if (sym.symbol)
|
if (sym.symbol)
|
||||||
{
|
{
|
||||||
write_exp_elt_opcode (ps, OP_VAR_VALUE);
|
write_exp_elt_opcode (ps, OP_VAR_VALUE);
|
||||||
|
|
|
@ -498,7 +498,7 @@ psym_lookup_symbol (struct objfile *objfile,
|
||||||
partial symtab is empty, we can assume it won't here
|
partial symtab is empty, we can assume it won't here
|
||||||
because lookup_partial_symbol succeeded. */
|
because lookup_partial_symbol succeeded. */
|
||||||
const struct blockvector *bv = COMPUNIT_BLOCKVECTOR (stab);
|
const struct blockvector *bv = COMPUNIT_BLOCKVECTOR (stab);
|
||||||
struct block *block = BLOCKVECTOR_BLOCK (bv, block_index);
|
const struct block *block = BLOCKVECTOR_BLOCK (bv, block_index);
|
||||||
|
|
||||||
sym = block_find_symbol (block, name, domain,
|
sym = block_find_symbol (block, name, domain,
|
||||||
block_find_non_opaque_type_preferred,
|
block_find_non_opaque_type_preferred,
|
||||||
|
@ -1165,8 +1165,8 @@ psymtab_to_fullname (struct partial_symtab *ps)
|
||||||
|
|
||||||
static int
|
static int
|
||||||
map_block (const char *name, domain_enum domain, struct objfile *objfile,
|
map_block (const char *name, domain_enum domain, struct objfile *objfile,
|
||||||
struct block *block,
|
const struct block *block,
|
||||||
int (*callback) (struct block *, struct symbol *, void *),
|
int (*callback) (const struct block *, struct symbol *, void *),
|
||||||
void *data, symbol_name_match_type match)
|
void *data, symbol_name_match_type match)
|
||||||
{
|
{
|
||||||
struct block_iterator iter;
|
struct block_iterator iter;
|
||||||
|
@ -1196,7 +1196,7 @@ static void
|
||||||
psym_map_matching_symbols (struct objfile *objfile,
|
psym_map_matching_symbols (struct objfile *objfile,
|
||||||
const char *name, domain_enum domain,
|
const char *name, domain_enum domain,
|
||||||
int global,
|
int global,
|
||||||
int (*callback) (struct block *,
|
int (*callback) (const struct block *,
|
||||||
struct symbol *, void *),
|
struct symbol *, void *),
|
||||||
void *data,
|
void *data,
|
||||||
symbol_name_match_type match,
|
symbol_name_match_type match,
|
||||||
|
@ -1212,7 +1212,7 @@ psym_map_matching_symbols (struct objfile *objfile,
|
||||||
ordered_compare))
|
ordered_compare))
|
||||||
{
|
{
|
||||||
struct compunit_symtab *cust = psymtab_to_symtab (objfile, ps);
|
struct compunit_symtab *cust = psymtab_to_symtab (objfile, ps);
|
||||||
struct block *block;
|
const struct block *block;
|
||||||
|
|
||||||
if (cust == NULL)
|
if (cust == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
@ -2095,7 +2095,7 @@ maintenance_check_psymtabs (const char *ignore, int from_tty)
|
||||||
struct symbol *sym;
|
struct symbol *sym;
|
||||||
struct compunit_symtab *cust = NULL;
|
struct compunit_symtab *cust = NULL;
|
||||||
const struct blockvector *bv;
|
const struct blockvector *bv;
|
||||||
struct block *b;
|
const struct block *b;
|
||||||
int length;
|
int length;
|
||||||
|
|
||||||
for (objfile *objfile : current_program_space->objfiles ())
|
for (objfile *objfile : current_program_space->objfiles ())
|
||||||
|
|
|
@ -54,7 +54,7 @@ enum mi_print_types
|
||||||
|
|
||||||
static enum ext_lang_bt_status
|
static enum ext_lang_bt_status
|
||||||
extract_sym (PyObject *obj, gdb::unique_xmalloc_ptr<char> *name,
|
extract_sym (PyObject *obj, gdb::unique_xmalloc_ptr<char> *name,
|
||||||
struct symbol **sym, struct block **sym_block,
|
struct symbol **sym, const struct block **sym_block,
|
||||||
const struct language_defn **language)
|
const struct language_defn **language)
|
||||||
{
|
{
|
||||||
gdbpy_ref<> result (PyObject_CallMethod (obj, "symbol", NULL));
|
gdbpy_ref<> result (PyObject_CallMethod (obj, "symbol", NULL));
|
||||||
|
@ -449,7 +449,7 @@ enumerate_args (PyObject *iter,
|
||||||
const struct language_defn *language;
|
const struct language_defn *language;
|
||||||
gdb::unique_xmalloc_ptr<char> sym_name;
|
gdb::unique_xmalloc_ptr<char> sym_name;
|
||||||
struct symbol *sym;
|
struct symbol *sym;
|
||||||
struct block *sym_block;
|
const struct block *sym_block;
|
||||||
struct value *val;
|
struct value *val;
|
||||||
enum ext_lang_bt_status success = EXT_LANG_BT_ERROR;
|
enum ext_lang_bt_status success = EXT_LANG_BT_ERROR;
|
||||||
|
|
||||||
|
@ -567,7 +567,7 @@ enumerate_locals (PyObject *iter,
|
||||||
struct value *val;
|
struct value *val;
|
||||||
enum ext_lang_bt_status success = EXT_LANG_BT_ERROR;
|
enum ext_lang_bt_status success = EXT_LANG_BT_ERROR;
|
||||||
struct symbol *sym;
|
struct symbol *sym;
|
||||||
struct block *sym_block;
|
const struct block *sym_block;
|
||||||
int local_indent = 8 + (8 * indent);
|
int local_indent = 8 + (8 * indent);
|
||||||
gdb::optional<ui_out_emit_tuple> tuple;
|
gdb::optional<ui_out_emit_tuple> tuple;
|
||||||
|
|
||||||
|
|
|
@ -176,7 +176,7 @@ static PyObject *
|
||||||
stpy_global_block (PyObject *self, PyObject *args)
|
stpy_global_block (PyObject *self, PyObject *args)
|
||||||
{
|
{
|
||||||
struct symtab *symtab = NULL;
|
struct symtab *symtab = NULL;
|
||||||
struct block *block = NULL;
|
const struct block *block = NULL;
|
||||||
const struct blockvector *blockvector;
|
const struct blockvector *blockvector;
|
||||||
|
|
||||||
STPY_REQUIRE_VALID (self, symtab);
|
STPY_REQUIRE_VALID (self, symtab);
|
||||||
|
@ -192,7 +192,7 @@ static PyObject *
|
||||||
stpy_static_block (PyObject *self, PyObject *args)
|
stpy_static_block (PyObject *self, PyObject *args)
|
||||||
{
|
{
|
||||||
struct symtab *symtab = NULL;
|
struct symtab *symtab = NULL;
|
||||||
struct block *block = NULL;
|
const struct block *block = NULL;
|
||||||
const struct blockvector *blockvector;
|
const struct blockvector *blockvector;
|
||||||
|
|
||||||
STPY_REQUIRE_VALID (self, symtab);
|
STPY_REQUIRE_VALID (self, symtab);
|
||||||
|
|
|
@ -1963,7 +1963,7 @@ spu_catch_start (struct objfile *objfile)
|
||||||
if (cust != NULL)
|
if (cust != NULL)
|
||||||
{
|
{
|
||||||
const struct blockvector *bv = COMPUNIT_BLOCKVECTOR (cust);
|
const struct blockvector *bv = COMPUNIT_BLOCKVECTOR (cust);
|
||||||
struct block *block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
|
const struct block *block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
|
||||||
struct symbol *sym;
|
struct symbol *sym;
|
||||||
struct symtab_and_line sal;
|
struct symtab_and_line sal;
|
||||||
|
|
||||||
|
|
|
@ -240,7 +240,7 @@ static void
|
||||||
debug_qf_map_matching_symbols (struct objfile *objfile,
|
debug_qf_map_matching_symbols (struct objfile *objfile,
|
||||||
const char *name, domain_enum domain,
|
const char *name, domain_enum domain,
|
||||||
int global,
|
int global,
|
||||||
int (*callback) (struct block *,
|
int (*callback) (const struct block *,
|
||||||
struct symbol *, void *),
|
struct symbol *, void *),
|
||||||
void *data,
|
void *data,
|
||||||
symbol_name_match_type match,
|
symbol_name_match_type match,
|
||||||
|
|
|
@ -227,7 +227,7 @@ struct quick_symbol_functions
|
||||||
void (*map_matching_symbols) (struct objfile *,
|
void (*map_matching_symbols) (struct objfile *,
|
||||||
const char *name, domain_enum domain,
|
const char *name, domain_enum domain,
|
||||||
int global,
|
int global,
|
||||||
int (*callback) (struct block *,
|
int (*callback) (const struct block *,
|
||||||
struct symbol *, void *),
|
struct symbol *, void *),
|
||||||
void *data,
|
void *data,
|
||||||
symbol_name_match_type match,
|
symbol_name_match_type match,
|
||||||
|
|
|
@ -52,7 +52,7 @@ FILE *std_err;
|
||||||
|
|
||||||
/* Prototypes for local functions */
|
/* Prototypes for local functions */
|
||||||
|
|
||||||
static int block_depth (struct block *);
|
static int block_depth (const struct block *);
|
||||||
|
|
||||||
static void print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
|
static void print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
|
||||||
int depth, ui_file *outfile);
|
int depth, ui_file *outfile);
|
||||||
|
@ -278,7 +278,7 @@ dump_symtab_1 (struct symtab *symtab, struct ui_file *outfile)
|
||||||
struct linetable *l;
|
struct linetable *l;
|
||||||
const struct blockvector *bv;
|
const struct blockvector *bv;
|
||||||
struct symbol *sym;
|
struct symbol *sym;
|
||||||
struct block *b;
|
const struct block *b;
|
||||||
int depth;
|
int depth;
|
||||||
|
|
||||||
fprintf_filtered (outfile, "\nSymtab for file %s\n",
|
fprintf_filtered (outfile, "\nSymtab for file %s\n",
|
||||||
|
@ -950,7 +950,7 @@ maintenance_expand_symtabs (const char *args, int from_tty)
|
||||||
/* Return the nexting depth of a block within other blocks in its symtab. */
|
/* Return the nexting depth of a block within other blocks in its symtab. */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
block_depth (struct block *block)
|
block_depth (const struct block *block)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
|
|
|
@ -2752,7 +2752,7 @@ basic_lookup_transparent_type_quick (struct objfile *objfile, int block_index,
|
||||||
{
|
{
|
||||||
struct compunit_symtab *cust;
|
struct compunit_symtab *cust;
|
||||||
const struct blockvector *bv;
|
const struct blockvector *bv;
|
||||||
struct block *block;
|
const struct block *block;
|
||||||
struct symbol *sym;
|
struct symbol *sym;
|
||||||
|
|
||||||
if (!objfile->sf)
|
if (!objfile->sf)
|
||||||
|
@ -2922,7 +2922,7 @@ find_pc_sect_compunit_symtab (CORE_ADDR pc, struct obj_section *section)
|
||||||
{
|
{
|
||||||
for (compunit_symtab *cust : obj_file->compunits ())
|
for (compunit_symtab *cust : obj_file->compunits ())
|
||||||
{
|
{
|
||||||
struct block *b;
|
const struct block *b;
|
||||||
const struct blockvector *bv;
|
const struct blockvector *bv;
|
||||||
|
|
||||||
bv = COMPUNIT_BLOCKVECTOR (cust);
|
bv = COMPUNIT_BLOCKVECTOR (cust);
|
||||||
|
@ -3026,7 +3026,7 @@ find_symbol_at_address (CORE_ADDR address)
|
||||||
|
|
||||||
for (int i = GLOBAL_BLOCK; i <= STATIC_BLOCK; ++i)
|
for (int i = GLOBAL_BLOCK; i <= STATIC_BLOCK; ++i)
|
||||||
{
|
{
|
||||||
struct block *b = BLOCKVECTOR_BLOCK (bv, i);
|
const struct block *b = BLOCKVECTOR_BLOCK (bv, i);
|
||||||
struct block_iterator iter;
|
struct block_iterator iter;
|
||||||
struct symbol *sym;
|
struct symbol *sym;
|
||||||
|
|
||||||
|
@ -4357,7 +4357,7 @@ search_symbols (const char *regexp, enum search_domain kind,
|
||||||
int nfiles, const char *files[])
|
int nfiles, const char *files[])
|
||||||
{
|
{
|
||||||
const struct blockvector *bv;
|
const struct blockvector *bv;
|
||||||
struct block *b;
|
const struct block *b;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
struct block_iterator iter;
|
struct block_iterator iter;
|
||||||
struct symbol *sym;
|
struct symbol *sym;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue