binutils/gas/riscv: Add DWARF register numbers for CSRs
[deliverable/binutils-gdb.git] / gdb / block.c
index 366141c0333c7393c3835cf17f679bcc845d55a1..a4592e36e658c65f565efed4850cb1c6c9ba550d 100644 (file)
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-
-/* Local non-gdb includes.  */
-#include "addrmap.h"
 #include "block.h"
-#include "cp-support.h"
+#include "symtab.h"
+#include "symfile.h"
 #include "gdb_obstack.h"
+#include "cp-support.h"
+#include "addrmap.h"
 #include "gdbtypes.h"
 #include "objfiles.h"
-#include "symfile.h"
-#include "symtab.h"
 
 /* This is used by struct block to store namespace-related info for
    C++ files, namely using declarations and the current namespace in
@@ -67,29 +65,28 @@ block_gdbarch (const struct block *block)
   return get_objfile_arch (block_objfile (block));
 }
 
-/* Return Nonzero if block a is lexically nested within block b,
-   or if a and b have the same pc range.
-   Return zero otherwise.  */
+/* See block.h.  */
 
-int
-contained_in (const struct block *a, const struct block *b)
+bool
+contained_in (const struct block *a, const struct block *b,
+             bool allow_nested)
 {
   if (!a || !b)
-    return 0;
+    return false;
 
   do
     {
       if (a == b)
-       return 1;
+       return true;
       /* If A is a function block, then A cannot be contained in B,
          except if A was inlined.  */
-      if (BLOCK_FUNCTION (a) != NULL && !block_inlined_p (a))
-        return 0;
+      if (!allow_nested && BLOCK_FUNCTION (a) != NULL && !block_inlined_p (a))
+        return false;
       a = BLOCK_SUPERBLOCK (a);
     }
   while (a != NULL);
 
-  return 0;
+  return false;
 }
 
 
@@ -245,7 +242,7 @@ call_site_for_pc (struct gdbarch *gdbarch, CORE_ADDR pc)
                     "DW_TAG_call_site %s in %s"),
                   paddress (gdbarch, pc),
                   (msym.minsym == NULL ? "???"
-                   : MSYMBOL_PRINT_NAME (msym.minsym)));
+                   : msym.minsym->print_name ()));
     }
 
   return (struct call_site *) *slot;
@@ -346,7 +343,7 @@ block_set_using (struct block *block,
 }
 
 /* If BLOCK_NAMESPACE (block) is NULL, allocate it via OBSTACK and
-   ititialize its members to zero.  */
+   initialize its members to zero.  */
 
 static void
 block_initialize_namespace (struct block *block, struct obstack *obstack)
This page took 0.024669 seconds and 4 git commands to generate.