#include "demangle.h"
#include "complaints.h"
#include "cp-abi.h"
+#include "cp-support.h"
#include "gdb_assert.h"
#include "gdb_string.h"
{
/* This N_FUN marks the end of a function. This closes off
the current block. */
+ struct block *block;
if (context_stack_depth <= 0)
{
new = pop_context ();
/* Make a block for the local symbols within. */
- finish_block (new->name, &local_symbols, new->old_blocks,
- new->start_addr, new->start_addr + valu,
- objfile);
+ block = finish_block (new->name, &local_symbols, new->old_blocks,
+ new->start_addr, new->start_addr + valu,
+ objfile);
+
+ /* For C++, set the block's scope. */
+ if (SYMBOL_LANGUAGE (new->name) == language_cplus)
+ cp_set_block_scope (new->name, block, &objfile->objfile_obstack,
+ "", 0);
/* May be switching to an assembler file which may not be using
block relative stabs, so reset the offset. */
if (context_stack_depth > 0)
{
+ struct block *block;
+
new = pop_context ();
/* Make a block for the local symbols within. */
- finish_block (new->name, &local_symbols, new->old_blocks,
- new->start_addr, valu, objfile);
+ block = finish_block (new->name, &local_symbols,
+ new->old_blocks, new->start_addr,
+ valu, objfile);
+
+ /* For C++, set the block's scope. */
+ if (SYMBOL_LANGUAGE (new->name) == language_cplus)
+ cp_set_block_scope (new->name, block,
+ &objfile->objfile_obstack,
+ "", 0);
}
new = push_context (0, valu);