* target.h: Add enum target_waitkind, enum target_signal, and
[deliverable/binutils-gdb.git] / gdb / language.c
index d9c7c1cd7ae9e0baef39903be2b4713e61d0f0ae..b74e42830398b0fadc890eef093a4c0f8d9b13e9 100644 (file)
@@ -161,14 +161,12 @@ set_language_command (ignore, from_tty)
 
   /* FIXME -- do this from the list, with HELP.  */
   if (!language || !language[0]) {
-    printf("The currently understood settings are:\n\n");
-    printf ("local or auto    Automatic setting based on source file\n");
-    printf ("c                Use the C language\n");
-    printf ("c++              Use the C++ language\n");
-    /* start-sanitize-chill */
-    printf ("chill            Use the Chill language\n");
-    /* end-sanitize-chill */
-    printf ("modula-2         Use the Modula-2 language\n");
+    printf_unfiltered("The currently understood settings are:\n\n");
+    printf_unfiltered ("local or auto    Automatic setting based on source file\n");
+    printf_unfiltered ("c                Use the C language\n");
+    printf_unfiltered ("c++              Use the C++ language\n");
+    printf_unfiltered ("chill            Use the Chill language\n");
+    printf_unfiltered ("modula-2         Use the Modula-2 language\n");
     /* Restore the silly string. */
     set_language(current_language->la_language);
     return;
@@ -214,7 +212,7 @@ show_type_command(ignore, from_tty)
    int from_tty;
 {
    if (type_check != current_language->la_type_check)
-      printf(
+      printf_unfiltered(
 "Warning: the current type check setting does not match the language.\n");
 }
 
@@ -260,7 +258,7 @@ show_range_command(ignore, from_tty)
 {
 
    if (range_check != current_language->la_range_check)
-      printf(
+      printf_unfiltered(
 "Warning: the current range check setting does not match the language.\n");
 }
 
@@ -413,14 +411,14 @@ language_info (quietly)
     return;
 
   expected_language = current_language;
-  printf("Current language:  %s\n",language);
+  printf_unfiltered("Current language:  %s\n",language);
   show_language_command((char *)0, 1);
 
   if (!quietly)
     {
-       printf("Type checking:     %s\n",type);
+       printf_unfiltered("Type checking:     %s\n",type);
        show_type_command((char *)0, 1);
-       printf("Range checking:    %s\n",range);
+       printf_unfiltered("Range checking:    %s\n",range);
        show_range_command((char *)0, 1);
     }
 }
@@ -460,10 +458,8 @@ binop_result_type(v1,v2)
         not needed. */
       return l1 > l2 ? VALUE_TYPE(v1) : VALUE_TYPE(v2);
       break;
-    /* start-sanitize-chill */
-    case language_chill:
+   case language_chill:
       error ("Missing Chill support in function binop_result_check.");/*FIXME*/
-    /* end-sanitize-chill */
    }
    abort();
    return (struct type *)0;    /* For lint */
@@ -495,7 +491,7 @@ local_hex_format_custom(pre)
    string.  Returns a pointer to this string. */
 char *
 local_hex_string (num)
-   int num;
+   unsigned long num;
 {
    static char res[50];
 
@@ -507,7 +503,7 @@ local_hex_string (num)
    string.  Returns a pointer to this string. */
 char *
 local_hex_string_custom(num,pre)
-   int num;
+   unsigned long num;
    char *pre;
 {
    static char res[50];
@@ -531,6 +527,21 @@ local_octal_format_custom(pre)
    strcat (form, local_octal_format_suffix ());
    return form;
 }
+
+/* Returns the appropriate printf format for decimal numbers. */
+char *
+local_decimal_format_custom(pre)
+   char *pre;
+{
+   static char form[50];
+
+   strcpy (form, local_decimal_format_prefix ());
+   strcat (form, "%");
+   strcat (form, pre);
+   strcat (form, local_decimal_format_specifier ());
+   strcat (form, local_decimal_format_suffix ());
+   return form;
+}
 \f
 /* This page contains functions that are used in type/range checking.
    They all return zero if the type/range check fails.
@@ -619,10 +630,8 @@ integral_type (type)
         (TYPE_CODE(type) != TYPE_CODE_ENUM) ? 0 : 1;
    case language_m2:
       return TYPE_CODE(type) != TYPE_CODE_INT ? 0 : 1;
-    /* start-sanitize-chill */
    case language_chill:
       error ("Missing Chill support in function integral_type.");  /*FIXME*/
-    /* end-sanitize-chill */
    default:
       error ("Language not supported.");
    }
@@ -650,9 +659,7 @@ character_type (type)
 {
    switch(current_language->la_language)
    {
-    /* start-sanitize-chill */
    case language_chill:
-    /* end-sanitize-chill */
    case language_m2:
       return TYPE_CODE(type) != TYPE_CODE_CHAR ? 0 : 1;
 
@@ -673,9 +680,7 @@ string_type (type)
 {
    switch(current_language->la_language)
    {
-    /* start-sanitize-chill */
    case language_chill:
-    /* end-sanitize-chill */
    case language_m2:
       return TYPE_CODE(type) != TYPE_CODE_STRING ? 0 : 1;
 
@@ -695,9 +700,7 @@ boolean_type (type)
 {
    switch(current_language->la_language)
    {
-   /* start-sanitize-chill */
    case language_chill:
-   /* end-sanitize-chill */
    case language_m2:
       return TYPE_CODE(type) != TYPE_CODE_BOOL ? 0 : 1;
 
@@ -742,10 +745,8 @@ structured_type(type)
       return (TYPE_CODE(type) == TYPE_CODE_STRUCT) ||
         (TYPE_CODE(type) == TYPE_CODE_SET) ||
            (TYPE_CODE(type) == TYPE_CODE_ARRAY);
-    /* start-sanitize-chill */
    case language_chill:
       error ("Missing Chill support in function structured_type.");  /*FIXME*/
-    /* end-sanitize-chill */
    default:
       return (0);
    }
@@ -790,10 +791,8 @@ value_true(val)
       return 0;                /* BOOLEAN with value FALSE */
     break;
 
-  /* start-sanitize-chill */
   case language_chill:
     error ("Missing Chill support in function value_type.");  /*FIXME*/
-  /* end-sanitize-chill */
 
   default:
     error ("Language not supported.");
@@ -964,12 +963,10 @@ binop_type_check(arg1,arg2,op)
         }
 #endif
 
-/* start-sanitize-chill */
 #ifdef _LANG_chill
        case language_chill:
         error ("Missing Chill support in function binop_type_check.");/*FIXME*/
 #endif
-/* end-sanitize-chill */
 
       }
    }
@@ -1015,17 +1012,17 @@ type_error (va_alist)
    char *string;
 
    if (type_check==type_check_warn)
-      fprintf(stderr,warning_pre_print);
+      fprintf_unfiltered(gdb_stderr,warning_pre_print);
    else
       target_terminal_ours();
 
    va_start (args);
    string = va_arg (args, char *);
-   vfprintf (stderr, string, args);
-   fprintf (stderr, "\n");
+   vfprintf_unfiltered (gdb_stderr, string, args);
+   fprintf_unfiltered (gdb_stderr, "\n");
    va_end (args);
    if (type_check==type_check_on)
-      return_to_top_level();
+      return_to_top_level (RETURN_ERROR);
 }
 
 void
@@ -1036,17 +1033,17 @@ range_error (va_alist)
    char *string;
 
    if (range_check==range_check_warn)
-      fprintf(stderr,warning_pre_print);
+      fprintf_unfiltered(gdb_stderr,warning_pre_print);
    else
       target_terminal_ours();
 
    va_start (args);
    string = va_arg (args, char *);
-   vfprintf (stderr, string, args);
-   fprintf (stderr, "\n");
+   vfprintf_unfiltered (gdb_stderr, string, args);
+   fprintf_unfiltered (gdb_stderr, "\n");
    va_end (args);
    if (range_check==range_check_on)
-      return_to_top_level();
+      return_to_top_level (RETURN_ERROR);
 }
 
 \f
@@ -1088,9 +1085,9 @@ set_check (ignore, from_tty)
    char *ignore;
    int from_tty;
 {
-   printf(
+   printf_unfiltered(
 "\"set check\" must be followed by the name of a check subcommand.\n");
-   help_list(setchecklist, "set check ", -1, stdout);
+   help_list(setchecklist, "set check ", -1, gdb_stdout);
 }
 
 static void
@@ -1109,7 +1106,7 @@ add_language (lang)
 {
   if (lang->la_magic != LANG_MAGIC)
     {
-      fprintf(stderr, "Magic number of %s language struct wrong\n",
+      fprintf_unfiltered(gdb_stderr, "Magic number of %s language struct wrong\n",
        lang->la_name);
       abort();
     }
@@ -1147,14 +1144,14 @@ unk_lang_error (msg)
 static void
 unk_lang_printchar (c, stream)
      register int c;
-     FILE *stream;
+     GDB_FILE *stream;
 {
   error ("internal error - unimplemented function unk_lang_printchar called.");
 }
 
 static void
 unk_lang_printstr (stream, string, length, force_ellipses)
-     FILE *stream;
+     GDB_FILE *stream;
      char *string;
      unsigned int length;
      int force_ellipses;
@@ -1174,7 +1171,7 @@ void
 unk_lang_print_type (type, varstring, stream, show, level)
      struct type *type;
      char *varstring;
-     FILE *stream;
+     GDB_FILE *stream;
      int show;
      int level;
 {
@@ -1187,7 +1184,7 @@ unk_lang_val_print (type, valaddr, address, stream, format, deref_ref,
      struct type *type;
      char *valaddr;
      CORE_ADDR address;
-     FILE *stream;
+     GDB_FILE *stream;
      int format;
      int deref_ref;
      int recurse;
@@ -1198,7 +1195,7 @@ unk_lang_val_print (type, valaddr, address, stream, format, deref_ref,
 
 static struct type ** const (unknown_builtin_types[]) = { 0 };
 static const struct op_print unk_op_print_tab[] = {
-    {NULL, 0, 0, 0}
+    {NULL, OP_NULL, PREC_NULL, 0}
 };
 
 const struct language_defn unknown_language_defn = {
@@ -1218,9 +1215,9 @@ const struct language_defn unknown_language_defn = {
   &builtin_type_error,         /* longest unsigned integral type */
   &builtin_type_error,         /* longest floating point type */
   {"",      "",    "",   ""},  /* Binary format info */
-  {"0%o",   "0",   "o",  ""},  /* Octal format info */
-  {"%d",    "",    "d",  ""},  /* Decimal format info */
-  {"0x%x",  "0x",  "x",  ""},  /* Hex format info */
+  {"0%lo",   "0",   "o",  ""}, /* Octal format info */
+  {"%ld",    "",    "d",  ""}, /* Decimal format info */
+  {"0x%lx",  "0x",  "x",  ""}, /* Hex format info */
   unk_op_print_tab,            /* expression operators for printing */
   LANG_MAGIC
 };
@@ -1243,9 +1240,9 @@ const struct language_defn auto_language_defn = {
   &builtin_type_error,         /* longest unsigned integral type */
   &builtin_type_error,         /* longest floating point type */
   {"",      "",    "",   ""},  /* Binary format info */
-  {"0%o",   "0",   "o",  ""},  /* Octal format info */
-  {"%d",    "",    "d",  ""},  /* Decimal format info */
-  {"0x%x",  "0x",  "x",  ""},  /* Hex format info */
+  {"0%lo",   "0",   "o",  ""}, /* Octal format info */
+  {"%ld",    "",    "d",  ""}, /* Decimal format info */
+  {"0x%lx",  "0x",  "x",  ""}, /* Hex format info */
   unk_op_print_tab,            /* expression operators for printing */
   LANG_MAGIC
 };
@@ -1267,9 +1264,9 @@ const struct language_defn local_language_defn = {
   &builtin_type_error,         /* longest unsigned integral type */
   &builtin_type_error,         /* longest floating point type */
   {"",      "",    "",   ""},  /* Binary format info */
-  {"0%o",   "0",   "o",  ""},  /* Octal format info */
-  {"%d",    "",    "d",  ""},  /* Decimal format info */
-  {"0x%x",  "0x",  "x",  ""},  /* Hex format info */
+  {"0%lo",   "0",   "o",  ""}, /* Octal format info */
+  {"%ld",    "",    "d",  ""}, /* Decimal format info */
+  {"0x%lx",  "0x",  "x",  ""}, /* Hex format info */
   unk_op_print_tab,            /* expression operators for printing */
   LANG_MAGIC
 };
This page took 0.027565 seconds and 4 git commands to generate.