1 /* C language support routines for GDB, the GNU debugger.
3 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2002, 2003,
4 2004, 2005, 2007 Free Software Foundation, Inc.
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., 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA. */
26 #include "expression.h"
27 #include "parser-defs.h"
31 #include "macroscope.h"
32 #include "gdb_assert.h"
34 #include "gdb_string.h"
37 #include "cp-support.h"
39 extern void _initialize_c_language (void);
40 static void c_emit_char (int c
, struct ui_file
* stream
, int quoter
);
42 /* Print the character C on STREAM as part of the contents of a literal
43 string whose delimiter is QUOTER. Note that that format for printing
44 characters and strings is language specific. */
47 c_emit_char (int c
, struct ui_file
*stream
, int quoter
)
52 c
&= 0xFF; /* Avoid sign bit follies */
54 escape
= c_target_char_has_backslash_escape (c
);
57 if (quoter
== '"' && strcmp (escape
, "0") == 0)
58 /* Print nulls embedded in double quoted strings as \000 to
60 fprintf_filtered (stream
, "\\000");
62 fprintf_filtered (stream
, "\\%s", escape
);
64 else if (target_char_to_host (c
, &host_char
)
65 && host_char_print_literally (host_char
))
67 if (host_char
== '\\' || host_char
== quoter
)
68 fputs_filtered ("\\", stream
);
69 fprintf_filtered (stream
, "%c", host_char
);
72 fprintf_filtered (stream
, "\\%.3o", (unsigned int) c
);
76 c_printchar (int c
, struct ui_file
*stream
)
78 fputc_filtered ('\'', stream
);
79 LA_EMIT_CHAR (c
, stream
, '\'');
80 fputc_filtered ('\'', stream
);
83 /* Print the character string STRING, printing at most LENGTH characters.
84 LENGTH is -1 if the string is nul terminated. Each character is WIDTH bytes
85 long. Printing stops early if the number hits print_max; repeat counts are
86 printed as appropriate. Print ellipses at the end if we had to stop before
87 printing LENGTH characters, or if FORCE_ELLIPSES. */
90 c_printstr (struct ui_file
*stream
, const gdb_byte
*string
,
91 unsigned int length
, int width
, int force_ellipses
)
94 unsigned int things_printed
= 0;
98 /* If the string was not truncated due to `set print elements', and
99 the last byte of it is a null, we don't print that, in traditional C
103 && (extract_unsigned_integer (string
+ (length
- 1) * width
, width
)
109 fputs_filtered ("\"\"", stream
);
113 for (i
= 0; i
< length
&& things_printed
< print_max
; ++i
)
115 /* Position of the character we are examining
116 to see whether it is repeated. */
118 /* Number of repetitions we have detected so far. */
120 unsigned long current_char
;
126 fputs_filtered (", ", stream
);
130 current_char
= extract_unsigned_integer (string
+ i
* width
, width
);
135 && extract_unsigned_integer (string
+ rep1
* width
, width
)
142 if (reps
> repeat_count_threshold
)
147 fputs_filtered ("\\\", ", stream
);
149 fputs_filtered ("\", ", stream
);
152 LA_PRINT_CHAR (current_char
, stream
);
153 fprintf_filtered (stream
, _(" <repeats %u times>"), reps
);
155 things_printed
+= repeat_count_threshold
;
163 fputs_filtered ("\\\"", stream
);
165 fputs_filtered ("\"", stream
);
168 LA_EMIT_CHAR (current_char
, stream
, '"');
173 /* Terminate the quotes if necessary. */
177 fputs_filtered ("\\\"", stream
);
179 fputs_filtered ("\"", stream
);
182 if (force_ellipses
|| i
< length
)
183 fputs_filtered ("...", stream
);
186 /* Create a fundamental C type using default reasonable for the current
189 Some object/debugging file formats (DWARF version 1, COFF, etc) do not
190 define fundamental types such as "int" or "double". Others (stabs or
191 DWARF version 2, etc) do define fundamental types. For the formats which
192 don't provide fundamental types, gdb can create such types using this
195 FIXME: Some compilers distinguish explicitly signed integral types
196 (signed short, signed int, signed long) from "regular" integral types
197 (short, int, long) in the debugging information. There is some dis-
198 agreement as to how useful this feature is. In particular, gcc does
199 not support this. Also, only some debugging formats allow the
200 distinction to be passed on to a debugger. For now, we always just
201 use "short", "int", or "long" as the type name, for both the implicit
202 and explicitly signed types. This also makes life easier for the
203 gdb test suite since we don't have to account for the differences
204 in output depending upon what the compiler and debugging format
205 support. We will probably have to re-examine the issue when gdb
206 starts taking its fundamental type information directly from the
207 debugging information supplied by the compiler. fnf@cygnus.com */
210 c_create_fundamental_type (struct objfile
*objfile
, int typeid)
212 struct type
*type
= NULL
;
217 /* FIXME: For now, if we are asked to produce a type not in this
218 language, create the equivalent of a C integer type with the
219 name "<?type?>". When all the dust settles from the type
220 reconstruction work, this should probably become an error. */
221 type
= init_type (TYPE_CODE_INT
,
222 TARGET_INT_BIT
/ TARGET_CHAR_BIT
,
223 0, "<?type?>", objfile
);
224 warning (_("internal error: no C/C++ fundamental type %d"), typeid);
227 type
= init_type (TYPE_CODE_VOID
,
228 TARGET_CHAR_BIT
/ TARGET_CHAR_BIT
,
232 type
= init_type (TYPE_CODE_BOOL
,
233 TARGET_CHAR_BIT
/ TARGET_CHAR_BIT
,
237 type
= init_type (TYPE_CODE_INT
,
238 TARGET_CHAR_BIT
/ TARGET_CHAR_BIT
,
239 TYPE_FLAG_NOSIGN
, "char", objfile
);
242 type
= init_type (TYPE_CODE_INT
,
243 TARGET_CHAR_BIT
/ TARGET_CHAR_BIT
,
244 0, "signed char", objfile
);
246 case FT_UNSIGNED_CHAR
:
247 type
= init_type (TYPE_CODE_INT
,
248 TARGET_CHAR_BIT
/ TARGET_CHAR_BIT
,
249 TYPE_FLAG_UNSIGNED
, "unsigned char", objfile
);
252 type
= init_type (TYPE_CODE_INT
,
253 TARGET_SHORT_BIT
/ TARGET_CHAR_BIT
,
254 0, "short", objfile
);
256 case FT_SIGNED_SHORT
:
257 type
= init_type (TYPE_CODE_INT
,
258 TARGET_SHORT_BIT
/ TARGET_CHAR_BIT
,
259 0, "short", objfile
); /* FIXME-fnf */
261 case FT_UNSIGNED_SHORT
:
262 type
= init_type (TYPE_CODE_INT
,
263 TARGET_SHORT_BIT
/ TARGET_CHAR_BIT
,
264 TYPE_FLAG_UNSIGNED
, "unsigned short", objfile
);
267 type
= init_type (TYPE_CODE_INT
,
268 TARGET_INT_BIT
/ TARGET_CHAR_BIT
,
271 case FT_SIGNED_INTEGER
:
272 type
= init_type (TYPE_CODE_INT
,
273 TARGET_INT_BIT
/ TARGET_CHAR_BIT
,
274 0, "int", objfile
); /* FIXME -fnf */
276 case FT_UNSIGNED_INTEGER
:
277 type
= init_type (TYPE_CODE_INT
,
278 TARGET_INT_BIT
/ TARGET_CHAR_BIT
,
279 TYPE_FLAG_UNSIGNED
, "unsigned int", objfile
);
282 type
= init_type (TYPE_CODE_INT
,
283 TARGET_LONG_BIT
/ TARGET_CHAR_BIT
,
287 type
= init_type (TYPE_CODE_INT
,
288 TARGET_LONG_BIT
/ TARGET_CHAR_BIT
,
289 0, "long", objfile
); /* FIXME -fnf */
291 case FT_UNSIGNED_LONG
:
292 type
= init_type (TYPE_CODE_INT
,
293 TARGET_LONG_BIT
/ TARGET_CHAR_BIT
,
294 TYPE_FLAG_UNSIGNED
, "unsigned long", objfile
);
297 type
= init_type (TYPE_CODE_INT
,
298 TARGET_LONG_LONG_BIT
/ TARGET_CHAR_BIT
,
299 0, "long long", objfile
);
301 case FT_SIGNED_LONG_LONG
:
302 type
= init_type (TYPE_CODE_INT
,
303 TARGET_LONG_LONG_BIT
/ TARGET_CHAR_BIT
,
304 0, "signed long long", objfile
);
306 case FT_UNSIGNED_LONG_LONG
:
307 type
= init_type (TYPE_CODE_INT
,
308 TARGET_LONG_LONG_BIT
/ TARGET_CHAR_BIT
,
309 TYPE_FLAG_UNSIGNED
, "unsigned long long", objfile
);
312 type
= init_type (TYPE_CODE_FLT
,
313 TARGET_FLOAT_BIT
/ TARGET_CHAR_BIT
,
314 0, "float", objfile
);
316 case FT_DBL_PREC_FLOAT
:
317 type
= init_type (TYPE_CODE_FLT
,
318 TARGET_DOUBLE_BIT
/ TARGET_CHAR_BIT
,
319 0, "double", objfile
);
321 case FT_EXT_PREC_FLOAT
:
322 type
= init_type (TYPE_CODE_FLT
,
323 TARGET_LONG_DOUBLE_BIT
/ TARGET_CHAR_BIT
,
324 0, "long double", objfile
);
327 type
= init_type (TYPE_CODE_FLT
,
328 2 * TARGET_FLOAT_BIT
/ TARGET_CHAR_BIT
,
329 0, "complex float", objfile
);
330 TYPE_TARGET_TYPE (type
)
331 = init_type (TYPE_CODE_FLT
, TARGET_FLOAT_BIT
/ TARGET_CHAR_BIT
,
332 0, "float", objfile
);
334 case FT_DBL_PREC_COMPLEX
:
335 type
= init_type (TYPE_CODE_FLT
,
336 2 * TARGET_DOUBLE_BIT
/ TARGET_CHAR_BIT
,
337 0, "complex double", objfile
);
338 TYPE_TARGET_TYPE (type
)
339 = init_type (TYPE_CODE_FLT
, TARGET_DOUBLE_BIT
/ TARGET_CHAR_BIT
,
340 0, "double", objfile
);
342 case FT_EXT_PREC_COMPLEX
:
343 type
= init_type (TYPE_CODE_FLT
,
344 2 * TARGET_LONG_DOUBLE_BIT
/ TARGET_CHAR_BIT
,
345 0, "complex long double", objfile
);
346 TYPE_TARGET_TYPE (type
)
347 = init_type (TYPE_CODE_FLT
, TARGET_LONG_DOUBLE_BIT
/ TARGET_CHAR_BIT
,
348 0, "long double", objfile
);
350 case FT_TEMPLATE_ARG
:
351 type
= init_type (TYPE_CODE_TEMPLATE_ARG
,
353 0, "<template arg>", objfile
);
359 /* Preprocessing and parsing C and C++ expressions. */
362 /* When we find that lexptr (the global var defined in parse.c) is
363 pointing at a macro invocation, we expand the invocation, and call
364 scan_macro_expansion to save the old lexptr here and point lexptr
365 into the expanded text. When we reach the end of that, we call
366 end_macro_expansion to pop back to the value we saved here. The
367 macro expansion code promises to return only fully-expanded text,
368 so we don't need to "push" more than one level.
370 This is disgusting, of course. It would be cleaner to do all macro
371 expansion beforehand, and then hand that to lexptr. But we don't
372 really know where the expression ends. Remember, in a command like
374 (gdb) break *ADDRESS if CONDITION
376 we evaluate ADDRESS in the scope of the current frame, but we
377 evaluate CONDITION in the scope of the breakpoint's location. So
378 it's simply wrong to try to macro-expand the whole thing at once. */
379 static char *macro_original_text
;
380 static char *macro_expanded_text
;
384 scan_macro_expansion (char *expansion
)
386 /* We'd better not be trying to push the stack twice. */
387 gdb_assert (! macro_original_text
);
388 gdb_assert (! macro_expanded_text
);
390 /* Save the old lexptr value, so we can return to it when we're done
391 parsing the expanded text. */
392 macro_original_text
= lexptr
;
395 /* Save the expanded text, so we can free it when we're finished. */
396 macro_expanded_text
= expansion
;
401 scanning_macro_expansion (void)
403 return macro_original_text
!= 0;
408 finished_macro_expansion (void)
410 /* There'd better be something to pop back to, and we better have
411 saved a pointer to the start of the expanded text. */
412 gdb_assert (macro_original_text
);
413 gdb_assert (macro_expanded_text
);
415 /* Pop back to the original text. */
416 lexptr
= macro_original_text
;
417 macro_original_text
= 0;
419 /* Free the expanded text. */
420 xfree (macro_expanded_text
);
421 macro_expanded_text
= 0;
426 scan_macro_cleanup (void *dummy
)
428 if (macro_original_text
)
429 finished_macro_expansion ();
433 /* We set these global variables before calling c_parse, to tell it
434 how it to find macro definitions for the expression at hand. */
435 macro_lookup_ftype
*expression_macro_lookup_func
;
436 void *expression_macro_lookup_baton
;
439 static struct macro_definition
*
440 null_macro_lookup (const char *name
, void *baton
)
447 c_preprocess_and_parse (void)
449 /* Set up a lookup function for the macro expander. */
450 struct macro_scope
*scope
= 0;
451 struct cleanup
*back_to
= make_cleanup (free_current_contents
, &scope
);
453 if (expression_context_block
)
454 scope
= sal_macro_scope (find_pc_line (expression_context_pc
, 0));
456 scope
= default_macro_scope ();
460 expression_macro_lookup_func
= standard_macro_lookup
;
461 expression_macro_lookup_baton
= (void *) scope
;
465 expression_macro_lookup_func
= null_macro_lookup
;
466 expression_macro_lookup_baton
= 0;
469 gdb_assert (! macro_original_text
);
470 make_cleanup (scan_macro_cleanup
, 0);
473 int result
= c_parse ();
474 do_cleanups (back_to
);
481 /* Table mapping opcodes into strings for printing operators
482 and precedences of the operators. */
484 const struct op_print c_op_print_tab
[] =
486 {",", BINOP_COMMA
, PREC_COMMA
, 0},
487 {"=", BINOP_ASSIGN
, PREC_ASSIGN
, 1},
488 {"||", BINOP_LOGICAL_OR
, PREC_LOGICAL_OR
, 0},
489 {"&&", BINOP_LOGICAL_AND
, PREC_LOGICAL_AND
, 0},
490 {"|", BINOP_BITWISE_IOR
, PREC_BITWISE_IOR
, 0},
491 {"^", BINOP_BITWISE_XOR
, PREC_BITWISE_XOR
, 0},
492 {"&", BINOP_BITWISE_AND
, PREC_BITWISE_AND
, 0},
493 {"==", BINOP_EQUAL
, PREC_EQUAL
, 0},
494 {"!=", BINOP_NOTEQUAL
, PREC_EQUAL
, 0},
495 {"<=", BINOP_LEQ
, PREC_ORDER
, 0},
496 {">=", BINOP_GEQ
, PREC_ORDER
, 0},
497 {">", BINOP_GTR
, PREC_ORDER
, 0},
498 {"<", BINOP_LESS
, PREC_ORDER
, 0},
499 {">>", BINOP_RSH
, PREC_SHIFT
, 0},
500 {"<<", BINOP_LSH
, PREC_SHIFT
, 0},
501 {"+", BINOP_ADD
, PREC_ADD
, 0},
502 {"-", BINOP_SUB
, PREC_ADD
, 0},
503 {"*", BINOP_MUL
, PREC_MUL
, 0},
504 {"/", BINOP_DIV
, PREC_MUL
, 0},
505 {"%", BINOP_REM
, PREC_MUL
, 0},
506 {"@", BINOP_REPEAT
, PREC_REPEAT
, 0},
507 {"-", UNOP_NEG
, PREC_PREFIX
, 0},
508 {"!", UNOP_LOGICAL_NOT
, PREC_PREFIX
, 0},
509 {"~", UNOP_COMPLEMENT
, PREC_PREFIX
, 0},
510 {"*", UNOP_IND
, PREC_PREFIX
, 0},
511 {"&", UNOP_ADDR
, PREC_PREFIX
, 0},
512 {"sizeof ", UNOP_SIZEOF
, PREC_PREFIX
, 0},
513 {"++", UNOP_PREINCREMENT
, PREC_PREFIX
, 0},
514 {"--", UNOP_PREDECREMENT
, PREC_PREFIX
, 0},
518 enum c_primitive_types
{
519 c_primitive_type_int
,
520 c_primitive_type_long
,
521 c_primitive_type_short
,
522 c_primitive_type_char
,
523 c_primitive_type_float
,
524 c_primitive_type_double
,
525 c_primitive_type_void
,
526 c_primitive_type_long_long
,
527 c_primitive_type_signed_char
,
528 c_primitive_type_unsigned_char
,
529 c_primitive_type_unsigned_short
,
530 c_primitive_type_unsigned_int
,
531 c_primitive_type_unsigned_long
,
532 c_primitive_type_unsigned_long_long
,
533 c_primitive_type_long_double
,
534 c_primitive_type_complex
,
535 c_primitive_type_double_complex
,
540 c_language_arch_info (struct gdbarch
*gdbarch
,
541 struct language_arch_info
*lai
)
543 const struct builtin_type
*builtin
= builtin_type (gdbarch
);
544 lai
->string_char_type
= builtin
->builtin_char
;
545 lai
->primitive_type_vector
546 = GDBARCH_OBSTACK_CALLOC (gdbarch
, nr_c_primitive_types
+ 1,
548 lai
->primitive_type_vector
[c_primitive_type_int
] = builtin
->builtin_int
;
549 lai
->primitive_type_vector
[c_primitive_type_long
] = builtin
->builtin_long
;
550 lai
->primitive_type_vector
[c_primitive_type_short
] = builtin
->builtin_short
;
551 lai
->primitive_type_vector
[c_primitive_type_char
] = builtin
->builtin_char
;
552 lai
->primitive_type_vector
[c_primitive_type_float
] = builtin
->builtin_float
;
553 lai
->primitive_type_vector
[c_primitive_type_double
] = builtin
->builtin_double
;
554 lai
->primitive_type_vector
[c_primitive_type_void
] = builtin
->builtin_void
;
555 lai
->primitive_type_vector
[c_primitive_type_long_long
] = builtin
->builtin_long_long
;
556 lai
->primitive_type_vector
[c_primitive_type_signed_char
] = builtin
->builtin_signed_char
;
557 lai
->primitive_type_vector
[c_primitive_type_unsigned_char
] = builtin
->builtin_unsigned_char
;
558 lai
->primitive_type_vector
[c_primitive_type_unsigned_short
] = builtin
->builtin_unsigned_short
;
559 lai
->primitive_type_vector
[c_primitive_type_unsigned_int
] = builtin
->builtin_unsigned_int
;
560 lai
->primitive_type_vector
[c_primitive_type_unsigned_long
] = builtin
->builtin_unsigned_long
;
561 lai
->primitive_type_vector
[c_primitive_type_unsigned_long_long
] = builtin
->builtin_unsigned_long_long
;
562 lai
->primitive_type_vector
[c_primitive_type_long_double
] = builtin
->builtin_long_double
;
563 lai
->primitive_type_vector
[c_primitive_type_complex
] = builtin
->builtin_complex
;
564 lai
->primitive_type_vector
[c_primitive_type_double_complex
] = builtin
->builtin_double_complex
;
567 const struct language_defn c_language_defn
=
569 "c", /* Language name */
576 &exp_descriptor_standard
,
577 c_preprocess_and_parse
,
580 c_printchar
, /* Print a character constant */
581 c_printstr
, /* Function to print string constant */
582 c_emit_char
, /* Print a single char */
583 c_create_fundamental_type
, /* Create fundamental type in this language */
584 c_print_type
, /* Print a type using appropriate syntax */
585 c_val_print
, /* Print a value using appropriate syntax */
586 c_value_print
, /* Print a top-level value */
587 NULL
, /* Language specific skip_trampoline */
588 NULL
, /* value_of_this */
589 basic_lookup_symbol_nonlocal
, /* lookup_symbol_nonlocal */
590 basic_lookup_transparent_type
,/* lookup_transparent_type */
591 NULL
, /* Language specific symbol demangler */
592 NULL
, /* Language specific class_name_from_physname */
593 c_op_print_tab
, /* expression operators for printing */
594 1, /* c-style arrays */
595 0, /* String lower bound */
597 default_word_break_characters
,
598 c_language_arch_info
,
599 default_print_array_index
,
603 struct type
**const (cplus_builtin_types
[]) =
610 &builtin_type_double
,
612 &builtin_type_long_long
,
613 &builtin_type_signed_char
,
614 &builtin_type_unsigned_char
,
615 &builtin_type_unsigned_short
,
616 &builtin_type_unsigned_int
,
617 &builtin_type_unsigned_long
,
618 &builtin_type_unsigned_long_long
,
619 &builtin_type_long_double
,
620 &builtin_type_complex
,
621 &builtin_type_double_complex
,
626 const struct language_defn cplus_language_defn
=
628 "c++", /* Language name */
635 &exp_descriptor_standard
,
636 c_preprocess_and_parse
,
639 c_printchar
, /* Print a character constant */
640 c_printstr
, /* Function to print string constant */
641 c_emit_char
, /* Print a single char */
642 c_create_fundamental_type
, /* Create fundamental type in this language */
643 c_print_type
, /* Print a type using appropriate syntax */
644 c_val_print
, /* Print a value using appropriate syntax */
645 c_value_print
, /* Print a top-level value */
646 cplus_skip_trampoline
, /* Language specific skip_trampoline */
647 value_of_this
, /* value_of_this */
648 cp_lookup_symbol_nonlocal
, /* lookup_symbol_nonlocal */
649 cp_lookup_transparent_type
, /* lookup_transparent_type */
650 cplus_demangle
, /* Language specific symbol demangler */
651 cp_class_name_from_physname
, /* Language specific class_name_from_physname */
652 c_op_print_tab
, /* expression operators for printing */
653 1, /* c-style arrays */
654 0, /* String lower bound */
655 &builtin_type_char
, /* Type of string elements */
656 default_word_break_characters
,
657 NULL
, /* FIXME: la_language_arch_info. */
658 default_print_array_index
,
662 const struct language_defn asm_language_defn
=
664 "asm", /* Language name */
671 &exp_descriptor_standard
,
672 c_preprocess_and_parse
,
675 c_printchar
, /* Print a character constant */
676 c_printstr
, /* Function to print string constant */
677 c_emit_char
, /* Print a single char */
678 c_create_fundamental_type
, /* Create fundamental type in this language */
679 c_print_type
, /* Print a type using appropriate syntax */
680 c_val_print
, /* Print a value using appropriate syntax */
681 c_value_print
, /* Print a top-level value */
682 NULL
, /* Language specific skip_trampoline */
683 NULL
, /* value_of_this */
684 basic_lookup_symbol_nonlocal
, /* lookup_symbol_nonlocal */
685 basic_lookup_transparent_type
,/* lookup_transparent_type */
686 NULL
, /* Language specific symbol demangler */
687 NULL
, /* Language specific class_name_from_physname */
688 c_op_print_tab
, /* expression operators for printing */
689 1, /* c-style arrays */
690 0, /* String lower bound */
692 default_word_break_characters
,
693 c_language_arch_info
, /* FIXME: la_language_arch_info. */
694 default_print_array_index
,
698 /* The following language_defn does not represent a real language.
699 It just provides a minimal support a-la-C that should allow users
700 to do some simple operations when debugging applications that use
701 a language currently not supported by GDB. */
703 const struct language_defn minimal_language_defn
=
705 "minimal", /* Language name */
712 &exp_descriptor_standard
,
713 c_preprocess_and_parse
,
716 c_printchar
, /* Print a character constant */
717 c_printstr
, /* Function to print string constant */
718 c_emit_char
, /* Print a single char */
719 c_create_fundamental_type
, /* Create fundamental type in this language */
720 c_print_type
, /* Print a type using appropriate syntax */
721 c_val_print
, /* Print a value using appropriate syntax */
722 c_value_print
, /* Print a top-level value */
723 NULL
, /* Language specific skip_trampoline */
724 NULL
, /* value_of_this */
725 basic_lookup_symbol_nonlocal
, /* lookup_symbol_nonlocal */
726 basic_lookup_transparent_type
,/* lookup_transparent_type */
727 NULL
, /* Language specific symbol demangler */
728 NULL
, /* Language specific class_name_from_physname */
729 c_op_print_tab
, /* expression operators for printing */
730 1, /* c-style arrays */
731 0, /* String lower bound */
733 default_word_break_characters
,
734 c_language_arch_info
,
735 default_print_array_index
,
740 _initialize_c_language (void)
742 add_language (&c_language_defn
);
743 add_language (&cplus_language_defn
);
744 add_language (&asm_language_defn
);
745 add_language (&minimal_language_defn
);