1130803Smarcel/* Helper routines for C++ support in GDB. 2130803Smarcel Copyright 2002, 2003, 2004 Free Software Foundation, Inc. 3130803Smarcel 4130803Smarcel Contributed by MontaVista Software. 5130803Smarcel Namespace support contributed by David Carlton. 6130803Smarcel 7130803Smarcel This file is part of GDB. 8130803Smarcel 9130803Smarcel This program is free software; you can redistribute it and/or modify 10130803Smarcel it under the terms of the GNU General Public License as published by 11130803Smarcel the Free Software Foundation; either version 2 of the License, or 12130803Smarcel (at your option) any later version. 13130803Smarcel 14130803Smarcel This program is distributed in the hope that it will be useful, 15130803Smarcel but WITHOUT ANY WARRANTY; without even the implied warranty of 16130803Smarcel MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17130803Smarcel GNU General Public License for more details. 18130803Smarcel 19130803Smarcel You should have received a copy of the GNU General Public License 20130803Smarcel along with this program; if not, write to the Free Software 21130803Smarcel Foundation, Inc., 59 Temple Place - Suite 330, 22130803Smarcel Boston, MA 02111-1307, USA. */ 23130803Smarcel 24130803Smarcel#ifndef CP_SUPPORT_H 25130803Smarcel#define CP_SUPPORT_H 26130803Smarcel 27130803Smarcel/* We need this for 'domain_enum', alas... */ 28130803Smarcel 29130803Smarcel#include "symtab.h" 30130803Smarcel 31130803Smarcel/* Opaque declarations. */ 32130803Smarcel 33130803Smarcelstruct symbol; 34130803Smarcelstruct obstack; 35130803Smarcelstruct block; 36130803Smarcelstruct objfile; 37130803Smarcelstruct type; 38130803Smarcel 39130803Smarcel/* This struct is designed to store data from using directives. It 40130803Smarcel says that names from namespace INNER should be visible within 41130803Smarcel namespace OUTER. OUTER should always be a strict initial substring 42130803Smarcel of INNER. These form a linked list; NEXT is the next element of 43130803Smarcel the list. */ 44130803Smarcel 45130803Smarcelstruct using_direct 46130803Smarcel{ 47130803Smarcel char *inner; 48130803Smarcel char *outer; 49130803Smarcel struct using_direct *next; 50130803Smarcel}; 51130803Smarcel 52130803Smarcel 53130803Smarcel/* Functions from cp-support.c. */ 54130803Smarcel 55130803Smarcelextern char *class_name_from_physname (const char *physname); 56130803Smarcel 57130803Smarcelextern char *method_name_from_physname (const char *physname); 58130803Smarcel 59130803Smarcelextern unsigned int cp_find_first_component (const char *name); 60130803Smarcel 61130803Smarcelextern unsigned int cp_entire_prefix_len (const char *name); 62130803Smarcel 63130803Smarcelextern char *cp_func_name (const char *full_name); 64130803Smarcel 65130803Smarcelextern struct symbol **make_symbol_overload_list (const char *, 66130803Smarcel const char *); 67130803Smarcel 68130803Smarcelextern struct type *cp_lookup_rtti_type (const char *name, 69130803Smarcel struct block *block); 70130803Smarcel 71130803Smarcel/* Functions/variables from cp-namespace.c. */ 72130803Smarcel 73130803Smarcelextern unsigned char processing_has_namespace_info; 74130803Smarcel 75130803Smarcelextern const char *processing_current_prefix; 76130803Smarcel 77130803Smarcelextern int cp_is_anonymous (const char *namespace); 78130803Smarcel 79130803Smarcelextern void cp_add_using_directive (const char *name, 80130803Smarcel unsigned int outer_length, 81130803Smarcel unsigned int inner_length); 82130803Smarcel 83130803Smarcelextern void cp_initialize_namespace (void); 84130803Smarcel 85130803Smarcelextern void cp_finalize_namespace (struct block *static_block, 86130803Smarcel struct obstack *obstack); 87130803Smarcel 88130803Smarcelextern void cp_set_block_scope (const struct symbol *symbol, 89130803Smarcel struct block *block, 90130803Smarcel struct obstack *obstack); 91130803Smarcel 92130803Smarcelextern void cp_scan_for_anonymous_namespaces (const struct symbol *symbol); 93130803Smarcel 94130803Smarcelextern struct symbol *cp_lookup_symbol_nonlocal (const char *name, 95130803Smarcel const char *linkage_name, 96130803Smarcel const struct block *block, 97130803Smarcel const domain_enum domain, 98130803Smarcel struct symtab **symtab); 99130803Smarcel 100130803Smarcelextern struct symbol *cp_lookup_symbol_namespace (const char *namespace, 101130803Smarcel const char *name, 102130803Smarcel const char *linkage_name, 103130803Smarcel const struct block *block, 104130803Smarcel const domain_enum domain, 105130803Smarcel struct symtab **symtab); 106130803Smarcel 107130803Smarcelextern struct type *cp_lookup_nested_type (struct type *parent_type, 108130803Smarcel const char *nested_name, 109130803Smarcel const struct block *block); 110130803Smarcel 111130803Smarcelextern void cp_check_possible_namespace_symbols (const char *name, 112130803Smarcel struct objfile *objfile); 113130803Smarcel 114130803Smarcelstruct type *cp_lookup_transparent_type (const char *name); 115130803Smarcel 116130803Smarcel/* The list of "maint cplus" commands. */ 117130803Smarcel 118130803Smarcelextern struct cmd_list_element *maint_cplus_cmd_list; 119130803Smarcel 120130803Smarcel#endif /* CP_SUPPORT_H */ 121