Don't print symbol on address 0x0
[deliverable/binutils-gdb.git] / gdb / block.h
index 2eec346b392391ace4825c3993426af83089d89c..0e5d0bed68b2126d8bc982a8731327f8188bb26a 100644 (file)
@@ -1,6 +1,6 @@
 /* Code dealing with blocks for GDB.
 
-   Copyright (C) 2003, 2007-2012 Free Software Foundation, Inc.
+   Copyright (C) 2003-2014 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -99,6 +99,21 @@ struct block
   language_specific;
 };
 
+/* The global block is singled out so that we can provide a back-link
+   to the primary symtab.  */
+
+struct global_block
+{
+  /* The block.  */
+
+  struct block block;
+
+  /* This holds a pointer to the primary symtab holding this
+     block.  */
+
+  struct symtab *symtab;
+};
+
 #define BLOCK_START(bl)                (bl)->startaddr
 #define BLOCK_END(bl)          (bl)->endaddr
 #define BLOCK_FUNCTION(bl)     (bl)->function
@@ -130,19 +145,22 @@ extern int block_inlined_p (const struct block *block);
 
 extern int contained_in (const struct block *, const struct block *);
 
-extern struct blockvector *blockvector_for_pc (CORE_ADDR, struct block **);
+extern const struct blockvector *blockvector_for_pc (CORE_ADDR,
+                                              const struct block **);
 
-extern struct blockvector *blockvector_for_pc_sect (CORE_ADDR, 
-                                                   struct obj_section *,
-                                                   struct block **,
-                                                    struct symtab *);
+extern const struct blockvector *blockvector_for_pc_sect (CORE_ADDR, 
+                                                         struct obj_section *,
+                                                         const struct block **,
+                                                         struct symtab *);
+
+extern int blockvector_contains_pc (const struct blockvector *bv, CORE_ADDR pc);
 
 extern struct call_site *call_site_for_pc (struct gdbarch *gdbarch,
                                           CORE_ADDR pc);
 
-extern struct block *block_for_pc (CORE_ADDR);
+extern const struct block *block_for_pc (CORE_ADDR);
 
-extern struct block *block_for_pc_sect (CORE_ADDR, struct obj_section *);
+extern const struct block *block_for_pc_sect (CORE_ADDR, struct obj_section *);
 
 extern const char *block_scope (const struct block *block);
 
@@ -161,6 +179,9 @@ extern const struct block *block_global_block (const struct block *block);
 
 extern struct block *allocate_block (struct obstack *obstack);
 
+extern struct block *allocate_global_block (struct obstack *obstack);
+
+extern void set_block_symtab (struct block *, struct symtab *);
 
 /* A block iterator.  This structure should be treated as though it
    were opaque; it is only defined here because we want to support
@@ -168,6 +189,28 @@ extern struct block *allocate_block (struct obstack *obstack);
 
 struct block_iterator
 {
+  /* If we're iterating over a single block, this holds the block.
+     Otherwise, it holds the canonical symtab.  */
+
+  union
+  {
+    struct symtab *symtab;
+    const struct block *block;
+  } d;
+
+  /* If we're iterating over a single block, this is always -1.
+     Otherwise, it holds the index of the current "included" symtab in
+     the canonical symtab (that is, d.symtab->includes[idx]), with -1
+     meaning the canonical symtab itself.  */
+
+  int idx;
+
+  /* Which block, either static or global, to iterate over.  If this
+     is FIRST_LOCAL_BLOCK, then we are iterating over a single block.
+     This is used to select which field of 'd' is in use.  */
+
+  enum block_enum which;
+
   /* The underlying dictionary iterator.  */
 
   struct dict_iterator dict_iter;
This page took 0.025756 seconds and 4 git commands to generate.