1 /* Multiple source language support for GDB.
2 Copyright 1991 Free Software Foundation, Inc.
3 Contributed by the Department of Computer Science at the State University
4 of New York at Buffalo.
6 This file is part of GDB.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
22 /* This file contains functions that return things that are specific
23 to languages. Each function should examine current_language if necessary,
24 and return the appropriate result. */
26 /* FIXME: Most of these would be better organized as macros which
27 return data out of a "language-specific" struct pointer that is set
28 whenever the working language changes. That would be a lot faster. */
40 #include "expression.h"
42 #include "parser-defs.h"
44 /* Forward function declarations */
45 static void set_type_range ();
47 /* Forward declaration */
48 extern struct language_defn unknown_language_defn
;
50 /* The current (default at startup) state of type and range checking.
51 (If the modes are set to "auto", though, these are changed based
52 on the default language at startup, and then again based on the
53 language of the first source file. */
55 enum range_mode range_mode
= range_mode_auto
;
56 enum range_check range_check
= range_check_off
;
57 enum type_mode type_mode
= type_mode_auto
;
58 enum type_check type_check
= type_check_off
;
60 /* The current language and language_mode (see language.h) */
62 struct language_defn
*current_language
= &unknown_language_defn
;
63 enum language_mode language_mode
= language_mode_auto
;
65 /* The list of supported languages. The list itself is malloc'd. */
67 static struct language_defn
**languages
;
68 static unsigned languages_size
;
69 static unsigned languages_allocsize
;
70 #define DEFAULT_ALLOCSIZE 3
72 /* The "set language/type/range" commands all put stuff in these
73 buffers. This is to make them work as set/show commands. The
74 user's string is copied here, then the set_* commands look at
75 them and update them to something that looks nice when it is
78 static char *language
;
82 /* Warning issued when current_language and the language of the current
83 frame do not match. */
84 char lang_frame_mismatch_warn
[] =
85 "Warning: the current language does not match this frame.";
91 /* This page contains the functions corresponding to GDB commands
94 /* Show command. Display a warning if the language set
95 does not match the frame. */
97 show_language_command (str
, from_tty
)
101 enum language flang
; /* The language of the current frame */
103 flang
= get_frame_language();
104 if (flang
!= language_unknown
&&
105 language_mode
== language_mode_manual
&&
106 current_language
->la_language
!= flang
)
107 printf_filtered("%s\n",lang_frame_mismatch_warn
);
110 /* Set command. Change the current working language. */
112 set_language_command (str
, from_tty
)
119 /* FIXME -- do this from the list, with HELP. */
120 if (!language
|| !language
[0]) {
121 printf("The currently understood settings are:\n\n\
122 local or auto Automatic setting based on source file\n\
123 c or cc Always parse in C syntax\n\
124 mod or m2 Always parse in Modula-2 syntax\n");
128 /* Search the list of languages for a match. */
129 for (i
= 0; i
< languages_size
; i
++) {
130 if (!strcmp (languages
[i
]->la_name
, language
)) {
131 /* Found it! Go into manual mode, and use this language. */
132 if (languages
[i
]->la_language
== language_auto
) {
133 /* Enter auto mode. Set to the current frame's language, if known. */
134 language_mode
= language_mode_auto
;
135 flang
= get_frame_language();
136 if (flang
!=language_unknown
)
140 /* Enter manual mode. Set the specified language. */
141 language_mode
= language_mode_manual
;
142 current_language
= languages
[i
];
150 error ("Unknown language `%s'.",language
);
153 /* Show command. Display a warning if the type setting does
154 not match the current language. */
156 show_type_command(str
, from_tty
)
160 if (type_check
!= current_language
->la_type_check
)
162 "Warning: the current type check setting does not match the language.\n");
165 /* Set command. Change the setting for type checking. */
167 set_type_command(str
, from_tty
)
171 if (!strcmp(type
,"on"))
173 type_check
= type_check_on
;
174 type_mode
= type_mode_manual
;
176 else if (!strcmp(type
,"warn"))
178 type_check
= type_check_warn
;
179 type_mode
= type_mode_manual
;
181 else if (!strcmp(type
,"off"))
183 type_check
= type_check_off
;
184 type_mode
= type_mode_manual
;
186 else if (!strcmp(type
,"auto"))
188 type_mode
= type_mode_auto
;
190 /* Avoid hitting the set_type_str call below. We
191 did it in set_type_range. */
198 /* Show command. Display a warning if the range setting does
199 not match the current language. */
201 show_range_command(str
, from_tty
)
206 if (range_check
!= current_language
->la_range_check
)
208 "Warning: the current range check setting does not match the language.\n");
211 /* Set command. Change the setting for range checking. */
213 set_range_command(str
, from_tty
)
217 if (!strcmp(range
,"on"))
219 range_check
= range_check_on
;
220 range_mode
= range_mode_manual
;
222 else if (!strcmp(range
,"warn"))
224 range_check
= range_check_warn
;
225 range_mode
= range_mode_manual
;
227 else if (!strcmp(range
,"off"))
229 range_check
= range_check_off
;
230 range_mode
= range_mode_manual
;
232 else if (!strcmp(range
,"auto"))
234 range_mode
= range_mode_auto
;
236 /* Avoid hitting the set_range_str call below. We
237 did it in set_type_range. */
241 show_range_command();
244 /* Set the status of range and type checking based on
245 the current modes and the current language.
246 If SHOW is non-zero, then print out the current language,
247 type and range checking status. */
253 if (range_mode
== range_mode_auto
)
254 range_check
= current_language
->la_range_check
;
256 if (type_mode
== type_mode_auto
)
257 type_check
= current_language
->la_type_check
;
263 /* Set current language to (enum language) LANG. */
271 for (i
= 0; i
< languages_size
; i
++) {
272 if (languages
[i
]->la_language
== lang
) {
273 current_language
= languages
[i
];
280 /* This page contains functions that update the global vars
281 language, type and range. */
285 char *tmp
, *prefix
= "";
288 if (language_mode
== language_mode_auto
)
289 prefix
= "auto; currently ";
291 language
= concat(prefix
, current_language
->la_name
, "");
297 char *tmp
, *prefix
= "";
300 if (type_mode
==type_mode_auto
)
301 prefix
= "auto; currently ";
311 case type_check_warn
:
315 error ("Unrecognized type check setting.");
318 type
= concat(prefix
,tmp
,"");
324 char *tmp
, *pref
= "";
327 if (range_mode
==range_mode_auto
)
328 pref
= "auto; currently ";
335 case range_check_off
:
338 case range_check_warn
:
342 error ("Unrecognized range check setting.");
345 range
= concat(pref
,tmp
,"");
349 /* Print out the current language settings: language, range and
354 printf("Current Language: %s\n",language
);
355 show_language_command();
356 printf("Type checking: %s\n",type
);
358 printf("Range checking: %s\n",range
);
359 show_range_command();
362 /* Return the result of a binary operation. */
364 binop_result_type(v1
,v2
)
369 l1
=TYPE_LENGTH(VALUE_TYPE(v1
));
370 l2
=TYPE_LENGTH(VALUE_TYPE(v2
));
371 size
= l1
> l2
? l1
: l2
;
372 uns
= TYPE_UNSIGNED(VALUE_TYPE(v1
)) || TYPE_UNSIGNED(VALUE_TYPE(v2
));
374 switch(current_language
->la_language
)
377 if (TYPE_CODE(VALUE_TYPE(v1
))==TYPE_CODE_FLT
)
378 return TYPE_CODE(VALUE_TYPE(v2
)) == TYPE_CODE_FLT
&& l2
> l1
?
379 VALUE_TYPE(v2
) : VALUE_TYPE(v1
);
380 else if (TYPE_CODE(VALUE_TYPE(v2
))==TYPE_CODE_FLT
)
381 return TYPE_CODE(VALUE_TYPE(v1
)) == TYPE_CODE_FLT
&& l1
> l2
?
382 VALUE_TYPE(v1
) : VALUE_TYPE(v2
);
383 else if (TYPE_UNSIGNED(VALUE_TYPE(v1
)) && l1
> l2
)
384 return VALUE_TYPE(v1
);
385 else if (TYPE_UNSIGNED(VALUE_TYPE(v2
)) && l2
> l1
)
386 return VALUE_TYPE(v2
);
387 else /* Both are signed. Result is the longer type */
388 return l1
> l2
? VALUE_TYPE(v1
) : VALUE_TYPE(v2
);
391 /* If we are doing type-checking, l1 should equal l2, so this is
393 return l1
> l2
? VALUE_TYPE(v1
) : VALUE_TYPE(v2
);
398 /* This page contains functions that return format strings for
399 printf for printing out numbers in different formats */
401 /* Returns the appropriate printf format for hexadecimal
404 local_hex_format_custom(pre
)
407 static char form
[50];
409 strcpy (form
, current_language
->la_hex_format_pre
);
411 strcat (form
, current_language
->la_hex_format_suf
);
415 /* Converts a number to hexadecimal and stores it in a static
416 string. Returns a pointer to this string. */
418 local_hex_string (num
)
423 sprintf (res
, current_language
->la_hex_format
, num
);
427 /* Converts a number to custom hexadecimal and stores it in a static
428 string. Returns a pointer to this string. */
430 local_hex_string_custom(num
,pre
)
436 sprintf (res
, local_hex_format_custom(pre
), num
);
440 /* Returns the appropriate printf format for octal
443 local_octal_format_custom(pre
)
446 static char form
[50];
448 strcpy (form
, current_language
->la_octal_format_pre
);
450 strcat (form
, current_language
->la_octal_format_suf
);
454 /* This page contains functions that are used in type/range checking.
455 They all return zero if the type/range check fails.
457 It is hoped that these will make extending GDB to parse different
458 languages a little easier. These are primarily used in eval.c when
459 evaluating expressions and making sure that their types are correct.
460 Instead of having a mess of conjucted/disjuncted expressions in an "if",
461 the ideas of type can be wrapped up in the following functions.
463 Note that some of them are not currently dependent upon which language
464 is currently being parsed. For example, floats are the same in
465 C and Modula-2 (ie. the only floating point type has TYPE_CODE of
466 TYPE_CODE_FLT), while booleans are different. */
468 /* Returns non-zero if its argument is a simple type. This is the same for
469 both Modula-2 and for C. In the C case, TYPE_CODE_CHAR will never occur,
470 and thus will never cause the failure of the test. */
475 switch (TYPE_CODE (type
)) {
480 case TYPE_CODE_RANGE
:
489 /* Returns non-zero if its argument is of an ordered type. */
494 switch (TYPE_CODE (type
)) {
499 case TYPE_CODE_RANGE
:
507 /* Returns non-zero if the two types are the same */
509 same_type (arg1
, arg2
)
510 struct type
*arg1
, *arg2
;
512 if (structured_type(arg1
) ? !structured_type(arg2
) : structured_type(arg2
))
513 /* One is structured and one isn't */
515 else if (structured_type(arg1
) && structured_type(arg2
))
517 else if (numeric_type(arg1
) && numeric_type(arg2
))
518 return (TYPE_CODE(arg2
) == TYPE_CODE(arg1
)) &&
519 (TYPE_UNSIGNED(arg1
) == TYPE_UNSIGNED(arg2
))
525 /* Returns non-zero if the type is integral */
530 switch(current_language
->la_language
)
533 return (TYPE_CODE(type
) != TYPE_CODE_INT
) &&
534 (TYPE_CODE(type
) != TYPE_CODE_ENUM
) ? 0 : 1;
536 return TYPE_CODE(type
) != TYPE_CODE_INT
? 0 : 1;
538 error ("Language not supported.");
542 /* Returns non-zero if the value is numeric */
547 switch (TYPE_CODE (type
)) {
557 /* Returns non-zero if the value is a character type */
559 character_type (type
)
562 switch(current_language
->la_language
)
565 return TYPE_CODE(type
) != TYPE_CODE_CHAR
? 0 : 1;
568 return (TYPE_CODE(type
) == TYPE_CODE_INT
) &&
569 TYPE_LENGTH(type
) == sizeof(char)
574 /* Returns non-zero if the value is a boolean type */
579 switch(current_language
->la_language
)
582 return TYPE_CODE(type
) != TYPE_CODE_BOOL
? 0 : 1;
585 return TYPE_CODE(type
) != TYPE_CODE_INT
? 0 : 1;
589 /* Returns non-zero if the value is a floating-point type */
594 return TYPE_CODE(type
) == TYPE_CODE_FLT
;
597 /* Returns non-zero if the value is a pointer type */
602 return TYPE_CODE(type
) == TYPE_CODE_PTR
||
603 TYPE_CODE(type
) == TYPE_CODE_REF
;
606 /* Returns non-zero if the value is a structured type */
608 structured_type(type
)
611 switch(current_language
->la_language
)
614 return (TYPE_CODE(type
) == TYPE_CODE_STRUCT
) ||
615 (TYPE_CODE(type
) == TYPE_CODE_UNION
) ||
616 (TYPE_CODE(type
) == TYPE_CODE_ARRAY
);
618 return (TYPE_CODE(type
) == TYPE_CODE_STRUCT
) ||
619 (TYPE_CODE(type
) == TYPE_CODE_SET
) ||
620 (TYPE_CODE(type
) == TYPE_CODE_ARRAY
);
624 /* This page contains functions that return info about
625 (struct value) values used in GDB. */
627 /* Returns non-zero if the value VAL represents a true value. */
636 switch (current_language
->la_language
) {
639 return !value_zerop (val
);
642 type
= VALUE_TYPE(val
);
643 if (TYPE_CODE (type
) != TYPE_CODE_BOOL
)
644 return 0; /* Not a BOOLEAN at all */
645 /* Search the fields for one that matches the current value. */
646 len
= TYPE_NFIELDS (type
);
647 v
= value_as_long (val
);
648 for (i
= 0; i
< len
; i
++)
651 if (v
== TYPE_FIELD_BITPOS (type
, i
))
655 return 0; /* Not a valid BOOLEAN value */
656 if (!strcmp ("TRUE", TYPE_FIELD_NAME(VALUE_TYPE(val
), i
)))
657 return 1; /* BOOLEAN with value TRUE */
659 return 0; /* BOOLEAN with value FALSE */
663 error ("Language not supported.");
667 /* Returns non-zero if the operator OP is defined on
668 the values ARG1 and ARG2. */
670 binop_type_check(arg1
,arg2
,op
)
674 struct type
*t1
, *t2
;
676 /* If we're not checking types, always return success. */
681 if (arg2
!=(value
)NULL
)
690 if ((numeric_type(t1
) && pointer_type(t2
)) ||
691 (pointer_type(t1
) && numeric_type(t2
)))
693 printf("warning: combining pointer and integer.\n");
699 if (!numeric_type(t1
) || !numeric_type(t2
))
700 type_op_error ("Arguments to %s must be numbers.",op
);
701 else if (!same_type(t1
,t2
))
702 type_op_error ("Arguments to %s must be of the same type.",op
);
707 if (!boolean_type(t1
) || !boolean_type(t2
))
708 type_op_error ("Arguments to %s must be of boolean type.",op
);
712 if ((pointer_type(t1
) && !(pointer_type(t2
) || integral_type(t2
))) ||
713 (pointer_type(t2
) && !(pointer_type(t1
) || integral_type(t1
))))
714 type_op_error ("A pointer can only be compared to an integer or pointer.",op
);
715 else if ((pointer_type(t1
) && integral_type(t2
)) ||
716 (integral_type(t1
) && pointer_type(t2
)))
718 printf("warning: combining integer and pointer.\n");
721 else if (!simple_type(t1
) || !simple_type(t2
))
722 type_op_error ("Arguments to %s must be of simple type.",op
);
723 else if (!same_type(t1
,t2
))
724 type_op_error ("Arguments to %s must be of the same type.",op
);
728 if (!integral_type(t1
) || !integral_type(t2
))
729 type_op_error ("Arguments to %s must be of integral type.",op
);
736 if (!ordered_type(t1
) || !ordered_type(t2
))
737 type_op_error ("Arguments to %s must be of ordered type.",op
);
738 else if (!same_type(t1
,t2
))
739 type_op_error ("Arguments to %s must be of the same type.",op
);
743 if (pointer_type(t1
) && !integral_type(t2
))
744 type_op_error ("A pointer can only be assigned an integer.",op
);
745 else if (pointer_type(t1
) && integral_type(t2
))
747 printf("warning: combining integer and pointer.");
750 else if (!simple_type(t1
) || !simple_type(t2
))
751 type_op_error ("Arguments to %s must be of simple type.",op
);
752 else if (!same_type(t1
,t2
))
753 type_op_error ("Arguments to %s must be of the same type.",op
);
756 /* Unary checks -- arg2 is null */
759 if (!boolean_type(t1
))
760 type_op_error ("Argument to %s must be of boolean type.",op
);
765 if (!numeric_type(t1
))
766 type_op_error ("Argument to %s must be of numeric type.",op
);
770 if (integral_type(t1
))
772 printf("warning: combining pointer and integer.\n");
775 else if (!pointer_type(t1
))
776 type_op_error ("Argument to %s must be a pointer.",op
);
779 case UNOP_PREINCREMENT
:
780 case UNOP_POSTINCREMENT
:
781 case UNOP_PREDECREMENT
:
782 case UNOP_POSTDECREMENT
:
783 if (!ordered_type(t1
))
784 type_op_error ("Argument to %s must be of an ordered type.",op
);
788 /* Ok. The following operators have different meanings in
789 different languages. */
790 switch(current_language
->la_language
)
797 if (!numeric_type(t1
) || !numeric_type(t2
))
798 type_op_error ("Arguments to %s must be numbers.",op
);
809 if (!float_type(t1
) || !float_type(t2
))
810 type_op_error ("Arguments to %s must be floating point numbers.",op
);
813 if (!integral_type(t1
) || !integral_type(t2
))
814 type_op_error ("Arguments to %s must be of integral type.",op
);
822 /* This page contains functions for the printing out of
823 error messages that occur during type- and range-
826 /* Prints the format string FMT with the operator as a string
827 corresponding to the opcode OP. If FATAL is non-zero, then
828 this is an error and error () is called. Otherwise, it is
829 a warning and printf() is called. */
831 op_error (fmt
,op
,fatal
)
837 error (fmt
,op_string(op
));
841 printf(fmt
,op_string(op
));
846 /* These are called when a language fails a type- or range-check.
847 The first argument should be a printf()-style format string, and
848 the rest of the arguments should be its arguments. If
849 [type|range]_check is [type|range]_check_on, then return_to_top_level()
850 is called in the style of error (). Otherwise, the message is prefixed
851 by "warning: " and we do not return to the top level. */
853 type_error (va_alist
)
859 if (type_check
==type_check_warn
)
860 fprintf(stderr
,"warning: ");
862 target_terminal_ours();
865 string
= va_arg (args
, char *);
866 vfprintf (stderr
, string
, args
);
867 fprintf (stderr
, "\n");
869 if (type_check
==type_check_on
)
870 return_to_top_level();
874 range_error (va_alist
)
880 if (range_check
==range_check_warn
)
881 fprintf(stderr
,"warning: ");
883 target_terminal_ours();
886 string
= va_arg (args
, char *);
887 vfprintf (stderr
, string
, args
);
888 fprintf (stderr
, "\n");
890 if (range_check
==range_check_on
)
891 return_to_top_level();
895 /* This page contains miscellaneous functions */
897 /* Return the language as a string */
904 for (i
= 0; i
< languages_size
; i
++) {
905 if (languages
[i
]->la_language
== lang
) {
906 return languages
[i
]->la_name
;
912 struct cmd_list_element
*setchecklist
= NULL
;
913 struct cmd_list_element
*showchecklist
= NULL
;
916 set_check (arg
, from_tty
)
921 "\"set check\" must be followed by the name of a check subcommand.\n");
922 help_list(setchecklist
, "set check ", -1, stdout
);
926 show_check (arg
, from_tty
)
930 cmd_show_list(showchecklist
, from_tty
, "");
933 /* Add a language to the set of known languages. */
937 struct language_defn
*lang
;
939 if (lang
->la_magic
!= LANG_MAGIC
)
941 fprintf(stderr
, "Magic number of %s language struct wrong\n",
948 languages_allocsize
= DEFAULT_ALLOCSIZE
;
949 languages
= (struct language_defn
**) xmalloc
950 (languages_allocsize
* sizeof (*languages
));
952 if (languages_size
>= languages_allocsize
)
954 languages_allocsize
*= 2;
955 languages
= (struct language_defn
**) xrealloc (languages
,
956 languages_allocsize
* sizeof (*languages
));
958 languages
[languages_size
++] = lang
;
961 if (targetlist
== NULL
)
962 add_prefix_cmd ("target", class_run
, target_command
,
963 "Connect to a target machine or process.\n\
964 The first argument is the type or protocol of the target machine.\n\
965 Remaining arguments are interpreted by the target protocol. For more\n\
966 information on the arguments for a particular protocol, type\n\
967 `help target ' followed by the protocol name.",
968 &targetlist
, "target ", 0, &cmdlist
);
969 add_cmd (t
->to_shortname
, no_class
, t
->to_open
, t
->to_doc
, &targetlist
);
973 /* Define the language that is no language. */
984 error ("Attempted to parse an expression with unknown language");
987 static struct type
** const (unknown_builtin_types
[]) = { 0 };
988 static const struct op_print unk_op_print_tab
[] = { 0 };
990 const struct language_defn unknown_language_defn
= {
993 &unknown_builtin_types
[0],
998 &builtin_type_error
, /* longest signed integral type */
999 &builtin_type_error
, /* longest unsigned integral type */
1000 &builtin_type_error
, /* longest floating point type */
1001 "0x%x", "0x%", "x", /* Hex format, prefix, suffix */
1002 "0%o", "0%", "o", /* Octal format, prefix, suffix */
1003 unk_op_print_tab
, /* expression operators for printing */
1007 /* These two structs define fake entries for the "local" and "auto" options. */
1008 const struct language_defn auto_language_defn
= {
1011 &unknown_builtin_types
[0],
1016 &builtin_type_error
, /* longest signed integral type */
1017 &builtin_type_error
, /* longest unsigned integral type */
1018 &builtin_type_error
, /* longest floating point type */
1019 "0x%x", "0x%", "x", /* Hex format, prefix, suffix */
1020 "0%o", "0%", "o", /* Octal format, prefix, suffix */
1021 unk_op_print_tab
, /* expression operators for printing */
1025 const struct language_defn local_language_defn
= {
1028 &unknown_builtin_types
[0],
1033 &builtin_type_error
, /* longest signed integral type */
1034 &builtin_type_error
, /* longest unsigned integral type */
1035 &builtin_type_error
, /* longest floating point type */
1036 "0x%x", "0x%", "x", /* Hex format, prefix, suffix */
1037 "0%o", "0%", "o", /* Octal format, prefix, suffix */
1038 unk_op_print_tab
, /* expression operators for printing */
1042 /* Initialize the language routines */
1045 _initialize_language()
1047 struct cmd_list_element
*set
, *show
;
1049 /* GDB commands for language specific stuff */
1051 set
= add_set_cmd ("language", class_support
, var_string_noescape
,
1053 "Set the current working language.",
1055 show
= add_show_from_set (set
, &showlist
);
1056 set
->function
= set_language_command
;
1057 show
->function
= show_language_command
;
1059 add_prefix_cmd ("check", no_class
, set_check
,
1060 "Set the status of the type/range checker",
1061 &setchecklist
, "set check ", 0, &setlist
);
1062 add_alias_cmd ("c", "check", no_class
, 1, &setlist
);
1063 add_alias_cmd ("ch", "check", no_class
, 1, &setlist
);
1065 add_prefix_cmd ("check", no_class
, show_check
,
1066 "Show the status of the type/range checker",
1067 &showchecklist
, "set check ", 0, &showlist
);
1068 add_alias_cmd ("c", "check", no_class
, 1, &showlist
);
1069 add_alias_cmd ("ch", "check", no_class
, 1, &showlist
);
1071 set
= add_set_cmd ("type", class_support
, var_string_noescape
,
1073 "Set type checking on/warn/off/auto.",
1075 show
= add_show_from_set (set
, &showchecklist
);
1076 set
->function
= set_type_command
;
1077 show
->function
= show_type_command
;
1079 set
= add_set_cmd ("range", class_support
, var_string_noescape
,
1081 "Set range checking on/warn/off/auto.",
1083 show
= add_show_from_set (set
, &showchecklist
);
1084 set
->function
= set_range_command
;
1085 show
->function
= show_range_command
;
1087 add_language (&unknown_language_defn
);
1088 add_language (&local_language_defn
);
1089 add_language (&auto_language_defn
);
1091 language
= savestring ("auto",strlen("auto"));
1092 range
= savestring ("auto",strlen("auto"));
1093 type
= savestring ("auto",strlen("auto"));
1095 /* Have the above take effect */
1097 set_language_command (NULL
, 0);
1098 set_type_command (NULL
, 0);
1099 set_range_command (NULL
, 0);