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
)
120 /* FIXME -- do this from the list, with HELP. */
121 if (!language
|| !language
[0]) {
122 printf("The currently understood settings are:\n\n\
123 local or auto Automatic setting based on source file\n\
124 c Use the C language\n\
125 modula-2 Use the Modula-2 language\n");
126 /* Restore the silly string. */
127 set_language(current_language
->la_language
);
131 /* Search the list of languages for a match. */
132 for (i
= 0; i
< languages_size
; i
++) {
133 if (!strcmp (languages
[i
]->la_name
, language
)) {
134 /* Found it! Go into manual mode, and use this language. */
135 if (languages
[i
]->la_language
== language_auto
) {
136 /* Enter auto mode. Set to the current frame's language, if known. */
137 language_mode
= language_mode_auto
;
138 flang
= get_frame_language();
139 if (flang
!=language_unknown
)
143 /* Enter manual mode. Set the specified language. */
144 language_mode
= language_mode_manual
;
145 current_language
= languages
[i
];
153 /* Reset the language (esp. the global string "language") to the
155 err_lang
=savestring(language
,strlen(language
));
156 make_cleanup (free
, err_lang
); /* Free it after error */
157 set_language(current_language
->la_language
);
158 error ("Unknown language `%s'.",err_lang
);
161 /* Show command. Display a warning if the type setting does
162 not match the current language. */
164 show_type_command(str
, from_tty
)
168 if (type_check
!= current_language
->la_type_check
)
170 "Warning: the current type check setting does not match the language.\n");
173 /* Set command. Change the setting for type checking. */
175 set_type_command(str
, from_tty
)
179 if (!strcmp(type
,"on"))
181 type_check
= type_check_on
;
182 type_mode
= type_mode_manual
;
184 else if (!strcmp(type
,"warn"))
186 type_check
= type_check_warn
;
187 type_mode
= type_mode_manual
;
189 else if (!strcmp(type
,"off"))
191 type_check
= type_check_off
;
192 type_mode
= type_mode_manual
;
194 else if (!strcmp(type
,"auto"))
196 type_mode
= type_mode_auto
;
198 /* Avoid hitting the set_type_str call below. We
199 did it in set_type_range. */
206 /* Show command. Display a warning if the range setting does
207 not match the current language. */
209 show_range_command(str
, from_tty
)
214 if (range_check
!= current_language
->la_range_check
)
216 "Warning: the current range check setting does not match the language.\n");
219 /* Set command. Change the setting for range checking. */
221 set_range_command(str
, from_tty
)
225 if (!strcmp(range
,"on"))
227 range_check
= range_check_on
;
228 range_mode
= range_mode_manual
;
230 else if (!strcmp(range
,"warn"))
232 range_check
= range_check_warn
;
233 range_mode
= range_mode_manual
;
235 else if (!strcmp(range
,"off"))
237 range_check
= range_check_off
;
238 range_mode
= range_mode_manual
;
240 else if (!strcmp(range
,"auto"))
242 range_mode
= range_mode_auto
;
244 /* Avoid hitting the set_range_str call below. We
245 did it in set_type_range. */
249 show_range_command();
252 /* Set the status of range and type checking based on
253 the current modes and the current language.
254 If SHOW is non-zero, then print out the current language,
255 type and range checking status. */
261 if (range_mode
== range_mode_auto
)
262 range_check
= current_language
->la_range_check
;
264 if (type_mode
== type_mode_auto
)
265 type_check
= current_language
->la_type_check
;
271 /* Set current language to (enum language) LANG. */
279 for (i
= 0; i
< languages_size
; i
++) {
280 if (languages
[i
]->la_language
== lang
) {
281 current_language
= languages
[i
];
288 /* This page contains functions that update the global vars
289 language, type and range. */
293 char *tmp
, *prefix
= "";
296 if (language_mode
== language_mode_auto
)
297 prefix
= "auto; currently ";
299 language
= concat(prefix
, current_language
->la_name
, "");
305 char *tmp
, *prefix
= "";
308 if (type_mode
==type_mode_auto
)
309 prefix
= "auto; currently ";
319 case type_check_warn
:
323 error ("Unrecognized type check setting.");
326 type
= concat(prefix
,tmp
,"");
332 char *tmp
, *pref
= "";
335 if (range_mode
==range_mode_auto
)
336 pref
= "auto; currently ";
343 case range_check_off
:
346 case range_check_warn
:
350 error ("Unrecognized range check setting.");
353 range
= concat(pref
,tmp
,"");
357 /* Print out the current language settings: language, range and
362 printf("Current Language: %s\n",language
);
363 show_language_command();
364 printf("Type checking: %s\n",type
);
366 printf("Range checking: %s\n",range
);
367 show_range_command();
370 /* Return the result of a binary operation. */
372 binop_result_type(v1
,v2
)
377 l1
=TYPE_LENGTH(VALUE_TYPE(v1
));
378 l2
=TYPE_LENGTH(VALUE_TYPE(v2
));
379 size
= l1
> l2
? l1
: l2
;
380 uns
= TYPE_UNSIGNED(VALUE_TYPE(v1
)) || TYPE_UNSIGNED(VALUE_TYPE(v2
));
382 switch(current_language
->la_language
)
385 if (TYPE_CODE(VALUE_TYPE(v1
))==TYPE_CODE_FLT
)
386 return TYPE_CODE(VALUE_TYPE(v2
)) == TYPE_CODE_FLT
&& l2
> l1
?
387 VALUE_TYPE(v2
) : VALUE_TYPE(v1
);
388 else if (TYPE_CODE(VALUE_TYPE(v2
))==TYPE_CODE_FLT
)
389 return TYPE_CODE(VALUE_TYPE(v1
)) == TYPE_CODE_FLT
&& l1
> l2
?
390 VALUE_TYPE(v1
) : VALUE_TYPE(v2
);
391 else if (TYPE_UNSIGNED(VALUE_TYPE(v1
)) && l1
> l2
)
392 return VALUE_TYPE(v1
);
393 else if (TYPE_UNSIGNED(VALUE_TYPE(v2
)) && l2
> l1
)
394 return VALUE_TYPE(v2
);
395 else /* Both are signed. Result is the longer type */
396 return l1
> l2
? VALUE_TYPE(v1
) : VALUE_TYPE(v2
);
399 /* If we are doing type-checking, l1 should equal l2, so this is
401 return l1
> l2
? VALUE_TYPE(v1
) : VALUE_TYPE(v2
);
406 /* This page contains functions that return format strings for
407 printf for printing out numbers in different formats */
409 /* Returns the appropriate printf format for hexadecimal
412 local_hex_format_custom(pre
)
415 static char form
[50];
417 strcpy (form
, current_language
->la_hex_format_pre
);
419 strcat (form
, current_language
->la_hex_format_suf
);
423 /* Converts a number to hexadecimal and stores it in a static
424 string. Returns a pointer to this string. */
426 local_hex_string (num
)
431 sprintf (res
, current_language
->la_hex_format
, num
);
435 /* Converts a number to custom hexadecimal and stores it in a static
436 string. Returns a pointer to this string. */
438 local_hex_string_custom(num
,pre
)
444 sprintf (res
, local_hex_format_custom(pre
), num
);
448 /* Returns the appropriate printf format for octal
451 local_octal_format_custom(pre
)
454 static char form
[50];
456 strcpy (form
, current_language
->la_octal_format_pre
);
458 strcat (form
, current_language
->la_octal_format_suf
);
462 /* This page contains functions that are used in type/range checking.
463 They all return zero if the type/range check fails.
465 It is hoped that these will make extending GDB to parse different
466 languages a little easier. These are primarily used in eval.c when
467 evaluating expressions and making sure that their types are correct.
468 Instead of having a mess of conjucted/disjuncted expressions in an "if",
469 the ideas of type can be wrapped up in the following functions.
471 Note that some of them are not currently dependent upon which language
472 is currently being parsed. For example, floats are the same in
473 C and Modula-2 (ie. the only floating point type has TYPE_CODE of
474 TYPE_CODE_FLT), while booleans are different. */
476 /* Returns non-zero if its argument is a simple type. This is the same for
477 both Modula-2 and for C. In the C case, TYPE_CODE_CHAR will never occur,
478 and thus will never cause the failure of the test. */
483 switch (TYPE_CODE (type
)) {
488 case TYPE_CODE_RANGE
:
497 /* Returns non-zero if its argument is of an ordered type. */
502 switch (TYPE_CODE (type
)) {
507 case TYPE_CODE_RANGE
:
515 /* Returns non-zero if the two types are the same */
517 same_type (arg1
, arg2
)
518 struct type
*arg1
, *arg2
;
520 if (structured_type(arg1
) ? !structured_type(arg2
) : structured_type(arg2
))
521 /* One is structured and one isn't */
523 else if (structured_type(arg1
) && structured_type(arg2
))
525 else if (numeric_type(arg1
) && numeric_type(arg2
))
526 return (TYPE_CODE(arg2
) == TYPE_CODE(arg1
)) &&
527 (TYPE_UNSIGNED(arg1
) == TYPE_UNSIGNED(arg2
))
533 /* Returns non-zero if the type is integral */
538 switch(current_language
->la_language
)
541 return (TYPE_CODE(type
) != TYPE_CODE_INT
) &&
542 (TYPE_CODE(type
) != TYPE_CODE_ENUM
) ? 0 : 1;
544 return TYPE_CODE(type
) != TYPE_CODE_INT
? 0 : 1;
546 error ("Language not supported.");
550 /* Returns non-zero if the value is numeric */
555 switch (TYPE_CODE (type
)) {
565 /* Returns non-zero if the value is a character type */
567 character_type (type
)
570 switch(current_language
->la_language
)
573 return TYPE_CODE(type
) != TYPE_CODE_CHAR
? 0 : 1;
576 return (TYPE_CODE(type
) == TYPE_CODE_INT
) &&
577 TYPE_LENGTH(type
) == sizeof(char)
582 /* Returns non-zero if the value is a boolean type */
587 switch(current_language
->la_language
)
590 return TYPE_CODE(type
) != TYPE_CODE_BOOL
? 0 : 1;
593 return TYPE_CODE(type
) != TYPE_CODE_INT
? 0 : 1;
597 /* Returns non-zero if the value is a floating-point type */
602 return TYPE_CODE(type
) == TYPE_CODE_FLT
;
605 /* Returns non-zero if the value is a pointer type */
610 return TYPE_CODE(type
) == TYPE_CODE_PTR
||
611 TYPE_CODE(type
) == TYPE_CODE_REF
;
614 /* Returns non-zero if the value is a structured type */
616 structured_type(type
)
619 switch(current_language
->la_language
)
622 return (TYPE_CODE(type
) == TYPE_CODE_STRUCT
) ||
623 (TYPE_CODE(type
) == TYPE_CODE_UNION
) ||
624 (TYPE_CODE(type
) == TYPE_CODE_ARRAY
);
626 return (TYPE_CODE(type
) == TYPE_CODE_STRUCT
) ||
627 (TYPE_CODE(type
) == TYPE_CODE_SET
) ||
628 (TYPE_CODE(type
) == TYPE_CODE_ARRAY
);
632 /* This page contains functions that return info about
633 (struct value) values used in GDB. */
635 /* Returns non-zero if the value VAL represents a true value. */
644 switch (current_language
->la_language
) {
647 return !value_zerop (val
);
650 type
= VALUE_TYPE(val
);
651 if (TYPE_CODE (type
) != TYPE_CODE_BOOL
)
652 return 0; /* Not a BOOLEAN at all */
653 /* Search the fields for one that matches the current value. */
654 len
= TYPE_NFIELDS (type
);
655 v
= value_as_long (val
);
656 for (i
= 0; i
< len
; i
++)
659 if (v
== TYPE_FIELD_BITPOS (type
, i
))
663 return 0; /* Not a valid BOOLEAN value */
664 if (!strcmp ("TRUE", TYPE_FIELD_NAME(VALUE_TYPE(val
), i
)))
665 return 1; /* BOOLEAN with value TRUE */
667 return 0; /* BOOLEAN with value FALSE */
671 error ("Language not supported.");
675 /* Returns non-zero if the operator OP is defined on
676 the values ARG1 and ARG2. */
678 binop_type_check(arg1
,arg2
,op
)
682 struct type
*t1
, *t2
;
684 /* If we're not checking types, always return success. */
689 if (arg2
!=(value
)NULL
)
698 if ((numeric_type(t1
) && pointer_type(t2
)) ||
699 (pointer_type(t1
) && numeric_type(t2
)))
701 printf("warning: combining pointer and integer.\n");
707 if (!numeric_type(t1
) || !numeric_type(t2
))
708 type_op_error ("Arguments to %s must be numbers.",op
);
709 else if (!same_type(t1
,t2
))
710 type_op_error ("Arguments to %s must be of the same type.",op
);
715 if (!boolean_type(t1
) || !boolean_type(t2
))
716 type_op_error ("Arguments to %s must be of boolean type.",op
);
720 if ((pointer_type(t1
) && !(pointer_type(t2
) || integral_type(t2
))) ||
721 (pointer_type(t2
) && !(pointer_type(t1
) || integral_type(t1
))))
722 type_op_error ("A pointer can only be compared to an integer or pointer.",op
);
723 else if ((pointer_type(t1
) && integral_type(t2
)) ||
724 (integral_type(t1
) && pointer_type(t2
)))
726 printf("warning: combining integer and pointer.\n");
729 else if (!simple_type(t1
) || !simple_type(t2
))
730 type_op_error ("Arguments to %s must be of simple type.",op
);
731 else if (!same_type(t1
,t2
))
732 type_op_error ("Arguments to %s must be of the same type.",op
);
736 if (!integral_type(t1
) || !integral_type(t2
))
737 type_op_error ("Arguments to %s must be of integral type.",op
);
744 if (!ordered_type(t1
) || !ordered_type(t2
))
745 type_op_error ("Arguments to %s must be of ordered type.",op
);
746 else if (!same_type(t1
,t2
))
747 type_op_error ("Arguments to %s must be of the same type.",op
);
751 if (pointer_type(t1
) && !integral_type(t2
))
752 type_op_error ("A pointer can only be assigned an integer.",op
);
753 else if (pointer_type(t1
) && integral_type(t2
))
755 printf("warning: combining integer and pointer.");
758 else if (!simple_type(t1
) || !simple_type(t2
))
759 type_op_error ("Arguments to %s must be of simple type.",op
);
760 else if (!same_type(t1
,t2
))
761 type_op_error ("Arguments to %s must be of the same type.",op
);
764 /* Unary checks -- arg2 is null */
767 if (!boolean_type(t1
))
768 type_op_error ("Argument to %s must be of boolean type.",op
);
773 if (!numeric_type(t1
))
774 type_op_error ("Argument to %s must be of numeric type.",op
);
778 if (integral_type(t1
))
780 printf("warning: combining pointer and integer.\n");
783 else if (!pointer_type(t1
))
784 type_op_error ("Argument to %s must be a pointer.",op
);
787 case UNOP_PREINCREMENT
:
788 case UNOP_POSTINCREMENT
:
789 case UNOP_PREDECREMENT
:
790 case UNOP_POSTDECREMENT
:
791 if (!ordered_type(t1
))
792 type_op_error ("Argument to %s must be of an ordered type.",op
);
796 /* Ok. The following operators have different meanings in
797 different languages. */
798 switch(current_language
->la_language
)
805 if (!numeric_type(t1
) || !numeric_type(t2
))
806 type_op_error ("Arguments to %s must be numbers.",op
);
817 if (!float_type(t1
) || !float_type(t2
))
818 type_op_error ("Arguments to %s must be floating point numbers.",op
);
821 if (!integral_type(t1
) || !integral_type(t2
))
822 type_op_error ("Arguments to %s must be of integral type.",op
);
830 /* This page contains functions for the printing out of
831 error messages that occur during type- and range-
834 /* Prints the format string FMT with the operator as a string
835 corresponding to the opcode OP. If FATAL is non-zero, then
836 this is an error and error () is called. Otherwise, it is
837 a warning and printf() is called. */
839 op_error (fmt
,op
,fatal
)
845 error (fmt
,op_string(op
));
849 printf(fmt
,op_string(op
));
854 /* These are called when a language fails a type- or range-check.
855 The first argument should be a printf()-style format string, and
856 the rest of the arguments should be its arguments. If
857 [type|range]_check is [type|range]_check_on, then return_to_top_level()
858 is called in the style of error (). Otherwise, the message is prefixed
859 by "warning: " and we do not return to the top level. */
861 type_error (va_alist
)
867 if (type_check
==type_check_warn
)
868 fprintf(stderr
,"warning: ");
870 target_terminal_ours();
873 string
= va_arg (args
, char *);
874 vfprintf (stderr
, string
, args
);
875 fprintf (stderr
, "\n");
877 if (type_check
==type_check_on
)
878 return_to_top_level();
882 range_error (va_alist
)
888 if (range_check
==range_check_warn
)
889 fprintf(stderr
,"warning: ");
891 target_terminal_ours();
894 string
= va_arg (args
, char *);
895 vfprintf (stderr
, string
, args
);
896 fprintf (stderr
, "\n");
898 if (range_check
==range_check_on
)
899 return_to_top_level();
903 /* This page contains miscellaneous functions */
905 /* Return the language as a string */
912 for (i
= 0; i
< languages_size
; i
++) {
913 if (languages
[i
]->la_language
== lang
) {
914 return languages
[i
]->la_name
;
920 struct cmd_list_element
*setchecklist
= NULL
;
921 struct cmd_list_element
*showchecklist
= NULL
;
924 set_check (arg
, from_tty
)
929 "\"set check\" must be followed by the name of a check subcommand.\n");
930 help_list(setchecklist
, "set check ", -1, stdout
);
934 show_check (arg
, from_tty
)
938 cmd_show_list(showchecklist
, from_tty
, "");
941 /* Add a language to the set of known languages. */
945 struct language_defn
*lang
;
947 if (lang
->la_magic
!= LANG_MAGIC
)
949 fprintf(stderr
, "Magic number of %s language struct wrong\n",
956 languages_allocsize
= DEFAULT_ALLOCSIZE
;
957 languages
= (struct language_defn
**) xmalloc
958 (languages_allocsize
* sizeof (*languages
));
960 if (languages_size
>= languages_allocsize
)
962 languages_allocsize
*= 2;
963 languages
= (struct language_defn
**) xrealloc (languages
,
964 languages_allocsize
* sizeof (*languages
));
966 languages
[languages_size
++] = lang
;
969 if (targetlist
== NULL
)
970 add_prefix_cmd ("target", class_run
, target_command
,
971 "Connect to a target machine or process.\n\
972 The first argument is the type or protocol of the target machine.\n\
973 Remaining arguments are interpreted by the target protocol. For more\n\
974 information on the arguments for a particular protocol, type\n\
975 `help target ' followed by the protocol name.",
976 &targetlist
, "target ", 0, &cmdlist
);
977 add_cmd (t
->to_shortname
, no_class
, t
->to_open
, t
->to_doc
, &targetlist
);
981 /* Define the language that is no language. */
992 error ("Attempted to parse an expression with unknown language");
995 static struct type
** const (unknown_builtin_types
[]) = { 0 };
996 static const struct op_print unk_op_print_tab
[] = { 0 };
998 const struct language_defn unknown_language_defn
= {
1001 &unknown_builtin_types
[0],
1006 &builtin_type_error
, /* longest signed integral type */
1007 &builtin_type_error
, /* longest unsigned integral type */
1008 &builtin_type_error
, /* longest floating point type */
1009 "0x%x", "0x%", "x", /* Hex format, prefix, suffix */
1010 "0%o", "0%", "o", /* Octal format, prefix, suffix */
1011 unk_op_print_tab
, /* expression operators for printing */
1015 /* These two structs define fake entries for the "local" and "auto" options. */
1016 const struct language_defn auto_language_defn
= {
1019 &unknown_builtin_types
[0],
1024 &builtin_type_error
, /* longest signed integral type */
1025 &builtin_type_error
, /* longest unsigned integral type */
1026 &builtin_type_error
, /* longest floating point type */
1027 "0x%x", "0x%", "x", /* Hex format, prefix, suffix */
1028 "0%o", "0%", "o", /* Octal format, prefix, suffix */
1029 unk_op_print_tab
, /* expression operators for printing */
1033 const struct language_defn local_language_defn
= {
1036 &unknown_builtin_types
[0],
1041 &builtin_type_error
, /* longest signed integral type */
1042 &builtin_type_error
, /* longest unsigned integral type */
1043 &builtin_type_error
, /* longest floating point type */
1044 "0x%x", "0x%", "x", /* Hex format, prefix, suffix */
1045 "0%o", "0%", "o", /* Octal format, prefix, suffix */
1046 unk_op_print_tab
, /* expression operators for printing */
1050 /* Initialize the language routines */
1053 _initialize_language()
1055 struct cmd_list_element
*set
, *show
;
1057 /* GDB commands for language specific stuff */
1059 set
= add_set_cmd ("language", class_support
, var_string_noescape
,
1061 "Set the current source language.",
1063 show
= add_show_from_set (set
, &showlist
);
1064 set
->function
= set_language_command
;
1065 show
->function
= show_language_command
;
1067 add_prefix_cmd ("check", no_class
, set_check
,
1068 "Set the status of the type/range checker",
1069 &setchecklist
, "set check ", 0, &setlist
);
1070 add_alias_cmd ("c", "check", no_class
, 1, &setlist
);
1071 add_alias_cmd ("ch", "check", no_class
, 1, &setlist
);
1073 add_prefix_cmd ("check", no_class
, show_check
,
1074 "Show the status of the type/range checker",
1075 &showchecklist
, "show check ", 0, &showlist
);
1076 add_alias_cmd ("c", "check", no_class
, 1, &showlist
);
1077 add_alias_cmd ("ch", "check", no_class
, 1, &showlist
);
1079 set
= add_set_cmd ("type", class_support
, var_string_noescape
,
1081 "Set type checking. (on/warn/off/auto)",
1083 show
= add_show_from_set (set
, &showchecklist
);
1084 set
->function
= set_type_command
;
1085 show
->function
= show_type_command
;
1087 set
= add_set_cmd ("range", class_support
, var_string_noescape
,
1089 "Set range checking. (on/warn/off/auto)",
1091 show
= add_show_from_set (set
, &showchecklist
);
1092 set
->function
= set_range_command
;
1093 show
->function
= show_range_command
;
1095 add_language (&unknown_language_defn
);
1096 add_language (&local_language_defn
);
1097 add_language (&auto_language_defn
);
1099 language
= savestring ("auto",strlen("auto"));
1100 range
= savestring ("auto",strlen("auto"));
1101 type
= savestring ("auto",strlen("auto"));
1103 /* Have the above take effect */
1105 set_language_command (language
, 0);
1106 set_type_command (NULL
, 0);
1107 set_range_command (NULL
, 0);