Add block::function_block
[binutils-gdb.git] / gdb / block.h
index 9fccbe02b9902aa923d186626d06144a6c3f8cd6..a29298517b0cd1216659f65234f5429fb48f9fe7 100644 (file)
@@ -273,6 +273,12 @@ struct block : public allocate_on_obstack
   bool is_global_block () const
   { return superblock () == nullptr; }
 
+  /* Return the function block for this block.  Returns nullptr if
+     there is no enclosing function, i.e., if this block is a static
+     or global block.  */
+
+  const struct block *function_block () const;
+
   /* Set the compunit of this block, which must be a global block.  */
 
   void set_compunit_symtab (struct compunit_symtab *);