diff options
author | David Carlton <carlton@bactrian.org> | 2003-04-15 23:07:11 +0000 |
---|---|---|
committer | David Carlton <carlton@bactrian.org> | 2003-04-15 23:07:11 +0000 |
commit | 9219021cb5bab1206e80f84c2b4b7d8eac7eb4ea (patch) | |
tree | 24d969246b096eaff5c7caf64ab2425bcd2dbfbc /gdb/cp-support.h | |
parent | ff773b85a456d2a737126fc2d752579091fd2933 (diff) | |
download | gdb-9219021cb5bab1206e80f84c2b4b7d8eac7eb4ea.zip gdb-9219021cb5bab1206e80f84c2b4b7d8eac7eb4ea.tar.gz 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/cp-support.h')
-rw-r--r-- | gdb/cp-support.h | 58 |
1 files changed, 57 insertions, 1 deletions
diff --git a/gdb/cp-support.h b/gdb/cp-support.h index a7d333f..76e842b 100644 --- a/gdb/cp-support.h +++ b/gdb/cp-support.h @@ -1,7 +1,8 @@ /* Helper routines for C++ support in GDB. - Copyright 2002 Free Software Foundation, Inc. + Copyright 2002, 2003 Free Software Foundation, Inc. Contributed by MontaVista Software. + Namespace support contributed by David Carlton. This file is part of GDB. @@ -20,6 +21,61 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifndef CP_SUPPORT_H +#define CP_SUPPORT_H + +/* Opaque declarations. */ + +struct obstack; +struct block; +struct symbol; + +/* This struct is designed to store data from using directives. It + says that names from namespace INNER should be visible within + namespace OUTER. OUTER should always be a strict initial substring + of INNER. These form a linked list; NEXT is the next element of + the list. */ + +struct using_direct +{ + char *inner; + char *outer; + struct using_direct *next; +}; + + +/* Functions from cp-support.c. */ + extern char *class_name_from_physname (const char *physname); extern char *method_name_from_physname (const char *physname); + +extern unsigned int cp_find_first_component (const char *name); + +extern unsigned int cp_entire_prefix_len (const char *name); + + +/* Functions/variables from cp-namespace.c. */ + +extern unsigned char processing_has_namespace_info; + +extern const char *processing_current_namespace; + +extern int cp_is_anonymous (const char *namespace); + +extern void cp_add_using_directive (const char *name, + unsigned int outer_length, + unsigned int inner_length); + +extern void cp_initialize_namespace (); + +extern void cp_finalize_namespace (struct block *static_block, + struct obstack *obstack); + +extern void cp_set_block_scope (const struct symbol *symbol, + struct block *block, + struct obstack *obstack); + +extern void cp_scan_for_anonymous_namespaces (const struct symbol *symbol); + +#endif /* CP_SUPPORT_H */ |