Implement Ada operator overloading
[deliverable/binutils-gdb.git] / gdb / block.c
index 46c24ec96d510d01231be932ac8c9fd0288d701d..4cb9573139601482ade1023e72bf13178342e08f 100644 (file)
@@ -1,6 +1,6 @@
 /* Block-related functions for the GNU debugger, GDB.
 
-   Copyright (C) 2003-2020 Free Software Foundation, Inc.
+   Copyright (C) 2003-2021 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -62,7 +62,7 @@ block_gdbarch (const struct block *block)
   if (BLOCK_FUNCTION (block) != NULL)
     return symbol_arch (BLOCK_FUNCTION (block));
 
-  return get_objfile_arch (block_objfile (block));
+  return block_objfile (block)->arch ();
 }
 
 /* See block.h.  */
@@ -79,9 +79,9 @@ contained_in (const struct block *a, const struct block *b,
       if (a == b)
        return true;
       /* If A is a function block, then A cannot be contained in B,
-         except if A was inlined.  */
+        except if A was inlined.  */
       if (!allow_nested && BLOCK_FUNCTION (a) != NULL && !block_inlined_p (a))
-        return false;
+       return false;
       a = BLOCK_SUPERBLOCK (a);
     }
   while (a != NULL);
@@ -166,6 +166,8 @@ find_block_in_blockvector (const struct blockvector *bl, CORE_ADDR pc)
   while (bot >= STATIC_BLOCK)
     {
       b = BLOCKVECTOR_BLOCK (bl, bot);
+      if (!(BLOCK_START (b) <= pc))
+       return NULL;
       if (BLOCK_END (b) > pc)
        return b;
       bot--;
@@ -657,19 +659,18 @@ block_iter_match_next (const lookup_name_info &name,
   return block_iter_match_step (iterator, name, 0);
 }
 
-/* Return true if symbol A is the best match possible for DOMAIN.  */
+/* See block.h.  */
 
-static bool
+bool
 best_symbol (struct symbol *a, const domain_enum domain)
 {
   return (SYMBOL_DOMAIN (a) == domain
          && SYMBOL_CLASS (a) != LOC_UNRESOLVED);
 }
 
-/* Return symbol B if it is a better match than symbol A for DOMAIN.
-   Otherwise return A.  */
+/* See block.h.  */
 
-static struct symbol *
+struct symbol *
 better_symbol (struct symbol *a, struct symbol *b, const domain_enum domain)
 {
   if (a == NULL)
@@ -878,14 +879,14 @@ block_find_non_opaque_type_preferred (struct symbol *sym, void *data)
 
 struct blockranges *
 make_blockranges (struct objfile *objfile,
-                  const std::vector<blockrange> &rangevec)
+                 const std::vector<blockrange> &rangevec)
 {
   struct blockranges *blr;
   size_t n = rangevec.size();
 
   blr = (struct blockranges *)
     obstack_alloc (&objfile->objfile_obstack,
-                   sizeof (struct blockranges)
+                  sizeof (struct blockranges)
                   + (n - 1) * sizeof (struct blockrange));
 
   blr->nranges = n;
This page took 0.025307 seconds and 4 git commands to generate.