GDB (xrefs)

Enumerations | Functions | Variables
/tmp/gdb-8.1/gdb/c-lang.h File Reference
`#include "value.h"`
`#include "macroexp.h"`
`#include "parser-defs.h"`
`#include "common/enum-flags.h"`

Go to the source code of this file.

## Enumerations
enum | c_string_type_values { C_STRING = 0, C_WIDE_STRING = 1, C_STRING_16 = 2, C_STRING_32 = 3, C_CHAR = 4, C_WIDE_CHAR = 5, C_CHAR_16 = 6, C_CHAR_32 = 7 }

## Functions
| DEF_ENUM_FLAGS_TYPE (enum c_string_type_values, c_string_type)
int | c_parse (struct parser_state *)
void | c_yyerror (const char *)
int | c_parse_escape (const char **, struct obstack *)
void | c_print_type (struct type *, const char *, struct ui_file *, int, int, const struct type_print_options *)
void | c_print_typedef (struct type *, struct symbol *, struct ui_file *)
void | c_val_print (struct type *, int, CORE_ADDR, struct ui_file *, int, struct value *, const struct value_print_options *)
void | c_value_print (struct value *, struct ui_file *, const struct value_print_options *)
struct value * | evaluate_subexp_c (struct type *expect_type, struct expression *exp, int *pos, enum noside noside)
void | c_printchar (int, struct type *, struct ui_file *)
void | c_printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string, unsigned int length, const char *user_encoding, int force_ellipses, const struct value_print_options *options)
void | c_language_arch_info (struct gdbarch *gdbarch, struct language_arch_info *lai)
void | c_emit_char (int c, struct type *type, struct ui_file *stream, int quoter)
gdb::unique_xmalloc_ptr< char > | c_watch_location_expression (struct type *type, CORE_ADDR addr)
void | c_type_print_base (struct type *, struct ui_file *, int, int, const struct type_print_options *)
void | cp_print_class_member (const gdb_byte *, struct type *, struct ui_file *, const char *)
void | cp_print_value_fields (struct type *, struct type *, LONGEST, CORE_ADDR, struct ui_file *, int, struct value *, const struct value_print_options *, struct type **, int)
void | cp_print_value_fields_rtti (struct type *, const gdb_byte *, LONGEST, CORE_ADDR, struct ui_file *, int, struct value *, const struct value_print_options *, struct type **, int)
int | cp_is_vtbl_ptr_type (struct type *)
int | cp_is_vtbl_member (struct type *)
int | c_textual_element_type (struct type *, char)
struct compile_instance * | c_get_compile_context (void)
std::string | c_compute_program (struct compile_instance *inst, const char *input, struct gdbarch *gdbarch, const struct block *expr_block, CORE_ADDR expr_pc)

## Variables
const struct exp_descriptor | exp_descriptor_c
const struct op_print | c_op_print_tab []

## Enumeration Type Documentation

## ◆ c_string_type_values

enum c_string_type_values

Enumerator
C_STRING |
C_WIDE_STRING |
C_STRING_16 |
C_STRING_32 |
C_CHAR |
C_WIDE_CHAR |
C_CHAR_16 |
C_CHAR_32 |

Definition at line 38 of file c-lang.h.

## Function Documentation

## ◆ c_compute_program()

std::string c_compute_program | ( | struct compile_instance * | inst,
|  | const char * | input,
|  | struct gdbarch * | gdbarch,
|  | const struct block * | expr_block,
|  | CORE_ADDR | expr_pc
| ) |  |

Definition at line 336 of file compile-c-support.c.

References add_code_footer(), add_code_header(), c_get_mode_for_size(), string_file::c_str(), COMPILE_I_EXPR_PTR_TYPE, COMPILE_I_EXPR_VAL, COMPILE_I_PRINT_ADDRESS_SCOPE, COMPILE_I_PRINT_OUT_ARG, COMPILE_I_PRINT_VALUE_SCOPE, COMPILE_I_RAW_SCOPE, COMPILE_I_SIMPLE_SCOPE, gdb_assert, generate_c_for_variable_locations(), generate_register_struct(), make_cleanup(), ui_file::printf(), ui_file::puts(), compile_instance::scope, string_file::size(), string_file::string(), string_file::write(), write_macro_definitions(), and xfree().

## ◆ c_emit_char()

void c_emit_char | ( | int | c,
|  | struct type * | type,
|  | struct ui_file * | stream,
|  | int | quoter
| ) |  |

Definition at line 143 of file c-lang.c.

References classify_type(), generic_emit_char(), and get_type_arch().

## ◆ c_get_compile_context()

struct compile_instance* c_get_compile_context | ( | void |  | ) |

Definition at line 99 of file compile-c-support.c.

