PR ld/1540
[deliverable/binutils-gdb.git] / gdb / language.h
index 98bdc3e1db97e158f718405e329e9450227155dc..e25aec4036d8d09fcbeae3dbf6d0cf648481db66 100644 (file)
@@ -117,37 +117,6 @@ extern enum case_sensitivity
   }
 case_sensitivity;
 \f
-/* Information for doing language dependent formatting of printed values. */
-
-struct language_format_info
-  {
-    /* The format that can be passed directly to standard C printf functions
-       to generate a completely formatted value in the format appropriate for
-       the language. */
-
-    char *la_format;
-
-    /* The prefix to be used when directly printing a value, or constructing
-       a standard C printf format.  This generally is everything up to the
-       conversion specification (the part introduced by the '%' character
-       and terminated by the conversion specifier character). */
-
-    char *la_format_prefix;
-
-    /* The conversion specifier.  This is generally everything after the
-       field width and precision, typically only a single character such
-       as 'o' for octal format or 'x' for hexadecimal format. */
-
-    char *la_format_specifier;
-
-    /* The suffix to be used when directly printing a value, or constructing
-       a standard C printf format.  This generally is everything after the
-       conversion specification (the part introduced by the '%' character
-       and terminated by the conversion specifier character). */
-
-    char *la_format_suffix;    /* Suffix for custom format string */
-  };
-
 /* Per architecture (OS/ABI) language information.  */
 
 struct language_arch_info
@@ -224,7 +193,7 @@ struct language_defn
 
     void (*la_printchar) (int ch, struct ui_file * stream);
 
