/* Multiple source language support for GDB.
- Copyright (C) 1991-2018 Free Software Foundation, Inc.
+ Copyright (C) 1991-2019 Free Software Foundation, Inc.
Contributed by the Department of Computer Science at the State University
of New York at Buffalo.
&ada_language_defn,
};
-/* The current values of the "set language/type/range" enum
+/* The current values of the "set language/range/case-sensitive" enum
commands. */
static const char *language;
-static const char *type;
static const char *range;
static const char *case_sensitive;
/* Enter auto mode. Set to the current frame's language, if
known, or fallback to the initial language. */
language_mode = language_mode_auto;
- TRY
+ try
{
struct frame_info *frame;
frame = get_selected_frame (NULL);
flang = get_frame_language (frame);
}
- CATCH (ex, RETURN_MASK_ERROR)
+ catch (const gdb_exception_error &ex)
{
flang = language_unknown;
}
- END_CATCH
if (flang != language_unknown)
set_language (flang);
/* See language.h. */
+bool
+default_is_string_type_p (struct type *type)
+{
+ type = check_typedef (type);
+ while (TYPE_CODE (type) == TYPE_CODE_REF)
+ {
+ type = TYPE_TARGET_TYPE (type);
+ type = check_typedef (type);
+ }
+ return (TYPE_CODE (type) == TYPE_CODE_STRING);
+}
+
+/* See language.h. */
+
symbol_name_matcher_ftype *
get_symbol_name_matcher (const language_defn *lang,
const lookup_name_info &lookup_name)
&default_varobj_ops,
NULL,
NULL,
- LANG_MAGIC
+ default_is_string_type_p,
+ "{...}" /* la_struct_too_deep_ellipsis */
};
/* These two structs define fake entries for the "local" and "auto"
&default_varobj_ops,
NULL,
NULL,
- LANG_MAGIC
+ default_is_string_type_p,
+ "{...}" /* la_struct_too_deep_ellipsis */
};
\f
add_set_language_command ();
- language = xstrdup ("auto");
- type = xstrdup ("auto");
- range = xstrdup ("auto");
- case_sensitive = xstrdup ("auto");
+ language = "auto";
+ range = "auto";
+ case_sensitive = "auto";
/* Have the above take effect. */
set_language (language_auto);