References _, error(), func, gdb_assert, load_libcc(), and new_compile_instance().

## ◆ c_language_arch_info()

void c_language_arch_info | ( | struct gdbarch * | gdbarch,
|  | struct language_arch_info * | lai
| ) |  |

Definition at line 784 of file c-lang.c.

References language_arch_info::bool_type_default, builtin_type::builtin_char, builtin_type::builtin_complex, builtin_type::builtin_decdouble, builtin_type::builtin_decfloat, builtin_type::builtin_declong, builtin_type::builtin_double, builtin_type::builtin_double_complex, builtin_type::builtin_float, builtin_type::builtin_int, builtin_type::builtin_long, builtin_type::builtin_long_double, builtin_type::builtin_long_long, builtin_type::builtin_short, builtin_type::builtin_signed_char, builtin_type(), builtin_type::builtin_unsigned_char, builtin_type::builtin_unsigned_int, builtin_type::builtin_unsigned_long, builtin_type::builtin_unsigned_long_long, builtin_type::builtin_unsigned_short, builtin_type::builtin_void, c_primitive_type_char, c_primitive_type_complex, c_primitive_type_decdouble, c_primitive_type_decfloat, c_primitive_type_declong, c_primitive_type_double, c_primitive_type_double_complex, c_primitive_type_float, c_primitive_type_int, c_primitive_type_long, c_primitive_type_long_double, c_primitive_type_long_long, c_primitive_type_short, c_primitive_type_signed_char, c_primitive_type_unsigned_char, c_primitive_type_unsigned_int, c_primitive_type_unsigned_long, c_primitive_type_unsigned_long_long, c_primitive_type_unsigned_short, c_primitive_type_void, GDBARCH_OBSTACK_CALLOC, nr_c_primitive_types, language_arch_info::primitive_type_vector, and language_arch_info::string_char_type.

## ◆ c_parse()

int c_parse | ( | struct parser_state * |  | ) |

Definition at line 5809 of file c-exp.c.

References auto_obstack::clear(), default_macro_scope(), do_cleanups(), expansion_obstack, expression_context_block, expression_context_pc, expression_macro_scope, find_pc_line(), free_current_contents(), gdb_assert, last_was_structop, macro_original_text, make_cleanup(), make_scoped_restore(), parser_debug, pstate, sal_macro_scope(), saw_name_at_eof, scan_macro_cleanup(), user_macro_scope(), VEC_free, yydebug, and yyparse().

## ◆ c_parse_escape()

int c_parse_escape | ( | const char ** | ,
|  | struct obstack * |
| ) |  |

Definition at line 4591 of file c-exp.c.

References _, error(), HOST_ESCAPE_CHAR, and obstack_grow_str.

Referenced by get_character_constant(), get_string_literal(), and parse_string_or_char().

## ◆ c_print_type()

void c_print_type | ( | struct type * | ,
|  | const char * | ,
|  | struct ui_file * | ,
|  | int | ,
|  | int | ,
|  | const struct type_print_options * |
| ) |  |

Definition at line 164 of file c-typeprint.c.

References c_print_type_1(), and flags.

Referenced by ada_print_type(), c_type_print_args(), c_type_print_template_args(), cp_type_print_method_args(), dwarf2_compute_name(), gnuv3_print_method_ptr(), go_print_type(), opencl_print_type(), rust_print_struct_def(), rust_print_type(), and yyparse().

## ◆ c_print_typedef()

void c_print_typedef | ( | struct type * | ,
|  | struct symbol * | ,
|  | struct ui_file * |
| ) |  |

Definition at line 180 of file c-typeprint.c.

References check_typedef(), fprintf_filtered(), new_symbol(), SYMBOL_LINKAGE_NAME, SYMBOL_PRINT_NAME, SYMBOL_TYPE, TYPE_CODE, TYPE_CODE_TYPEDEF, TYPE_NAME, and type_print().

## ◆ c_printchar()

void c_printchar | ( | int | ,
|  | struct type * | ,
|  | struct ui_file * |
| ) |  |

Definition at line 153 of file c-lang.c.

References C_CHAR, C_CHAR_16, C_CHAR_32, C_WIDE_CHAR, classify_type(), fputc_filtered(), get_type_arch(), and LA_EMIT_CHAR.

Referenced by dwarf2_compute_name().

## ◆ c_printstr()

void c_printstr | ( | struct ui_file * | stream,
|  | struct type * | elttype,
|  | const gdb_byte * | string,
|  | unsigned int | length,
|  | const char * | user_encoding,
|  | int | force_ellipses,
|  | const struct value_print_options * | options
| ) |  |

Definition at line 186 of file c-lang.c.

References C_CHAR, C_STRING, C_STRING_16, C_STRING_32, C_WIDE_STRING, classify_type(), fputs_filtered(), generic_printstr(), and get_type_arch().

