gdb/c-lang.h - gdb

Data types defined

Macros defined

Source code

  1. /* C language support definitions for GDB, the GNU debugger.

  2.    Copyright (C) 1992-2015 Free Software Foundation, Inc.

  3.    This file is part of GDB.

  4.    This program is free software; you can redistribute it and/or modify
  5.    it under the terms of the GNU General Public License as published by
  6.    the Free Software Foundation; either version 3 of the License, or
  7.    (at your option) any later version.

  8.    This program is distributed in the hope that it will be useful,
  9.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  10.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11.    GNU General Public License for more details.

  12.    You should have received a copy of the GNU General Public License
  13.    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */


  14. #if !defined (C_LANG_H)
  15. #define C_LANG_H 1

  16. struct ui_file;
  17. struct language_arch_info;
  18. struct type_print_options;
  19. struct parser_state;

  20. #include "value.h"
  21. #include "macroexp.h"
  22. #include "parser-defs.h"


  23. /* The various kinds of C string and character.  Note that these
  24.    values are chosen so that they may be or'd together in certain
  25.    ways.  */
  26. enum c_string_type
  27.   {
  28.     /* An ordinary string: "value".  */
  29.     C_STRING = 0,
  30.     /* A wide string: L"value".  */
  31.     C_WIDE_STRING = 1,
  32.     /* A 16-bit Unicode string: u"value".  */
  33.     C_STRING_16 = 2,
  34.     /* A 32-bit Unicode string: U"value".  */
  35.     C_STRING_32 = 3,
  36.     /* An ordinary char: 'v'.  This can also be or'd with one of the
  37.        above to form the corresponding CHAR value from a STRING
  38.        value.  */
  39.     C_CHAR = 4,
  40.     /* A wide char: L'v'.  */
  41.     C_WIDE_CHAR = 5,
  42.     /* A 16-bit Unicode char: u'v'.  */
  43.     C_CHAR_16 = 6,
  44.     /* A 32-bit Unicode char: U'v'.  */
  45.     C_CHAR_32 = 7
  46.   };

  47. /* Defined in c-exp.y.  */

  48. extern int c_parse (struct parser_state *);

  49. extern void c_error (char *);

  50. extern int c_parse_escape (const char **, struct obstack *);

  51. /* Defined in c-typeprint.c */
  52. extern void c_print_type (struct type *, const char *,
  53.                           struct ui_file *, int, int,
  54.                           const struct type_print_options *);

  55. extern void c_print_typedef (struct type *,
  56.                              struct symbol *,
  57.                              struct ui_file *);

  58. extern void c_val_print (struct type *, const gdb_byte *,
  59.                          int, CORE_ADDR,
  60.                          struct ui_file *, int,
  61.                          const struct value *,
  62.                          const struct value_print_options *);

  63. extern void c_value_print (struct value *, struct ui_file *,
  64.                            const struct value_print_options *);

  65. /* These are in c-lang.c: */

  66. extern struct value *evaluate_subexp_c (struct type *expect_type,
  67.                                         struct expression *exp,
  68.                                         int *pos,
  69.                                         enum noside noside);

  70. extern void c_printchar (int, struct type *, struct ui_file *);

  71. extern void c_printstr (struct ui_file * stream,
  72.                         struct type *elttype,
  73.                         const gdb_byte *string,
  74.                         unsigned int length,
  75.                         const char *user_encoding,
  76.                         int force_ellipses,
  77.                         const struct value_print_options *options);

  78. extern void c_language_arch_info (struct gdbarch *gdbarch,
  79.                                   struct language_arch_info *lai);

  80. extern const struct exp_descriptor exp_descriptor_c;

  81. extern void c_emit_char (int c, struct type *type,
  82.                          struct ui_file *stream, int quoter);

  83. extern const struct op_print c_op_print_tab[];

  84. /* These are in c-typeprint.c: */

  85. extern void c_type_print_base (struct type *, struct ui_file *,
  86.                                int, int, const struct type_print_options *);

  87. /* These are in cp-valprint.c */

  88. extern void cp_print_class_member (const gdb_byte *, struct type *,
  89.                                    struct ui_file *, char *);

  90. extern void cp_print_value_fields (struct type *, struct type *,
  91.                                    const gdb_byte *, int, CORE_ADDR,
  92.                                    struct ui_file *, int,
  93.                                    const struct value *,
  94.                                    const struct value_print_options *,
  95.                                    struct type **, int);

  96. extern void cp_print_value_fields_rtti (struct type *,
  97.                                         const gdb_byte *, int, CORE_ADDR,
  98.                                         struct ui_file *, int,
  99.                                         const struct value *,
  100.                                         const struct value_print_options *,
  101.                                         struct type **, int);

  102. extern int cp_is_vtbl_ptr_type (struct type *);

  103. extern int cp_is_vtbl_member (struct type *);

  104. /* These are in c-valprint.c.  */

  105. extern int c_textual_element_type (struct type *, char);

  106. /* Create a new instance of the C compiler and return it.  The new
  107.    compiler is owned by the caller and must be freed using the destroy
  108.    method.  This function never returns NULL, but rather throws an
  109.    exception on failure.  This is suitable for use as the
  110.    la_get_compile_instance language method.  */

  111. extern struct compile_instance *c_get_compile_context (void);

  112. /* This takes the user-supplied text and returns a newly malloc'd bit
  113.    of code to compile.

  114.    This is used as the la_compute_program language method; see that
  115.    for a description of the arguments.  */

  116. extern char *c_compute_program (struct compile_instance *inst,
  117.                                 const char *input,
  118.                                 struct gdbarch *gdbarch,
  119.                                 const struct block *expr_block,
  120.                                 CORE_ADDR expr_pc);

  121. #endif /* !defined (C_LANG_H) */