OSDN Git Service

* c-lang.c (c_emit_char): Don't treat \0 specially unless quoter
[pf3gnuchains/pf3gnuchains3x.git] / gdb / c-lang.c
1 /* C language support routines for GDB, the GNU debugger.
2    Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2002
3    Free Software Foundation, Inc.
4
5    This file is part of GDB.
6
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 2 of the License, or
10    (at your option) any later version.
11
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with this program; if not, write to the Free Software
19    Foundation, Inc., 59 Temple Place - Suite 330,
20    Boston, MA 02111-1307, USA.  */
21
22 #include "defs.h"
23 #include "symtab.h"
24 #include "gdbtypes.h"
25 #include "expression.h"
26 #include "parser-defs.h"
27 #include "language.h"
28 #include "c-lang.h"
29 #include "valprint.h"
30 #include "macroscope.h"
31 #include "gdb_assert.h"
32
33 extern void _initialize_c_language (void);
34 static void c_emit_char (int c, struct ui_file * stream, int quoter);
35
36 /* Print the character C on STREAM as part of the contents of a literal
37    string whose delimiter is QUOTER.  Note that that format for printing
38    characters and strings is language specific. */
39
40 static void
41 c_emit_char (register int c, struct ui_file *stream, int quoter)
42 {
43   c &= 0xFF;                    /* Avoid sign bit follies */
44
45   if (PRINT_LITERAL_FORM (c))
46     {
47       if (c == '\\' || c == quoter)
48         {
49           fputs_filtered ("\\", stream);
50         }
51       fprintf_filtered (stream, "%c", c);
52     }
53   else
54     {
55       switch (c)
56         {
57         case '\n':
58           fputs_filtered ("\\n", stream);
59           break;
60         case '\b':
61           fputs_filtered ("\\b", stream);
62           break;
63         case '\t':
64           fputs_filtered ("\\t", stream);
65           break;
66         case '\f':
67           fputs_filtered ("\\f", stream);
68           break;
69         case '\r':
70           fputs_filtered ("\\r", stream);
71           break;
72         case '\013':
73           fputs_filtered ("\\v", stream);
74           break;
75         case '\033':
76           fputs_filtered ("\\e", stream);
77           break;
78         case '\007':
79           fputs_filtered ("\\a", stream);
80           break;
81         case '\0':
82           if (quoter == '\'')
83             fputs_filtered ("\\0", stream);
84           else
85             fprintf_filtered (stream, "\\%.3o", (unsigned int) c);
86           break;
87         default:
88           fprintf_filtered (stream, "\\%.3o", (unsigned int) c);
89           break;
90         }
91     }
92 }
93
94 void
95 c_printchar (int c, struct ui_file *stream)
96 {
97   fputc_filtered ('\'', stream);
98   LA_EMIT_CHAR (c, stream, '\'');
99   fputc_filtered ('\'', stream);
100 }
101
102 /* Print the character string STRING, printing at most LENGTH characters.
103    LENGTH is -1 if the string is nul terminated.  Each character is WIDTH bytes
104    long.  Printing stops early if the number hits print_max; repeat counts are
105    printed as appropriate.  Print ellipses at the end if we had to stop before
106    printing LENGTH characters, or if FORCE_ELLIPSES.  */
107
108 void
109 c_printstr (struct ui_file *stream, char *string, unsigned int length,
110             int width, int force_ellipses)
111 {
112   register unsigned int i;
113   unsigned int things_printed = 0;
114   int in_quotes = 0;
115   int need_comma = 0;
116   extern int inspect_it;
117
118   /* If the string was not truncated due to `set print elements', and
119      the last byte of it is a null, we don't print that, in traditional C
120      style.  */
121   if (!force_ellipses
122       && length > 0
123       && (extract_unsigned_integer (string + (length - 1) * width, width)
124           == '\0'))
125     length--;
126
127   if (length == 0)
128     {
129       fputs_filtered ("\"\"", stream);
130       return;
131     }
132
133   for (i = 0; i < length && things_printed < print_max; ++i)
134     {
135       /* Position of the character we are examining
136          to see whether it is repeated.  */
137       unsigned int rep1;
138       /* Number of repetitions we have detected so far.  */
139       unsigned int reps;
140       unsigned long current_char;
141
142       QUIT;
143
144       if (need_comma)
145         {
146           fputs_filtered (", ", stream);
147           need_comma = 0;
148         }
149
150       current_char = extract_unsigned_integer (string + i * width, width);
151
152       rep1 = i + 1;
153       reps = 1;
154       while (rep1 < length
155              && extract_unsigned_integer (string + rep1 * width, width)
156              == current_char)
157         {
158           ++rep1;
159           ++reps;
160         }
161
162       if (reps > repeat_count_threshold)
163         {
164           if (in_quotes)
165             {
166               if (inspect_it)
167                 fputs_filtered ("\\\", ", stream);
168               else
169                 fputs_filtered ("\", ", stream);
170               in_quotes = 0;
171             }
172           LA_PRINT_CHAR (current_char, stream);
173           fprintf_filtered (stream, " <repeats %u times>", reps);
174           i = rep1 - 1;
175           things_printed += repeat_count_threshold;
176           need_comma = 1;
177         }
178       else
179         {
180           if (!in_quotes)
181             {
182               if (inspect_it)
183                 fputs_filtered ("\\\"", stream);
184               else
185                 fputs_filtered ("\"", stream);
186               in_quotes = 1;
187             }
188           LA_EMIT_CHAR (current_char, stream, '"');
189           ++things_printed;
190         }
191     }
192
193   /* Terminate the quotes if necessary.  */
194   if (in_quotes)
195     {
196       if (inspect_it)
197         fputs_filtered ("\\\"", stream);
198       else
199         fputs_filtered ("\"", stream);
200     }
201
202   if (force_ellipses || i < length)
203     fputs_filtered ("...", stream);
204 }
205
206 /* Create a fundamental C type using default reasonable for the current
207    target machine.
208
209    Some object/debugging file formats (DWARF version 1, COFF, etc) do not
210    define fundamental types such as "int" or "double".  Others (stabs or
211    DWARF version 2, etc) do define fundamental types.  For the formats which
212    don't provide fundamental types, gdb can create such types using this
213    function.
214
215    FIXME:  Some compilers distinguish explicitly signed integral types
216    (signed short, signed int, signed long) from "regular" integral types
217    (short, int, long) in the debugging information.  There is some dis-
218    agreement as to how useful this feature is.  In particular, gcc does
219    not support this.  Also, only some debugging formats allow the
220    distinction to be passed on to a debugger.  For now, we always just
221    use "short", "int", or "long" as the type name, for both the implicit
222    and explicitly signed types.  This also makes life easier for the
223    gdb test suite since we don't have to account for the differences
224    in output depending upon what the compiler and debugging format
225    support.  We will probably have to re-examine the issue when gdb
226    starts taking it's fundamental type information directly from the
227    debugging information supplied by the compiler.  fnf@cygnus.com */
228
229 struct type *
230 c_create_fundamental_type (struct objfile *objfile, int typeid)
231 {
232   register struct type *type = NULL;
233
234   switch (typeid)
235     {
236     default:
237       /* FIXME:  For now, if we are asked to produce a type not in this
238          language, create the equivalent of a C integer type with the
239          name "<?type?>".  When all the dust settles from the type
240          reconstruction work, this should probably become an error. */
241       type = init_type (TYPE_CODE_INT,
242                         TARGET_INT_BIT / TARGET_CHAR_BIT,
243                         0, "<?type?>", objfile);
244       warning ("internal error: no C/C++ fundamental type %d", typeid);
245       break;
246     case FT_VOID:
247       type = init_type (TYPE_CODE_VOID,
248                         TARGET_CHAR_BIT / TARGET_CHAR_BIT,
249                         0, "void", objfile);
250       break;
251     case FT_BOOLEAN:
252       type = init_type (TYPE_CODE_BOOL,
253                         TARGET_CHAR_BIT / TARGET_CHAR_BIT,
254                         0, "bool", objfile);
255       break;
256     case FT_CHAR:
257       type = init_type (TYPE_CODE_INT,
258                         TARGET_CHAR_BIT / TARGET_CHAR_BIT,
259                         TYPE_FLAG_NOSIGN, "char", objfile);
260       break;
261     case FT_SIGNED_CHAR:
262       type = init_type (TYPE_CODE_INT,
263                         TARGET_CHAR_BIT / TARGET_CHAR_BIT,
264                         0, "signed char", objfile);
265       break;
266     case FT_UNSIGNED_CHAR:
267       type = init_type (TYPE_CODE_INT,
268                         TARGET_CHAR_BIT / TARGET_CHAR_BIT,
269                         TYPE_FLAG_UNSIGNED, "unsigned char", objfile);
270       break;
271     case FT_SHORT:
272       type = init_type (TYPE_CODE_INT,
273                         TARGET_SHORT_BIT / TARGET_CHAR_BIT,
274                         0, "short", objfile);
275       break;
276     case FT_SIGNED_SHORT:
277       type = init_type (TYPE_CODE_INT,
278                         TARGET_SHORT_BIT / TARGET_CHAR_BIT,
279                         0, "short", objfile);   /* FIXME-fnf */
280       break;
281     case FT_UNSIGNED_SHORT:
282       type = init_type (TYPE_CODE_INT,
283                         TARGET_SHORT_BIT / TARGET_CHAR_BIT,
284                         TYPE_FLAG_UNSIGNED, "unsigned short", objfile);
285       break;
286     case FT_INTEGER:
287       type = init_type (TYPE_CODE_INT,
288                         TARGET_INT_BIT / TARGET_CHAR_BIT,
289                         0, "int", objfile);
290       break;
291     case FT_SIGNED_INTEGER:
292       type = init_type (TYPE_CODE_INT,
293                         TARGET_INT_BIT / TARGET_CHAR_BIT,
294                         0, "int", objfile);     /* FIXME -fnf */
295       break;
296     case FT_UNSIGNED_INTEGER:
297       type = init_type (TYPE_CODE_INT,
298                         TARGET_INT_BIT / TARGET_CHAR_BIT,
299                         TYPE_FLAG_UNSIGNED, "unsigned int", objfile);
300       break;
301     case FT_LONG:
302       type = init_type (TYPE_CODE_INT,
303                         TARGET_LONG_BIT / TARGET_CHAR_BIT,
304                         0, "long", objfile);
305       break;
306     case FT_SIGNED_LONG:
307       type = init_type (TYPE_CODE_INT,
308                         TARGET_LONG_BIT / TARGET_CHAR_BIT,
309                         0, "long", objfile);    /* FIXME -fnf */
310       break;
311     case FT_UNSIGNED_LONG:
312       type = init_type (TYPE_CODE_INT,
313                         TARGET_LONG_BIT / TARGET_CHAR_BIT,
314                         TYPE_FLAG_UNSIGNED, "unsigned long", objfile);
315       break;
316     case FT_LONG_LONG:
317       type = init_type (TYPE_CODE_INT,
318                         TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
319                         0, "long long", objfile);
320       break;
321     case FT_SIGNED_LONG_LONG:
322       type = init_type (TYPE_CODE_INT,
323                         TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
324                         0, "signed long long", objfile);
325       break;
326     case FT_UNSIGNED_LONG_LONG:
327       type = init_type (TYPE_CODE_INT,
328                         TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
329                         TYPE_FLAG_UNSIGNED, "unsigned long long", objfile);
330       break;
331     case FT_FLOAT:
332       type = init_type (TYPE_CODE_FLT,
333                         TARGET_FLOAT_BIT / TARGET_CHAR_BIT,
334                         0, "float", objfile);
335       break;
336     case FT_DBL_PREC_FLOAT:
337       type = init_type (TYPE_CODE_FLT,
338                         TARGET_DOUBLE_BIT / TARGET_CHAR_BIT,
339                         0, "double", objfile);
340       break;
341     case FT_EXT_PREC_FLOAT:
342       type = init_type (TYPE_CODE_FLT,
343                         TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT,
344                         0, "long double", objfile);
345       break;
346     case FT_COMPLEX:
347       type = init_type (TYPE_CODE_FLT,
348                         2 * TARGET_FLOAT_BIT / TARGET_CHAR_BIT,
349                         0, "complex float", objfile);
350       TYPE_TARGET_TYPE (type)
351         = init_type (TYPE_CODE_FLT, TARGET_FLOAT_BIT / TARGET_CHAR_BIT,
352                      0, "float", objfile);
353       break;
354     case FT_DBL_PREC_COMPLEX:
355       type = init_type (TYPE_CODE_FLT,
356                         2 * TARGET_DOUBLE_BIT / TARGET_CHAR_BIT,
357                         0, "complex double", objfile);
358       TYPE_TARGET_TYPE (type)
359         = init_type (TYPE_CODE_FLT, TARGET_DOUBLE_BIT / TARGET_CHAR_BIT,
360                      0, "double", objfile);
361       break;
362     case FT_EXT_PREC_COMPLEX:
363       type = init_type (TYPE_CODE_FLT,
364                         2 * TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT,
365                         0, "complex long double", objfile);
366       TYPE_TARGET_TYPE (type)
367         = init_type (TYPE_CODE_FLT, TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT,
368                      0, "long double", objfile);
369       break;
370     case FT_TEMPLATE_ARG:
371       type = init_type (TYPE_CODE_TEMPLATE_ARG,
372                         0,
373                         0, "<template arg>", objfile);
374       break;
375     }
376   return (type);
377 }
378 \f
379 /* Preprocessing and parsing C and C++ expressions.  */
380
381
382 /* When we find that lexptr (the global var defined in parse.c) is
383    pointing at a macro invocation, we expand the invocation, and call
384    scan_macro_expansion to save the old lexptr here and point lexptr
385    into the expanded text.  When we reach the end of that, we call
386    end_macro_expansion to pop back to the value we saved here.  The
387    macro expansion code promises to return only fully-expanded text,
388    so we don't need to "push" more than one level.
389
390    This is disgusting, of course.  It would be cleaner to do all macro
391    expansion beforehand, and then hand that to lexptr.  But we don't
392    really know where the expression ends.  Remember, in a command like
393
394      (gdb) break *ADDRESS if CONDITION
395
396    we evaluate ADDRESS in the scope of the current frame, but we
397    evaluate CONDITION in the scope of the breakpoint's location.  So
398    it's simply wrong to try to macro-expand the whole thing at once.  */
399 static char *macro_original_text;
400 static char *macro_expanded_text;
401
402
403 void
404 scan_macro_expansion (char *expansion)
405 {
406   /* We'd better not be trying to push the stack twice.  */
407   gdb_assert (! macro_original_text);
408   gdb_assert (! macro_expanded_text);
409
410   /* Save the old lexptr value, so we can return to it when we're done
411      parsing the expanded text.  */
412   macro_original_text = lexptr;
413   lexptr = expansion;
414
415   /* Save the expanded text, so we can free it when we're finished.  */
416   macro_expanded_text = expansion;
417 }
418
419
420 int
421 scanning_macro_expansion (void)
422 {
423   return macro_original_text != 0;
424 }
425
426
427 void 
428 finished_macro_expansion (void)
429 {
430   /* There'd better be something to pop back to, and we better have
431      saved a pointer to the start of the expanded text.  */
432   gdb_assert (macro_original_text);
433   gdb_assert (macro_expanded_text);
434
435   /* Pop back to the original text.  */
436   lexptr = macro_original_text;
437   macro_original_text = 0;
438
439   /* Free the expanded text.  */
440   xfree (macro_expanded_text);
441   macro_expanded_text = 0;
442 }
443
444
445 static void
446 scan_macro_cleanup (void *dummy)
447 {
448   if (macro_original_text)
449     finished_macro_expansion ();
450 }
451
452
453 /* We set these global variables before calling c_parse, to tell it
454    how it to find macro definitions for the expression at hand.  */
455 macro_lookup_ftype *expression_macro_lookup_func;
456 void *expression_macro_lookup_baton;
457
458
459 static struct macro_definition *
460 null_macro_lookup (const char *name, void *baton)
461 {
462   return 0;
463 }
464
465
466 static int
467 c_preprocess_and_parse (void)
468 {
469   /* Set up a lookup function for the macro expander.  */
470   struct macro_scope *scope = 0;
471   struct cleanup *back_to = make_cleanup (free_current_contents, &scope);
472
473   if (expression_context_block)
474     scope = sal_macro_scope (find_pc_line (expression_context_pc, 0));
475   else
476     scope = default_macro_scope ();
477
478   if (scope)
479     {
480       expression_macro_lookup_func = standard_macro_lookup;
481       expression_macro_lookup_baton = (void *) scope;
482     }
483   else
484     {
485       expression_macro_lookup_func = null_macro_lookup;
486       expression_macro_lookup_baton = 0;      
487     }
488
489   gdb_assert (! macro_original_text);
490   make_cleanup (scan_macro_cleanup, 0);
491
492   {
493     int result = c_parse ();
494     do_cleanups (back_to);
495     return result;
496   }
497 }
498
499
500 \f
501 /* Table mapping opcodes into strings for printing operators
502    and precedences of the operators.  */
503
504 const struct op_print c_op_print_tab[] =
505 {
506   {",", BINOP_COMMA, PREC_COMMA, 0},
507   {"=", BINOP_ASSIGN, PREC_ASSIGN, 1},
508   {"||", BINOP_LOGICAL_OR, PREC_LOGICAL_OR, 0},
509   {"&&", BINOP_LOGICAL_AND, PREC_LOGICAL_AND, 0},
510   {"|", BINOP_BITWISE_IOR, PREC_BITWISE_IOR, 0},
511   {"^", BINOP_BITWISE_XOR, PREC_BITWISE_XOR, 0},
512   {"&", BINOP_BITWISE_AND, PREC_BITWISE_AND, 0},
513   {"==", BINOP_EQUAL, PREC_EQUAL, 0},
514   {"!=", BINOP_NOTEQUAL, PREC_EQUAL, 0},
515   {"<=", BINOP_LEQ, PREC_ORDER, 0},
516   {">=", BINOP_GEQ, PREC_ORDER, 0},
517   {">", BINOP_GTR, PREC_ORDER, 0},
518   {"<", BINOP_LESS, PREC_ORDER, 0},
519   {">>", BINOP_RSH, PREC_SHIFT, 0},
520   {"<<", BINOP_LSH, PREC_SHIFT, 0},
521   {"+", BINOP_ADD, PREC_ADD, 0},
522   {"-", BINOP_SUB, PREC_ADD, 0},
523   {"*", BINOP_MUL, PREC_MUL, 0},
524   {"/", BINOP_DIV, PREC_MUL, 0},
525   {"%", BINOP_REM, PREC_MUL, 0},
526   {"@", BINOP_REPEAT, PREC_REPEAT, 0},
527   {"-", UNOP_NEG, PREC_PREFIX, 0},
528   {"!", UNOP_LOGICAL_NOT, PREC_PREFIX, 0},
529   {"~", UNOP_COMPLEMENT, PREC_PREFIX, 0},
530   {"*", UNOP_IND, PREC_PREFIX, 0},
531   {"&", UNOP_ADDR, PREC_PREFIX, 0},
532   {"sizeof ", UNOP_SIZEOF, PREC_PREFIX, 0},
533   {"++", UNOP_PREINCREMENT, PREC_PREFIX, 0},
534   {"--", UNOP_PREDECREMENT, PREC_PREFIX, 0},
535   {NULL, 0, 0, 0}
536 };
537 \f
538 struct type **const (c_builtin_types[]) =
539 {
540   &builtin_type_int,
541   &builtin_type_long,
542   &builtin_type_short,
543   &builtin_type_char,
544   &builtin_type_float,
545   &builtin_type_double,
546   &builtin_type_void,
547   &builtin_type_long_long,
548   &builtin_type_signed_char,
549   &builtin_type_unsigned_char,
550   &builtin_type_unsigned_short,
551   &builtin_type_unsigned_int,
552   &builtin_type_unsigned_long,
553   &builtin_type_unsigned_long_long,
554   &builtin_type_long_double,
555   &builtin_type_complex,
556   &builtin_type_double_complex,
557   0
558 };
559
560 const struct language_defn c_language_defn =
561 {
562   "c",                          /* Language name */
563   language_c,
564   c_builtin_types,
565   range_check_off,
566   type_check_off,
567   case_sensitive_on,
568   c_preprocess_and_parse,
569   c_error,
570   evaluate_subexp_standard,
571   c_printchar,                  /* Print a character constant */
572   c_printstr,                   /* Function to print string constant */
573   c_emit_char,                  /* Print a single char */
574   c_create_fundamental_type,    /* Create fundamental type in this language */
575   c_print_type,                 /* Print a type using appropriate syntax */
576   c_val_print,                  /* Print a value using appropriate syntax */
577   c_value_print,                /* Print a top-level value */
578   {"", "", "", ""},             /* Binary format info */
579   {"0%lo", "0", "o", ""},       /* Octal format info */
580   {"%ld", "", "d", ""},         /* Decimal format info */
581   {"0x%lx", "0x", "x", ""},     /* Hex format info */
582   c_op_print_tab,               /* expression operators for printing */
583   1,                            /* c-style arrays */
584   0,                            /* String lower bound */
585   &builtin_type_char,           /* Type of string elements */
586   LANG_MAGIC
587 };
588
589 struct type **const (cplus_builtin_types[]) =
590 {
591   &builtin_type_int,
592   &builtin_type_long,
593   &builtin_type_short,
594   &builtin_type_char,
595   &builtin_type_float,
596   &builtin_type_double,
597   &builtin_type_void,
598   &builtin_type_long_long,
599   &builtin_type_signed_char,
600   &builtin_type_unsigned_char,
601   &builtin_type_unsigned_short,
602   &builtin_type_unsigned_int,
603   &builtin_type_unsigned_long,
604   &builtin_type_unsigned_long_long,
605   &builtin_type_long_double,
606   &builtin_type_complex,
607   &builtin_type_double_complex,
608   &builtin_type_bool,
609   0
610 };
611
612 const struct language_defn cplus_language_defn =
613 {
614   "c++",                        /* Language name */
615   language_cplus,
616   cplus_builtin_types,
617   range_check_off,
618   type_check_off,
619   case_sensitive_on,
620   c_preprocess_and_parse,
621   c_error,
622   evaluate_subexp_standard,
623   c_printchar,                  /* Print a character constant */
624   c_printstr,                   /* Function to print string constant */
625   c_emit_char,                  /* Print a single char */
626   c_create_fundamental_type,    /* Create fundamental type in this language */
627   c_print_type,                 /* Print a type using appropriate syntax */
628   c_val_print,                  /* Print a value using appropriate syntax */
629   c_value_print,                /* Print a top-level value */
630   {"", "", "", ""},             /* Binary format info */
631   {"0%lo", "0", "o", ""},       /* Octal format info */
632   {"%ld", "", "d", ""},         /* Decimal format info */
633   {"0x%lx", "0x", "x", ""},     /* Hex format info */
634   c_op_print_tab,               /* expression operators for printing */
635   1,                            /* c-style arrays */
636   0,                            /* String lower bound */
637   &builtin_type_char,           /* Type of string elements */
638   LANG_MAGIC
639 };
640
641 const struct language_defn asm_language_defn =
642 {
643   "asm",                        /* Language name */
644   language_asm,
645   c_builtin_types,
646   range_check_off,
647   type_check_off,
648   case_sensitive_on,
649   c_preprocess_and_parse,
650   c_error,
651   evaluate_subexp_standard,
652   c_printchar,                  /* Print a character constant */
653   c_printstr,                   /* Function to print string constant */
654   c_emit_char,                  /* Print a single char */
655   c_create_fundamental_type,    /* Create fundamental type in this language */
656   c_print_type,                 /* Print a type using appropriate syntax */
657   c_val_print,                  /* Print a value using appropriate syntax */
658   c_value_print,                /* Print a top-level value */
659   {"", "", "", ""},             /* Binary format info */
660   {"0%lo", "0", "o", ""},       /* Octal format info */
661   {"%ld", "", "d", ""},         /* Decimal format info */
662   {"0x%lx", "0x", "x", ""},     /* Hex format info */
663   c_op_print_tab,               /* expression operators for printing */
664   1,                            /* c-style arrays */
665   0,                            /* String lower bound */
666   &builtin_type_char,           /* Type of string elements */
667   LANG_MAGIC
668 };
669
670 void
671 _initialize_c_language (void)
672 {
673   add_language (&c_language_defn);
674   add_language (&cplus_language_defn);
675   add_language (&asm_language_defn);
676 }