Referenced by rust_printstr().

## ◆ c_textual_element_type()

int c_textual_element_type | ( | struct type * | ,
|  | char |
| ) |  |

Definition at line 57 of file c-valprint.c.

References check_typedef(), textual_name(), type, TYPE_CODE, TYPE_CODE_CHAR, TYPE_CODE_INT, TYPE_CODE_TYPEDEF, TYPE_LENGTH, TYPE_NAME, TYPE_NOTTEXT, and TYPE_TARGET_TYPE.

Referenced by c_get_string(), c_val_print_array(), c_val_print_int(), gen_traced_pop(), and print_unpacked_pointer().

## ◆ c_type_print_base()

void c_type_print_base | ( | struct type * | ,
|  | struct ui_file * | ,
|  | int | ,
|  | int | ,
|  | const struct type_print_options * |
| ) |  |

Definition at line 1774 of file c-typeprint.c.

References c_type_print_base_1(), and flags.

Referenced by cp_print_class_member().

## ◆ c_val_print()

void c_val_print | ( | struct type * | ,
|  | int | ,
|  | CORE_ADDR | ,
|  | struct ui_file * | ,
|  | int | ,
|  | struct value * | ,
|  | const struct value_print_options * |
| ) |  |

Definition at line 500 of file c-valprint.c.

References c_decorations, c_val_print_array(), c_val_print_int(), c_val_print_memberptr(), c_val_print_ptr(), c_val_print_struct(), c_val_print_union(), check_typedef(), cplus_print_method_ptr(), gdb_flush(), generic_val_print(), type, TYPE_CODE, TYPE_CODE_ARRAY, TYPE_CODE_BOOL, TYPE_CODE_CHAR, TYPE_CODE_COMPLEX, TYPE_CODE_DECFLOAT, TYPE_CODE_ENUM, TYPE_CODE_ERROR, TYPE_CODE_FLAGS, TYPE_CODE_FLT, TYPE_CODE_FUNC, TYPE_CODE_INT, TYPE_CODE_MEMBERPTR, TYPE_CODE_METHOD, TYPE_CODE_METHODPTR, TYPE_CODE_PTR, TYPE_CODE_RANGE, TYPE_CODE_REF, TYPE_CODE_RVALUE_REF, TYPE_CODE_STRUCT, TYPE_CODE_UNDEF, TYPE_CODE_UNION, TYPE_CODE_VOID, and value_contents_for_printing().

Referenced by d_val_print(), go_val_print(), rust_get_disr_info(), and rust_val_print().

## ◆ c_value_print()

void c_value_print | ( | struct value * | ,
|  | struct ui_file * | ,
|  | const struct value_print_options * |
| ) |  |

Definition at line 571 of file c-valprint.c.

References _, check_typedef(), current_language, value_print_options::deref_ref, fprintf_filtered(), value_print_options::objectprint, textual_name(), type, TYPE_CODE, TYPE_CODE_PTR, TYPE_CODE_STRUCT, TYPE_CODE_UNDEF, TYPE_IS_REFERENCE, TYPE_NAME, type_print(), TYPE_TARGET_TYPE, val_print(), value_addr(), value_address(), value_as_address(), value_embedded_offset(), value_enclosing_type(), value_entirely_available(), value_from_pointer(), value_full_object(), value_ind(), value_initialized(), value_ref(), value_rtti_indirect_type(), value_rtti_type(), and value_type().

## ◆ c_watch_location_expression()

gdb::unique_xmalloc_ptr<char> c_watch_location_expression | ( | struct type * | type,
|  | CORE_ADDR | addr
| ) |  |

Definition at line 712 of file c-lang.c.

References check_typedef(), core_addr_to_string(), name, string, TYPE_TARGET_TYPE, type_to_string(), and xstrprintf().

## ◆ c_yyerror()

void c_yyerror | ( | const char * |  | ) |

## ◆ cp_is_vtbl_member()

int cp_is_vtbl_member | ( | struct type * |  | ) |

Definition at line 107 of file cp-valprint.c.

References cp_is_vtbl_ptr_type(), TYPE_CODE, TYPE_CODE_ARRAY, TYPE_CODE_PTR, TYPE_CODE_STRUCT, and TYPE_TARGET_TYPE.

Referenced by print_unpacked_pointer().

## ◆ cp_is_vtbl_ptr_type()

int cp_is_vtbl_ptr_type | ( | struct type * |  | ) |

Definition at line 96 of file cp-valprint.c.

References type_name_no_tag(), and vtbl_ptr_name.

Referenced by c_val_print_array(), c_val_print_ptr(), c_val_print_struct(), and cp_is_vtbl_member().