-    void (*la_printstr) (struct ui_file * stream, char *string,
+    void (*la_printstr) (struct ui_file * stream, const gdb_byte *string,
                         unsigned int length, int width,
                         int force_ellipses);
 
@@ -239,7 +208,7 @@ struct language_defn
 
     /* Print a value using syntax appropriate for this language. */
 
-    int (*la_val_print) (struct type *, char *, int, CORE_ADDR,
+    int (*la_val_print) (struct type *, const gdb_byte *, int, CORE_ADDR,
                         struct ui_file *, int, int, int,
                         enum val_prettyprint);
 
@@ -284,22 +253,6 @@ struct language_defn
     /* Return class name of a mangled method name or NULL.  */
     char *(*la_class_name_from_physname) (const char *physname);
 
-    /* Base 2 (binary) formats. */
-
-    struct language_format_info la_binary_format;
-
-    /* Base 8 (octal) formats. */
-
-    struct language_format_info la_octal_format;
-
-    /* Base 10 (decimal) formats */
-
-    struct language_format_info la_decimal_format;
-
-    /* Base 16 (hexadecimal) formats */
-
-    struct language_format_info la_hex_format;
-
     /* Table for printing expressions */
 
     const struct op_print *la_op_print_tab;
@@ -322,6 +275,12 @@ struct language_defn
     void (*la_language_arch_info) (struct gdbarch *,
                                   struct language_arch_info *);
 
+    /* Print the index of an element of an array.  */
+    void (*la_print_array_index) (struct value *index_value,
+                                  struct ui_file *stream,
+                                  int format,
+                                  enum val_prettyprint pretty);
+
     /* Add fields above this point, so the magic number is always last. */
     /* Magic number for compat checking */
 
@@ -402,47 +361,6 @@ extern enum language set_language (enum language);
 #define LA_VALUE_PRINT(val,stream,fmt,pretty) \
   (current_language->la_value_print(val,stream,fmt,pretty))
 
-/* Return a format string for printf that will print a number in one of
-   the local (language-specific) formats.  Result is static and is
-   overwritten by the next call.  Takes printf options like "08" or "l"
-   (to produce e.g. %08x or %lx).  */
-
-#define local_binary_format() \
-  (current_language->la_binary_format.la_format)
-#define local_binary_format_prefix() \
-  (current_language->la_binary_format.la_format_prefix)
-#define local_binary_format_specifier() \
-  (current_language->la_binary_format.la_format_specifier)
-#define local_binary_format_suffix() \
-  (current_language->la_binary_format.la_format_suffix)
-
-#define local_octal_format() \
-  (current_language->la_octal_format.la_format)
-#define local_octal_format_prefix() \
-  (current_language->la_octal_format.la_format_prefix)
-#define local_octal_format_specifier() \
-  (current_language->la_octal_format.la_format_specifier)
-#define local_octal_format_suffix() \
-  (current_language->la_octal_format.la_format_suffix)
-
-#define local_decimal_format() \
-  (current_language->la_decimal_format.la_format)
-#define local_decimal_format_prefix() \
-  (current_language->la_decimal_format.la_format_prefix)
-#define local_decimal_format_specifier() \
-  (current_language->la_decimal_format.la_format_specifier)
-#define local_decimal_format_suffix() \
-  (current_language->la_decimal_format.la_format_suffix)
-
-#define local_hex_format() \
-  (current_language->la_hex_format.la_format)
-#define local_hex_format_prefix() \
-  (current_language->la_hex_format.la_format_prefix)
-#define local_hex_format_specifier() \
-  (current_language->la_hex_format.la_format_specifier)
-#define local_hex_format_suffix() \
-  (current_language->la_hex_format.la_format_suffix)
-
 #define LA_PRINT_CHAR(ch, stream) \
   (current_language->la_printchar(ch, stream))
 #define LA_PRINT_STRING(stream, string, length, width, force_ellipses) \
@@ -450,6 +368,9 @@ extern enum language set_language (enum language);
 #define LA_EMIT_CHAR(ch, stream, quoter) \
   (current_language->la_emitchar(ch, stream, quoter))
 
+#define LA_PRINT_ARRAY_INDEX(index_value, stream, format, pretty) \
+  (current_language->la_print_array_index(index_value, stream, format, pretty))
+
 /* Test a character to decide whether it can be printed in literal form
    or needs to be printed in another representation.  For example,
    in C the literal form of the character with octal value 141 is 'a'
@@ -461,17 +382,6 @@ extern enum language set_language (enum language);
    && ((c) < 0x7F || (c) >= 0xA0)      \
    && (!sevenbit_strings || (c) < 0x80))
 
-/* Return a format string for printf that will print a number in one of
-   the local (language-specific) formats.  Result is static and is
-   overwritten by the next call.  Takes printf options like "08" or "l"
-   (to produce e.g. %08x or %lx).  */
-
-extern char *local_decimal_format_custom (char *);     /* language.c */
-
-extern char *local_octal_format_custom (char *);       /* language.c */
-
-extern char *local_hex_format_custom (char *); /* language.c */
-
 #if 0
 /* FIXME: cagney/2000-03-04: This function does not appear to be used.
    It can be deleted once 5.0 has been released. */
@@ -481,14 +391,6 @@ extern char *local_hex_format_custom (char *);     /* language.c */
 extern char *longest_raw_hex_string (LONGEST);
 #endif
 
-/* Return a string that contains a number formatted in one of the local
-   (language-specific) formats.  Result is static and is overwritten by
-   the next call.  Takes printf options like "08l" or "l".  */
-
-extern char *local_hex_string (LONGEST);       /* language.c */
-
-extern char *local_hex_string_custom (LONGEST, char *);        /* language.c */
-
 /* Type predicates */
 
 extern int simple_type (struct type *);
@@ -564,4 +466,10 @@ extern char *language_class_name_from_physname (const struct language_defn *,
 /* Splitting strings into words.  */
 extern char *default_word_break_characters (void);
 
+/* Print the index of an array element using the C99 syntax.  */
+extern void default_print_array_index (struct value *index_value,
+                                       struct ui_file *stream,
+                                       int format,
+                                       enum val_prettyprint pretty);
+
 #endif /* defined (LANGUAGE_H) */
This page took 0.026157 seconds and 4 git commands to generate.