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 type
= TYPE_DEBUG_REPRESENTATION_TYPE (type
);
1057 /* If there was an input error and we don't really have a type,
1058 avoid crashing and write something that is at least valid
1059 by assuming `int'. */
1060 if (type
== error_mark_node
)
1061 type
= integer_type_node
;
1064 if (TYPE_NAME (type
)
1065 && TREE_CODE (TYPE_NAME (type
)) == TYPE_DECL
1066 && TYPE_DECL_SUPPRESS_DEBUG (TYPE_NAME (type
)))
1070 /* Try to find the "main variant" with the same name. */
1071 if (TYPE_NAME (type
) && TREE_CODE (TYPE_NAME (type
)) == TYPE_DECL
1072 && DECL_ORIGINAL_TYPE (TYPE_NAME (type
)))
1073 main_variant
= TREE_TYPE (TYPE_NAME (type
));
1075 main_variant
= TYPE_MAIN_VARIANT (type
);
1077 /* If we are not using extensions, stabs does not distinguish const and
1078 volatile, so there is no need to make them separate types. */
1079 if (!use_gnu_debug_info_extensions
)
1080 type
= main_variant
;
1082 if (TYPE_SYMTAB_ADDRESS (type
) == 0)
1084 /* Type has no dbx number assigned. Assign next available number. */
1085 TYPE_SYMTAB_ADDRESS (type
) = next_type_number
++;
1087 /* Make sure type vector is long enough to record about this type. */
1089 if (next_type_number
== typevec_len
)
1092 = (struct typeinfo
*) xrealloc (typevec
,
1093 typevec_len
* 2 * sizeof typevec
[0]);
1094 memset ((char *) (typevec
+ typevec_len
), 0,
1095 typevec_len
* sizeof typevec
[0]);
1099 #ifdef DBX_USE_BINCL
1100 typevec
[TYPE_SYMTAB_ADDRESS (type
)].file_number
1101 = current_file
->file_number
;
1102 typevec
[TYPE_SYMTAB_ADDRESS (type
)].type_number
1103 = current_file
->next_type_number
++;
1107 /* Output the number of this type, to refer to it. */
1108 dbxout_type_index (type
);
1110 #ifdef DBX_TYPE_DEFINED
1111 if (DBX_TYPE_DEFINED (type
))
1115 /* If this type's definition has been output or is now being output,
1118 switch (typevec
[TYPE_SYMTAB_ADDRESS (type
)].status
)
1123 /* If we have already had a cross reference,
1124 and either that's all we want or that's the best we could do,
1125 don't repeat the cross reference.
1126 Sun dbx crashes if we do. */
1127 if (! full
|| !COMPLETE_TYPE_P (type
)
1128 /* No way in DBX fmt to describe a variable size. */
1129 || ! host_integerp (TYPE_SIZE (type
), 1))
1137 /* For systems where dbx output does not allow the `=xsNAME:' syntax,
1138 leave the type-number completely undefined rather than output
1139 a cross-reference. If we have already used GNU debug info extensions,
1140 then it is OK to output a cross reference. This is necessary to get
1141 proper C++ debug output. */
1142 if ((TREE_CODE (type
) == RECORD_TYPE
|| TREE_CODE (type
) == UNION_TYPE
1143 || TREE_CODE (type
) == QUAL_UNION_TYPE
1144 || TREE_CODE (type
) == ENUMERAL_TYPE
)
1145 && ! use_gnu_debug_info_extensions
)
1146 /* We must use the same test here as we use twice below when deciding
1147 whether to emit a cross-reference. */
1148 if ((TYPE_NAME (type
) != 0
1149 && ! (TREE_CODE (TYPE_NAME (type
)) == TYPE_DECL
1150 && DECL_IGNORED_P (TYPE_NAME (type
)))
1152 || !COMPLETE_TYPE_P (type
)
1153 /* No way in DBX fmt to describe a variable size. */
1154 || ! host_integerp (TYPE_SIZE (type
), 1))
1156 typevec
[TYPE_SYMTAB_ADDRESS (type
)].status
= TYPE_XREF
;
1161 /* Output a definition now. */
1163 fprintf (asmfile
, "=");
1166 /* Mark it as defined, so that if it is self-referent
1167 we will not get into an infinite recursion of definitions. */
1169 typevec
[TYPE_SYMTAB_ADDRESS (type
)].status
= TYPE_DEFINED
;
1171 /* If this type is a variant of some other, hand off. Types with
1172 different names are usefully distinguished. We only distinguish
1173 cv-qualified types if we're using extensions. */
1174 if (TYPE_READONLY (type
) > TYPE_READONLY (main_variant
))
1176 putc ('k', asmfile
);
1178 dbxout_type (build_type_variant (type
, 0, TYPE_VOLATILE (type
)), 0);
1181 else if (TYPE_VOLATILE (type
) > TYPE_VOLATILE (main_variant
))
1183 putc ('B', asmfile
);
1185 dbxout_type (build_type_variant (type
, TYPE_READONLY (type
), 0), 0);
1188 else if (main_variant
!= TYPE_MAIN_VARIANT (type
))
1190 /* 'type' is a typedef; output the type it refers to. */
1191 dbxout_type (DECL_ORIGINAL_TYPE (TYPE_NAME (type
)), 0);
1194 /* else continue. */
1196 switch (TREE_CODE (type
))
1200 /* For a void type, just define it as itself; ie, "5=5".
1201 This makes us consider it defined
1202 without saying what it is. The debugger will make it
1203 a void type when the reference is seen, and nothing will
1204 ever override that default. */
1205 dbxout_type_index (type
);
1209 if (type
== char_type_node
&& ! TREE_UNSIGNED (type
))
1211 /* Output the type `char' as a subrange of itself!
1212 I don't understand this definition, just copied it
1213 from the output of pcc.
1214 This used to use `r2' explicitly and we used to
1215 take care to make sure that `char' was type number 2. */
1216 fprintf (asmfile
, "r");
1218 dbxout_type_index (type
);
1219 fprintf (asmfile
, ";0;127;");
1223 /* If this is a subtype of another integer type, always prefer to
1224 write it as a subtype. */
1225 else if (TREE_TYPE (type
) != 0
1226 && TREE_CODE (TREE_TYPE (type
)) == INTEGER_TYPE
)
1228 /* If the size is non-standard, say what it is if we can use
1231 if (use_gnu_debug_info_extensions
1232 && TYPE_PRECISION (type
) != TYPE_PRECISION (integer_type_node
))
1234 have_used_extensions
= 1;
1235 fprintf (asmfile
, "@s%d;", TYPE_PRECISION (type
));
1239 dbxout_range_type (type
);
1244 /* If the size is non-standard, say what it is if we can use
1247 if (use_gnu_debug_info_extensions
1248 && TYPE_PRECISION (type
) != TYPE_PRECISION (integer_type_node
))
1250 have_used_extensions
= 1;
1251 fprintf (asmfile
, "@s%d;", TYPE_PRECISION (type
));
1255 /* If we can use GDB extensions and the size is wider than a
1256 long (the size used by GDB to read them) or we may have
1257 trouble writing the bounds the usual way, write them in
1258 octal. Note the test is for the *target's* size of "long",
1259 not that of the host. The host test is just to make sure we
1260 can write it out in case the host wide int is narrower than the
1263 /* For unsigned types, we use octal if they are the same size or
1264 larger. This is because we print the bounds as signed decimal,
1265 and hence they can't span same size unsigned types. */
1267 if (use_gnu_debug_info_extensions
1268 && TYPE_MIN_VALUE (type
) != 0
1269 && TREE_CODE (TYPE_MIN_VALUE (type
)) == INTEGER_CST
1270 && TYPE_MAX_VALUE (type
) != 0
1271 && TREE_CODE (TYPE_MAX_VALUE (type
)) == INTEGER_CST
1272 && (TYPE_PRECISION (type
) > TYPE_PRECISION (integer_type_node
)
1273 || ((TYPE_PRECISION (type
)
1274 == TYPE_PRECISION (integer_type_node
))
1275 && TREE_UNSIGNED (type
))
1276 || TYPE_PRECISION (type
) > HOST_BITS_PER_WIDE_INT
1277 || (TYPE_PRECISION (type
) == HOST_BITS_PER_WIDE_INT
1278 && TREE_UNSIGNED (type
))))
1280 fprintf (asmfile
, "r");
1282 dbxout_type_index (type
);
1283 fprintf (asmfile
, ";");
1285 print_int_cst_octal (TYPE_MIN_VALUE (type
));
1286 fprintf (asmfile
, ";");
1288 print_int_cst_octal (TYPE_MAX_VALUE (type
));
1289 fprintf (asmfile
, ";");
1294 /* Output other integer types as subranges of `int'. */
1295 dbxout_range_type (type
);
1301 /* This used to say `r1' and we used to take care
1302 to make sure that `int' was type number 1. */
1303 fprintf (asmfile
, "r");
1305 dbxout_type_index (integer_type_node
);
1306 putc (';', asmfile
);
1308 print_wide_int (int_size_in_bytes (type
));
1309 fputs (";0;", asmfile
);
1314 if (use_gnu_debug_info_extensions
)
1316 have_used_extensions
= 1;
1317 fputs ("@s", asmfile
);
1319 print_wide_int (BITS_PER_UNIT
* int_size_in_bytes (type
));
1320 fputs (";-20;", asmfile
);
1325 /* Output the type `char' as a subrange of itself.
1326 That is what pcc seems to do. */
1327 fprintf (asmfile
, "r");
1329 dbxout_type_index (char_type_node
);
1330 fprintf (asmfile
, ";0;%d;", TREE_UNSIGNED (type
) ? 255 : 127);
1336 if (use_gnu_debug_info_extensions
)
1338 have_used_extensions
= 1;
1339 fputs ("@s", asmfile
);
1341 print_wide_int (BITS_PER_UNIT
* int_size_in_bytes (type
));
1342 fputs (";-16;", asmfile
);
1345 else /* Define as enumeral type (False, True) */
1347 fprintf (asmfile
, "eFalse:0,True:1,;");
1353 putc ('d', asmfile
);
1355 dbxout_type (TREE_TYPE (type
), 0);
1359 /* Differs from the REAL_TYPE by its new data type number */
1361 if (TREE_CODE (TREE_TYPE (type
)) == REAL_TYPE
)
1363 fprintf (asmfile
, "r");
1365 dbxout_type_index (type
);
1366 putc (';', asmfile
);
1368 print_wide_int (2 * int_size_in_bytes (TREE_TYPE (type
)));
1369 fputs (";0;", asmfile
);
1374 /* Output a complex integer type as a structure,
1375 pending some other way to do it. */
1376 putc ('s', asmfile
);
1378 print_wide_int (int_size_in_bytes (type
));
1379 fprintf (asmfile
, "real:");
1382 dbxout_type (TREE_TYPE (type
), 0);
1383 fprintf (asmfile
, ",0,%d;", TYPE_PRECISION (TREE_TYPE (type
)));
1385 fprintf (asmfile
, "imag:");
1387 dbxout_type (TREE_TYPE (type
), 0);
1388 fprintf (asmfile
, ",%d,%d;;", TYPE_PRECISION (TREE_TYPE (type
)),
1389 TYPE_PRECISION (TREE_TYPE (type
)));
1395 if (use_gnu_debug_info_extensions
)
1397 have_used_extensions
= 1;
1398 fputs ("@s", asmfile
);
1400 print_wide_int (BITS_PER_UNIT
* int_size_in_bytes (type
));
1401 putc (';', asmfile
);
1404 /* Check if a bitstring type, which in Chill is
1405 different from a [power]set. */
1406 if (TYPE_STRING_FLAG (type
))
1408 fprintf (asmfile
, "@S;");
1412 putc ('S', asmfile
);
1414 dbxout_type (TYPE_DOMAIN (type
), 0);
1418 /* Make arrays of packed bits look like bitstrings for chill. */
1419 if (TYPE_PACKED (type
) && use_gnu_debug_info_extensions
)
1421 have_used_extensions
= 1;
1422 fputs ("@s", asmfile
);
1424 print_wide_int (BITS_PER_UNIT
* int_size_in_bytes (type
));
1425 fprintf (asmfile
, ";@S;S");
1427 dbxout_type (TYPE_DOMAIN (type
), 0);
1431 /* Output "a" followed by a range type definition
1432 for the index type of the array
1433 followed by a reference to the target-type.
1434 ar1;0;N;M for a C array of type M and size N+1. */
1435 /* Check if a character string type, which in Chill is
1436 different from an array of characters. */
1437 if (TYPE_STRING_FLAG (type
) && use_gnu_debug_info_extensions
)
1439 have_used_extensions
= 1;
1440 fprintf (asmfile
, "@S;");
1443 tem
= TYPE_DOMAIN (type
);
1446 fprintf (asmfile
, "ar");
1448 dbxout_type_index (integer_type_node
);
1449 fprintf (asmfile
, ";0;-1;");
1454 fprintf (asmfile
, "a");
1456 dbxout_range_type (tem
);
1459 dbxout_type (TREE_TYPE (type
), 0);
1464 case QUAL_UNION_TYPE
:
1466 int i
, n_baseclasses
= 0;
1468 if (TYPE_BINFO (type
) != 0
1469 && TREE_CODE (TYPE_BINFO (type
)) == TREE_VEC
1470 && TYPE_BINFO_BASETYPES (type
) != 0)
1471 n_baseclasses
= TREE_VEC_LENGTH (TYPE_BINFO_BASETYPES (type
));
1473 /* Output a structure type. We must use the same test here as we
1474 use in the DBX_NO_XREFS case above. */
1475 if ((TYPE_NAME (type
) != 0
1476 && ! (TREE_CODE (TYPE_NAME (type
)) == TYPE_DECL
1477 && DECL_IGNORED_P (TYPE_NAME (type
)))
1479 || !COMPLETE_TYPE_P (type
)
1480 /* No way in DBX fmt to describe a variable size. */
1481 || ! host_integerp (TYPE_SIZE (type
), 1))
1483 /* If the type is just a cross reference, output one
1484 and mark the type as partially described.
1485 If it later becomes defined, we will output
1486 its real definition.
1487 If the type has a name, don't nest its definition within
1488 another type's definition; instead, output an xref
1489 and let the definition come when the name is defined. */
1490 fputs ((TREE_CODE (type
) == RECORD_TYPE
) ? "xs" : "xu", asmfile
);
1492 #if 0 /* This assertion is legitimately false in C++. */
1493 /* We shouldn't be outputting a reference to a type before its
1494 definition unless the type has a tag name.
1495 A typedef name without a tag name should be impossible. */
1496 if (TREE_CODE (TYPE_NAME (type
)) != IDENTIFIER_NODE
)
1499 if (TYPE_NAME (type
) != 0)
1500 dbxout_type_name (type
);
1503 fprintf (asmfile
, "$$%d", anonymous_type_number
++);
1507 fprintf (asmfile
, ":");
1509 typevec
[TYPE_SYMTAB_ADDRESS (type
)].status
= TYPE_XREF
;
1513 /* Identify record or union, and print its size. */
1514 putc (((TREE_CODE (type
) == RECORD_TYPE
) ? 's' : 'u'), asmfile
);
1516 print_wide_int (int_size_in_bytes (type
));
1518 if (use_gnu_debug_info_extensions
)
1522 have_used_extensions
= 1;
1523 fprintf (asmfile
, "!%d,", n_baseclasses
);
1527 for (i
= 0; i
< n_baseclasses
; i
++)
1529 tree child
= TREE_VEC_ELT (BINFO_BASETYPES (TYPE_BINFO (type
)), i
);
1531 if (use_gnu_debug_info_extensions
)
1533 have_used_extensions
= 1;
1534 putc (TREE_VIA_VIRTUAL (child
) ? '1' : '0', asmfile
);
1535 putc (TREE_VIA_PUBLIC (child
) ? '2' : '0', asmfile
);
1537 if (TREE_VIA_VIRTUAL (child
) && strcmp (lang_hooks
.name
, "GNU C++") == 0)
1538 /* For a virtual base, print the (negative) offset within
1539 the vtable where we must look to find the necessary
1541 print_wide_int (tree_low_cst (BINFO_VPTR_FIELD (child
), 0)
1544 print_wide_int (tree_low_cst (BINFO_OFFSET (child
), 0)
1546 putc (',', asmfile
);
1548 dbxout_type (BINFO_TYPE (child
), 0);
1549 putc (';', asmfile
);
1554 /* Print out the base class information with fields
1555 which have the same names at the types they hold. */
1556 dbxout_type_name (BINFO_TYPE (child
));
1557 putc (':', asmfile
);
1559 dbxout_type (BINFO_TYPE (child
), full
);
1560 putc (',', asmfile
);
1562 print_wide_int (tree_low_cst (BINFO_OFFSET (child
), 0)
1564 putc (',', asmfile
);
1566 print_wide_int (tree_low_cst (DECL_SIZE
1568 (BINFO_TYPE (child
))),
1571 putc (';', asmfile
);
1577 /* Write out the field declarations. */
1578 dbxout_type_fields (type
);
1579 if (use_gnu_debug_info_extensions
&& TYPE_METHODS (type
) != NULL_TREE
)
1581 have_used_extensions
= 1;
1582 dbxout_type_methods (type
);
1585 putc (';', asmfile
);
1588 if (use_gnu_debug_info_extensions
&& TREE_CODE (type
) == RECORD_TYPE
1589 /* Avoid the ~ if we don't really need it--it confuses dbx. */
1590 && TYPE_VFIELD (type
))
1592 have_used_extensions
= 1;
1594 /* Tell GDB+ that it may keep reading. */
1595 putc ('~', asmfile
);
1598 /* We need to write out info about what field this class
1599 uses as its "main" vtable pointer field, because if this
1600 field is inherited from a base class, GDB cannot necessarily
1601 figure out which field it's using in time. */
1602 if (TYPE_VFIELD (type
))
1604 putc ('%', asmfile
);
1606 dbxout_type (DECL_FCONTEXT (TYPE_VFIELD (type
)), 0);
1609 putc (';', asmfile
);
1615 /* We must use the same test here as we use in the DBX_NO_XREFS case
1616 above. We simplify it a bit since an enum will never have a variable
1618 if ((TYPE_NAME (type
) != 0
1619 && ! (TREE_CODE (TYPE_NAME (type
)) == TYPE_DECL
1620 && DECL_IGNORED_P (TYPE_NAME (type
)))
1622 || !COMPLETE_TYPE_P (type
))
1624 fprintf (asmfile
, "xe");
1626 dbxout_type_name (type
);
1627 typevec
[TYPE_SYMTAB_ADDRESS (type
)].status
= TYPE_XREF
;
1628 putc (':', asmfile
);
1632 #ifdef DBX_OUTPUT_ENUM
1633 DBX_OUTPUT_ENUM (asmfile
, type
);
1635 if (use_gnu_debug_info_extensions
1636 && TYPE_PRECISION (type
) != TYPE_PRECISION (integer_type_node
))
1638 fprintf (asmfile
, "@s%d;", TYPE_PRECISION (type
));
1642 putc ('e', asmfile
);
1644 for (tem
= TYPE_VALUES (type
); tem
; tem
= TREE_CHAIN (tem
))
1646 fprintf (asmfile
, "%s:", IDENTIFIER_POINTER (TREE_PURPOSE (tem
)));
1647 CHARS (IDENTIFIER_LENGTH (TREE_PURPOSE (tem
)) + 1);
1648 if (TREE_INT_CST_HIGH (TREE_VALUE (tem
)) == 0)
1649 print_wide_int (TREE_INT_CST_LOW (TREE_VALUE (tem
)));
1650 else if (TREE_INT_CST_HIGH (TREE_VALUE (tem
)) == -1
1651 && (HOST_WIDE_INT
) TREE_INT_CST_LOW (TREE_VALUE (tem
)) < 0)
1652 print_wide_int (TREE_INT_CST_LOW (TREE_VALUE (tem
)));
1654 print_int_cst_octal (TREE_VALUE (tem
));
1656 putc (',', asmfile
);
1658 if (TREE_CHAIN (tem
) != 0)
1662 putc (';', asmfile
);
1668 putc ('*', asmfile
);
1670 dbxout_type (TREE_TYPE (type
), 0);
1674 if (use_gnu_debug_info_extensions
)
1676 have_used_extensions
= 1;
1677 putc ('#', asmfile
);
1680 /* Write the argument types out longhand. */
1681 dbxout_type (TYPE_METHOD_BASETYPE (type
), 0);
1682 putc (',', asmfile
);
1684 dbxout_type (TREE_TYPE (type
), 0);
1685 dbxout_args (TYPE_ARG_TYPES (type
));
1686 putc (';', asmfile
);
1690 /* Treat it as a function type. */
1691 dbxout_type (TREE_TYPE (type
), 0);
1695 if (use_gnu_debug_info_extensions
)
1697 have_used_extensions
= 1;
1698 putc ('@', asmfile
);
1700 dbxout_type (TYPE_OFFSET_BASETYPE (type
), 0);
1701 putc (',', asmfile
);
1703 dbxout_type (TREE_TYPE (type
), 0);
1706 /* Should print as an int, because it is really just an offset. */
1707 dbxout_type (integer_type_node
, 0);
1710 case REFERENCE_TYPE
:
1711 if (use_gnu_debug_info_extensions
)
1712 have_used_extensions
= 1;
1713 putc (use_gnu_debug_info_extensions
? '&' : '*', asmfile
);
1715 dbxout_type (TREE_TYPE (type
), 0);
1719 putc ('f', asmfile
);
1721 dbxout_type (TREE_TYPE (type
), 0);
1729 /* Print the value of integer constant C, in octal,
1730 handling double precision. */
1733 print_int_cst_octal (c
)
1736 unsigned HOST_WIDE_INT high
= TREE_INT_CST_HIGH (c
);
1737 unsigned HOST_WIDE_INT low
= TREE_INT_CST_LOW (c
);
1738 int excess
= (3 - (HOST_BITS_PER_WIDE_INT
% 3));
1739 unsigned int width
= TYPE_PRECISION (TREE_TYPE (c
));
1741 /* GDB wants constants with no extra leading "1" bits, so
1742 we need to remove any sign-extension that might be
1744 if (width
== HOST_BITS_PER_WIDE_INT
* 2)
1746 else if (width
> HOST_BITS_PER_WIDE_INT
)
1747 high
&= (((HOST_WIDE_INT
) 1 << (width
- HOST_BITS_PER_WIDE_INT
)) - 1);
1748 else if (width
== HOST_BITS_PER_WIDE_INT
)
1751 high
= 0, low
&= (((HOST_WIDE_INT
) 1 << width
) - 1);
1753 fprintf (asmfile
, "0");
1758 print_octal (high
, HOST_BITS_PER_WIDE_INT
/ 3);
1759 print_octal (low
, HOST_BITS_PER_WIDE_INT
/ 3);
1763 unsigned HOST_WIDE_INT beg
= high
>> excess
;
1764 unsigned HOST_WIDE_INT middle
1765 = ((high
& (((HOST_WIDE_INT
) 1 << excess
) - 1)) << (3 - excess
)
1766 | (low
>> (HOST_BITS_PER_WIDE_INT
/ 3 * 3)));
1767 unsigned HOST_WIDE_INT end
1768 = low
& (((unsigned HOST_WIDE_INT
) 1
1769 << (HOST_BITS_PER_WIDE_INT
/ 3 * 3))
1772 fprintf (asmfile
, "%o%01o", (int) beg
, (int) middle
);
1774 print_octal (end
, HOST_BITS_PER_WIDE_INT
/ 3);
1779 print_octal (value
, digits
)
1780 unsigned HOST_WIDE_INT value
;
1785 for (i
= digits
- 1; i
>= 0; i
--)
1786 fprintf (asmfile
, "%01o", (int) ((value
>> (3 * i
)) & 7));
1791 /* Output C in decimal while adjusting the number of digits written. */
1799 fprintf (asmfile
, HOST_WIDE_INT_PRINT_DEC
, c
);
1810 /* Output the name of type TYPE, with no punctuation.
1811 Such names can be set up either by typedef declarations
1812 or by struct, enum and union tags. */
1815 dbxout_type_name (type
)
1819 if (TYPE_NAME (type
) == 0)
1821 if (TREE_CODE (TYPE_NAME (type
)) == IDENTIFIER_NODE
)
1823 t
= TYPE_NAME (type
);
1825 else if (TREE_CODE (TYPE_NAME (type
)) == TYPE_DECL
)
1827 t
= DECL_NAME (TYPE_NAME (type
));
1832 fprintf (asmfile
, "%s", IDENTIFIER_POINTER (t
));
1833 CHARS (IDENTIFIER_LENGTH (t
));
1836 /* Output leading leading struct or class names needed for qualifying
1837 type whose scope is limited to a struct or class. */
1840 dbxout_class_name_qualifiers (decl
)
1843 tree context
= decl_type_context (decl
);
1845 if (context
!= NULL_TREE
1846 && TREE_CODE(context
) == RECORD_TYPE
1847 && TYPE_NAME (context
) != 0
1848 && (TREE_CODE (TYPE_NAME (context
)) == IDENTIFIER_NODE
1849 || (DECL_NAME (TYPE_NAME (context
)) != 0)))
1851 tree name
= TYPE_NAME (context
);
1853 if (TREE_CODE (name
) == TYPE_DECL
)
1855 dbxout_class_name_qualifiers (name
);
1856 name
= DECL_NAME (name
);
1858 fprintf (asmfile
, "%s::", IDENTIFIER_POINTER (name
));
1859 CHARS (IDENTIFIER_LENGTH (name
) + 2);
1863 /* Output a .stabs for the symbol defined by DECL,
1864 which must be a ..._DECL node in the normal namespace.
1865 It may be a CONST_DECL, a FUNCTION_DECL, a PARM_DECL or a VAR_DECL.
1866 LOCAL is nonzero if the scope is less than the entire file.
1867 Return 1 if a stabs might have been emitted. */
1870 dbxout_symbol (decl
, local
)
1872 int local ATTRIBUTE_UNUSED
;
1874 tree type
= TREE_TYPE (decl
);
1875 tree context
= NULL_TREE
;
1878 /* Cast avoids warning in old compilers. */
1879 current_sym_code
= (STAB_CODE_TYPE
) 0;
1880 current_sym_value
= 0;
1881 current_sym_addr
= 0;
1883 /* Ignore nameless syms, but don't ignore type tags. */
1885 if ((DECL_NAME (decl
) == 0 && TREE_CODE (decl
) != TYPE_DECL
)
1886 || DECL_IGNORED_P (decl
))
1889 dbxout_prepare_symbol (decl
);
1891 /* The output will always start with the symbol name,
1892 so always count that in the length-output-so-far. */
1894 if (DECL_NAME (decl
) != 0)
1895 current_sym_nchars
= 2 + IDENTIFIER_LENGTH (DECL_NAME (decl
));
1897 switch (TREE_CODE (decl
))
1900 /* Enum values are defined by defining the enum type. */
1904 if (DECL_RTL (decl
) == 0)
1906 if (DECL_EXTERNAL (decl
))
1908 /* Don't mention a nested function under its parent. */
1909 context
= decl_function_context (decl
);
1910 if (context
== current_function_decl
)
1912 if (GET_CODE (DECL_RTL (decl
)) != MEM
1913 || GET_CODE (XEXP (DECL_RTL (decl
), 0)) != SYMBOL_REF
)
1917 fprintf (asmfile
, "%s\"%s:%c", ASM_STABS_OP
,
1918 IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl
)),
1919 TREE_PUBLIC (decl
) ? 'F' : 'f');
1922 current_sym_code
= N_FUN
;
1923 current_sym_addr
= XEXP (DECL_RTL (decl
), 0);
1925 if (TREE_TYPE (type
))
1926 dbxout_type (TREE_TYPE (type
), 0);
1928 dbxout_type (void_type_node
, 0);
1930 /* For a nested function, when that function is compiled,
1931 mention the containing function name
1932 as well as (since dbx wants it) our own assembler-name. */
1934 fprintf (asmfile
, ",%s,%s",
1935 IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl
)),
1936 IDENTIFIER_POINTER (DECL_NAME (context
)));
1938 dbxout_finish_symbol (decl
);
1943 /* This seems all wrong. Outputting most kinds of types gives no name
1944 at all. A true definition gives no name; a cross-ref for a
1945 structure can give the tag name, but not a type name.
1946 It seems that no typedef name is defined by outputting a type. */
1948 /* If this typedef name was defined by outputting the type,
1949 don't duplicate it. */
1950 if (typevec
[TYPE_SYMTAB_ADDRESS (type
)].status
== TYPE_DEFINED
1951 && TYPE_NAME (TREE_TYPE (decl
)) == decl
)
1954 /* Don't output the same typedef twice.
1955 And don't output what language-specific stuff doesn't want output. */
1956 if (TREE_ASM_WRITTEN (decl
) || TYPE_DECL_SUPPRESS_DEBUG (decl
))
1965 if (DECL_NAME (decl
))
1967 /* Nonzero means we must output a tag as well as a typedef. */
1970 /* Handle the case of a C++ structure or union
1971 where the TYPE_NAME is a TYPE_DECL
1972 which gives both a typedef name and a tag. */
1973 /* dbx requires the tag first and the typedef second. */
1974 if ((TREE_CODE (type
) == RECORD_TYPE
1975 || TREE_CODE (type
) == UNION_TYPE
1976 || TREE_CODE (type
) == QUAL_UNION_TYPE
)
1977 && TYPE_NAME (type
) == decl
1978 && !(use_gnu_debug_info_extensions
&& have_used_extensions
)
1979 && !TREE_ASM_WRITTEN (TYPE_NAME (type
))
1980 /* Distinguish the implicit typedefs of C++
1981 from explicit ones that might be found in C. */
1982 && DECL_ARTIFICIAL (decl
)
1983 /* Do not generate a tag for records of variable size,
1984 since this type can not be properly described in the
1985 DBX format, and it confuses some tools such as objdump. */
1986 && host_integerp (TYPE_SIZE (type
), 1))
1988 tree name
= TYPE_NAME (type
);
1989 if (TREE_CODE (name
) == TYPE_DECL
)
1990 name
= DECL_NAME (name
);
1992 current_sym_code
= DBX_TYPE_DECL_STABS_CODE
;
1993 current_sym_value
= 0;
1994 current_sym_addr
= 0;
1995 current_sym_nchars
= 2 + IDENTIFIER_LENGTH (name
);
1997 fprintf (asmfile
, "%s\"%s:T", ASM_STABS_OP
,
1998 IDENTIFIER_POINTER (name
));
1999 dbxout_type (type
, 1);
2000 dbxout_finish_symbol (NULL_TREE
);
2003 /* Output .stabs (or whatever) and leading double quote. */
2004 fprintf (asmfile
, "%s\"", ASM_STABS_OP
);
2006 if (use_gnu_debug_info_extensions
)
2008 /* Output leading class/struct qualifiers. */
2009 dbxout_class_name_qualifiers (decl
);
2012 /* Output typedef name. */
2013 fprintf (asmfile
, "%s:", IDENTIFIER_POINTER (DECL_NAME (decl
)));
2015 /* Short cut way to output a tag also. */
2016 if ((TREE_CODE (type
) == RECORD_TYPE
2017 || TREE_CODE (type
) == UNION_TYPE
2018 || TREE_CODE (type
) == QUAL_UNION_TYPE
)
2019 && TYPE_NAME (type
) == decl
2020 /* Distinguish the implicit typedefs of C++
2021 from explicit ones that might be found in C. */
2022 && DECL_ARTIFICIAL (decl
))
2024 if (use_gnu_debug_info_extensions
&& have_used_extensions
)
2026 putc ('T', asmfile
);
2027 TREE_ASM_WRITTEN (TYPE_NAME (type
)) = 1;
2029 #if 0 /* Now we generate the tag for this case up above. */
2035 putc ('t', asmfile
);
2036 current_sym_code
= DBX_TYPE_DECL_STABS_CODE
;
2038 dbxout_type (type
, 1);
2039 dbxout_finish_symbol (decl
);
2043 /* Don't output a tag if this is an incomplete type. This prevents
2044 the sun4 Sun OS 4.x dbx from crashing. */
2046 if (tag_needed
&& TYPE_NAME (type
) != 0
2047 && (TREE_CODE (TYPE_NAME (type
)) == IDENTIFIER_NODE
2048 || (DECL_NAME (TYPE_NAME (type
)) != 0))
2049 && COMPLETE_TYPE_P (type
)
2050 && !TREE_ASM_WRITTEN (TYPE_NAME (type
)))
2052 /* For a TYPE_DECL with no name, but the type has a name,
2054 This is what represents `struct foo' with no typedef. */
2055 /* In C++, the name of a type is the corresponding typedef.
2056 In C, it is an IDENTIFIER_NODE. */
2057 tree name
= TYPE_NAME (type
);
2058 if (TREE_CODE (name
) == TYPE_DECL
)
2059 name
= DECL_NAME (name
);
2061 current_sym_code
= DBX_TYPE_DECL_STABS_CODE
;
2062 current_sym_value
= 0;
2063 current_sym_addr
= 0;
2064 current_sym_nchars
= 2 + IDENTIFIER_LENGTH (name
);
2066 fprintf (asmfile
, "%s\"%s:T", ASM_STABS_OP
,
2067 IDENTIFIER_POINTER (name
));
2068 dbxout_type (type
, 1);
2069 dbxout_finish_symbol (NULL_TREE
);
2073 /* If an enum type has no name, it cannot be referred to,
2074 but we must output it anyway, since the enumeration constants
2075 can be referred to. */
2076 if (!did_output
&& TREE_CODE (type
) == ENUMERAL_TYPE
)
2078 current_sym_code
= DBX_TYPE_DECL_STABS_CODE
;
2079 current_sym_value
= 0;
2080 current_sym_addr
= 0;
2081 current_sym_nchars
= 2;
2083 /* Some debuggers fail when given NULL names, so give this a
2084 harmless name of ` '. */
2085 fprintf (asmfile
, "%s\" :T", ASM_STABS_OP
);
2086 dbxout_type (type
, 1);
2087 dbxout_finish_symbol (NULL_TREE
);
2090 /* Prevent duplicate output of a typedef. */
2091 TREE_ASM_WRITTEN (decl
) = 1;
2096 /* Parm decls go in their own separate chains
2097 and are output by dbxout_reg_parms and dbxout_parms. */
2101 /* Named return value, treat like a VAR_DECL. */
2103 if (! DECL_RTL_SET_P (decl
))
2105 /* Don't mention a variable that is external.
2106 Let the file that defines it describe it. */
2107 if (DECL_EXTERNAL (decl
))
2110 /* If the variable is really a constant
2111 and not written in memory, inform the debugger. */
2112 if (TREE_STATIC (decl
) && TREE_READONLY (decl
)
2113 && DECL_INITIAL (decl
) != 0
2114 && host_integerp (DECL_INITIAL (decl
), 0)
2115 && ! TREE_ASM_WRITTEN (decl
)
2116 && (DECL_CONTEXT (decl
) == NULL_TREE
2117 || TREE_CODE (DECL_CONTEXT (decl
)) == BLOCK
))
2119 if (TREE_PUBLIC (decl
) == 0)
2121 /* The sun4 assembler does not grok this. */
2122 const char *name
= IDENTIFIER_POINTER (DECL_NAME (decl
));
2124 if (TREE_CODE (TREE_TYPE (decl
)) == INTEGER_TYPE
2125 || TREE_CODE (TREE_TYPE (decl
)) == ENUMERAL_TYPE
)
2127 HOST_WIDE_INT ival
= tree_low_cst (DECL_INITIAL (decl
), 0);
2128 #ifdef DBX_OUTPUT_CONSTANT_SYMBOL
2129 DBX_OUTPUT_CONSTANT_SYMBOL (asmfile
, name
, ival
);
2131 fprintf (asmfile
, "%s\"%s:c=i", ASM_STABS_OP
, name
);
2133 fprintf (asmfile
, HOST_WIDE_INT_PRINT_DEC
, ival
);
2134 fprintf (asmfile
, "\",0x%x,0,0,0\n", N_LSYM
);
2138 else if (TREE_CODE (TREE_TYPE (decl
)) == REAL_TYPE
)
2140 /* don't know how to do this yet. */
2144 /* else it is something we handle like a normal variable. */
2147 SET_DECL_RTL (decl
, eliminate_regs (DECL_RTL (decl
), 0, NULL_RTX
));
2148 #ifdef LEAF_REG_REMAP
2149 if (current_function_uses_only_leaf_regs
)
2150 leaf_renumber_regs_insn (DECL_RTL (decl
));
2153 result
= dbxout_symbol_location (decl
, type
, 0, DECL_RTL (decl
));
2162 /* Output the stab for DECL, a VAR_DECL, RESULT_DECL or PARM_DECL.
2163 Add SUFFIX to its name, if SUFFIX is not 0.
2164 Describe the variable as residing in HOME
2165 (usually HOME is DECL_RTL (DECL), but not always).
2166 Returns 1 if the stab was really emitted. */
2169 dbxout_symbol_location (decl
, type
, suffix
, home
)
2177 /* Don't mention a variable at all
2178 if it was completely optimized into nothingness.
2180 If the decl was from an inline function, then its rtl
2181 is not identically the rtl that was used in this
2182 particular compilation. */
2183 if (GET_CODE (home
) == SUBREG
)
2187 while (GET_CODE (value
) == SUBREG
)
2188 value
= SUBREG_REG (value
);
2189 if (GET_CODE (value
) == REG
)
2191 if (REGNO (value
) >= FIRST_PSEUDO_REGISTER
)
2194 home
= alter_subreg (&home
);
2196 if (GET_CODE (home
) == REG
)
2198 regno
= REGNO (home
);
2199 if (regno
>= FIRST_PSEUDO_REGISTER
)
2203 /* The kind-of-variable letter depends on where
2204 the variable is and on the scope of its name:
2205 G and N_GSYM for static storage and global scope,
2206 S for static storage and file scope,
2207 V for static storage and local scope,
2208 for those two, use N_LCSYM if data is in bss segment,
2209 N_STSYM if in data segment, N_FUN otherwise.
2210 (We used N_FUN originally, then changed to N_STSYM
2211 to please GDB. However, it seems that confused ld.
2212 Now GDB has been fixed to like N_FUN, says Kingdon.)
2213 no letter at all, and N_LSYM, for auto variable,
2214 r and N_RSYM for register variable. */
2216 if (GET_CODE (home
) == MEM
2217 && GET_CODE (XEXP (home
, 0)) == SYMBOL_REF
)
2219 if (TREE_PUBLIC (decl
))
2222 current_sym_code
= N_GSYM
;
2226 current_sym_addr
= XEXP (home
, 0);
2228 letter
= decl_function_context (decl
) ? 'V' : 'S';
2230 /* This should be the same condition as in assemble_variable, but
2231 we don't have access to dont_output_data here. So, instead,
2232 we rely on the fact that error_mark_node initializers always
2233 end up in bss for C++ and never end up in bss for C. */
2234 if (DECL_INITIAL (decl
) == 0
2235 || (!strcmp (lang_hooks
.name
, "GNU C++")
2236 && DECL_INITIAL (decl
) == error_mark_node
))
2237 current_sym_code
= N_LCSYM
;
2238 else if (DECL_IN_TEXT_SECTION (decl
))
2239 /* This is not quite right, but it's the closest
2240 of all the codes that Unix defines. */
2241 current_sym_code
= DBX_STATIC_CONST_VAR_CODE
;
2244 /* Some ports can transform a symbol ref into a label ref,
2245 because the symbol ref is too far away and has to be
2246 dumped into a constant pool. Alternatively, the symbol
2247 in the constant pool might be referenced by a different
2249 if (GET_CODE (current_sym_addr
) == SYMBOL_REF
2250 && CONSTANT_POOL_ADDRESS_P (current_sym_addr
))
2252 rtx tmp
= get_pool_constant (current_sym_addr
);
2254 if (GET_CODE (tmp
) == SYMBOL_REF
2255 || GET_CODE (tmp
) == LABEL_REF
)
2256 current_sym_addr
= tmp
;
2259 /* Ultrix `as' seems to need this. */
2260 #ifdef DBX_STATIC_STAB_DATA_SECTION
2263 current_sym_code
= N_STSYM
;
2267 else if (regno
>= 0)
2270 current_sym_code
= N_RSYM
;
2271 current_sym_value
= DBX_REGISTER_NUMBER (regno
);
2273 else if (GET_CODE (home
) == MEM
2274 && (GET_CODE (XEXP (home
, 0)) == MEM
2275 || (GET_CODE (XEXP (home
, 0)) == REG
2276 && REGNO (XEXP (home
, 0)) != HARD_FRAME_POINTER_REGNUM
2277 && REGNO (XEXP (home
, 0)) != STACK_POINTER_REGNUM
2278 #if ARG_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM
2279 && REGNO (XEXP (home
, 0)) != ARG_POINTER_REGNUM
2282 /* If the value is indirect by memory or by a register
2283 that isn't the frame pointer
2284 then it means the object is variable-sized and address through
2285 that register or stack slot. DBX has no way to represent this
2286 so all we can do is output the variable as a pointer.
2287 If it's not a parameter, ignore it.
2288 (VAR_DECLs like this can be made by integrate.c.) */
2290 if (GET_CODE (XEXP (home
, 0)) == REG
)
2293 current_sym_code
= N_RSYM
;
2294 if (REGNO (XEXP (home
, 0)) >= FIRST_PSEUDO_REGISTER
)
2296 current_sym_value
= DBX_REGISTER_NUMBER (REGNO (XEXP (home
, 0)));
2300 current_sym_code
= N_LSYM
;
2301 /* RTL looks like (MEM (MEM (PLUS (REG...) (CONST_INT...)))).
2302 We want the value of that CONST_INT. */
2304 = DEBUGGER_AUTO_OFFSET (XEXP (XEXP (home
, 0), 0));
2307 /* Effectively do build_pointer_type, but don't cache this type,
2308 since it might be temporary whereas the type it points to
2309 might have been saved for inlining. */
2310 /* Don't use REFERENCE_TYPE because dbx can't handle that. */
2311 type
= make_node (POINTER_TYPE
);
2312 TREE_TYPE (type
) = TREE_TYPE (decl
);
2314 else if (GET_CODE (home
) == MEM
2315 && GET_CODE (XEXP (home
, 0)) == REG
)
2317 current_sym_code
= N_LSYM
;
2318 current_sym_value
= DEBUGGER_AUTO_OFFSET (XEXP (home
, 0));
2320 else if (GET_CODE (home
) == MEM
2321 && GET_CODE (XEXP (home
, 0)) == PLUS
2322 && GET_CODE (XEXP (XEXP (home
, 0), 1)) == CONST_INT
)
2324 current_sym_code
= N_LSYM
;
2325 /* RTL looks like (MEM (PLUS (REG...) (CONST_INT...)))
2326 We want the value of that CONST_INT. */
2327 current_sym_value
= DEBUGGER_AUTO_OFFSET (XEXP (home
, 0));
2329 else if (GET_CODE (home
) == MEM
2330 && GET_CODE (XEXP (home
, 0)) == CONST
)
2332 /* Handle an obscure case which can arise when optimizing and
2333 when there are few available registers. (This is *always*
2334 the case for i386/i486 targets). The RTL looks like
2335 (MEM (CONST ...)) even though this variable is a local `auto'
2336 or a local `register' variable. In effect, what has happened
2337 is that the reload pass has seen that all assignments and
2338 references for one such a local variable can be replaced by
2339 equivalent assignments and references to some static storage
2340 variable, thereby avoiding the need for a register. In such
2341 cases we're forced to lie to debuggers and tell them that
2342 this variable was itself `static'. */
2343 current_sym_code
= N_LCSYM
;
2345 current_sym_addr
= XEXP (XEXP (home
, 0), 0);
2347 else if (GET_CODE (home
) == CONCAT
)
2351 /* If TYPE is not a COMPLEX_TYPE (it might be a RECORD_TYPE,
2352 for example), then there is no easy way to figure out
2353 what SUBTYPE should be. So, we give up. */
2354 if (TREE_CODE (type
) != COMPLEX_TYPE
)
2357 subtype
= TREE_TYPE (type
);
2359 /* If the variable's storage is in two parts,
2360 output each as a separate stab with a modified name. */
2361 if (WORDS_BIG_ENDIAN
)
2362 dbxout_symbol_location (decl
, subtype
, "$imag", XEXP (home
, 0));
2364 dbxout_symbol_location (decl
, subtype
, "$real", XEXP (home
, 0));
2366 /* Cast avoids warning in old compilers. */
2367 current_sym_code
= (STAB_CODE_TYPE
) 0;
2368 current_sym_value
= 0;
2369 current_sym_addr
= 0;
2370 dbxout_prepare_symbol (decl
);
2372 if (WORDS_BIG_ENDIAN
)
2373 dbxout_symbol_location (decl
, subtype
, "$real", XEXP (home
, 1));
2375 dbxout_symbol_location (decl
, subtype
, "$imag", XEXP (home
, 1));
2379 /* Address might be a MEM, when DECL is a variable-sized object.
2380 Or it might be const0_rtx, meaning previous passes
2381 want us to ignore this variable. */
2384 /* Ok, start a symtab entry and output the variable name. */
2387 #ifdef DBX_STATIC_BLOCK_START
2388 DBX_STATIC_BLOCK_START (asmfile
, current_sym_code
);
2391 dbxout_symbol_name (decl
, suffix
, letter
);
2392 dbxout_type (type
, 0);
2393 dbxout_finish_symbol (decl
);
2395 #ifdef DBX_STATIC_BLOCK_END
2396 DBX_STATIC_BLOCK_END (asmfile
, current_sym_code
);
2401 /* Output the symbol name of DECL for a stabs, with suffix SUFFIX.
2402 Then output LETTER to indicate the kind of location the symbol has. */
2405 dbxout_symbol_name (decl
, suffix
, letter
)
2412 if (DECL_CONTEXT (decl
) && TYPE_P (DECL_CONTEXT (decl
)))
2413 /* One slight hitch: if this is a VAR_DECL which is a static
2414 class member, we must put out the mangled name instead of the
2415 DECL_NAME. Note also that static member (variable) names DO NOT begin
2416 with underscores in .stabs directives. */
2417 name
= IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl
));
2419 /* ...but if we're function-local, we don't want to include the junk
2420 added by ASM_FORMAT_PRIVATE_NAME. */
2421 name
= IDENTIFIER_POINTER (DECL_NAME (decl
));
2425 fprintf (asmfile
, "%s\"%s%s:", ASM_STABS_OP
, name
,
2426 (suffix
? suffix
: ""));
2429 putc (letter
, asmfile
);
2433 dbxout_prepare_symbol (decl
)
2434 tree decl ATTRIBUTE_UNUSED
;
2437 const char *filename
= DECL_SOURCE_FILE (decl
);
2439 dbxout_source_file (asmfile
, filename
);
2444 dbxout_finish_symbol (sym
)
2447 #ifdef DBX_FINISH_SYMBOL
2448 DBX_FINISH_SYMBOL (sym
);
2451 if (use_gnu_debug_info_extensions
&& sym
!= 0)
2452 line
= DECL_SOURCE_LINE (sym
);
2454 fprintf (asmfile
, "\",%d,0,%d,", current_sym_code
, line
);
2455 if (current_sym_addr
)
2456 output_addr_const (asmfile
, current_sym_addr
);
2458 fprintf (asmfile
, "%d", current_sym_value
);
2459 putc ('\n', asmfile
);
2463 /* Output definitions of all the decls in a chain. Return nonzero if
2464 anything was output */
2473 result
+= dbxout_symbol (syms
, 1);
2474 syms
= TREE_CHAIN (syms
);
2479 /* The following two functions output definitions of function parameters.
2480 Each parameter gets a definition locating it in the parameter list.
2481 Each parameter that is a register variable gets a second definition
2482 locating it in the register.
2484 Printing or argument lists in gdb uses the definitions that
2485 locate in the parameter list. But reference to the variable in
2486 expressions uses preferentially the definition as a register. */
2488 /* Output definitions, referring to storage in the parmlist,
2489 of all the parms in PARMS, which is a chain of PARM_DECL nodes. */
2492 dbxout_parms (parms
)
2495 for (; parms
; parms
= TREE_CHAIN (parms
))
2496 if (DECL_NAME (parms
) && TREE_TYPE (parms
) != error_mark_node
)
2498 dbxout_prepare_symbol (parms
);
2500 /* Perform any necessary register eliminations on the parameter's rtl,
2501 so that the debugging output will be accurate. */
2502 DECL_INCOMING_RTL (parms
)
2503 = eliminate_regs (DECL_INCOMING_RTL (parms
), 0, NULL_RTX
);
2504 SET_DECL_RTL (parms
, eliminate_regs (DECL_RTL (parms
), 0, NULL_RTX
));
2505 #ifdef LEAF_REG_REMAP
2506 if (current_function_uses_only_leaf_regs
)
2508 leaf_renumber_regs_insn (DECL_INCOMING_RTL (parms
));
2509 leaf_renumber_regs_insn (DECL_RTL (parms
));
2513 if (PARM_PASSED_IN_MEMORY (parms
))
2515 rtx addr
= XEXP (DECL_INCOMING_RTL (parms
), 0);
2517 /* ??? Here we assume that the parm address is indexed
2518 off the frame pointer or arg pointer.
2519 If that is not true, we produce meaningless results,
2520 but do not crash. */
2521 if (GET_CODE (addr
) == PLUS
2522 && GET_CODE (XEXP (addr
, 1)) == CONST_INT
)
2523 current_sym_value
= INTVAL (XEXP (addr
, 1));
2525 current_sym_value
= 0;
2527 current_sym_code
= N_PSYM
;
2528 current_sym_addr
= 0;
2531 if (DECL_NAME (parms
))
2533 current_sym_nchars
= 2 + IDENTIFIER_LENGTH (DECL_NAME (parms
));
2535 fprintf (asmfile
, "%s\"%s:%c", ASM_STABS_OP
,
2536 IDENTIFIER_POINTER (DECL_NAME (parms
)),
2537 DBX_MEMPARM_STABS_LETTER
);
2541 current_sym_nchars
= 8;
2542 fprintf (asmfile
, "%s\"(anon):%c", ASM_STABS_OP
,
2543 DBX_MEMPARM_STABS_LETTER
);
2546 /* It is quite tempting to use:
2548 dbxout_type (TREE_TYPE (parms), 0);
2550 as the next statement, rather than using DECL_ARG_TYPE(), so
2551 that gcc reports the actual type of the parameter, rather
2552 than the promoted type. This certainly makes GDB's life
2553 easier, at least for some ports. The change is a bad idea
2554 however, since GDB expects to be able access the type without
2555 performing any conversions. So for example, if we were
2556 passing a float to an unprototyped function, gcc will store a
2557 double on the stack, but if we emit a stab saying the type is a
2558 float, then gdb will only read in a single value, and this will
2559 produce an erroneous value. */
2560 dbxout_type (DECL_ARG_TYPE (parms
), 0);
2561 current_sym_value
= DEBUGGER_ARG_OFFSET (current_sym_value
, addr
);
2562 dbxout_finish_symbol (parms
);
2564 else if (GET_CODE (DECL_RTL (parms
)) == REG
)
2567 char regparm_letter
;
2569 /* Parm passed in registers and lives in registers or nowhere. */
2571 current_sym_code
= DBX_REGPARM_STABS_CODE
;
2572 regparm_letter
= DBX_REGPARM_STABS_LETTER
;
2573 current_sym_addr
= 0;
2575 /* If parm lives in a register, use that register;
2576 pretend the parm was passed there. It would be more consistent
2577 to describe the register where the parm was passed,
2578 but in practice that register usually holds something else.
2580 If we use DECL_RTL, then we must use the declared type of
2581 the variable, not the type that it arrived in. */
2582 if (REGNO (DECL_RTL (parms
)) < FIRST_PSEUDO_REGISTER
)
2584 best_rtl
= DECL_RTL (parms
);
2585 parm_type
= TREE_TYPE (parms
);
2587 /* If the parm lives nowhere, use the register where it was
2588 passed. It is also better to use the declared type here. */
2591 best_rtl
= DECL_INCOMING_RTL (parms
);
2592 parm_type
= TREE_TYPE (parms
);
2594 current_sym_value
= DBX_REGISTER_NUMBER (REGNO (best_rtl
));
2597 if (DECL_NAME (parms
))
2599 current_sym_nchars
= 2 + IDENTIFIER_LENGTH (DECL_NAME (parms
));
2600 fprintf (asmfile
, "%s\"%s:%c", ASM_STABS_OP
,
2601 IDENTIFIER_POINTER (DECL_NAME (parms
)),
2606 current_sym_nchars
= 8;
2607 fprintf (asmfile
, "%s\"(anon):%c", ASM_STABS_OP
,
2611 dbxout_type (parm_type
, 0);
2612 dbxout_finish_symbol (parms
);
2614 else if (GET_CODE (DECL_RTL (parms
)) == MEM
2615 && GET_CODE (XEXP (DECL_RTL (parms
), 0)) == REG
2616 && REGNO (XEXP (DECL_RTL (parms
), 0)) != HARD_FRAME_POINTER_REGNUM
2617 && REGNO (XEXP (DECL_RTL (parms
), 0)) != STACK_POINTER_REGNUM
2618 #if ARG_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM
2619 && REGNO (XEXP (DECL_RTL (parms
), 0)) != ARG_POINTER_REGNUM
2623 /* Parm was passed via invisible reference.
2624 That is, its address was passed in a register.
2625 Output it as if it lived in that register.
2626 The debugger will know from the type
2627 that it was actually passed by invisible reference. */
2629 char regparm_letter
;
2630 /* Parm passed in registers and lives in registers or nowhere. */
2632 current_sym_code
= DBX_REGPARM_STABS_CODE
;
2633 if (use_gnu_debug_info_extensions
)
2634 regparm_letter
= GDB_INV_REF_REGPARM_STABS_LETTER
;
2636 regparm_letter
= DBX_REGPARM_STABS_LETTER
;
2638 /* DECL_RTL looks like (MEM (REG...). Get the register number.
2639 If it is an unallocated pseudo-reg, then use the register where
2640 it was passed instead. */
2641 if (REGNO (XEXP (DECL_RTL (parms
), 0)) < FIRST_PSEUDO_REGISTER
)
2642 current_sym_value
= REGNO (XEXP (DECL_RTL (parms
), 0));
2644 current_sym_value
= REGNO (DECL_INCOMING_RTL (parms
));
2646 current_sym_addr
= 0;
2649 if (DECL_NAME (parms
))
2652 = 2 + strlen (IDENTIFIER_POINTER (DECL_NAME (parms
)));
2654 fprintf (asmfile
, "%s\"%s:%c", ASM_STABS_OP
,
2655 IDENTIFIER_POINTER (DECL_NAME (parms
)),
2660 current_sym_nchars
= 8;
2661 fprintf (asmfile
, "%s\"(anon):%c", ASM_STABS_OP
,
2665 dbxout_type (TREE_TYPE (parms
), 0);
2666 dbxout_finish_symbol (parms
);
2668 else if (GET_CODE (DECL_RTL (parms
)) == MEM
2669 && GET_CODE (XEXP (DECL_RTL (parms
), 0)) == MEM
)
2671 /* Parm was passed via invisible reference, with the reference
2672 living on the stack. DECL_RTL looks like
2673 (MEM (MEM (PLUS (REG ...) (CONST_INT ...)))) or it
2674 could look like (MEM (MEM (REG))). */
2675 const char *const decl_name
= (DECL_NAME (parms
)
2676 ? IDENTIFIER_POINTER (DECL_NAME (parms
))
2678 if (GET_CODE (XEXP (XEXP (DECL_RTL (parms
), 0), 0)) == REG
)
2679 current_sym_value
= 0;
2682 = INTVAL (XEXP (XEXP (XEXP (DECL_RTL (parms
), 0), 0), 1));
2683 current_sym_addr
= 0;
2684 current_sym_code
= N_PSYM
;
2687 fprintf (asmfile
, "%s\"%s:v", ASM_STABS_OP
, decl_name
);
2690 = DEBUGGER_ARG_OFFSET (current_sym_value
,
2691 XEXP (XEXP (DECL_RTL (parms
), 0), 0));
2692 dbxout_type (TREE_TYPE (parms
), 0);
2693 dbxout_finish_symbol (parms
);
2695 else if (GET_CODE (DECL_RTL (parms
)) == MEM
2696 && XEXP (DECL_RTL (parms
), 0) != const0_rtx
2697 /* ??? A constant address for a parm can happen
2698 when the reg it lives in is equiv to a constant in memory.
2699 Should make this not happen, after 2.4. */
2700 && ! CONSTANT_P (XEXP (DECL_RTL (parms
), 0)))
2702 /* Parm was passed in registers but lives on the stack. */
2704 current_sym_code
= N_PSYM
;
2705 /* DECL_RTL looks like (MEM (PLUS (REG...) (CONST_INT...))),
2706 in which case we want the value of that CONST_INT,
2708 in which case we use a value of zero. */
2709 if (GET_CODE (XEXP (DECL_RTL (parms
), 0)) == REG
)
2710 current_sym_value
= 0;
2713 = INTVAL (XEXP (XEXP (DECL_RTL (parms
), 0), 1));
2715 current_sym_addr
= 0;
2717 /* Make a big endian correction if the mode of the type of the
2718 parameter is not the same as the mode of the rtl. */
2719 if (BYTES_BIG_ENDIAN
2720 && TYPE_MODE (TREE_TYPE (parms
)) != GET_MODE (DECL_RTL (parms
))
2721 && GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (parms
))) < UNITS_PER_WORD
)
2723 current_sym_value
+=
2724 GET_MODE_SIZE (GET_MODE (DECL_RTL (parms
)))
2725 - GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (parms
)));
2729 if (DECL_NAME (parms
))
2732 = 2 + strlen (IDENTIFIER_POINTER (DECL_NAME (parms
)));
2734 fprintf (asmfile
, "%s\"%s:%c", ASM_STABS_OP
,
2735 IDENTIFIER_POINTER (DECL_NAME (parms
)),
2736 DBX_MEMPARM_STABS_LETTER
);
2740 current_sym_nchars
= 8;
2741 fprintf (asmfile
, "%s\"(anon):%c", ASM_STABS_OP
,
2742 DBX_MEMPARM_STABS_LETTER
);
2746 = DEBUGGER_ARG_OFFSET (current_sym_value
,
2747 XEXP (DECL_RTL (parms
), 0));
2748 dbxout_type (TREE_TYPE (parms
), 0);
2749 dbxout_finish_symbol (parms
);
2754 /* Output definitions for the places where parms live during the function,
2755 when different from where they were passed, when the parms were passed
2758 It is not useful to do this for parms passed in registers
2759 that live during the function in different registers, because it is
2760 impossible to look in the passed register for the passed value,
2761 so we use the within-the-function register to begin with.
2763 PARMS is a chain of PARM_DECL nodes. */
2766 dbxout_reg_parms (parms
)
2769 for (; parms
; parms
= TREE_CHAIN (parms
))
2770 if (DECL_NAME (parms
) && PARM_PASSED_IN_MEMORY (parms
))
2772 dbxout_prepare_symbol (parms
);
2774 /* Report parms that live in registers during the function
2775 but were passed in memory. */
2776 if (GET_CODE (DECL_RTL (parms
)) == REG
2777 && REGNO (DECL_RTL (parms
)) < FIRST_PSEUDO_REGISTER
)
2778 dbxout_symbol_location (parms
, TREE_TYPE (parms
),
2779 0, DECL_RTL (parms
));
2780 else if (GET_CODE (DECL_RTL (parms
)) == CONCAT
)
2781 dbxout_symbol_location (parms
, TREE_TYPE (parms
),
2782 0, DECL_RTL (parms
));
2783 /* Report parms that live in memory but not where they were passed. */
2784 else if (GET_CODE (DECL_RTL (parms
)) == MEM
2785 && ! rtx_equal_p (DECL_RTL (parms
), DECL_INCOMING_RTL (parms
)))
2786 dbxout_symbol_location (parms
, TREE_TYPE (parms
),
2787 0, DECL_RTL (parms
));
2791 /* Given a chain of ..._TYPE nodes (as come in a parameter list),
2792 output definitions of those names, in raw form */
2800 putc (',', asmfile
);
2801 dbxout_type (TREE_VALUE (args
), 0);
2803 args
= TREE_CHAIN (args
);
2807 /* Output everything about a symbol block (a BLOCK node
2808 that represents a scope level),
2809 including recursive output of contained blocks.
2811 BLOCK is the BLOCK node.
2812 DEPTH is its depth within containing symbol blocks.
2813 ARGS is usually zero; but for the outermost block of the
2814 body of a function, it is a chain of PARM_DECLs for the function parameters.
2815 We output definitions of all the register parms
2816 as if they were local variables of that block.
2818 If -g1 was used, we count blocks just the same, but output nothing
2819 except for the outermost block.
2821 Actually, BLOCK may be several blocks chained together.
2822 We handle them all in sequence. */
2825 dbxout_block (block
, depth
, args
)
2832 #if DBX_BLOCKS_FUNCTION_RELATIVE
2833 const char *begin_label
;
2834 if (current_function_func_begin_label
!= NULL_TREE
)
2835 begin_label
= IDENTIFIER_POINTER (current_function_func_begin_label
);
2837 begin_label
= XSTR (XEXP (DECL_RTL (current_function_decl
), 0), 0);
2842 /* Ignore blocks never expanded or otherwise marked as real. */
2843 if (TREE_USED (block
) && TREE_ASM_WRITTEN (block
))
2847 #ifdef DBX_LBRAC_FIRST
2850 /* In dbx format, the syms of a block come before the N_LBRAC.
2851 If nothing is output, we don't need the N_LBRAC, either. */
2853 if (debug_info_level
!= DINFO_LEVEL_TERSE
|| depth
== 0)
2854 did_output
= dbxout_syms (BLOCK_VARS (block
));
2856 dbxout_reg_parms (args
);
2859 /* Now output an N_LBRAC symbol to represent the beginning of
2860 the block. Use the block's tree-walk order to generate
2861 the assembler symbols LBBn and LBEn
2862 that final will define around the code in this block. */
2863 if (depth
> 0 && did_output
)
2866 blocknum
= BLOCK_NUMBER (block
);
2867 ASM_GENERATE_INTERNAL_LABEL (buf
, "LBB", blocknum
);
2869 if (BLOCK_HANDLER_BLOCK (block
))
2871 /* A catch block. Must precede N_LBRAC. */
2872 tree decl
= BLOCK_VARS (block
);
2875 #ifdef DBX_OUTPUT_CATCH
2876 DBX_OUTPUT_CATCH (asmfile
, decl
, buf
);
2878 fprintf (asmfile
, "%s\"%s:C1\",%d,0,0,", ASM_STABS_OP
,
2879 IDENTIFIER_POINTER (DECL_NAME (decl
)), N_CATCH
);
2880 assemble_name (asmfile
, buf
);
2881 fprintf (asmfile
, "\n");
2883 decl
= TREE_CHAIN (decl
);
2887 #ifdef DBX_OUTPUT_LBRAC
2888 DBX_OUTPUT_LBRAC (asmfile
, buf
);
2890 fprintf (asmfile
, "%s%d,0,0,", ASM_STABN_OP
, N_LBRAC
);
2891 assemble_name (asmfile
, buf
);
2892 #if DBX_BLOCKS_FUNCTION_RELATIVE
2893 putc ('-', asmfile
);
2894 assemble_name (asmfile
, begin_label
);
2896 fprintf (asmfile
, "\n");
2900 #ifdef DBX_LBRAC_FIRST
2901 /* On some weird machines, the syms of a block
2902 come after the N_LBRAC. */
2903 if (debug_info_level
!= DINFO_LEVEL_TERSE
|| depth
== 0)
2904 dbxout_syms (BLOCK_VARS (block
));
2906 dbxout_reg_parms (args
);
2909 /* Output the subblocks. */
2910 dbxout_block (BLOCK_SUBBLOCKS (block
), depth
+ 1, NULL_TREE
);
2912 /* Refer to the marker for the end of the block. */
2913 if (depth
> 0 && did_output
)
2916 ASM_GENERATE_INTERNAL_LABEL (buf
, "LBE", blocknum
);
2917 #ifdef DBX_OUTPUT_RBRAC
2918 DBX_OUTPUT_RBRAC (asmfile
, buf
);
2920 fprintf (asmfile
, "%s%d,0,0,", ASM_STABN_OP
, N_RBRAC
);
2921 assemble_name (asmfile
, buf
);
2922 #if DBX_BLOCKS_FUNCTION_RELATIVE
2923 putc ('-', asmfile
);
2924 assemble_name (asmfile
, begin_label
);
2926 fprintf (asmfile
, "\n");
2930 block
= BLOCK_CHAIN (block
);
2934 /* Output the information about a function and its arguments and result.
2935 Usually this follows the function's code,
2936 but on some systems, it comes before. */
2938 #if defined (DBX_DEBUGGING_INFO)
2940 dbxout_begin_function (decl
)
2943 dbxout_symbol (decl
, 0);
2944 dbxout_parms (DECL_ARGUMENTS (decl
));
2945 if (DECL_NAME (DECL_RESULT (decl
)) != 0)
2946 dbxout_symbol (DECL_RESULT (decl
), 1);
2948 #endif /* DBX_DEBUGGING_INFO */
2950 #endif /* DBX_DEBUGGING_INFO || XCOFF_DEBUGGING_INFO */