X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Flinespec.c;h=8a2c8e35ed19460ddd0cb4a51c079c578856ae36;hb=014f9477f4bdb04ca3accad0a7c986c2dff90e1f;hp=e8bc695c20bba76b822d4c814fd9fdbb9ebce0de;hpb=e617b0692b15848fe5c91eb4810cc670d34ae628;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/linespec.c b/gdb/linespec.c index e8bc695c20..8a2c8e35ed 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -1,6 +1,6 @@ /* Parser for linespec for the GNU debugger, GDB. - Copyright (C) 1986-2013 Free Software Foundation, Inc. + Copyright (C) 1986-2014 Free Software Foundation, Inc. This file is part of GDB. @@ -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 @@ -1665,6 +1665,10 @@ linespec_parse_basic (linespec_parser *parser) discard_cleanups (cleanup); return; } + + /* The convenience variable/history value parsed correctly. + NAME is no longer needed. */ + do_cleanups (cleanup); } else { @@ -1893,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; @@ -1921,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) @@ -3210,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; @@ -3417,9 +3421,9 @@ minsym_found (struct linespec_state *self, struct objfile *objfile, CORE_ADDR pc; struct symtab_and_line sal; - sal = find_pc_sect_line (SYMBOL_VALUE_ADDRESS (msymbol), + sal = find_pc_sect_line (MSYMBOL_VALUE_ADDRESS (objfile, msymbol), (struct obj_section *) 0, 0); - sal.section = SYMBOL_OBJ_SECTION (objfile, msymbol); + sal.section = MSYMBOL_OBJ_SECTION (objfile, msymbol); /* The minimal symbol might point to a function descriptor; resolve it to the actual code address instead. */ @@ -3431,7 +3435,7 @@ minsym_found (struct linespec_state *self, struct objfile *objfile, skip_prologue_sal (&sal); if (maybe_add_address (self->addr_set, objfile->pspace, sal.pc)) - add_sal_to_sals (self, result, &sal, SYMBOL_NATURAL_NAME (msymbol), 0); + add_sal_to_sals (self, result, &sal, MSYMBOL_NATURAL_NAME (msymbol), 0); } /* A helper struct to pass some data through @@ -3498,6 +3502,9 @@ add_minsym (struct minimal_symbol *minsym, void *d) struct collect_minsyms *info = d; bound_minimal_symbol_d mo; + mo.minsym = minsym; + mo.objfile = info->objfile; + /* Exclude data symbols when looking for breakpoint locations. */ if (!info->list_mode) switch (minsym->type) @@ -3513,16 +3520,14 @@ add_minsym (struct minimal_symbol *minsym, void *d) before we decide to discard it. */ struct gdbarch *gdbarch = get_objfile_arch (info->objfile); CORE_ADDR addr = gdbarch_convert_from_func_ptr_addr - (gdbarch, SYMBOL_VALUE_ADDRESS (minsym), + (gdbarch, BMSYMBOL_VALUE_ADDRESS (mo), ¤t_target); - if (addr == SYMBOL_VALUE_ADDRESS (minsym)) + if (addr == BMSYMBOL_VALUE_ADDRESS (mo)) return; } } - mo.minsym = minsym; - mo.objfile = info->objfile; VEC_safe_push (bound_minimal_symbol_d, info->msyms, &mo); }