-
- set = add_set_cmd ("demangle-style", class_support, var_string_noescape,
- (char *) ¤t_demangling_style_string,
- "Set the current C++ demangling style.\n\
+ int i, ndems;
+
+ /* Fill the demangling_style_names[] array. */
+ for (ndems = 0;
+ libiberty_demanglers[ndems].demangling_style != unknown_demangling;
+ ndems++)
+ ;
+ demangling_style_names = xcalloc (ndems + 1, sizeof (char *));
+ for (i = 0;
+ libiberty_demanglers[i].demangling_style != unknown_demangling;
+ i++)
+ demangling_style_names[i] =
+ xstrdup (libiberty_demanglers[i].demangling_style_name);
+
+ set = add_set_enum_cmd ("demangle-style", class_support,
+ demangling_style_names,
+ (const char **) ¤t_demangling_style_string,
+ "Set the current C++ demangling style.\n\