aboutsummaryrefslogtreecommitdiff
path: root/gdb/block.h
diff options
context:
space:
mode:
authorDavid Carlton <carlton@bactrian.org>2003-04-15 23:07:11 +0000
committerDavid Carlton <carlton@bactrian.org>2003-04-15 23:07:11 +0000
commit9219021cb5bab1206e80f84c2b4b7d8eac7eb4ea (patch)
tree24d969246b096eaff5c7caf64ab2425bcd2dbfbc /gdb/block.h
parentff773b85a456d2a737126fc2d752579091fd2933 (diff)
downloadfsf-binutils-gdb-9219021cb5bab1206e80f84c2b4b7d8eac7eb4ea.zip
fsf-binutils-gdb-9219021cb5bab1206e80f84c2b4b7d8eac7eb4ea.tar.gz
fsf-binutils-gdb-9219021cb5bab1206e80f84c2b4b7d8eac7eb4ea.tar.bz2
2003-04-15 David Carlton <carlton@math.stanford.edu>
* Makefile.in (SFILES): Add cp-namespace.c. (COMMON_OBS): Add cp-namespace.o. (block.o): Depend on gdb_obstack_h and cp_support_h. (buildsym.o): Depend on cp_support_h. (cp-namespace.o): New. (cp-support.o): Depend on gdb_string_h, demangle_h, gdb_assert_h, gdb_obstack_h, symtab_h, symfile_h, and gdbcmd_h. (dwarf2read.o): Depend on cp_support_h. * jv-lang.c (get_java_class_symtab): Set BLOCK_NAMESPACE. * dwarf2read.c (process_die): Set processing_has_namespace_info, processing_current_namespace. (read_namespace): Update processing_current_namespace; check for anonymous namespaces. (dwarf2_name): New function. (dwarf2_extension): Ditto. * cp-support.h: Update copyright, contributors. Add inclusion guards. Add opaque declaration for structs obstack, block, symbol. (struct using_direct): New struct. Add declarations for cp_find_first_component, cp_entire_prefix_len, processing_has_namespace_info, processing_current_namespace, cp_is_anonymous, cp_add_using_directive, cp_initialize_namespace, cp_finalize_namespace, cp_set_block_scope, cp_scan_for_anonymous_namespaces. * cp-namespace.c: New file. * cp-support.c: Update copyright. Include ctype.h, gdb_assert.h, gdbcmd.h. New variable maint_cplus_cmd_list. (cp_find_first_component): New function. (cp_entire_prefix_len, maint_cplus_command) (first_component_command, _initialize_cp_support): Ditto. * buildsym.c: Include cp-support.h. New variable using_list. (add_symbol_to_list): Check for anonymous namespaces. (finish_block): Set block's scope. (start_symtab): Initialize C++ namespace support. (end_symtab): Finalize C++ namespace support. * block.h: Add opaque declarations for structs block_namespace_info, using_direct, and obstack. Add declarations for block_set_scope and block_set_using. (struct block): Add 'language_specific' member. (BLOCK_NAMESPACE): New macro. * block.c: Include gdb_obstack.h and cp-support.h. (struct block_namespace_info): New struct. (block_set_scope): New function. (block_set_using, block_initialize_namespace): Ditto. 2003-04-15 David Carlton <carlton@math.stanford.edu> * gdb.c++/maint.exp: New file.
Diffstat (limited to 'gdb/block.h')
-rw-r--r--gdb/block.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/gdb/block.h b/gdb/block.h
index d7dbf31..2fef52a 100644
--- a/gdb/block.h
+++ b/gdb/block.h
@@ -26,6 +26,9 @@
struct symbol;
struct symtab;
+struct block_namespace_info;
+struct using_direct;
+struct obstack;
/* All of the name-scope contours of the program
are represented by `struct block' objects.
@@ -74,6 +77,22 @@ struct block
struct block *superblock;
+ /* Used for language-specific info. */
+
+ union
+ {
+ struct
+ {
+ /* Contains information about namespace-related info relevant to
+ this block: using directives and the current namespace
+ scope. */
+
+ struct block_namespace_info *namespace;
+ }
+ cplus_specific;
+ }
+ language_specific;
+
/* Version of GCC used to compile the function corresponding
to this block, or 0 if not compiled with GCC. When possible,
GCC should be compatible with the native compiler, or if that
@@ -120,6 +139,7 @@ struct block
#define BLOCK_FUNCTION(bl) (bl)->function
#define BLOCK_SUPERBLOCK(bl) (bl)->superblock
#define BLOCK_GCC_COMPILED(bl) (bl)->gcc_compile_flag
+#define BLOCK_NAMESPACE(bl) (bl)->language_specific.cplus_specific.namespace
#define BLOCK_HASHTABLE(bl) (bl)->hashtable
/* For blocks without a hashtable (BLOCK_HASHTABLE (bl) == 0) only. */
@@ -180,4 +200,11 @@ extern struct block *block_for_pc (CORE_ADDR);
extern struct block *block_for_pc_sect (CORE_ADDR, asection *);
+extern void block_set_scope (struct block *block, const char *scope,
+ struct obstack *obstack);
+
+extern void block_set_using (struct block *block,
+ struct using_direct *using,
+ struct obstack *obstack);
+
#endif /* BLOCK_H */