1 /* Output dbx-format symbol table information from GNU compiler.
2 Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
3 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING. If not, write to the Free
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
23 /* Output dbx-format symbol table data.
24 This consists of many symbol table entries, each of them
25 a .stabs assembler pseudo-op with four operands:
26 a "name" which is really a description of one symbol and its type,
27 a "code", which is a symbol defined in stab.h whose name starts with N_,
28 an unused operand always 0,
29 and a "value" which is an address or an offset.
30 The name is enclosed in doublequote characters.
32 Each function, variable, typedef, and structure tag
33 has a symbol table entry to define it.
34 The beginning and end of each level of name scoping within
35 a function are also marked by special symbol table entries.
37 The "name" consists of the symbol name, a colon, a kind-of-symbol letter,
38 and a data type number. The data type number may be followed by
39 "=" and a type definition; normally this will happen the first time
40 the type number is mentioned. The type definition may refer to
41 other types by number, and those type numbers may be followed
42 by "=" and nested definitions.
44 This can make the "name" quite long.
45 When a name is more than 80 characters, we split the .stabs pseudo-op
46 into two .stabs pseudo-ops, both sharing the same "code" and "value".
47 The first one is marked as continued with a double-backslash at the
50 The kind-of-symbol letter distinguished function names from global
51 variables from file-scope variables from parameters from auto
52 variables in memory from typedef names from register variables.
55 The "code" is mostly redundant with the kind-of-symbol letter
56 that goes in the "name", but not entirely: for symbols located
57 in static storage, the "code" says which segment the address is in,
58 which controls how it is relocated.
60 The "value" for a symbol in static storage
61 is the core address of the symbol (actually, the assembler
62 label for the symbol). For a symbol located in a stack slot
63 it is the stack offset; for one in a register, the register number.
64 For a typedef symbol, it is zero.
66 If DEBUG_SYMS_TEXT is defined, all debugging symbols must be
67 output while in the text section.
69 For more on data type definitions, see `dbxout_type'. */
78 #include "insn-config.h"
80 #include "output.h" /* ASM_OUTPUT_SOURCE_LINE may refer to sdb functions. */
88 #include "langhooks.h"
90 #ifdef XCOFF_DEBUGGING_INFO
95 #define ASM_STABS_OP "\t.stabs\t"
99 #define ASM_STABN_OP "\t.stabn\t"
102 #ifndef DBX_TYPE_DECL_STABS_CODE
103 #define DBX_TYPE_DECL_STABS_CODE N_LSYM
106 #ifndef DBX_STATIC_CONST_VAR_CODE
107 #define DBX_STATIC_CONST_VAR_CODE N_FUN
110 #ifndef DBX_REGPARM_STABS_CODE
111 #define DBX_REGPARM_STABS_CODE N_RSYM
114 #ifndef DBX_REGPARM_STABS_LETTER
115 #define DBX_REGPARM_STABS_LETTER 'P'
118 /* This is used for parameters passed by invisible reference in a register. */
119 #ifndef GDB_INV_REF_REGPARM_STABS_LETTER
120 #define GDB_INV_REF_REGPARM_STABS_LETTER 'a'
123 #ifndef DBX_MEMPARM_STABS_LETTER
124 #define DBX_MEMPARM_STABS_LETTER 'p'
127 #ifndef FILE_NAME_JOINER
128 #define FILE_NAME_JOINER "/"
131 /* GDB needs to know that the stabs were generated by GCC. We emit an
132 N_OPT stab at the beginning of the source file to indicate this.
133 The string is historical, and different on a very few targets. */
134 #ifndef STABS_GCC_MARKER
135 #define STABS_GCC_MARKER "gcc2_compiled."
138 /* Typical USG systems don't have stab.h, and they also have
139 no use for DBX-format debugging info. */
141 #if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
143 /* Nonzero if we have actually used any of the GDB extensions
144 to the debugging format. The idea is that we use them for the
145 first time only if there's a strong reason, but once we have done that,
146 we use them whenever convenient. */
148 static int have_used_extensions
= 0;
150 /* Number for the next N_SOL filename stabs label. The number 0 is reserved
151 for the N_SO filename stabs label. */
153 #if defined (DBX_DEBUGGING_INFO) && !defined (DBX_OUTPUT_SOURCE_FILENAME)
154 static int source_label_number
= 1;
157 #ifdef DEBUG_SYMS_TEXT
158 #define FORCE_TEXT function_section (current_function_decl);
165 #define STAB_CODE_TYPE enum __stab_debug_code
167 /* 1 if PARM is passed to this function in memory. */
169 #define PARM_PASSED_IN_MEMORY(PARM) \
170 (GET_CODE (DECL_INCOMING_RTL (PARM)) == MEM)
172 /* A C expression for the integer offset value of an automatic variable
173 (N_LSYM) having address X (an RTX). */
174 #ifndef DEBUGGER_AUTO_OFFSET
175 #define DEBUGGER_AUTO_OFFSET(X) \
176 (GET_CODE (X) == PLUS ? INTVAL (XEXP (X, 1)) : 0)
179 /* A C expression for the integer offset value of an argument (N_PSYM)
180 having address X (an RTX). The nominal offset is OFFSET. */
181 #ifndef DEBUGGER_ARG_OFFSET
182 #define DEBUGGER_ARG_OFFSET(OFFSET, X) (OFFSET)
185 /* Stream for writing to assembler file. */
187 static FILE *asmfile
;
189 /* Last source file name mentioned in a NOTE insn. */
191 static const char *lastfile
;
193 /* Current working directory. */
195 static const char *cwd
;
197 enum typestatus
{TYPE_UNSEEN
, TYPE_XREF
, TYPE_DEFINED
};
199 /* Structure recording information about a C data type.
200 The status element says whether we have yet output
201 the definition of the type. TYPE_XREF says we have
202 output it as a cross-reference only.
203 The file_number and type_number elements are used if DBX_USE_BINCL
208 enum typestatus status
;
215 /* Vector recording information about C data types.
216 When we first notice a data type (a tree node),
217 we assign it a number using next_type_number.
218 That is its index in this vector. */
220 struct typeinfo
*typevec
;
222 /* Number of elements of space allocated in `typevec'. */
224 static int typevec_len
;
226 /* In dbx output, each type gets a unique number.
227 This is the number for the next type output.
228 The number, once assigned, is in the TYPE_SYMTAB_ADDRESS field. */
230 static int next_type_number
;
234 /* When using N_BINCL in dbx output, each type number is actually a
235 pair of the file number and the type number within the file.
236 This is a stack of input files. */
240 struct dbx_file
*next
;
242 int next_type_number
;
245 /* This is the top of the stack. */
247 static struct dbx_file
*current_file
;
249 /* This is the next file number to use. */
251 static int next_file_number
;
253 #endif /* DBX_USE_BINCL */
255 /* These variables are for dbxout_symbol to communicate to
256 dbxout_finish_symbol.
257 current_sym_code is the symbol-type-code, a symbol N_... define in stab.h.
258 current_sym_value and current_sym_addr are two ways to address the
259 value to store in the symtab entry.
260 current_sym_addr if nonzero represents the value as an rtx.
261 If that is zero, current_sym_value is used. This is used
262 when the value is an offset (such as for auto variables,
263 register variables and parms). */
265 static STAB_CODE_TYPE current_sym_code
;
266 static int current_sym_value
;
267 static rtx current_sym_addr
;
269 /* Number of chars of symbol-description generated so far for the
270 current symbol. Used by CHARS and CONTIN. */
272 static int current_sym_nchars
;
274 /* Report having output N chars of the current symbol-description. */
276 #define CHARS(N) (current_sym_nchars += (N))
278 /* Break the current symbol-description, generating a continuation,
279 if it has become long. */
281 #ifndef DBX_CONTIN_LENGTH
282 #define DBX_CONTIN_LENGTH 80
285 #if DBX_CONTIN_LENGTH > 0
287 do {if (current_sym_nchars > DBX_CONTIN_LENGTH) dbxout_continue ();} while (0)
289 #define CONTIN do { } while (0)
292 static void dbxout_init
PARAMS ((const char *));
293 static void dbxout_finish
PARAMS ((const char *));
294 static void dbxout_start_source_file
PARAMS ((unsigned, const char *));
295 static void dbxout_end_source_file
PARAMS ((unsigned));
296 static void dbxout_typedefs
PARAMS ((tree
));
297 static void dbxout_type_index
PARAMS ((tree
));
298 #if DBX_CONTIN_LENGTH > 0
299 static void dbxout_continue
PARAMS ((void));
301 static void dbxout_args
PARAMS ((tree
));
302 static void dbxout_type_fields
PARAMS ((tree
));
303 static void dbxout_type_method_1
PARAMS ((tree
, const char *));
304 static void dbxout_type_methods
PARAMS ((tree
));
305 static void dbxout_range_type
PARAMS ((tree
));
306 static void dbxout_type
PARAMS ((tree
, int));
307 static void print_int_cst_octal
PARAMS ((tree
));
308 static void print_octal
PARAMS ((unsigned HOST_WIDE_INT
, int));
309 static void print_wide_int
PARAMS ((HOST_WIDE_INT
));
310 static void dbxout_type_name
PARAMS ((tree
));
311 static void dbxout_class_name_qualifiers
PARAMS ((tree
));
312 static int dbxout_symbol_location
PARAMS ((tree
, tree
, const char *, rtx
));
313 static void dbxout_symbol_name
PARAMS ((tree
, const char *, int));
314 static void dbxout_prepare_symbol
PARAMS ((tree
));
315 static void dbxout_finish_symbol
PARAMS ((tree
));
316 static void dbxout_block
PARAMS ((tree
, int, tree
));
317 static void dbxout_global_decl
PARAMS ((tree
));
319 /* The debug hooks structure. */
320 #if defined (DBX_DEBUGGING_INFO)
322 static void dbxout_source_line
PARAMS ((unsigned int, const char *));
323 static void dbxout_source_file
PARAMS ((FILE *, const char *));
324 static void dbxout_function_end
PARAMS ((void));
325 static void dbxout_begin_function
PARAMS ((tree
));
326 static void dbxout_begin_block
PARAMS ((unsigned, unsigned));
327 static void dbxout_end_block
PARAMS ((unsigned, unsigned));
328 static void dbxout_function_decl
PARAMS ((tree
));
330 const struct gcc_debug_hooks dbx_debug_hooks
=
334 debug_nothing_int_charstar
,
335 debug_nothing_int_charstar
,
336 dbxout_start_source_file
,
337 dbxout_end_source_file
,
340 debug_true_tree
, /* ignore_block */
341 dbxout_source_line
, /* source_line */
342 dbxout_source_line
, /* begin_prologue: just output line info */
343 debug_nothing_int_charstar
, /* end_prologue */
344 debug_nothing_int_charstar
, /* end_epilogue */
345 #ifdef DBX_FUNCTION_FIRST
346 dbxout_begin_function
,
348 debug_nothing_tree
, /* begin_function */
350 debug_nothing_int
, /* end_function */
351 dbxout_function_decl
,
352 dbxout_global_decl
, /* global_decl */
353 debug_nothing_tree
, /* deferred_inline_function */
354 debug_nothing_tree
, /* outlining_inline_function */
355 debug_nothing_rtx
/* label */
357 #endif /* DBX_DEBUGGING_INFO */
359 #if defined (XCOFF_DEBUGGING_INFO)
360 const struct gcc_debug_hooks xcoff_debug_hooks
=
364 debug_nothing_int_charstar
,
365 debug_nothing_int_charstar
,
366 dbxout_start_source_file
,
367 dbxout_end_source_file
,
368 xcoffout_begin_block
,
370 debug_true_tree
, /* ignore_block */
371 xcoffout_source_line
,
372 xcoffout_begin_prologue
, /* begin_prologue */
373 debug_nothing_int_charstar
, /* end_prologue */
374 xcoffout_end_epilogue
,
375 debug_nothing_tree
, /* begin_function */
376 xcoffout_end_function
,
377 debug_nothing_tree
, /* function_decl */
378 dbxout_global_decl
, /* global_decl */
379 debug_nothing_tree
, /* deferred_inline_function */
380 debug_nothing_tree
, /* outlining_inline_function */
381 debug_nothing_rtx
/* label */
383 #endif /* XCOFF_DEBUGGING_INFO */
385 #if defined (DBX_DEBUGGING_INFO)
387 dbxout_function_end ()
389 static int scope_labelno
= 0;
390 char lscope_label_name
[100];
391 /* Convert Ltext into the appropriate format for local labels in case
392 the system doesn't insert underscores in front of user generated
394 ASM_GENERATE_INTERNAL_LABEL (lscope_label_name
, "Lscope", scope_labelno
);
395 ASM_OUTPUT_INTERNAL_LABEL (asmfile
, "Lscope", scope_labelno
);
398 /* By convention, GCC will mark the end of a function with an N_FUN
399 symbol and an empty string. */
400 #ifdef DBX_OUTPUT_NFUN
401 DBX_OUTPUT_NFUN (asmfile
, lscope_label_name
, current_function_decl
);
403 fprintf (asmfile
, "%s\"\",%d,0,0,", ASM_STABS_OP
, N_FUN
);
404 assemble_name (asmfile
, lscope_label_name
);
406 assemble_name (asmfile
, XSTR (XEXP (DECL_RTL (current_function_decl
), 0), 0));
407 fprintf (asmfile
, "\n");
410 #endif /* DBX_DEBUGGING_INFO */
412 /* At the beginning of compilation, start writing the symbol table.
413 Initialize `typevec' and output the standard data types of C. */
416 dbxout_init (input_file_name
)
417 const char *input_file_name
;
419 char ltext_label_name
[100];
420 tree syms
= (*lang_hooks
.decls
.getdecls
) ();
422 asmfile
= asm_out_file
;
425 typevec
= (struct typeinfo
*) xcalloc (typevec_len
, sizeof typevec
[0]);
427 /* Convert Ltext into the appropriate format for local labels in case
428 the system doesn't insert underscores in front of user generated
430 ASM_GENERATE_INTERNAL_LABEL (ltext_label_name
, "Ltext", 0);
432 /* Put the current working directory in an N_SO symbol. */
433 #ifndef DBX_WORKING_DIRECTORY /* Only some versions of DBX want this,
434 but GDB always does. */
435 if (use_gnu_debug_info_extensions
)
438 if (!cwd
&& (cwd
= getpwd ()) && (!*cwd
|| cwd
[strlen (cwd
) - 1] != '/'))
439 cwd
= concat (cwd
, FILE_NAME_JOINER
, NULL
);
442 #ifdef DBX_OUTPUT_MAIN_SOURCE_DIRECTORY
443 DBX_OUTPUT_MAIN_SOURCE_DIRECTORY (asmfile
, cwd
);
444 #else /* no DBX_OUTPUT_MAIN_SOURCE_DIRECTORY */
445 fprintf (asmfile
, "%s", ASM_STABS_OP
);
446 output_quoted_string (asmfile
, cwd
);
447 fprintf (asmfile
, ",%d,0,0,", N_SO
);
448 assemble_name (asmfile
, ltext_label_name
);
449 fputc ('\n', asmfile
);
450 #endif /* no DBX_OUTPUT_MAIN_SOURCE_DIRECTORY */
454 #ifdef DBX_OUTPUT_MAIN_SOURCE_FILENAME
455 /* This should NOT be DBX_OUTPUT_SOURCE_FILENAME. That
456 would give us an N_SOL, and we want an N_SO. */
457 DBX_OUTPUT_MAIN_SOURCE_FILENAME (asmfile
, input_file_name
);
458 #else /* no DBX_OUTPUT_MAIN_SOURCE_FILENAME */
459 /* We include outputting `Ltext:' here,
460 because that gives you a way to override it. */
461 /* Used to put `Ltext:' before the reference, but that loses on sun 4. */
462 fprintf (asmfile
, "%s", ASM_STABS_OP
);
463 output_quoted_string (asmfile
, input_file_name
);
464 fprintf (asmfile
, ",%d,0,0,", N_SO
);
465 assemble_name (asmfile
, ltext_label_name
);
466 fputc ('\n', asmfile
);
468 ASM_OUTPUT_INTERNAL_LABEL (asmfile
, "Ltext", 0);
469 #endif /* no DBX_OUTPUT_MAIN_SOURCE_FILENAME */
471 #ifdef DBX_OUTPUT_GCC_MARKER
472 DBX_OUTPUT_GCC_MARKER (asmfile
);
474 /* Emit an N_OPT stab to indicate that this file was compiled by GCC. */
475 fprintf (asmfile
, "%s\"%s\",%d,0,0,0\n",
476 ASM_STABS_OP
, STABS_GCC_MARKER
, N_OPT
);
479 lastfile
= input_file_name
;
481 next_type_number
= 1;
484 current_file
= (struct dbx_file
*) xmalloc (sizeof *current_file
);
485 current_file
->next
= NULL
;
486 current_file
->file_number
= 0;
487 current_file
->next_type_number
= 1;
488 next_file_number
= 1;
491 /* Make sure that types `int' and `char' have numbers 1 and 2.
492 Definitions of other integer types will refer to those numbers.
493 (Actually it should no longer matter what their numbers are.
494 Also, if any types with tags have been defined, dbxout_symbol
495 will output them first, so the numbers won't be 1 and 2. That
496 happens in C++. So it's a good thing it should no longer matter). */
498 #ifdef DBX_OUTPUT_STANDARD_TYPES
499 DBX_OUTPUT_STANDARD_TYPES (syms
);
501 dbxout_symbol (TYPE_NAME (integer_type_node
), 0);
502 dbxout_symbol (TYPE_NAME (char_type_node
), 0);
505 /* Get all permanent types that have typedef names,
506 and output them all, except for those already output. */
508 dbxout_typedefs (syms
);
511 /* Output any typedef names for types described by TYPE_DECLs in SYMS,
512 in the reverse order from that which is found in SYMS. */
515 dbxout_typedefs (syms
)
520 dbxout_typedefs (TREE_CHAIN (syms
));
521 if (TREE_CODE (syms
) == TYPE_DECL
)
523 tree type
= TREE_TYPE (syms
);
525 && TREE_CODE (TYPE_NAME (type
)) == TYPE_DECL
526 && COMPLETE_TYPE_P (type
)
527 && ! TREE_ASM_WRITTEN (TYPE_NAME (type
)))
528 dbxout_symbol (TYPE_NAME (type
), 0);
533 /* Change to reading from a new source file. Generate a N_BINCL stab. */
536 dbxout_start_source_file (line
, filename
)
537 unsigned int line ATTRIBUTE_UNUSED
;
538 const char *filename ATTRIBUTE_UNUSED
;
541 struct dbx_file
*n
= (struct dbx_file
*) xmalloc (sizeof *n
);
543 n
->next
= current_file
;
544 n
->file_number
= next_file_number
++;
545 n
->next_type_number
= 1;
547 fprintf (asmfile
, "%s", ASM_STABS_OP
);
548 output_quoted_string (asmfile
, filename
);
549 fprintf (asmfile
, ",%d,0,0,0\n", N_BINCL
);
553 /* Revert to reading a previous source file. Generate a N_EINCL stab. */
556 dbxout_end_source_file (line
)
557 unsigned int line ATTRIBUTE_UNUSED
;
560 struct dbx_file
*next
;
562 fprintf (asmfile
, "%s%d,0,0,0\n", ASM_STABN_OP
, N_EINCL
);
563 next
= current_file
->next
;
569 #if defined (DBX_DEBUGGING_INFO)
570 /* Output debugging info to FILE to switch to sourcefile FILENAME. */
573 dbxout_source_file (file
, filename
)
575 const char *filename
;
577 if (filename
&& (lastfile
== 0 || strcmp (filename
, lastfile
)))
579 #ifdef DBX_OUTPUT_SOURCE_FILENAME
580 DBX_OUTPUT_SOURCE_FILENAME (file
, filename
);
582 char ltext_label_name
[100];
584 ASM_GENERATE_INTERNAL_LABEL (ltext_label_name
, "Ltext",
585 source_label_number
);
586 fprintf (file
, "%s", ASM_STABS_OP
);
587 output_quoted_string (file
, filename
);
588 fprintf (asmfile
, ",%d,0,0,", N_SOL
);
589 assemble_name (asmfile
, ltext_label_name
);
590 fputc ('\n', asmfile
);
591 if (current_function_decl
!= NULL_TREE
592 && DECL_SECTION_NAME (current_function_decl
) != NULL_TREE
)
593 ; /* Don't change section amid function. */
596 ASM_OUTPUT_INTERNAL_LABEL (file
, "Ltext", source_label_number
);
597 source_label_number
++;
603 /* Output a line number symbol entry for source file FILENAME and line
607 dbxout_source_line (lineno
, filename
)
609 const char *filename
;
611 dbxout_source_file (asmfile
, filename
);
613 #ifdef ASM_OUTPUT_SOURCE_LINE
614 ASM_OUTPUT_SOURCE_LINE (asmfile
, lineno
);
616 fprintf (asmfile
, "%s%d,0,%d\n", ASM_STABD_OP
, N_SLINE
, lineno
);
620 /* Describe the beginning of an internal block within a function. */
623 dbxout_begin_block (line
, n
)
624 unsigned int line ATTRIBUTE_UNUSED
;
627 ASM_OUTPUT_INTERNAL_LABEL (asmfile
, "LBB", n
);
630 /* Describe the end line-number of an internal block within a function. */
633 dbxout_end_block (line
, n
)
634 unsigned int line ATTRIBUTE_UNUSED
;
637 ASM_OUTPUT_INTERNAL_LABEL (asmfile
, "LBE", n
);
640 /* Output dbx data for a function definition.
641 This includes a definition of the function name itself (a symbol),
642 definitions of the parameters (locating them in the parameter list)
643 and then output the block that makes up the function's body
644 (including all the auto variables of the function). */
647 dbxout_function_decl (decl
)
650 #ifndef DBX_FUNCTION_FIRST
651 dbxout_begin_function (decl
);
653 dbxout_block (DECL_INITIAL (decl
), 0, DECL_ARGUMENTS (decl
));
654 #ifdef DBX_OUTPUT_FUNCTION_END
655 DBX_OUTPUT_FUNCTION_END (asmfile
, decl
);
657 if (use_gnu_debug_info_extensions
658 #if defined(NO_DBX_FUNCTION_END)
659 && ! NO_DBX_FUNCTION_END
661 && targetm
.have_named_sections
)
662 dbxout_function_end ();
665 #endif /* DBX_DEBUGGING_INFO */
667 /* Debug information for a global DECL. Called from toplev.c after
668 compilation proper has finished. */
670 dbxout_global_decl (decl
)
673 if (TREE_CODE (decl
) == VAR_DECL
674 && ! DECL_EXTERNAL (decl
)
675 && DECL_RTL_SET_P (decl
)) /* Not necessary? */
676 dbxout_symbol (decl
, 0);
679 /* At the end of compilation, finish writing the symbol table.
680 Unless you define DBX_OUTPUT_MAIN_SOURCE_FILE_END, the default is
684 dbxout_finish (filename
)
685 const char *filename ATTRIBUTE_UNUSED
;
687 #ifdef DBX_OUTPUT_MAIN_SOURCE_FILE_END
688 DBX_OUTPUT_MAIN_SOURCE_FILE_END (asmfile
, filename
);
689 #endif /* DBX_OUTPUT_MAIN_SOURCE_FILE_END */
692 /* Output the index of a type. */
695 dbxout_type_index (type
)
698 #ifndef DBX_USE_BINCL
699 fprintf (asmfile
, "%d", TYPE_SYMTAB_ADDRESS (type
));
702 struct typeinfo
*t
= &typevec
[TYPE_SYMTAB_ADDRESS (type
)];
703 fprintf (asmfile
, "(%d,%d)", t
->file_number
, t
->type_number
);
708 #if DBX_CONTIN_LENGTH > 0
709 /* Continue a symbol-description that gets too big.
710 End one symbol table entry with a double-backslash
711 and start a new one, eventually producing something like
712 .stabs "start......\\",code,0,value
713 .stabs "...rest",code,0,value */
718 #ifdef DBX_CONTIN_CHAR
719 fprintf (asmfile
, "%c", DBX_CONTIN_CHAR
);
721 fprintf (asmfile
, "\\\\");
723 dbxout_finish_symbol (NULL_TREE
);
724 fprintf (asmfile
, "%s\"", ASM_STABS_OP
);
725 current_sym_nchars
= 0;
727 #endif /* DBX_CONTIN_LENGTH > 0 */
729 /* Subroutine of `dbxout_type'. Output the type fields of TYPE.
730 This must be a separate function because anonymous unions require
734 dbxout_type_fields (type
)
739 /* Output the name, type, position (in bits), size (in bits) of each
740 field that we can support. */
741 for (tem
= TYPE_FIELDS (type
); tem
; tem
= TREE_CHAIN (tem
))
743 /* Omit here local type decls until we know how to support them. */
744 if (TREE_CODE (tem
) == TYPE_DECL
745 /* Omit fields whose position or size are variable or too large to
747 || (TREE_CODE (tem
) == FIELD_DECL
748 && (! host_integerp (bit_position (tem
), 0)
750 || ! host_integerp (DECL_SIZE (tem
), 1)))
751 /* Omit here the nameless fields that are used to skip bits. */
752 || DECL_IGNORED_P (tem
))
755 else if (TREE_CODE (tem
) != CONST_DECL
)
757 /* Continue the line if necessary,
758 but not before the first field. */
759 if (tem
!= TYPE_FIELDS (type
))
764 fprintf (asmfile
, "%s:", IDENTIFIER_POINTER (DECL_NAME (tem
)));
765 CHARS (2 + IDENTIFIER_LENGTH (DECL_NAME (tem
)));
769 fprintf (asmfile
, ":");
773 if (use_gnu_debug_info_extensions
774 && (TREE_PRIVATE (tem
) || TREE_PROTECTED (tem
)
775 || TREE_CODE (tem
) != FIELD_DECL
))
777 have_used_extensions
= 1;
779 putc ((TREE_PRIVATE (tem
) ? '0'
780 : TREE_PROTECTED (tem
) ? '1' : '2'),
785 dbxout_type ((TREE_CODE (tem
) == FIELD_DECL
786 && DECL_BIT_FIELD_TYPE (tem
))
787 ? DECL_BIT_FIELD_TYPE (tem
) : TREE_TYPE (tem
), 0);
789 if (TREE_CODE (tem
) == VAR_DECL
)
791 if (TREE_STATIC (tem
) && use_gnu_debug_info_extensions
)
793 tree name
= DECL_ASSEMBLER_NAME (tem
);
795 have_used_extensions
= 1;
796 fprintf (asmfile
, ":%s;", IDENTIFIER_POINTER (name
));
797 CHARS (IDENTIFIER_LENGTH (name
) + 2);
801 /* If TEM is non-static, GDB won't understand it. */
802 fprintf (asmfile
, ",0,0;");
809 print_wide_int (int_bit_position (tem
));
811 print_wide_int (tree_low_cst (DECL_SIZE (tem
), 1));
819 /* Subroutine of `dbxout_type_methods'. Output debug info about the
820 method described DECL. DEBUG_NAME is an encoding of the method's
821 type signature. ??? We may be able to do without DEBUG_NAME altogether
825 dbxout_type_method_1 (decl
, debug_name
)
827 const char *debug_name
;
831 if (TREE_CODE (TREE_TYPE (decl
)) == FUNCTION_TYPE
)
833 else /* it's a METHOD_TYPE. */
835 tree firstarg
= TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (decl
)));
836 /* A for normal functions.
837 B for `const' member functions.
838 C for `volatile' member functions.
839 D for `const volatile' member functions. */
840 if (TYPE_READONLY (TREE_TYPE (firstarg
)))
842 if (TYPE_VOLATILE (TREE_TYPE (firstarg
)))
845 if (DECL_VINDEX (decl
))
851 fprintf (asmfile
, ":%s;%c%c%c", debug_name
,
852 TREE_PRIVATE (decl
) ? '0'
853 : TREE_PROTECTED (decl
) ? '1' : '2', c1
, c2
);
854 CHARS (IDENTIFIER_LENGTH (DECL_ASSEMBLER_NAME (decl
)) + 6
855 - (debug_name
- IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl
))));
857 if (DECL_VINDEX (decl
) && host_integerp (DECL_VINDEX (decl
), 0))
859 print_wide_int (tree_low_cst (DECL_VINDEX (decl
), 0));
862 dbxout_type (DECL_CONTEXT (decl
), 0);
863 fprintf (asmfile
, ";");
868 /* Subroutine of `dbxout_type'. Output debug info about the methods defined
872 dbxout_type_methods (type
)
875 /* C++: put out the method names and their parameter lists */
876 tree methods
= TYPE_METHODS (type
);
880 char formatted_type_identifier_length
[16];
881 int type_identifier_length
;
883 if (methods
== NULL_TREE
)
886 type_encoding
= DECL_NAME (TYPE_NAME (type
));
889 /* C++: Template classes break some assumptions made by this code about
890 the class names, constructor names, and encodings for assembler
891 label names. For now, disable output of dbx info for them. */
893 const char *ptr
= IDENTIFIER_POINTER (type_encoding
);
894 /* This should use index. (mrs) */
895 while (*ptr
&& *ptr
!= '<') ptr
++;
906 type_identifier_length
= IDENTIFIER_LENGTH (type_encoding
);
908 sprintf (formatted_type_identifier_length
, "%d", type_identifier_length
);
910 if (TREE_CODE (methods
) != TREE_VEC
)
912 else if (TREE_VEC_ELT (methods
, 0) != NULL_TREE
)
913 fndecl
= TREE_VEC_ELT (methods
, 0);
915 fndecl
= TREE_VEC_ELT (methods
, 1);
921 /* Group together all the methods for the same operation.
922 These differ in the types of the arguments. */
923 for (last
= NULL_TREE
;
924 fndecl
&& (last
== NULL_TREE
|| DECL_NAME (fndecl
) == DECL_NAME (last
));
925 fndecl
= TREE_CHAIN (fndecl
))
926 /* Output the name of the field (after overloading), as
927 well as the name of the field before overloading, along
928 with its parameter list */
930 /* This is the "mangled" name of the method.
931 It encodes the argument types. */
932 const char *debug_name
;
934 /* Skip methods that aren't FUNCTION_DECLs. (In C++, these
935 include TEMPLATE_DECLs.) The debugger doesn't know what
936 to do with such entities anyhow. */
937 if (TREE_CODE (fndecl
) != FUNCTION_DECL
)
940 debug_name
= IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (fndecl
));
946 /* Also ignore abstract methods; those are only interesting to
947 the DWARF backends. */
948 if (DECL_IGNORED_P (fndecl
) || DECL_ABSTRACT (fndecl
))
951 /* Redundantly output the plain name, since that's what gdb
955 tree name
= DECL_NAME (fndecl
);
956 fprintf (asmfile
, "%s::", IDENTIFIER_POINTER (name
));
957 CHARS (IDENTIFIER_LENGTH (name
) + 2);
961 dbxout_type (TREE_TYPE (fndecl
), 0);
963 dbxout_type_method_1 (fndecl
, debug_name
);
973 /* Emit a "range" type specification, which has the form:
974 "r<index type>;<lower bound>;<upper bound>;".
975 TYPE is an INTEGER_TYPE. */
978 dbxout_range_type (type
)
981 fprintf (asmfile
, "r");
982 if (TREE_TYPE (type
))
983 dbxout_type (TREE_TYPE (type
), 0);
984 else if (TREE_CODE (type
) != INTEGER_TYPE
)
985 dbxout_type (type
, 0); /* E.g. Pascal's ARRAY [BOOLEAN] of INTEGER */
988 /* Traditionally, we made sure 'int' was type 1, and builtin types
989 were defined to be sub-ranges of int. Unfortunately, this
990 does not allow us to distinguish true sub-ranges from integer
991 types. So, instead we define integer (non-sub-range) types as
992 sub-ranges of themselves. This matters for Chill. If this isn't
993 a subrange type, then we want to define it in terms of itself.
994 However, in C, this may be an anonymous integer type, and we don't
995 want to emit debug info referring to it. Just calling
996 dbxout_type_index won't work anyways, because the type hasn't been
997 defined yet. We make this work for both cases by checked to see
998 whether this is a defined type, referring to it if it is, and using
1000 if (TYPE_SYMTAB_ADDRESS (type
) != 0)
1001 dbxout_type_index (type
);
1003 dbxout_type_index (integer_type_node
);
1006 if (TYPE_MIN_VALUE (type
) != 0
1007 && host_integerp (TYPE_MIN_VALUE (type
), 0))
1009 putc (';', asmfile
);
1011 print_wide_int (tree_low_cst (TYPE_MIN_VALUE (type
), 0));
1015 fprintf (asmfile
, ";0");
1019 if (TYPE_MAX_VALUE (type
) != 0
1020 && host_integerp (TYPE_MAX_VALUE (type
), 0))
1022 putc (';', asmfile
);
1024 print_wide_int (tree_low_cst (TYPE_MAX_VALUE (type
), 0));
1025 putc (';', asmfile
);
1030 fprintf (asmfile
, ";-1;");
1035 /* Output a reference to a type. If the type has not yet been
1036 described in the dbx output, output its definition now.
1037 For a type already defined, just refer to its definition
1038 using the type number.
1040 If FULL is nonzero, and the type has been described only with
1041 a forward-reference, output the definition now.
1042 If FULL is zero in this case, just refer to the forward-reference
1043 using the number previously allocated. */
1046 dbxout_type (type
, full
)
1052 static int anonymous_type_number
= 0;
1054 if (TREE_CODE (type
) == VECTOR_TYPE
)
1055 /* The frontend feeds us a representation for the vector as a struct
1056 containing an array. Pull out the array type. */
1057 type
= TREE_TYPE (TYPE_FIELDS (TYPE_DEBUG_REPRESENTATION_TYPE (type
)));
1059 /* If there was an input error and we don't really have a type,
1060 avoid crashing and write something that is at least valid
1061 by assuming `int'. */
1062 if (type
== error_mark_node
)
1063 type
= integer_type_node
;
1066 if (TYPE_NAME (type
)
1067 && TREE_CODE (TYPE_NAME (type
)) == TYPE_DECL
1068 && TYPE_DECL_SUPPRESS_DEBUG (TYPE_NAME (type
)))
1072 /* Try to find the "main variant" with the same name. */
1073 if (TYPE_NAME (type
) && TREE_CODE (TYPE_NAME (type
)) == TYPE_DECL
1074 && DECL_ORIGINAL_TYPE (TYPE_NAME (type
)))
1075 main_variant
= TREE_TYPE (TYPE_NAME (type
));
1077 main_variant
= TYPE_MAIN_VARIANT (type
);
1079 /* If we are not using extensions, stabs does not distinguish const and
1080 volatile, so there is no need to make them separate types. */
1081 if (!use_gnu_debug_info_extensions
)
1082 type
= main_variant
;
1084 if (TYPE_SYMTAB_ADDRESS (type
) == 0)
1086 /* Type has no dbx number assigned. Assign next available number. */
1087 TYPE_SYMTAB_ADDRESS (type
) = next_type_number
++;
1089 /* Make sure type vector is long enough to record about this type. */
1091 if (next_type_number
== typevec_len
)
1094 = (struct typeinfo
*) xrealloc (typevec
,
1095 typevec_len
* 2 * sizeof typevec
[0]);
1096 memset ((char *) (typevec
+ typevec_len
), 0,
1097 typevec_len
* sizeof typevec
[0]);
1101 #ifdef DBX_USE_BINCL
1102 typevec
[TYPE_SYMTAB_ADDRESS (type
)].file_number
1103 = current_file
->file_number
;
1104 typevec
[TYPE_SYMTAB_ADDRESS (type
)].type_number
1105 = current_file
->next_type_number
++;
1109 /* Output the number of this type, to refer to it. */
1110 dbxout_type_index (type
);
1112 #ifdef DBX_TYPE_DEFINED
1113 if (DBX_TYPE_DEFINED (type
))
1117 /* If this type's definition has been output or is now being output,
1120 switch (typevec
[TYPE_SYMTAB_ADDRESS (type
)].status
)
1125 /* If we have already had a cross reference,
1126 and either that's all we want or that's the best we could do,
1127 don't repeat the cross reference.
1128 Sun dbx crashes if we do. */
1129 if (! full
|| !COMPLETE_TYPE_P (type
)
1130 /* No way in DBX fmt to describe a variable size. */
1131 || ! host_integerp (TYPE_SIZE (type
), 1))
1139 /* For systems where dbx output does not allow the `=xsNAME:' syntax,
1140 leave the type-number completely undefined rather than output
1141 a cross-reference. If we have already used GNU debug info extensions,
1142 then it is OK to output a cross reference. This is necessary to get
1143 proper C++ debug output. */
1144 if ((TREE_CODE (type
) == RECORD_TYPE
|| TREE_CODE (type
) == UNION_TYPE
1145 || TREE_CODE (type
) == QUAL_UNION_TYPE
1146 || TREE_CODE (type
) == ENUMERAL_TYPE
)
1147 && ! use_gnu_debug_info_extensions
)
1148 /* We must use the same test here as we use twice below when deciding
1149 whether to emit a cross-reference. */
1150 if ((TYPE_NAME (type
) != 0
1151 && ! (TREE_CODE (TYPE_NAME (type
)) == TYPE_DECL
1152 && DECL_IGNORED_P (TYPE_NAME (type
)))
1154 || !COMPLETE_TYPE_P (type
)
1155 /* No way in DBX fmt to describe a variable size. */
1156 || ! host_integerp (TYPE_SIZE (type
), 1))
1158 typevec
[TYPE_SYMTAB_ADDRESS (type
)].status
= TYPE_XREF
;
1163 /* Output a definition now. */
1165 fprintf (asmfile
, "=");
1168 /* Mark it as defined, so that if it is self-referent
1169 we will not get into an infinite recursion of definitions. */
1171 typevec
[TYPE_SYMTAB_ADDRESS (type
)].status
= TYPE_DEFINED
;
1173 /* If this type is a variant of some other, hand off. Types with
1174 different names are usefully distinguished. We only distinguish
1175 cv-qualified types if we're using extensions. */
1176 if (TYPE_READONLY (type
) > TYPE_READONLY (main_variant
))
1178 putc ('k', asmfile
);
1180 dbxout_type (build_type_variant (type
, 0, TYPE_VOLATILE (type
)), 0);
1183 else if (TYPE_VOLATILE (type
) > TYPE_VOLATILE (main_variant
))
1185 putc ('B', asmfile
);
1187 dbxout_type (build_type_variant (type
, TYPE_READONLY (type
), 0), 0);
1190 else if (main_variant
!= TYPE_MAIN_VARIANT (type
))
1192 /* 'type' is a typedef; output the type it refers to. */
1193 dbxout_type (DECL_ORIGINAL_TYPE (TYPE_NAME (type
)), 0);
1196 /* else continue. */
1198 switch (TREE_CODE (type
))
1202 /* For a void type, just define it as itself; ie, "5=5".
1203 This makes us consider it defined
1204 without saying what it is. The debugger will make it
1205 a void type when the reference is seen, and nothing will
1206 ever override that default. */
1207 dbxout_type_index (type
);
1211 if (type
== char_type_node
&& ! TREE_UNSIGNED (type
))
1213 /* Output the type `char' as a subrange of itself!
1214 I don't understand this definition, just copied it
1215 from the output of pcc.
1216 This used to use `r2' explicitly and we used to
1217 take care to make sure that `char' was type number 2. */
1218 fprintf (asmfile
, "r");
1220 dbxout_type_index (type
);
1221 fprintf (asmfile
, ";0;127;");
1225 /* If this is a subtype of another integer type, always prefer to
1226 write it as a subtype. */
1227 else if (TREE_TYPE (type
) != 0
1228 && TREE_CODE (TREE_TYPE (type
)) == INTEGER_TYPE
)
1230 /* If the size is non-standard, say what it is if we can use
1233 if (use_gnu_debug_info_extensions
1234 && TYPE_PRECISION (type
) != TYPE_PRECISION (integer_type_node
))
1236 have_used_extensions
= 1;
1237 fprintf (asmfile
, "@s%d;", TYPE_PRECISION (type
));
1241 dbxout_range_type (type
);
1246 /* If the size is non-standard, say what it is if we can use
1249 if (use_gnu_debug_info_extensions
1250 && TYPE_PRECISION (type
) != TYPE_PRECISION (integer_type_node
))
1252 have_used_extensions
= 1;
1253 fprintf (asmfile
, "@s%d;", TYPE_PRECISION (type
));
1257 /* If we can use GDB extensions and the size is wider than a
1258 long (the size used by GDB to read them) or we may have
1259 trouble writing the bounds the usual way, write them in
1260 octal. Note the test is for the *target's* size of "long",
1261 not that of the host. The host test is just to make sure we
1262 can write it out in case the host wide int is narrower than the
1265 /* For unsigned types, we use octal if they are the same size or
1266 larger. This is because we print the bounds as signed decimal,
1267 and hence they can't span same size unsigned types. */
1269 if (use_gnu_debug_info_extensions
1270 && TYPE_MIN_VALUE (type
) != 0
1271 && TREE_CODE (TYPE_MIN_VALUE (type
)) == INTEGER_CST
1272 && TYPE_MAX_VALUE (type
) != 0
1273 && TREE_CODE (TYPE_MAX_VALUE (type
)) == INTEGER_CST
1274 && (TYPE_PRECISION (type
) > TYPE_PRECISION (integer_type_node
)
1275 || ((TYPE_PRECISION (type
)
1276 == TYPE_PRECISION (integer_type_node
))
1277 && TREE_UNSIGNED (type
))
1278 || TYPE_PRECISION (type
) > HOST_BITS_PER_WIDE_INT
1279 || (TYPE_PRECISION (type
) == HOST_BITS_PER_WIDE_INT
1280 && TREE_UNSIGNED (type
))))
1282 fprintf (asmfile
, "r");
1284 dbxout_type_index (type
);
1285 fprintf (asmfile
, ";");
1287 print_int_cst_octal (TYPE_MIN_VALUE (type
));
1288 fprintf (asmfile
, ";");
1290 print_int_cst_octal (TYPE_MAX_VALUE (type
));
1291 fprintf (asmfile
, ";");
1296 /* Output other integer types as subranges of `int'. */
1297 dbxout_range_type (type
);
1303 /* This used to say `r1' and we used to take care
1304 to make sure that `int' was type number 1. */
1305 fprintf (asmfile
, "r");
1307 dbxout_type_index (integer_type_node
);
1308 putc (';', asmfile
);
1310 print_wide_int (int_size_in_bytes (type
));
1311 fputs (";0;", asmfile
);
1316 if (use_gnu_debug_info_extensions
)
1318 have_used_extensions
= 1;
1319 fputs ("@s", asmfile
);
1321 print_wide_int (BITS_PER_UNIT
* int_size_in_bytes (type
));
1322 fputs (";-20;", asmfile
);
1327 /* Output the type `char' as a subrange of itself.
1328 That is what pcc seems to do. */
1329 fprintf (asmfile
, "r");
1331 dbxout_type_index (char_type_node
);
1332 fprintf (asmfile
, ";0;%d;", TREE_UNSIGNED (type
) ? 255 : 127);
1338 if (use_gnu_debug_info_extensions
)
1340 have_used_extensions
= 1;
1341 fputs ("@s", asmfile
);
1343 print_wide_int (BITS_PER_UNIT
* int_size_in_bytes (type
));
1344 fputs (";-16;", asmfile
);
1347 else /* Define as enumeral type (False, True) */
1349 fprintf (asmfile
, "eFalse:0,True:1,;");
1355 putc ('d', asmfile
);
1357 dbxout_type (TREE_TYPE (type
), 0);
1361 /* Differs from the REAL_TYPE by its new data type number */
1363 if (TREE_CODE (TREE_TYPE (type
)) == REAL_TYPE
)
1365 fprintf (asmfile
, "r");
1367 dbxout_type_index (type
);
1368 putc (';', asmfile
);
1370 print_wide_int (2 * int_size_in_bytes (TREE_TYPE (type
)));
1371 fputs (";0;", asmfile
);
1376 /* Output a complex integer type as a structure,
1377 pending some other way to do it. */
1378 putc ('s', asmfile
);
1380 print_wide_int (int_size_in_bytes (type
));
1381 fprintf (asmfile
, "real:");
1384 dbxout_type (TREE_TYPE (type
), 0);
1385 fprintf (asmfile
, ",0,%d;", TYPE_PRECISION (TREE_TYPE (type
)));
1387 fprintf (asmfile
, "imag:");
1389 dbxout_type (TREE_TYPE (type
), 0);
1390 fprintf (asmfile
, ",%d,%d;;", TYPE_PRECISION (TREE_TYPE (type
)),
1391 TYPE_PRECISION (TREE_TYPE (type
)));
1397 if (use_gnu_debug_info_extensions
)
1399 have_used_extensions
= 1;
1400 fputs ("@s", asmfile
);
1402 print_wide_int (BITS_PER_UNIT
* int_size_in_bytes (type
));
1403 putc (';', asmfile
);
1406 /* Check if a bitstring type, which in Chill is
1407 different from a [power]set. */
1408 if (TYPE_STRING_FLAG (type
))
1410 fprintf (asmfile
, "@S;");
1414 putc ('S', asmfile
);
1416 dbxout_type (TYPE_DOMAIN (type
), 0);
1420 /* Make arrays of packed bits look like bitstrings for chill. */
1421 if (TYPE_PACKED (type
) && use_gnu_debug_info_extensions
)
1423 have_used_extensions
= 1;
1424 fputs ("@s", asmfile
);
1426 print_wide_int (BITS_PER_UNIT
* int_size_in_bytes (type
));
1427 fprintf (asmfile
, ";@S;S");
1429 dbxout_type (TYPE_DOMAIN (type
), 0);
1433 /* Output "a" followed by a range type definition
1434 for the index type of the array
1435 followed by a reference to the target-type.
1436 ar1;0;N;M for a C array of type M and size N+1. */
1437 /* Check if a character string type, which in Chill is
1438 different from an array of characters. */
1439 if (TYPE_STRING_FLAG (type
) && use_gnu_debug_info_extensions
)
1441 have_used_extensions
= 1;
1442 fprintf (asmfile
, "@S;");
1445 tem
= TYPE_DOMAIN (type
);
1448 fprintf (asmfile
, "ar");
1450 dbxout_type_index (integer_type_node
);
1451 fprintf (asmfile
, ";0;-1;");
1456 fprintf (asmfile
, "a");
1458 dbxout_range_type (tem
);
1461 dbxout_type (TREE_TYPE (type
), 0);
1466 case QUAL_UNION_TYPE
:
1468 int i
, n_baseclasses
= 0;
1470 if (TYPE_BINFO (type
) != 0
1471 && TREE_CODE (TYPE_BINFO (type
)) == TREE_VEC
1472 && TYPE_BINFO_BASETYPES (type
) != 0)
1473 n_baseclasses
= TREE_VEC_LENGTH (TYPE_BINFO_BASETYPES (type
));
1475 /* Output a structure type. We must use the same test here as we
1476 use in the DBX_NO_XREFS case above. */
1477 if ((TYPE_NAME (type
) != 0
1478 && ! (TREE_CODE (TYPE_NAME (type
)) == TYPE_DECL
1479 && DECL_IGNORED_P (TYPE_NAME (type
)))
1481 || !COMPLETE_TYPE_P (type
)
1482 /* No way in DBX fmt to describe a variable size. */
1483 || ! host_integerp (TYPE_SIZE (type
), 1))
1485 /* If the type is just a cross reference, output one
1486 and mark the type as partially described.
1487 If it later becomes defined, we will output
1488 its real definition.
1489 If the type has a name, don't nest its definition within
1490 another type's definition; instead, output an xref
1491 and let the definition come when the name is defined. */
1492 fputs ((TREE_CODE (type
) == RECORD_TYPE
) ? "xs" : "xu", asmfile
);
1494 #if 0 /* This assertion is legitimately false in C++. */
1495 /* We shouldn't be outputting a reference to a type before its
1496 definition unless the type has a tag name.
1497 A typedef name without a tag name should be impossible. */
1498 if (TREE_CODE (TYPE_NAME (type
)) != IDENTIFIER_NODE
)
1501 if (TYPE_NAME (type
) != 0)
1502 dbxout_type_name (type
);
1505 fprintf (asmfile
, "$$%d", anonymous_type_number
++);
1509 fprintf (asmfile
, ":");
1511 typevec
[TYPE_SYMTAB_ADDRESS (type
)].status
= TYPE_XREF
;
1515 /* Identify record or union, and print its size. */
1516 putc (((TREE_CODE (type
) == RECORD_TYPE
) ? 's' : 'u'), asmfile
);
1518 print_wide_int (int_size_in_bytes (type
));
1520 if (use_gnu_debug_info_extensions
)
1524 have_used_extensions
= 1;
1525 fprintf (asmfile
, "!%d,", n_baseclasses
);
1529 for (i
= 0; i
< n_baseclasses
; i
++)
1531 tree child
= TREE_VEC_ELT (BINFO_BASETYPES (TYPE_BINFO (type
)), i
);
1533 if (use_gnu_debug_info_extensions
)
1535 have_used_extensions
= 1;
1536 putc (TREE_VIA_VIRTUAL (child
) ? '1' : '0', asmfile
);
1537 putc (TREE_VIA_PUBLIC (child
) ? '2' : '0', asmfile
);
1539 if (TREE_VIA_VIRTUAL (child
) && strcmp (lang_hooks
.name
, "GNU C++") == 0)
1540 /* For a virtual base, print the (negative) offset within
1541 the vtable where we must look to find the necessary
1543 print_wide_int (tree_low_cst (BINFO_VPTR_FIELD (child
), 0)
1546 print_wide_int (tree_low_cst (BINFO_OFFSET (child
), 0)
1548 putc (',', asmfile
);
1550 dbxout_type (BINFO_TYPE (child
), 0);
1551 putc (';', asmfile
);
1556 /* Print out the base class information with fields
1557 which have the same names at the types they hold. */
1558 dbxout_type_name (BINFO_TYPE (child
));
1559 putc (':', asmfile
);
1561 dbxout_type (BINFO_TYPE (child
), full
);
1562 putc (',', asmfile
);
1564 print_wide_int (tree_low_cst (BINFO_OFFSET (child
), 0)
1566 putc (',', asmfile
);
1568 print_wide_int (tree_low_cst (DECL_SIZE
1570 (BINFO_TYPE (child
))),
1573 putc (';', asmfile
);
1579 /* Write out the field declarations. */
1580 dbxout_type_fields (type
);
1581 if (use_gnu_debug_info_extensions
&& TYPE_METHODS (type
) != NULL_TREE
)
1583 have_used_extensions
= 1;
1584 dbxout_type_methods (type
);
1587 putc (';', asmfile
);
1590 if (use_gnu_debug_info_extensions
&& TREE_CODE (type
) == RECORD_TYPE
1591 /* Avoid the ~ if we don't really need it--it confuses dbx. */
1592 && TYPE_VFIELD (type
))
1594 have_used_extensions
= 1;
1596 /* Tell GDB+ that it may keep reading. */
1597 putc ('~', asmfile
);
1600 /* We need to write out info about what field this class
1601 uses as its "main" vtable pointer field, because if this
1602 field is inherited from a base class, GDB cannot necessarily
1603 figure out which field it's using in time. */
1604 if (TYPE_VFIELD (type
))
1606 putc ('%', asmfile
);
1608 dbxout_type (DECL_FCONTEXT (TYPE_VFIELD (type
)), 0);
1611 putc (';', asmfile
);
1617 /* We must use the same test here as we use in the DBX_NO_XREFS case
1618 above. We simplify it a bit since an enum will never have a variable
1620 if ((TYPE_NAME (type
) != 0
1621 && ! (TREE_CODE (TYPE_NAME (type
)) == TYPE_DECL
1622 && DECL_IGNORED_P (TYPE_NAME (type
)))
1624 || !COMPLETE_TYPE_P (type
))
1626 fprintf (asmfile
, "xe");
1628 dbxout_type_name (type
);
1629 typevec
[TYPE_SYMTAB_ADDRESS (type
)].status
= TYPE_XREF
;
1630 putc (':', asmfile
);
1634 #ifdef DBX_OUTPUT_ENUM
1635 DBX_OUTPUT_ENUM (asmfile
, type
);
1637 if (use_gnu_debug_info_extensions
1638 && TYPE_PRECISION (type
) != TYPE_PRECISION (integer_type_node
))
1640 fprintf (asmfile
, "@s%d;", TYPE_PRECISION (type
));
1644 putc ('e', asmfile
);
1646 for (tem
= TYPE_VALUES (type
); tem
; tem
= TREE_CHAIN (tem
))
1648 fprintf (asmfile
, "%s:", IDENTIFIER_POINTER (TREE_PURPOSE (tem
)));
1649 CHARS (IDENTIFIER_LENGTH (TREE_PURPOSE (tem
)) + 1);
1650 if (TREE_INT_CST_HIGH (TREE_VALUE (tem
)) == 0)
1651 print_wide_int (TREE_INT_CST_LOW (TREE_VALUE (tem
)));
1652 else if (TREE_INT_CST_HIGH (TREE_VALUE (tem
)) == -1
1653 && (HOST_WIDE_INT
) TREE_INT_CST_LOW (TREE_VALUE (tem
)) < 0)
1654 print_wide_int (TREE_INT_CST_LOW (TREE_VALUE (tem
)));
1656 print_int_cst_octal (TREE_VALUE (tem
));
1658 putc (',', asmfile
);
1660 if (TREE_CHAIN (tem
) != 0)
1664 putc (';', asmfile
);
1670 putc ('*', asmfile
);
1672 dbxout_type (TREE_TYPE (type
), 0);
1676 if (use_gnu_debug_info_extensions
)
1678 have_used_extensions
= 1;
1679 putc ('#', asmfile
);
1682 /* Write the argument types out longhand. */
1683 dbxout_type (TYPE_METHOD_BASETYPE (type
), 0);
1684 putc (',', asmfile
);
1686 dbxout_type (TREE_TYPE (type
), 0);
1687 dbxout_args (TYPE_ARG_TYPES (type
));
1688 putc (';', asmfile
);
1692 /* Treat it as a function type. */
1693 dbxout_type (TREE_TYPE (type
), 0);
1697 if (use_gnu_debug_info_extensions
)
1699 have_used_extensions
= 1;
1700 putc ('@', asmfile
);
1702 dbxout_type (TYPE_OFFSET_BASETYPE (type
), 0);
1703 putc (',', asmfile
);
1705 dbxout_type (TREE_TYPE (type
), 0);
1708 /* Should print as an int, because it is really just an offset. */
1709 dbxout_type (integer_type_node
, 0);
1712 case REFERENCE_TYPE
:
1713 if (use_gnu_debug_info_extensions
)
1714 have_used_extensions
= 1;
1715 putc (use_gnu_debug_info_extensions
? '&' : '*', asmfile
);
1717 dbxout_type (TREE_TYPE (type
), 0);
1721 putc ('f', asmfile
);
1723 dbxout_type (TREE_TYPE (type
), 0);
1731 /* Print the value of integer constant C, in octal,
1732 handling double precision. */
1735 print_int_cst_octal (c
)
1738 unsigned HOST_WIDE_INT high
= TREE_INT_CST_HIGH (c
);
1739 unsigned HOST_WIDE_INT low
= TREE_INT_CST_LOW (c
);
1740 int excess
= (3 - (HOST_BITS_PER_WIDE_INT
% 3));
1741 unsigned int width
= TYPE_PRECISION (TREE_TYPE (c
));
1743 /* GDB wants constants with no extra leading "1" bits, so
1744 we need to remove any sign-extension that might be
1746 if (width
== HOST_BITS_PER_WIDE_INT
* 2)
1748 else if (width
> HOST_BITS_PER_WIDE_INT
)
1749 high
&= (((HOST_WIDE_INT
) 1 << (width
- HOST_BITS_PER_WIDE_INT
)) - 1);
1750 else if (width
== HOST_BITS_PER_WIDE_INT
)
1753 high
= 0, low
&= (((HOST_WIDE_INT
) 1 << width
) - 1);
1755 fprintf (asmfile
, "0");
1760 print_octal (high
, HOST_BITS_PER_WIDE_INT
/ 3);
1761 print_octal (low
, HOST_BITS_PER_WIDE_INT
/ 3);
1765 unsigned HOST_WIDE_INT beg
= high
>> excess
;
1766 unsigned HOST_WIDE_INT middle
1767 = ((high
& (((HOST_WIDE_INT
) 1 << excess
) - 1)) << (3 - excess
)
1768 | (low
>> (HOST_BITS_PER_WIDE_INT
/ 3 * 3)));
1769 unsigned HOST_WIDE_INT end
1770 = low
& (((unsigned HOST_WIDE_INT
) 1
1771 << (HOST_BITS_PER_WIDE_INT
/ 3 * 3))
1774 fprintf (asmfile
, "%o%01o", (int) beg
, (int) middle
);
1776 print_octal (end
, HOST_BITS_PER_WIDE_INT
/ 3);
1781 print_octal (value
, digits
)
1782 unsigned HOST_WIDE_INT value
;
1787 for (i
= digits
- 1; i
>= 0; i
--)
1788 fprintf (asmfile
, "%01o", (int) ((value
>> (3 * i
)) & 7));
1793 /* Output C in decimal while adjusting the number of digits written. */
1801 fprintf (asmfile
, HOST_WIDE_INT_PRINT_DEC
, c
);
1812 /* Output the name of type TYPE, with no punctuation.
1813 Such names can be set up either by typedef declarations
1814 or by struct, enum and union tags. */
1817 dbxout_type_name (type
)
1821 if (TYPE_NAME (type
) == 0)
1823 if (TREE_CODE (TYPE_NAME (type
)) == IDENTIFIER_NODE
)
1825 t
= TYPE_NAME (type
);
1827 else if (TREE_CODE (TYPE_NAME (type
)) == TYPE_DECL
)
1829 t
= DECL_NAME (TYPE_NAME (type
));
1834 fprintf (asmfile
, "%s", IDENTIFIER_POINTER (t
));
1835 CHARS (IDENTIFIER_LENGTH (t
));
1838 /* Output leading leading struct or class names needed for qualifying
1839 type whose scope is limited to a struct or class. */
1842 dbxout_class_name_qualifiers (decl
)
1845 tree context
= decl_type_context (decl
);
1847 if (context
!= NULL_TREE
1848 && TREE_CODE(context
) == RECORD_TYPE
1849 && TYPE_NAME (context
) != 0
1850 && (TREE_CODE (TYPE_NAME (context
)) == IDENTIFIER_NODE
1851 || (DECL_NAME (TYPE_NAME (context
)) != 0)))
1853 tree name
= TYPE_NAME (context
);
1855 if (TREE_CODE (name
) == TYPE_DECL
)
1857 dbxout_class_name_qualifiers (name
);
1858 name
= DECL_NAME (name
);
1860 fprintf (asmfile
, "%s::", IDENTIFIER_POINTER (name
));
1861 CHARS (IDENTIFIER_LENGTH (name
) + 2);
1865 /* Output a .stabs for the symbol defined by DECL,
1866 which must be a ..._DECL node in the normal namespace.
1867 It may be a CONST_DECL, a FUNCTION_DECL, a PARM_DECL or a VAR_DECL.
1868 LOCAL is nonzero if the scope is less than the entire file.
1869 Return 1 if a stabs might have been emitted. */
1872 dbxout_symbol (decl
, local
)
1874 int local ATTRIBUTE_UNUSED
;
1876 tree type
= TREE_TYPE (decl
);
1877 tree context
= NULL_TREE
;
1880 /* Cast avoids warning in old compilers. */
1881 current_sym_code
= (STAB_CODE_TYPE
) 0;
1882 current_sym_value
= 0;
1883 current_sym_addr
= 0;
1885 /* Ignore nameless syms, but don't ignore type tags. */
1887 if ((DECL_NAME (decl
) == 0 && TREE_CODE (decl
) != TYPE_DECL
)
1888 || DECL_IGNORED_P (decl
))
1891 dbxout_prepare_symbol (decl
);
1893 /* The output will always start with the symbol name,
1894 so always count that in the length-output-so-far. */
1896 if (DECL_NAME (decl
) != 0)
1897 current_sym_nchars
= 2 + IDENTIFIER_LENGTH (DECL_NAME (decl
));
1899 switch (TREE_CODE (decl
))
1902 /* Enum values are defined by defining the enum type. */
1906 if (DECL_RTL (decl
) == 0)
1908 if (DECL_EXTERNAL (decl
))
1910 /* Don't mention a nested function under its parent. */
1911 context
= decl_function_context (decl
);
1912 if (context
== current_function_decl
)
1914 if (GET_CODE (DECL_RTL (decl
)) != MEM
1915 || GET_CODE (XEXP (DECL_RTL (decl
), 0)) != SYMBOL_REF
)
1919 fprintf (asmfile
, "%s\"%s:%c", ASM_STABS_OP
,
1920 IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl
)),
1921 TREE_PUBLIC (decl
) ? 'F' : 'f');
1924 current_sym_code
= N_FUN
;
1925 current_sym_addr
= XEXP (DECL_RTL (decl
), 0);
1927 if (TREE_TYPE (type
))
1928 dbxout_type (TREE_TYPE (type
), 0);
1930 dbxout_type (void_type_node
, 0);
1932 /* For a nested function, when that function is compiled,
1933 mention the containing function name
1934 as well as (since dbx wants it) our own assembler-name. */
1936 fprintf (asmfile
, ",%s,%s",
1937 IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl
)),
1938 IDENTIFIER_POINTER (DECL_NAME (context
)));
1940 dbxout_finish_symbol (decl
);
1945 /* This seems all wrong. Outputting most kinds of types gives no name
1946 at all. A true definition gives no name; a cross-ref for a
1947 structure can give the tag name, but not a type name.
1948 It seems that no typedef name is defined by outputting a type. */
1950 /* If this typedef name was defined by outputting the type,
1951 don't duplicate it. */
1952 if (typevec
[TYPE_SYMTAB_ADDRESS (type
)].status
== TYPE_DEFINED
1953 && TYPE_NAME (TREE_TYPE (decl
)) == decl
)
1956 /* Don't output the same typedef twice.
1957 And don't output what language-specific stuff doesn't want output. */
1958 if (TREE_ASM_WRITTEN (decl
) || TYPE_DECL_SUPPRESS_DEBUG (decl
))
1967 if (DECL_NAME (decl
))
1969 /* Nonzero means we must output a tag as well as a typedef. */
1972 /* Handle the case of a C++ structure or union
1973 where the TYPE_NAME is a TYPE_DECL
1974 which gives both a typedef name and a tag. */
1975 /* dbx requires the tag first and the typedef second. */
1976 if ((TREE_CODE (type
) == RECORD_TYPE
1977 || TREE_CODE (type
) == UNION_TYPE
1978 || TREE_CODE (type
) == QUAL_UNION_TYPE
)
1979 && TYPE_NAME (type
) == decl
1980 && !(use_gnu_debug_info_extensions
&& have_used_extensions
)
1981 && !TREE_ASM_WRITTEN (TYPE_NAME (type
))
1982 /* Distinguish the implicit typedefs of C++
1983 from explicit ones that might be found in C. */
1984 && DECL_ARTIFICIAL (decl
)
1985 /* Do not generate a tag for records of variable size,
1986 since this type can not be properly described in the
1987 DBX format, and it confuses some tools such as objdump. */
1988 && host_integerp (TYPE_SIZE (type
), 1))
1990 tree name
= TYPE_NAME (type
);
1991 if (TREE_CODE (name
) == TYPE_DECL
)
1992 name
= DECL_NAME (name
);
1994 current_sym_code
= DBX_TYPE_DECL_STABS_CODE
;
1995 current_sym_value
= 0;
1996 current_sym_addr
= 0;
1997 current_sym_nchars
= 2 + IDENTIFIER_LENGTH (name
);
1999 fprintf (asmfile
, "%s\"%s:T", ASM_STABS_OP
,
2000 IDENTIFIER_POINTER (name
));
2001 dbxout_type (type
, 1);
2002 dbxout_finish_symbol (NULL_TREE
);
2005 /* Output .stabs (or whatever) and leading double quote. */
2006 fprintf (asmfile
, "%s\"", ASM_STABS_OP
);
2008 if (use_gnu_debug_info_extensions
)
2010 /* Output leading class/struct qualifiers. */
2011 dbxout_class_name_qualifiers (decl
);
2014 /* Output typedef name. */
2015 fprintf (asmfile
, "%s:", IDENTIFIER_POINTER (DECL_NAME (decl
)));
2017 /* Short cut way to output a tag also. */
2018 if ((TREE_CODE (type
) == RECORD_TYPE
2019 || TREE_CODE (type
) == UNION_TYPE
2020 || TREE_CODE (type
) == QUAL_UNION_TYPE
)
2021 && TYPE_NAME (type
) == decl
2022 /* Distinguish the implicit typedefs of C++
2023 from explicit ones that might be found in C. */
2024 && DECL_ARTIFICIAL (decl
))
2026 if (use_gnu_debug_info_extensions
&& have_used_extensions
)
2028 putc ('T', asmfile
);
2029 TREE_ASM_WRITTEN (TYPE_NAME (type
)) = 1;
2031 #if 0 /* Now we generate the tag for this case up above. */
2037 putc ('t', asmfile
);
2038 current_sym_code
= DBX_TYPE_DECL_STABS_CODE
;
2040 dbxout_type (type
, 1);
2041 dbxout_finish_symbol (decl
);
2045 /* Don't output a tag if this is an incomplete type. This prevents
2046 the sun4 Sun OS 4.x dbx from crashing. */
2048 if (tag_needed
&& TYPE_NAME (type
) != 0
2049 && (TREE_CODE (TYPE_NAME (type
)) == IDENTIFIER_NODE
2050 || (DECL_NAME (TYPE_NAME (type
)) != 0))
2051 && COMPLETE_TYPE_P (type
)
2052 && !TREE_ASM_WRITTEN (TYPE_NAME (type
)))
2054 /* For a TYPE_DECL with no name, but the type has a name,
2056 This is what represents `struct foo' with no typedef. */
2057 /* In C++, the name of a type is the corresponding typedef.
2058 In C, it is an IDENTIFIER_NODE. */
2059 tree name
= TYPE_NAME (type
);
2060 if (TREE_CODE (name
) == TYPE_DECL
)
2061 name
= DECL_NAME (name
);
2063 current_sym_code
= DBX_TYPE_DECL_STABS_CODE
;
2064 current_sym_value
= 0;
2065 current_sym_addr
= 0;
2066 current_sym_nchars
= 2 + IDENTIFIER_LENGTH (name
);
2068 fprintf (asmfile
, "%s\"%s:T", ASM_STABS_OP
,
2069 IDENTIFIER_POINTER (name
));
2070 dbxout_type (type
, 1);
2071 dbxout_finish_symbol (NULL_TREE
);
2075 /* If an enum type has no name, it cannot be referred to,
2076 but we must output it anyway, since the enumeration constants
2077 can be referred to. */
2078 if (!did_output
&& TREE_CODE (type
) == ENUMERAL_TYPE
)
2080 current_sym_code
= DBX_TYPE_DECL_STABS_CODE
;
2081 current_sym_value
= 0;
2082 current_sym_addr
= 0;
2083 current_sym_nchars
= 2;
2085 /* Some debuggers fail when given NULL names, so give this a
2086 harmless name of ` '. */
2087 fprintf (asmfile
, "%s\" :T", ASM_STABS_OP
);
2088 dbxout_type (type
, 1);
2089 dbxout_finish_symbol (NULL_TREE
);
2092 /* Prevent duplicate output of a typedef. */
2093 TREE_ASM_WRITTEN (decl
) = 1;
2098 /* Parm decls go in their own separate chains
2099 and are output by dbxout_reg_parms and dbxout_parms. */
2103 /* Named return value, treat like a VAR_DECL. */
2105 if (! DECL_RTL_SET_P (decl
))
2107 /* Don't mention a variable that is external.
2108 Let the file that defines it describe it. */
2109 if (DECL_EXTERNAL (decl
))
2112 /* If the variable is really a constant
2113 and not written in memory, inform the debugger. */
2114 if (TREE_STATIC (decl
) && TREE_READONLY (decl
)
2115 && DECL_INITIAL (decl
) != 0
2116 && host_integerp (DECL_INITIAL (decl
), 0)
2117 && ! TREE_ASM_WRITTEN (decl
)
2118 && (DECL_CONTEXT (decl
) == NULL_TREE
2119 || TREE_CODE (DECL_CONTEXT (decl
)) == BLOCK
))
2121 if (TREE_PUBLIC (decl
) == 0)
2123 /* The sun4 assembler does not grok this. */
2124 const char *name
= IDENTIFIER_POINTER (DECL_NAME (decl
));
2126 if (TREE_CODE (TREE_TYPE (decl
)) == INTEGER_TYPE
2127 || TREE_CODE (TREE_TYPE (decl
)) == ENUMERAL_TYPE
)
2129 HOST_WIDE_INT ival
= tree_low_cst (DECL_INITIAL (decl
), 0);
2130 #ifdef DBX_OUTPUT_CONSTANT_SYMBOL
2131 DBX_OUTPUT_CONSTANT_SYMBOL (asmfile
, name
, ival
);
2133 fprintf (asmfile
, "%s\"%s:c=i", ASM_STABS_OP
, name
);
2135 fprintf (asmfile
, HOST_WIDE_INT_PRINT_DEC
, ival
);
2136 fprintf (asmfile
, "\",0x%x,0,0,0\n", N_LSYM
);
2140 else if (TREE_CODE (TREE_TYPE (decl
)) == REAL_TYPE
)
2142 /* don't know how to do this yet. */
2146 /* else it is something we handle like a normal variable. */
2149 SET_DECL_RTL (decl
, eliminate_regs (DECL_RTL (decl
), 0, NULL_RTX
));
2150 #ifdef LEAF_REG_REMAP
2151 if (current_function_uses_only_leaf_regs
)
2152 leaf_renumber_regs_insn (DECL_RTL (decl
));
2155 result
= dbxout_symbol_location (decl
, type
, 0, DECL_RTL (decl
));
2164 /* Output the stab for DECL, a VAR_DECL, RESULT_DECL or PARM_DECL.
2165 Add SUFFIX to its name, if SUFFIX is not 0.
2166 Describe the variable as residing in HOME
2167 (usually HOME is DECL_RTL (DECL), but not always).
2168 Returns 1 if the stab was really emitted. */
2171 dbxout_symbol_location (decl
, type
, suffix
, home
)
2179 /* Don't mention a variable at all
2180 if it was completely optimized into nothingness.
2182 If the decl was from an inline function, then its rtl
2183 is not identically the rtl that was used in this
2184 particular compilation. */
2185 if (GET_CODE (home
) == SUBREG
)
2189 while (GET_CODE (value
) == SUBREG
)
2190 value
= SUBREG_REG (value
);
2191 if (GET_CODE (value
) == REG
)
2193 if (REGNO (value
) >= FIRST_PSEUDO_REGISTER
)
2196 home
= alter_subreg (&home
);
2198 if (GET_CODE (home
) == REG
)
2200 regno
= REGNO (home
);
2201 if (regno
>= FIRST_PSEUDO_REGISTER
)
2205 /* The kind-of-variable letter depends on where
2206 the variable is and on the scope of its name:
2207 G and N_GSYM for static storage and global scope,
2208 S for static storage and file scope,
2209 V for static storage and local scope,
2210 for those two, use N_LCSYM if data is in bss segment,
2211 N_STSYM if in data segment, N_FUN otherwise.
2212 (We used N_FUN originally, then changed to N_STSYM
2213 to please GDB. However, it seems that confused ld.
2214 Now GDB has been fixed to like N_FUN, says Kingdon.)
2215 no letter at all, and N_LSYM, for auto variable,
2216 r and N_RSYM for register variable. */
2218 if (GET_CODE (home
) == MEM
2219 && GET_CODE (XEXP (home
, 0)) == SYMBOL_REF
)
2221 if (TREE_PUBLIC (decl
))
2224 current_sym_code
= N_GSYM
;
2228 current_sym_addr
= XEXP (home
, 0);
2230 letter
= decl_function_context (decl
) ? 'V' : 'S';
2232 /* This should be the same condition as in assemble_variable, but
2233 we don't have access to dont_output_data here. So, instead,
2234 we rely on the fact that error_mark_node initializers always
2235 end up in bss for C++ and never end up in bss for C. */
2236 if (DECL_INITIAL (decl
) == 0
2237 || (!strcmp (lang_hooks
.name
, "GNU C++")
2238 && DECL_INITIAL (decl
) == error_mark_node
))
2239 current_sym_code
= N_LCSYM
;
2240 else if (DECL_IN_TEXT_SECTION (decl
))
2241 /* This is not quite right, but it's the closest
2242 of all the codes that Unix defines. */
2243 current_sym_code
= DBX_STATIC_CONST_VAR_CODE
;
2246 /* Some ports can transform a symbol ref into a label ref,
2247 because the symbol ref is too far away and has to be
2248 dumped into a constant pool. Alternatively, the symbol
2249 in the constant pool might be referenced by a different
2251 if (GET_CODE (current_sym_addr
) == SYMBOL_REF
2252 && CONSTANT_POOL_ADDRESS_P (current_sym_addr
))
2254 rtx tmp
= get_pool_constant (current_sym_addr
);
2256 if (GET_CODE (tmp
) == SYMBOL_REF
2257 || GET_CODE (tmp
) == LABEL_REF
)
2258 current_sym_addr
= tmp
;
2261 /* Ultrix `as' seems to need this. */
2262 #ifdef DBX_STATIC_STAB_DATA_SECTION
2265 current_sym_code
= N_STSYM
;
2269 else if (regno
>= 0)
2272 current_sym_code
= N_RSYM
;
2273 current_sym_value
= DBX_REGISTER_NUMBER (regno
);
2275 else if (GET_CODE (home
) == MEM
2276 && (GET_CODE (XEXP (home
, 0)) == MEM
2277 || (GET_CODE (XEXP (home
, 0)) == REG
2278 && REGNO (XEXP (home
, 0)) != HARD_FRAME_POINTER_REGNUM
2279 && REGNO (XEXP (home
, 0)) != STACK_POINTER_REGNUM
2280 #if ARG_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM
2281 && REGNO (XEXP (home
, 0)) != ARG_POINTER_REGNUM
2284 /* If the value is indirect by memory or by a register
2285 that isn't the frame pointer
2286 then it means the object is variable-sized and address through
2287 that register or stack slot. DBX has no way to represent this
2288 so all we can do is output the variable as a pointer.
2289 If it's not a parameter, ignore it.
2290 (VAR_DECLs like this can be made by integrate.c.) */
2292 if (GET_CODE (XEXP (home
, 0)) == REG
)
2295 current_sym_code
= N_RSYM
;
2296 if (REGNO (XEXP (home
, 0)) >= FIRST_PSEUDO_REGISTER
)
2298 current_sym_value
= DBX_REGISTER_NUMBER (REGNO (XEXP (home
, 0)));
2302 current_sym_code
= N_LSYM
;
2303 /* RTL looks like (MEM (MEM (PLUS (REG...) (CONST_INT...)))).
2304 We want the value of that CONST_INT. */
2306 = DEBUGGER_AUTO_OFFSET (XEXP (XEXP (home
, 0), 0));
2309 /* Effectively do build_pointer_type, but don't cache this type,
2310 since it might be temporary whereas the type it points to
2311 might have been saved for inlining. */
2312 /* Don't use REFERENCE_TYPE because dbx can't handle that. */
2313 type
= make_node (POINTER_TYPE
);
2314 TREE_TYPE (type
) = TREE_TYPE (decl
);
2316 else if (GET_CODE (home
) == MEM
2317 && GET_CODE (XEXP (home
, 0)) == REG
)
2319 current_sym_code
= N_LSYM
;
2320 current_sym_value
= DEBUGGER_AUTO_OFFSET (XEXP (home
, 0));
2322 else if (GET_CODE (home
) == MEM
2323 && GET_CODE (XEXP (home
, 0)) == PLUS
2324 && GET_CODE (XEXP (XEXP (home
, 0), 1)) == CONST_INT
)
2326 current_sym_code
= N_LSYM
;
2327 /* RTL looks like (MEM (PLUS (REG...) (CONST_INT...)))
2328 We want the value of that CONST_INT. */
2329 current_sym_value
= DEBUGGER_AUTO_OFFSET (XEXP (home
, 0));
2331 else if (GET_CODE (home
) == MEM
2332 && GET_CODE (XEXP (home
, 0)) == CONST
)
2334 /* Handle an obscure case which can arise when optimizing and
2335 when there are few available registers. (This is *always*
2336 the case for i386/i486 targets). The RTL looks like
2337 (MEM (CONST ...)) even though this variable is a local `auto'
2338 or a local `register' variable. In effect, what has happened
2339 is that the reload pass has seen that all assignments and
2340 references for one such a local variable can be replaced by
2341 equivalent assignments and references to some static storage
2342 variable, thereby avoiding the need for a register. In such
2343 cases we're forced to lie to debuggers and tell them that
2344 this variable was itself `static'. */
2345 current_sym_code
= N_LCSYM
;
2347 current_sym_addr
= XEXP (XEXP (home
, 0), 0);
2349 else if (GET_CODE (home
) == CONCAT
)
2353 /* If TYPE is not a COMPLEX_TYPE (it might be a RECORD_TYPE,
2354 for example), then there is no easy way to figure out
2355 what SUBTYPE should be. So, we give up. */
2356 if (TREE_CODE (type
) != COMPLEX_TYPE
)
2359 subtype
= TREE_TYPE (type
);
2361 /* If the variable's storage is in two parts,
2362 output each as a separate stab with a modified name. */
2363 if (WORDS_BIG_ENDIAN
)
2364 dbxout_symbol_location (decl
, subtype
, "$imag", XEXP (home
, 0));
2366 dbxout_symbol_location (decl
, subtype
, "$real", XEXP (home
, 0));
2368 /* Cast avoids warning in old compilers. */
2369 current_sym_code
= (STAB_CODE_TYPE
) 0;
2370 current_sym_value
= 0;
2371 current_sym_addr
= 0;
2372 dbxout_prepare_symbol (decl
);
2374 if (WORDS_BIG_ENDIAN
)
2375 dbxout_symbol_location (decl
, subtype
, "$real", XEXP (home
, 1));
2377 dbxout_symbol_location (decl
, subtype
, "$imag", XEXP (home
, 1));
2381 /* Address might be a MEM, when DECL is a variable-sized object.
2382 Or it might be const0_rtx, meaning previous passes
2383 want us to ignore this variable. */
2386 /* Ok, start a symtab entry and output the variable name. */
2389 #ifdef DBX_STATIC_BLOCK_START
2390 DBX_STATIC_BLOCK_START (asmfile
, current_sym_code
);
2393 dbxout_symbol_name (decl
, suffix
, letter
);
2394 dbxout_type (type
, 0);
2395 dbxout_finish_symbol (decl
);
2397 #ifdef DBX_STATIC_BLOCK_END
2398 DBX_STATIC_BLOCK_END (asmfile
, current_sym_code
);
2403 /* Output the symbol name of DECL for a stabs, with suffix SUFFIX.
2404 Then output LETTER to indicate the kind of location the symbol has. */
2407 dbxout_symbol_name (decl
, suffix
, letter
)
2414 if (DECL_CONTEXT (decl
) && TYPE_P (DECL_CONTEXT (decl
)))
2415 /* One slight hitch: if this is a VAR_DECL which is a static
2416 class member, we must put out the mangled name instead of the
2417 DECL_NAME. Note also that static member (variable) names DO NOT begin
2418 with underscores in .stabs directives. */
2419 name
= IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl
));
2421 /* ...but if we're function-local, we don't want to include the junk
2422 added by ASM_FORMAT_PRIVATE_NAME. */
2423 name
= IDENTIFIER_POINTER (DECL_NAME (decl
));
2427 fprintf (asmfile
, "%s\"%s%s:", ASM_STABS_OP
, name
,
2428 (suffix
? suffix
: ""));
2431 putc (letter
, asmfile
);
2435 dbxout_prepare_symbol (decl
)
2436 tree decl ATTRIBUTE_UNUSED
;
2439 const char *filename
= DECL_SOURCE_FILE (decl
);
2441 dbxout_source_file (asmfile
, filename
);
2446 dbxout_finish_symbol (sym
)
2449 #ifdef DBX_FINISH_SYMBOL
2450 DBX_FINISH_SYMBOL (sym
);
2453 if (use_gnu_debug_info_extensions
&& sym
!= 0)
2454 line
= DECL_SOURCE_LINE (sym
);
2456 fprintf (asmfile
, "\",%d,0,%d,", current_sym_code
, line
);
2457 if (current_sym_addr
)
2458 output_addr_const (asmfile
, current_sym_addr
);
2460 fprintf (asmfile
, "%d", current_sym_value
);
2461 putc ('\n', asmfile
);
2465 /* Output definitions of all the decls in a chain. Return nonzero if
2466 anything was output */
2475 result
+= dbxout_symbol (syms
, 1);
2476 syms
= TREE_CHAIN (syms
);
2481 /* The following two functions output definitions of function parameters.
2482 Each parameter gets a definition locating it in the parameter list.
2483 Each parameter that is a register variable gets a second definition
2484 locating it in the register.
2486 Printing or argument lists in gdb uses the definitions that
2487 locate in the parameter list. But reference to the variable in
2488 expressions uses preferentially the definition as a register. */
2490 /* Output definitions, referring to storage in the parmlist,
2491 of all the parms in PARMS, which is a chain of PARM_DECL nodes. */
2494 dbxout_parms (parms
)
2497 for (; parms
; parms
= TREE_CHAIN (parms
))
2498 if (DECL_NAME (parms
) && TREE_TYPE (parms
) != error_mark_node
)
2500 dbxout_prepare_symbol (parms
);
2502 /* Perform any necessary register eliminations on the parameter's rtl,
2503 so that the debugging output will be accurate. */
2504 DECL_INCOMING_RTL (parms
)
2505 = eliminate_regs (DECL_INCOMING_RTL (parms
), 0, NULL_RTX
);
2506 SET_DECL_RTL (parms
, eliminate_regs (DECL_RTL (parms
), 0, NULL_RTX
));
2507 #ifdef LEAF_REG_REMAP
2508 if (current_function_uses_only_leaf_regs
)
2510 leaf_renumber_regs_insn (DECL_INCOMING_RTL (parms
));
2511 leaf_renumber_regs_insn (DECL_RTL (parms
));
2515 if (PARM_PASSED_IN_MEMORY (parms
))
2517 rtx addr
= XEXP (DECL_INCOMING_RTL (parms
), 0);
2519 /* ??? Here we assume that the parm address is indexed
2520 off the frame pointer or arg pointer.
2521 If that is not true, we produce meaningless results,
2522 but do not crash. */
2523 if (GET_CODE (addr
) == PLUS
2524 && GET_CODE (XEXP (addr
, 1)) == CONST_INT
)
2525 current_sym_value
= INTVAL (XEXP (addr
, 1));
2527 current_sym_value
= 0;
2529 current_sym_code
= N_PSYM
;
2530 current_sym_addr
= 0;
2533 if (DECL_NAME (parms
))
2535 current_sym_nchars
= 2 + IDENTIFIER_LENGTH (DECL_NAME (parms
));
2537 fprintf (asmfile
, "%s\"%s:%c", ASM_STABS_OP
,
2538 IDENTIFIER_POINTER (DECL_NAME (parms
)),
2539 DBX_MEMPARM_STABS_LETTER
);
2543 current_sym_nchars
= 8;
2544 fprintf (asmfile
, "%s\"(anon):%c", ASM_STABS_OP
,
2545 DBX_MEMPARM_STABS_LETTER
);
2548 /* It is quite tempting to use:
2550 dbxout_type (TREE_TYPE (parms), 0);
2552 as the next statement, rather than using DECL_ARG_TYPE(), so
2553 that gcc reports the actual type of the parameter, rather
2554 than the promoted type. This certainly makes GDB's life
2555 easier, at least for some ports. The change is a bad idea
2556 however, since GDB expects to be able access the type without
2557 performing any conversions. So for example, if we were
2558 passing a float to an unprototyped function, gcc will store a
2559 double on the stack, but if we emit a stab saying the type is a
2560 float, then gdb will only read in a single value, and this will
2561 produce an erroneous value. */
2562 dbxout_type (DECL_ARG_TYPE (parms
), 0);
2563 current_sym_value
= DEBUGGER_ARG_OFFSET (current_sym_value
, addr
);
2564 dbxout_finish_symbol (parms
);
2566 else if (GET_CODE (DECL_RTL (parms
)) == REG
)
2569 char regparm_letter
;
2571 /* Parm passed in registers and lives in registers or nowhere. */
2573 current_sym_code
= DBX_REGPARM_STABS_CODE
;
2574 regparm_letter
= DBX_REGPARM_STABS_LETTER
;
2575 current_sym_addr
= 0;
2577 /* If parm lives in a register, use that register;
2578 pretend the parm was passed there. It would be more consistent
2579 to describe the register where the parm was passed,
2580 but in practice that register usually holds something else.
2582 If we use DECL_RTL, then we must use the declared type of
2583 the variable, not the type that it arrived in. */
2584 if (REGNO (DECL_RTL (parms
)) < FIRST_PSEUDO_REGISTER
)
2586 best_rtl
= DECL_RTL (parms
);
2587 parm_type
= TREE_TYPE (parms
);
2589 /* If the parm lives nowhere, use the register where it was
2590 passed. It is also better to use the declared type here. */
2593 best_rtl
= DECL_INCOMING_RTL (parms
);
2594 parm_type
= TREE_TYPE (parms
);
2596 current_sym_value
= DBX_REGISTER_NUMBER (REGNO (best_rtl
));
2599 if (DECL_NAME (parms
))
2601 current_sym_nchars
= 2 + IDENTIFIER_LENGTH (DECL_NAME (parms
));
2602 fprintf (asmfile
, "%s\"%s:%c", ASM_STABS_OP
,
2603 IDENTIFIER_POINTER (DECL_NAME (parms
)),
2608 current_sym_nchars
= 8;
2609 fprintf (asmfile
, "%s\"(anon):%c", ASM_STABS_OP
,
2613 dbxout_type (parm_type
, 0);
2614 dbxout_finish_symbol (parms
);
2616 else if (GET_CODE (DECL_RTL (parms
)) == MEM
2617 && GET_CODE (XEXP (DECL_RTL (parms
), 0)) == REG
2618 && REGNO (XEXP (DECL_RTL (parms
), 0)) != HARD_FRAME_POINTER_REGNUM
2619 && REGNO (XEXP (DECL_RTL (parms
), 0)) != STACK_POINTER_REGNUM
2620 #if ARG_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM
2621 && REGNO (XEXP (DECL_RTL (parms
), 0)) != ARG_POINTER_REGNUM
2625 /* Parm was passed via invisible reference.
2626 That is, its address was passed in a register.
2627 Output it as if it lived in that register.
2628 The debugger will know from the type
2629 that it was actually passed by invisible reference. */
2631 char regparm_letter
;
2632 /* Parm passed in registers and lives in registers or nowhere. */
2634 current_sym_code
= DBX_REGPARM_STABS_CODE
;
2635 if (use_gnu_debug_info_extensions
)
2636 regparm_letter
= GDB_INV_REF_REGPARM_STABS_LETTER
;
2638 regparm_letter
= DBX_REGPARM_STABS_LETTER
;
2640 /* DECL_RTL looks like (MEM (REG...). Get the register number.
2641 If it is an unallocated pseudo-reg, then use the register where
2642 it was passed instead. */
2643 if (REGNO (XEXP (DECL_RTL (parms
), 0)) < FIRST_PSEUDO_REGISTER
)
2644 current_sym_value
= REGNO (XEXP (DECL_RTL (parms
), 0));
2646 current_sym_value
= REGNO (DECL_INCOMING_RTL (parms
));
2648 current_sym_addr
= 0;
2651 if (DECL_NAME (parms
))
2654 = 2 + strlen (IDENTIFIER_POINTER (DECL_NAME (parms
)));
2656 fprintf (asmfile
, "%s\"%s:%c", ASM_STABS_OP
,
2657 IDENTIFIER_POINTER (DECL_NAME (parms
)),
2662 current_sym_nchars
= 8;
2663 fprintf (asmfile
, "%s\"(anon):%c", ASM_STABS_OP
,
2667 dbxout_type (TREE_TYPE (parms
), 0);
2668 dbxout_finish_symbol (parms
);
2670 else if (GET_CODE (DECL_RTL (parms
)) == MEM
2671 && GET_CODE (XEXP (DECL_RTL (parms
), 0)) == MEM
)
2673 /* Parm was passed via invisible reference, with the reference
2674 living on the stack. DECL_RTL looks like
2675 (MEM (MEM (PLUS (REG ...) (CONST_INT ...)))) or it
2676 could look like (MEM (MEM (REG))). */
2677 const char *const decl_name
= (DECL_NAME (parms
)
2678 ? IDENTIFIER_POINTER (DECL_NAME (parms
))
2680 if (GET_CODE (XEXP (XEXP (DECL_RTL (parms
), 0), 0)) == REG
)
2681 current_sym_value
= 0;
2684 = INTVAL (XEXP (XEXP (XEXP (DECL_RTL (parms
), 0), 0), 1));
2685 current_sym_addr
= 0;
2686 current_sym_code
= N_PSYM
;
2689 fprintf (asmfile
, "%s\"%s:v", ASM_STABS_OP
, decl_name
);
2692 = DEBUGGER_ARG_OFFSET (current_sym_value
,
2693 XEXP (XEXP (DECL_RTL (parms
), 0), 0));
2694 dbxout_type (TREE_TYPE (parms
), 0);
2695 dbxout_finish_symbol (parms
);
2697 else if (GET_CODE (DECL_RTL (parms
)) == MEM
2698 && XEXP (DECL_RTL (parms
), 0) != const0_rtx
2699 /* ??? A constant address for a parm can happen
2700 when the reg it lives in is equiv to a constant in memory.
2701 Should make this not happen, after 2.4. */
2702 && ! CONSTANT_P (XEXP (DECL_RTL (parms
), 0)))
2704 /* Parm was passed in registers but lives on the stack. */
2706 current_sym_code
= N_PSYM
;
2707 /* DECL_RTL looks like (MEM (PLUS (REG...) (CONST_INT...))),
2708 in which case we want the value of that CONST_INT,
2710 in which case we use a value of zero. */
2711 if (GET_CODE (XEXP (DECL_RTL (parms
), 0)) == REG
)
2712 current_sym_value
= 0;
2715 = INTVAL (XEXP (XEXP (DECL_RTL (parms
), 0), 1));
2717 current_sym_addr
= 0;
2719 /* Make a big endian correction if the mode of the type of the
2720 parameter is not the same as the mode of the rtl. */
2721 if (BYTES_BIG_ENDIAN
2722 && TYPE_MODE (TREE_TYPE (parms
)) != GET_MODE (DECL_RTL (parms
))
2723 && GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (parms
))) < UNITS_PER_WORD
)
2725 current_sym_value
+=
2726 GET_MODE_SIZE (GET_MODE (DECL_RTL (parms
)))
2727 - GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (parms
)));
2731 if (DECL_NAME (parms
))
2734 = 2 + strlen (IDENTIFIER_POINTER (DECL_NAME (parms
)));
2736 fprintf (asmfile
, "%s\"%s:%c", ASM_STABS_OP
,
2737 IDENTIFIER_POINTER (DECL_NAME (parms
)),
2738 DBX_MEMPARM_STABS_LETTER
);
2742 current_sym_nchars
= 8;
2743 fprintf (asmfile
, "%s\"(anon):%c", ASM_STABS_OP
,
2744 DBX_MEMPARM_STABS_LETTER
);
2748 = DEBUGGER_ARG_OFFSET (current_sym_value
,
2749 XEXP (DECL_RTL (parms
), 0));
2750 dbxout_type (TREE_TYPE (parms
), 0);
2751 dbxout_finish_symbol (parms
);
2756 /* Output definitions for the places where parms live during the function,
2757 when different from where they were passed, when the parms were passed
2760 It is not useful to do this for parms passed in registers
2761 that live during the function in different registers, because it is
2762 impossible to look in the passed register for the passed value,
2763 so we use the within-the-function register to begin with.
2765 PARMS is a chain of PARM_DECL nodes. */
2768 dbxout_reg_parms (parms
)
2771 for (; parms
; parms
= TREE_CHAIN (parms
))
2772 if (DECL_NAME (parms
) && PARM_PASSED_IN_MEMORY (parms
))
2774 dbxout_prepare_symbol (parms
);
2776 /* Report parms that live in registers during the function
2777 but were passed in memory. */
2778 if (GET_CODE (DECL_RTL (parms
)) == REG
2779 && REGNO (DECL_RTL (parms
)) < FIRST_PSEUDO_REGISTER
)
2780 dbxout_symbol_location (parms
, TREE_TYPE (parms
),
2781 0, DECL_RTL (parms
));
2782 else if (GET_CODE (DECL_RTL (parms
)) == CONCAT
)
2783 dbxout_symbol_location (parms
, TREE_TYPE (parms
),
2784 0, DECL_RTL (parms
));
2785 /* Report parms that live in memory but not where they were passed. */
2786 else if (GET_CODE (DECL_RTL (parms
)) == MEM
2787 && ! rtx_equal_p (DECL_RTL (parms
), DECL_INCOMING_RTL (parms
)))
2788 dbxout_symbol_location (parms
, TREE_TYPE (parms
),
2789 0, DECL_RTL (parms
));
2793 /* Given a chain of ..._TYPE nodes (as come in a parameter list),
2794 output definitions of those names, in raw form */
2802 putc (',', asmfile
);
2803 dbxout_type (TREE_VALUE (args
), 0);
2805 args
= TREE_CHAIN (args
);
2809 /* Output everything about a symbol block (a BLOCK node
2810 that represents a scope level),
2811 including recursive output of contained blocks.
2813 BLOCK is the BLOCK node.
2814 DEPTH is its depth within containing symbol blocks.
2815 ARGS is usually zero; but for the outermost block of the
2816 body of a function, it is a chain of PARM_DECLs for the function parameters.
2817 We output definitions of all the register parms
2818 as if they were local variables of that block.
2820 If -g1 was used, we count blocks just the same, but output nothing
2821 except for the outermost block.
2823 Actually, BLOCK may be several blocks chained together.
2824 We handle them all in sequence. */
2827 dbxout_block (block
, depth
, args
)
2834 #if DBX_BLOCKS_FUNCTION_RELATIVE
2835 const char *begin_label
;
2836 if (current_function_func_begin_label
!= NULL_TREE
)
2837 begin_label
= IDENTIFIER_POINTER (current_function_func_begin_label
);
2839 begin_label
= XSTR (XEXP (DECL_RTL (current_function_decl
), 0), 0);
2844 /* Ignore blocks never expanded or otherwise marked as real. */
2845 if (TREE_USED (block
) && TREE_ASM_WRITTEN (block
))
2849 #ifdef DBX_LBRAC_FIRST
2852 /* In dbx format, the syms of a block come before the N_LBRAC.
2853 If nothing is output, we don't need the N_LBRAC, either. */
2855 if (debug_info_level
!= DINFO_LEVEL_TERSE
|| depth
== 0)
2856 did_output
= dbxout_syms (BLOCK_VARS (block
));
2858 dbxout_reg_parms (args
);
2861 /* Now output an N_LBRAC symbol to represent the beginning of
2862 the block. Use the block's tree-walk order to generate
2863 the assembler symbols LBBn and LBEn
2864 that final will define around the code in this block. */
2865 if (depth
> 0 && did_output
)
2868 blocknum
= BLOCK_NUMBER (block
);
2869 ASM_GENERATE_INTERNAL_LABEL (buf
, "LBB", blocknum
);
2871 if (BLOCK_HANDLER_BLOCK (block
))
2873 /* A catch block. Must precede N_LBRAC. */
2874 tree decl
= BLOCK_VARS (block
);
2877 #ifdef DBX_OUTPUT_CATCH
2878 DBX_OUTPUT_CATCH (asmfile
, decl
, buf
);
2880 fprintf (asmfile
, "%s\"%s:C1\",%d,0,0,", ASM_STABS_OP
,
2881 IDENTIFIER_POINTER (DECL_NAME (decl
)), N_CATCH
);
2882 assemble_name (asmfile
, buf
);
2883 fprintf (asmfile
, "\n");
2885 decl
= TREE_CHAIN (decl
);
2889 #ifdef DBX_OUTPUT_LBRAC
2890 DBX_OUTPUT_LBRAC (asmfile
, buf
);
2892 fprintf (asmfile
, "%s%d,0,0,", ASM_STABN_OP
, N_LBRAC
);
2893 assemble_name (asmfile
, buf
);
2894 #if DBX_BLOCKS_FUNCTION_RELATIVE
2895 putc ('-', asmfile
);
2896 assemble_name (asmfile
, begin_label
);
2898 fprintf (asmfile
, "\n");
2902 #ifdef DBX_LBRAC_FIRST
2903 /* On some weird machines, the syms of a block
2904 come after the N_LBRAC. */
2905 if (debug_info_level
!= DINFO_LEVEL_TERSE
|| depth
== 0)
2906 dbxout_syms (BLOCK_VARS (block
));
2908 dbxout_reg_parms (args
);
2911 /* Output the subblocks. */
2912 dbxout_block (BLOCK_SUBBLOCKS (block
), depth
+ 1, NULL_TREE
);
2914 /* Refer to the marker for the end of the block. */
2915 if (depth
> 0 && did_output
)
2918 ASM_GENERATE_INTERNAL_LABEL (buf
, "LBE", blocknum
);
2919 #ifdef DBX_OUTPUT_RBRAC
2920 DBX_OUTPUT_RBRAC (asmfile
, buf
);
2922 fprintf (asmfile
, "%s%d,0,0,", ASM_STABN_OP
, N_RBRAC
);
2923 assemble_name (asmfile
, buf
);
2924 #if DBX_BLOCKS_FUNCTION_RELATIVE
2925 putc ('-', asmfile
);
2926 assemble_name (asmfile
, begin_label
);
2928 fprintf (asmfile
, "\n");
2932 block
= BLOCK_CHAIN (block
);
2936 /* Output the information about a function and its arguments and result.
2937 Usually this follows the function's code,
2938 but on some systems, it comes before. */
2940 #if defined (DBX_DEBUGGING_INFO)
2942 dbxout_begin_function (decl
)
2945 dbxout_symbol (decl
, 0);
2946 dbxout_parms (DECL_ARGUMENTS (decl
));
2947 if (DECL_NAME (DECL_RESULT (decl
)) != 0)
2948 dbxout_symbol (DECL_RESULT (decl
), 1);
2950 #endif /* DBX_DEBUGGING_INFO */
2952 #endif /* DBX_DEBUGGING_INFO || XCOFF_DEBUGGING_INFO */