xref: /dflybsd-src/contrib/gdb-7/gdb/c-lang.h (revision de8e141f24382815c10a4012d209bbbf7abf1112)
15796c8dcSSimon Schubert /* C language support definitions for GDB, the GNU debugger.
25796c8dcSSimon Schubert 
3*ef5ccd6cSJohn Marino    Copyright (C) 1992-2013 Free Software Foundation, Inc.
45796c8dcSSimon Schubert 
55796c8dcSSimon Schubert    This file is part of GDB.
65796c8dcSSimon Schubert 
75796c8dcSSimon Schubert    This program is free software; you can redistribute it and/or modify
85796c8dcSSimon Schubert    it under the terms of the GNU General Public License as published by
95796c8dcSSimon Schubert    the Free Software Foundation; either version 3 of the License, or
105796c8dcSSimon Schubert    (at your option) any later version.
115796c8dcSSimon Schubert 
125796c8dcSSimon Schubert    This program is distributed in the hope that it will be useful,
135796c8dcSSimon Schubert    but WITHOUT ANY WARRANTY; without even the implied warranty of
145796c8dcSSimon Schubert    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
155796c8dcSSimon Schubert    GNU General Public License for more details.
165796c8dcSSimon Schubert 
175796c8dcSSimon Schubert    You should have received a copy of the GNU General Public License
185796c8dcSSimon Schubert    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
195796c8dcSSimon Schubert 
205796c8dcSSimon Schubert 
215796c8dcSSimon Schubert #if !defined (C_LANG_H)
225796c8dcSSimon Schubert #define C_LANG_H 1
235796c8dcSSimon Schubert 
245796c8dcSSimon Schubert struct ui_file;
255796c8dcSSimon Schubert struct language_arch_info;
26*ef5ccd6cSJohn Marino struct type_print_options;
275796c8dcSSimon Schubert 
285796c8dcSSimon Schubert #include "value.h"
295796c8dcSSimon Schubert #include "macroexp.h"
30c50c785cSJohn Marino #include "parser-defs.h"
315796c8dcSSimon Schubert 
325796c8dcSSimon Schubert 
335796c8dcSSimon Schubert /* The various kinds of C string and character.  Note that these
345796c8dcSSimon Schubert    values are chosen so that they may be or'd together in certain
355796c8dcSSimon Schubert    ways.  */
365796c8dcSSimon Schubert enum c_string_type
375796c8dcSSimon Schubert   {
385796c8dcSSimon Schubert     /* An ordinary string: "value".  */
395796c8dcSSimon Schubert     C_STRING = 0,
405796c8dcSSimon Schubert     /* A wide string: L"value".  */
415796c8dcSSimon Schubert     C_WIDE_STRING = 1,
425796c8dcSSimon Schubert     /* A 16-bit Unicode string: u"value".  */
435796c8dcSSimon Schubert     C_STRING_16 = 2,
445796c8dcSSimon Schubert     /* A 32-bit Unicode string: U"value".  */
455796c8dcSSimon Schubert     C_STRING_32 = 3,
465796c8dcSSimon Schubert     /* An ordinary char: 'v'.  This can also be or'd with one of the
475796c8dcSSimon Schubert        above to form the corresponding CHAR value from a STRING
485796c8dcSSimon Schubert        value.  */
495796c8dcSSimon Schubert     C_CHAR = 4,
505796c8dcSSimon Schubert     /* A wide char: L'v'.  */
515796c8dcSSimon Schubert     C_WIDE_CHAR = 5,
525796c8dcSSimon Schubert     /* A 16-bit Unicode char: u'v'.  */
535796c8dcSSimon Schubert     C_CHAR_16 = 6,
545796c8dcSSimon Schubert     /* A 32-bit Unicode char: U'v'.  */
555796c8dcSSimon Schubert     C_CHAR_32 = 7
565796c8dcSSimon Schubert   };
575796c8dcSSimon Schubert 
585796c8dcSSimon Schubert /* Defined in c-exp.y.  */
595796c8dcSSimon Schubert 
605796c8dcSSimon Schubert extern int c_parse (void);
615796c8dcSSimon Schubert 
625796c8dcSSimon Schubert extern void c_error (char *);
635796c8dcSSimon Schubert 
645796c8dcSSimon Schubert extern int c_parse_escape (char **, struct obstack *);
655796c8dcSSimon Schubert 
665796c8dcSSimon Schubert /* Defined in c-typeprint.c */
67c50c785cSJohn Marino extern void c_print_type (struct type *, const char *,
68*ef5ccd6cSJohn Marino 			  struct ui_file *, int, int,
69*ef5ccd6cSJohn Marino 			  const struct type_print_options *);
705796c8dcSSimon Schubert 
71c50c785cSJohn Marino extern void c_print_typedef (struct type *,
72c50c785cSJohn Marino 			     struct symbol *,
73c50c785cSJohn Marino 			     struct ui_file *);
745796c8dcSSimon Schubert 
75*ef5ccd6cSJohn Marino extern void c_val_print (struct type *, const gdb_byte *,
76c50c785cSJohn Marino 			 int, CORE_ADDR,
775796c8dcSSimon Schubert 			 struct ui_file *, int,
78cf7f2e2dSJohn Marino 			 const struct value *,
795796c8dcSSimon Schubert 			 const struct value_print_options *);
805796c8dcSSimon Schubert 
81*ef5ccd6cSJohn Marino extern void c_value_print (struct value *, struct ui_file *,
825796c8dcSSimon Schubert 			   const struct value_print_options *);
835796c8dcSSimon Schubert 
845796c8dcSSimon Schubert /* These are in c-lang.c: */
855796c8dcSSimon Schubert 
86c50c785cSJohn Marino extern struct value *evaluate_subexp_c (struct type *expect_type,
87c50c785cSJohn Marino 					struct expression *exp,
88c50c785cSJohn Marino 					int *pos,
89c50c785cSJohn Marino 					enum noside noside);
90c50c785cSJohn Marino 
915796c8dcSSimon Schubert extern void c_printchar (int, struct type *, struct ui_file *);
925796c8dcSSimon Schubert 
93c50c785cSJohn Marino extern void c_printstr (struct ui_file * stream,
94c50c785cSJohn Marino 			struct type *elttype,
95c50c785cSJohn Marino 			const gdb_byte *string,
96c50c785cSJohn Marino 			unsigned int length,
97c50c785cSJohn Marino 			const char *user_encoding,
98c50c785cSJohn Marino 			int force_ellipses,
995796c8dcSSimon Schubert 			const struct value_print_options *options);
1005796c8dcSSimon Schubert 
1015796c8dcSSimon Schubert extern void c_language_arch_info (struct gdbarch *gdbarch,
1025796c8dcSSimon Schubert 				  struct language_arch_info *lai);
1035796c8dcSSimon Schubert 
104cf7f2e2dSJohn Marino extern const struct exp_descriptor exp_descriptor_c;
105cf7f2e2dSJohn Marino 
106cf7f2e2dSJohn Marino extern void c_emit_char (int c, struct type *type,
107cf7f2e2dSJohn Marino 			 struct ui_file *stream, int quoter);
108cf7f2e2dSJohn Marino 
109c50c785cSJohn Marino extern const struct op_print c_op_print_tab[];
110c50c785cSJohn Marino 
1115796c8dcSSimon Schubert /* These are in c-typeprint.c: */
1125796c8dcSSimon Schubert 
113c50c785cSJohn Marino extern void c_type_print_base (struct type *, struct ui_file *,
114*ef5ccd6cSJohn Marino 			       int, int, const struct type_print_options *);
1155796c8dcSSimon Schubert 
1165796c8dcSSimon Schubert /* These are in cp-valprint.c */
1175796c8dcSSimon Schubert 
1185796c8dcSSimon Schubert extern void cp_print_class_member (const gdb_byte *, struct type *,
1195796c8dcSSimon Schubert 				   struct ui_file *, char *);
1205796c8dcSSimon Schubert 
1215796c8dcSSimon Schubert extern void cp_print_value_fields (struct type *, struct type *,
1225796c8dcSSimon Schubert 				   const gdb_byte *, int, CORE_ADDR,
1235796c8dcSSimon Schubert 				   struct ui_file *, int,
124cf7f2e2dSJohn Marino 				   const struct value *,
125cf7f2e2dSJohn Marino 				   const struct value_print_options *,
126cf7f2e2dSJohn Marino 				   struct type **, int);
127cf7f2e2dSJohn Marino 
128cf7f2e2dSJohn Marino extern void cp_print_value_fields_rtti (struct type *,
129cf7f2e2dSJohn Marino 					const gdb_byte *, int, CORE_ADDR,
130cf7f2e2dSJohn Marino 					struct ui_file *, int,
131cf7f2e2dSJohn Marino 					const struct value *,
1325796c8dcSSimon Schubert 					const struct value_print_options *,
1335796c8dcSSimon Schubert 					struct type **, int);
1345796c8dcSSimon Schubert 
1355796c8dcSSimon Schubert extern int cp_is_vtbl_ptr_type (struct type *);
1365796c8dcSSimon Schubert 
1375796c8dcSSimon Schubert extern int cp_is_vtbl_member (struct type *);
1385796c8dcSSimon Schubert 
139cf7f2e2dSJohn Marino /* These are in c-valprint.c.  */
140cf7f2e2dSJohn Marino 
141cf7f2e2dSJohn Marino extern int c_textual_element_type (struct type *, char);
142cf7f2e2dSJohn Marino 
1435796c8dcSSimon Schubert 
1445796c8dcSSimon Schubert #endif /* !defined (C_LANG_H) */
145