int
pointer_type (struct type *type)
{
- return TYPE_CODE (type) == TYPE_CODE_PTR || TYPE_IS_REFERENCE (type);
+ return type->code () == TYPE_CODE_PTR || TYPE_IS_REFERENCE (type);
}
\f
return languages[lang]->la_name;
}
-static void
-set_check (const char *ignore, int from_tty)
-{
- printf_unfiltered (
- "\"set check\" must be followed by the name of a check subcommand.\n");
- help_list (setchecklist, "set check ", all_commands, gdb_stdout);
-}
-
-static void
-show_check (const char *ignore, int from_tty)
-{
- cmd_show_list (showchecklist, from_tty, "");
-}
\f
/* Build and install the "set language LANG" command. */
/* Print the index of array elements using the C99 syntax. */
void
-default_print_array_index (struct value *index_value, struct ui_file *stream,
+default_print_array_index (struct type *index_type, LONGEST index,
+ struct ui_file *stream,
const struct value_print_options *options)
{
+ struct value *index_value = value_from_longest (index_type, index);
+
fprintf_filtered (stream, "[");
LA_VALUE_PRINT (index_value, stream, options);
fprintf_filtered (stream, "] = ");
const lookup_name_info &lookup_name,
completion_match_result *comp_match_res)
{
- const std::string &name = lookup_name.name ();
+ gdb::string_view name = lookup_name.name ();
completion_match_for_lcd *match_for_lcd
= (comp_match_res != NULL ? &comp_match_res->match_for_lcd : NULL);
strncmp_iw_mode mode = (lookup_name.completion_mode ()
? strncmp_iw_mode::NORMAL
: strncmp_iw_mode::MATCH_PARAMS);
- if (strncmp_iw_with_mode (symbol_search_name, name.c_str (), name.size (),
+ if (strncmp_iw_with_mode (symbol_search_name, name.data (), name.size (),
mode, language_minimal, match_for_lcd) == 0)
{
if (comp_match_res != NULL)
default_is_string_type_p (struct type *type)
{
type = check_typedef (type);
- while (TYPE_CODE (type) == TYPE_CODE_REF)
+ while (type->code () == TYPE_CODE_REF)
{
type = TYPE_TARGET_TYPE (type);
type = check_typedef (type);
}
- return (TYPE_CODE (type) == TYPE_CODE_STRING);
+ return (type->code () == TYPE_CODE_STRING);
}
/* See language.h. */
}
static void
-unk_lang_val_print (struct type *type,
- int embedded_offset, CORE_ADDR address,
- struct ui_file *stream, int recurse,
- struct value *val,
- const struct value_print_options *options)
+unk_lang_value_print_inner (struct value *val,
+ struct ui_file *stream, int recurse,
+ const struct value_print_options *options)
{
error (_("internal error - unimplemented "
- "function unk_lang_val_print called."));
+ "function unk_lang_value_print_inner called."));
}
static void
unk_lang_emit_char,
unk_lang_print_type, /* Print a type using appropriate syntax */
default_print_typedef, /* Print a typedef using appropriate syntax */
- unk_lang_val_print, /* Print a value using appropriate syntax */
+ unk_lang_value_print_inner, /* la_value_print_inner */
unk_lang_value_print, /* Print a top-level value */
default_read_var_value, /* la_read_var_value */
unk_lang_trampoline, /* Language specific skip_trampoline */
unk_lang_emit_char,
unk_lang_print_type, /* Print a type using appropriate syntax */
default_print_typedef, /* Print a typedef using appropriate syntax */
- unk_lang_val_print, /* Print a value using appropriate syntax */
+ unk_lang_value_print_inner, /* la_value_print_inner */
unk_lang_value_print, /* Print a top-level value */
default_read_var_value, /* la_read_var_value */
unk_lang_trampoline, /* Language specific skip_trampoline */
{
struct type *type = SYMBOL_TYPE (sym);
- if (type && TYPE_CODE (type) == TYPE_CODE_BOOL)
+ if (type && type->code () == TYPE_CODE_BOOL)
return type;
}
}
for (p = lai->primitive_type_vector; (*p) != NULL; p++)
{
- if (strcmp (TYPE_NAME (*p), name) == 0)
+ if (strcmp ((*p)->name (), name) == 0)
return p;
}
return NULL;
gdbarch = TYPE_OWNER (type).gdbarch;
symbol = new (gdbarch_obstack (gdbarch)) struct symbol ();
- symbol->m_name = TYPE_NAME (type);
+ symbol->m_name = type->name ();
symbol->set_language (lang, nullptr);
symbol->owner.arch = gdbarch;
SYMBOL_OBJFILE_OWNED (symbol) = 0;
+ SYMBOL_SECTION (symbol) = 0;
SYMBOL_TYPE (symbol) = type;
SYMBOL_DOMAIN (symbol) = VAR_DOMAIN;
SYMBOL_ACLASS_INDEX (symbol) = LOC_TYPEDEF;
/* GDB commands for language specific stuff. */
- add_prefix_cmd ("check", no_class, set_check,
- _("Set the status of the type/range checker."),
- &setchecklist, "set check ", 0, &setlist);
+ add_basic_prefix_cmd ("check", no_class,
+ _("Set the status of the type/range checker."),
+ &setchecklist, "set check ", 0, &setlist);
add_alias_cmd ("c", "check", no_class, 1, &setlist);
add_alias_cmd ("ch", "check", no_class, 1, &setlist);
- add_prefix_cmd ("check", no_class, show_check,
- _("Show the status of the type/range checker."),
- &showchecklist, "show check ", 0, &showlist);
+ add_show_prefix_cmd ("check", no_class,
+ _("Show the status of the type/range checker."),
+ &showchecklist, "show check ", 0, &showlist);
add_alias_cmd ("c", "check", no_class, 1, &showlist);
add_alias_cmd ("ch", "check", no_class, 1, &showlist);