From 346d1dfebdbc5b7c8ce7d84f9250cbb8f4ec3e6c Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 10 Jun 2014 13:11:19 -0600 Subject: constify some blockvector APIs Generally, the blockvector ought to be readonly. So, this patch makes the blockvector const in the symtab, and also changes various blockvector APIs to be const. This patch has a couple of spots that cast away const. I consider these to be ok because they occur in mdebugread and are used while constructing the blockvector. I have added comments at these spots. 2014-06-18 Tom Tromey * symtab.h (struct symtab) : Now const. * ada-lang.c (ada_add_global_exceptions): Update. * buildsym.c (augment_type_symtab): Update. * dwarf2read.c (dw2_lookup_symbol): Update. * jit.c (finalize_symtab): Update. * jv-lang.c (add_class_symtab_symbol): Update. * mdebugread.c (parse_symbol, add_block, sort_blocks, new_symtab): Update. * objfiles.c (objfile_relocate1): Update. * psymtab.c (lookup_symbol_aux_psymtabs) (maintenance_check_psymtabs): Update. * python/py-symtab.c (stpy_global_block, stpy_static_block): Update. * spu-tdep.c (spu_catch_start): Update. * symmisc.c (dump_symtab_1): Update. * symtab.c (lookup_global_symbol_from_objfile) (lookup_symbol_aux_objfile, lookup_symbol_aux_quick) (basic_lookup_transparent_type_quick) (basic_lookup_transparent_type, find_pc_sect_symtab) (find_pc_sect_line, search_symbols): Update. * block.c (find_block_in_blockvector): Make "bl" const. (blockvector_for_pc_sect, blockvector_for_pc): Make return type const. (blockvector_contains_pc): Make "bv" const. (block_for_pc_sect): Update. * block.h (blockvector_for_pc, blockvector_for_pc_sect) (blockvector_contains_pc): Update. * breakpoint.c (resolve_sal_pc): Update. * inline-frame.c (block_starting_point_at): Update. --- gdb/spu-tdep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gdb/spu-tdep.c') diff --git a/gdb/spu-tdep.c b/gdb/spu-tdep.c index d251e4d..3980fe7 100644 --- a/gdb/spu-tdep.c +++ b/gdb/spu-tdep.c @@ -1985,7 +1985,7 @@ spu_catch_start (struct objfile *objfile) minsym.minsym)); if (symtab != NULL) { - struct blockvector *bv = BLOCKVECTOR (symtab); + const struct blockvector *bv = BLOCKVECTOR (symtab); struct block *block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK); struct symbol *sym; struct symtab_and_line sal; -- cgit v1.1