PR symtab/17559
[deliverable/binutils-gdb.git] / gdb / linespec.c
index 70495c6d3a785844c82fd95475c81adb73c38dad..53257021f3cf14132c888821a2d107b56f091f11 100644 (file)
@@ -33,7 +33,6 @@
 #include "block.h"
 #include "objc-lang.h"
 #include "linespec.h"
-#include "exceptions.h"
 #include "language.h"
 #include "interps.h"
 #include "mi/mi-cmds.h"
@@ -1058,10 +1057,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 +1664,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 +1896,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 +1924,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 +3213,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,7 +3420,7 @@ minsym_found (struct linespec_state *self, struct objfile *objfile,
   CORE_ADDR pc;
   struct symtab_and_line sal;
 
-  sal = find_pc_sect_line (MSYMBOL_VALUE_ADDRESS (msymbol),
+  sal = find_pc_sect_line (MSYMBOL_VALUE_ADDRESS (objfile, msymbol),
                           (struct obj_section *) 0, 0);
   sal.section = MSYMBOL_OBJ_SECTION (objfile, msymbol);
 
@@ -3498,6 +3501,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 +3519,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, MSYMBOL_VALUE_ADDRESS (minsym),
+                              (gdbarch, BMSYMBOL_VALUE_ADDRESS (mo),
                                &current_target);
 
-           if (addr == MSYMBOL_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);
 }
 
This page took 0.028717 seconds and 4 git commands to generate.