## ◆ cp_print_class_member()

void cp_print_class_member | ( | const gdb_byte * | ,
|  | struct type * | ,
|  | struct ui_file * | ,
|  | const char * |
| ) |  |

Definition at line 751 of file cp-valprint.c.

References c_type_print_base(), cp_find_class_member(), extract_signed_integer(), fprintf_filtered(), fputs_filtered(), gdbarch_byte_order(), get_type_arch(), name, TYPE_FIELD_NAME, TYPE_LENGTH, type_name_no_tag(), type_print_raw_options, and TYPE_SELF_TYPE.

Referenced by c_val_print_memberptr().

## ◆ cp_print_value_fields()

void cp_print_value_fields | ( | struct type * | ,
|  | struct type * | ,
|  | LONGEST | ,
|  | CORE_ADDR | ,
|  | struct ui_file * | ,
|  | int | ,
|  | struct value * | ,
|  | const struct value_print_options * | ,
|  | struct type ** | ,
|  | int |
| ) |  |

Definition at line 155 of file cp-valprint.c.

References _, annotate_field_begin(), annotate_field_end(), annotate_field_name_end(), annotate_field_value(), CATCH, check_typedef(), common_val_print(), cp_print_static_field(), cp_print_value(), current_language, value_print_options::deref_ref, dont_print_stat_array_obstack, dont_print_statmem_obstack, END_CATCH, extract_typed_address(), field_is_static(), fprintf_filtered(), fprintf_symbol_filtered(), fputs_filtered(), get_type_arch(), get_vptr_fieldno(), language_defn::la_language, n_spaces(), offset, value_print_options::prettyformat, print_function_pointer_address(), print_spaces_filtered(), RETURN_MASK_ERROR, value_print_options::static_field_print, TRY, TYPE_FIELD, TYPE_FIELD_BITPOS, TYPE_FIELD_BITSIZE, TYPE_FIELD_IGNORE, TYPE_FIELD_NAME, TYPE_FIELD_PACKED, TYPE_FIELD_TYPE, TYPE_N_BASECLASSES, type_name_no_tag(), TYPE_NFIELDS, val_print(), valprint_check_validity(), value_bits_synthetic_pointer(), value_contents_for_printing(), value_field_bitfield(), value_static_field(), and wrap_here().

Referenced by cp_print_static_field(), cp_print_value(), cp_print_value_fields_rtti(), and m2_val_print().

## ◆ cp_print_value_fields_rtti()

void cp_print_value_fields_rtti | ( | struct type * | ,
|  | const gdb_byte * | ,
|  | LONGEST | ,
|  | CORE_ADDR | ,
|  | struct ui_file * | ,
|  | int | ,
|  | struct value * | ,
|  | const struct value_print_options * | ,
|  | struct type ** | ,
|  | int |
| ) |  |

Definition at line 415 of file cp-valprint.c.

References value::address, cp_print_value_fields(), offset, TARGET_CHAR_BIT, type, TYPE_LENGTH, value_bits_any_optimized_out(), value_from_contents_and_address(), value_rtti_type(), and value_type().

Referenced by c_val_print_struct().

## ◆ DEF_ENUM_FLAGS_TYPE()

DEF_ENUM_FLAGS_TYPE | ( | enum | c_string_type_values,
|  | c_string_type |
| ) |  |

## ◆ evaluate_subexp_c()

struct value* evaluate_subexp_c | ( | struct type * | expect_type,
|  | struct expression * | exp,
|  | int * | pos,
|  | enum noside | noside
| ) |  |

Definition at line 560 of file c-lang.c.

References _, allocate_value(), BYTES_TO_EXP_ELEM, C_CHAR, C_STRING, C_STRING_16, C_STRING_32, C_WIDE_STRING, charset_for_string_type(), check_typedef(), expression::elts, error(), EVAL_SKIP, evaluate_subexp_standard(), expression::gdbarch, get_discrete_bounds(), internal_error(), expression::language_defn, language_string_char_type(), exp_element::longconst, longest_to_int(), lookup_typename(), exp_element::opcode, parse_one_string(), exp_element::string, type, TYPE_CODE, TYPE_CODE_ARRAY, TYPE_CODE_CHAR, TYPE_CODE_INT, TYPE_INDEX_TYPE, TYPE_LENGTH, TYPE_TARGET_TYPE, unpack_long(), value_contents_raw(), value_cstring(), and value_from_longest().

Referenced by evaluate_subexp_opencl().

## Variable Documentation

## ◆ c_op_print_tab

const struct op_print c_op_print_tab[]

Definition at line 724 of file c-lang.c.

## ◆ exp_descriptor_c

const struct exp_descriptor exp_descriptor_c

Definition at line 817 of file c-lang.c.