home *** CD-ROM | disk | FTP | other *** search
/ Education Sampler 1992 [NeXTSTEP] / Education_1992_Sampler.iso / NeXT / GnuSource / cc-61.0.1 / cc / dbxout.c < prev    next >
C/C++ Source or Header  |  1991-12-19  |  52KB  |  1,751 lines

  1. /* Output dbx-format symbol table information from GNU compiler.
  2.    Copyright (C) 1987, 1988 Free Software Foundation, Inc.
  3.  
  4. This file is part of GNU CC.
  5.  
  6. GNU CC is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2, or (at your option)
  9. any later version.
  10.  
  11. GNU CC is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with GNU CC; see the file COPYING.  If not, write to
  18. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  19.  
  20.  
  21. /* Output dbx-format symbol table data.
  22.    This consists of many symbol table entries, each of them
  23.    a .stabs assembler pseudo-op with four operands:
  24.    a "name" which is really a description of one symbol and its type,
  25.    a "code", which is a symbol defined in stab.h whose name starts with N_,
  26.    an unused operand always 0,
  27.    and a "value" which is an address or an offset.
  28.    The name is enclosed in doublequote characters.
  29.  
  30.    Each function, variable, typedef, and structure tag
  31.    has a symbol table entry to define it.
  32.    The beginning and end of each level of name scoping within
  33.    a function are also marked by special symbol table entries.
  34.  
  35.    The "name" consists of the symbol name, a colon, a kind-of-symbol letter,
  36.    and a data type number.  The data type number may be followed by
  37.    "=" and a type definition; normally this will happen the first time
  38.    the type number is mentioned.  The type definition may refer to
  39.    other types by number, and those type numbers may be followed
  40.    by "=" and nested definitions.
  41.  
  42.    This can make the "name" quite long.
  43.    When a name is more than 80 characters, we split the .stabs pseudo-op
  44.    into two .stabs pseudo-ops, both sharing the same "code" and "value".
  45.    The first one is marked as continued with a double-backslash at the
  46.    end of its "name".
  47.  
  48.    The kind-of-symbol letter distinguished function names from global
  49.    variables from file-scope variables from parameters from auto
  50.    variables in memory from typedef names from register variables.
  51.    See `dbxout_symbol'.
  52.  
  53.    The "code" is mostly redundant with the kind-of-symbol letter
  54.    that goes in the "name", but not entirely: for symbols located
  55.    in static storage, the "code" says which segment the address is in,
  56.    which controls how it is relocated.
  57.  
  58.    The "value" for a symbol in static storage
  59.    is the core address of the symbol (actually, the assembler
  60.    label for the symbol).  For a symbol located in a stack slot
  61.    it is the stack offset; for one in a register, the register number.
  62.    For a typedef symbol, it is zero.
  63.  
  64.    If DEBUG_SYMS_TEXT is defined, all debugging symbols must be
  65.    output while in the text section.
  66.  
  67.    For more on data type definitions, see `dbxout_type'.  */
  68.  
  69. #include "config.h"
  70. #include "tree.h"
  71. #include "rtl.h"
  72. #include "flags.h"
  73. #include <stdio.h>
  74. #include <sys/param.h>
  75. #include "regs.h"
  76.  
  77. /* Emulate getwd on non-BSD systems.  */
  78.  
  79. #if defined(USG) || defined(VMS)
  80. #define getwd(addr) getcwd (addr, MAXPATHLEN)
  81. #endif
  82.  
  83. /* Typical USG systems don't have stab.h, and they also have
  84.    no use for DBX-format debugging info.  */
  85.  
  86. #ifdef DBX_DEBUGGING_INFO
  87.  
  88. #ifdef DEBUG_SYMS_TEXT
  89. #define FORCE_TEXT text_section ();
  90. #else
  91. #define FORCE_TEXT
  92. #endif
  93.  
  94. #ifdef USG
  95. #include "stab.h"  /* If doing DBX on sysV, use our own stab.h.  */
  96. #else
  97. #include <stab.h>  /* On BSD, use the system's stab.h.  */
  98. #endif /* not USG */
  99.  
  100. #ifdef __GNU_STAB__
  101. #define STAB_CODE_TYPE enum __stab_debug_code
  102. #else
  103. #define STAB_CODE_TYPE int
  104. #endif
  105.  
  106. /* 1 if PARM is passed to this function in memory.  */
  107.  
  108. #define PARM_PASSED_IN_MEMORY(PARM) \
  109.  (GET_CODE (DECL_INCOMING_RTL (PARM)) == MEM)
  110.  
  111. /* A C expression for the integer offset value of an automatic variable
  112.    (N_LSYM) having address X (an RTX).  */
  113. #ifndef DEBUGGER_AUTO_OFFSET
  114. #define DEBUGGER_AUTO_OFFSET(X) \
  115.   (GET_CODE (X) == PLUS ? INTVAL (XEXP (X, 1)) : 0)
  116. #endif
  117.  
  118. /* A C expression for the integer offset value of an argument (N_PSYM)
  119.    having address X (an RTX).  The nominal offset is OFFSET.  */
  120. #ifndef DEBUGGER_ARG_OFFSET
  121. #define DEBUGGER_ARG_OFFSET(OFFSET, X) (OFFSET)
  122. #endif
  123.  
  124. /* Stream for writing to assembler file.  */
  125.  
  126. static FILE *asmfile;
  127.  
  128. /* Last source file name mentioned in a NOTE insn.  */
  129.  
  130. static char *lastfile;
  131.  
  132. enum typestatus {TYPE_UNSEEN, TYPE_XREF, TYPE_DEFINED};
  133.  
  134. /* Vector recording the status of describing C data types.
  135.    When we first notice a data type (a tree node),
  136.    we assign it a number using next_type_number.
  137.    That is its index in this vector.
  138.    The vector element says whether we have yet output
  139.    the definition of the type.  TYPE_XREF says we have
  140.    output it as a cross-reference only.  */
  141.  
  142. enum typestatus *typevec;
  143.  
  144. /* Number of elements of space allocated in `typevec'.  */
  145.  
  146. static int typevec_len;
  147.  
  148. /* In dbx output, each type gets a unique number.
  149.    This is the number for the next type output.
  150.    The number, once assigned, is in the TYPE_SYMTAB_ADDRESS field.  */
  151.  
  152. static int next_type_number;
  153.  
  154. /* In dbx output, we must assign symbol-blocks id numbers
  155.    in the order in which their beginnings are encountered.
  156.    We output debugging info that refers to the beginning and
  157.    end of the ranges of code in each block
  158.    with assembler labels LBBn and LBEn, where n is the block number.
  159.    The labels are generated in final, which assigns numbers to the
  160.    blocks in the same way.  */
  161.  
  162. static int next_block_number;
  163.  
  164. /* These variables are for dbxout_symbol to communicate to
  165.    dbxout_finish_symbol.
  166.    current_sym_code is the symbol-type-code, a symbol N_... define in stab.h.
  167.    current_sym_value and current_sym_addr are two ways to address the
  168.    value to store in the symtab entry.
  169.    current_sym_addr if nonzero represents the value as an rtx.
  170.    If that is zero, current_sym_value is used.  This is used
  171.    when the value is an offset (such as for auto variables,
  172.    register variables and parms).  */
  173.  
  174. static STAB_CODE_TYPE current_sym_code;
  175. static int current_sym_value;
  176. static rtx current_sym_addr;
  177.  
  178. /* Number of chars of symbol-description generated so far for the
  179.    current symbol.  Used by CHARS and CONTIN.  */
  180.  
  181. static int current_sym_nchars;
  182.  
  183. /* Report having output N chars of the current symbol-description.  */
  184.  
  185. #define CHARS(N) (current_sym_nchars += (N))
  186.  
  187. /* Break the current symbol-description, generating a continuation,
  188.    if it has become long.  */
  189.  
  190. #ifndef DBX_CONTIN_LENGTH
  191. #define DBX_CONTIN_LENGTH 80
  192. #endif
  193.  
  194. #if DBX_CONTIN_LENGTH > 0
  195. #define CONTIN  \
  196.   do {if (current_sym_nchars > DBX_CONTIN_LENGTH) dbxout_continue ();} while (0)
  197. #else
  198. #define CONTIN
  199. #endif
  200.  
  201. void dbxout_types ();
  202. void dbxout_tags ();
  203. void dbxout_args ();
  204. void dbxout_symbol ();
  205. static void dbxout_type_name ();
  206. static void dbxout_type ();
  207. static void dbxout_prepare_symbol ();
  208. static void dbxout_finish_symbol ();
  209. static void dbxout_continue ();
  210. static void print_int_cst_octal ();
  211. static void print_octal ();
  212.  
  213. /* At the beginning of compilation, start writing the symbol table.
  214.    Initialize `typevec' and output the standard data types of C.  */
  215.  
  216. void
  217. dbxout_init (asm_file, input_file_name)
  218.      FILE *asm_file;
  219.      char *input_file_name;
  220. {
  221.   char ltext_label_name[100];
  222.  
  223.   asmfile = asm_file;
  224.  
  225.   typevec_len = 100;
  226.   typevec = (enum typestatus *) xmalloc (typevec_len * sizeof typevec[0]);
  227.   bzero (typevec, typevec_len * sizeof typevec[0]);
  228.  
  229.   /* Convert Ltext into the appropriate format for local labels in case
  230.      the system doesn't insert underscores in front of user generated
  231.      labels.  */
  232.   ASM_GENERATE_INTERNAL_LABEL (ltext_label_name, "Ltext", 0);
  233.  
  234.   /* Put the current working directory in an N_SO symbol.  */
  235.   {
  236.     static char wd[MAXPATHLEN];
  237.     static enum {not_gotten, gotten, error_getting} wd_status = not_gotten;
  238.  
  239.     if (wd_status == not_gotten)
  240.       {
  241.     if (getwd (wd))
  242.       wd_status = gotten;
  243.     else
  244.       wd_status = error_getting;
  245.       }
  246.  
  247.     if (wd_status == gotten)
  248.       {
  249. #ifdef ASM_OUTPUT_MAIN_SOURCE_DIRECTORY
  250.     ASM_OUTPUT_MAIN_SOURCE_DIRECTORY (file, filename);
  251. #else /* no ASM_OUTPUT_MAIN_SOURCE_DIRECTORY */
  252.     fprintf (asmfile, "\t.stabs \"%s/\",%d,0,0,%s\n", wd, N_SO,
  253.          <ext_label_name[1]);
  254. #endif /* no ASM_OUTPUT_MAIN_SOURCE_DIRECTORY */
  255.       }
  256.   }
  257.  
  258. #ifdef ASM_OUTPUT_MAIN_SOURCE_FILENAME
  259.   /* This should NOT be ASM_OUTPUT_SOURCE_FILENAME. That 
  260.      would give us an N_SOL, and we want an N_SO.  */
  261.   ASM_OUTPUT_MAIN_SOURCE_FILENAME (file, filename);
  262. #else /* no ASM_OUTPUT_MAIN_SOURCE_FILENAME */
  263.   /* Used to put `Ltext:' before the reference, but that loses on sun 4.  */
  264.   fprintf (asmfile, ".stabs \"%s\",%d,0,0,%s\n", input_file_name, N_SO,
  265.        <ext_label_name[1]);
  266.   text_section ();
  267.   ASM_OUTPUT_INTERNAL_LABEL (asmfile, "Ltext", 0);
  268. #endif /* no ASM_OUTPUT_MAIN_SOURCE_FILENAME */
  269.  
  270.   lastfile = input_file_name;
  271.  
  272.   next_type_number = 1;
  273.   next_block_number = 2;
  274.  
  275.   /* Make sure that types `int' and `char' have numbers 1 and 2.
  276.      Definitions of other integer types will refer to those numbers.
  277.      (Actually it should no longer matter what their numbers are.
  278.      Also, if any types with tags have been defined,
  279.      dbxout_symbol will output them first, so the numbers won't be 1 and 2.
  280.      That happens in C++.  So it's a good thing it should no longer matter.  */
  281.  
  282.   dbxout_symbol (TYPE_NAME (integer_type_node), 0);
  283.   dbxout_symbol (TYPE_NAME (char_type_node), 0);
  284.  
  285.   /* Get all permanent types not yet gotten, and output them.  */
  286.  
  287.   dbxout_types (get_permanent_types ());
  288. }
  289.  
  290. /* Output debugging info to FILE to switch to sourcefile FILENAME.  */
  291.  
  292. void
  293. dbxout_source_file (file, filename)
  294.      FILE *file;
  295.      char *filename;
  296. {
  297.   char ltext_label_name[100];
  298.  
  299.   if (filename && (lastfile == 0 || strcmp (filename, lastfile)))
  300.     {
  301. #ifdef ASM_OUTPUT_SOURCE_FILENAME
  302.       ASM_OUTPUT_SOURCE_FILENAME (file, filename);
  303. #else
  304.       ASM_GENERATE_INTERNAL_LABEL (ltext_label_name, "Ltext", 0);
  305.       fprintf (file, "\t.stabs \"%s\",%d,0,0,%s\n",
  306.            filename, N_SOL, <ext_label_name[1]);
  307. #endif
  308.       lastfile = filename;
  309.     }
  310. }
  311.  
  312. /* At the end of compilation, finish writing the symbol table.
  313.    Unless you define ASM_OUTPUT_MAIN_SOURCE_FILE_END, the default is
  314.    to do nothing. */
  315.  
  316. void
  317. dbxout_finish (file, filename)
  318.      FILE *file;
  319.      char *filename;
  320. {
  321. #ifdef ASM_OUTPUT_MAIN_SOURCE_FILE_END
  322.   ASM_OUTPUT_MAIN_SOURCE_FILE_END (file, filename);
  323. #endif /* ASM_OUTPUT_MAIN_SOURCE_FILE_END */
  324. }
  325.  
  326. /* Continue a symbol-description that gets too big.
  327.    End one symbol table entry with a double-backslash
  328.    and start a new one, eventually producing something like
  329.    .stabs "start......\\",code,0,value
  330.    .stabs "...rest",code,0,value   */
  331.  
  332. static void
  333. dbxout_continue ()
  334. {
  335. #ifdef DBX_CONTIN_CHAR
  336.   fprintf (asmfile, "%c", DBX_CONTIN_CHAR);
  337. #else
  338.   fprintf (asmfile, "\\\\");
  339. #endif
  340.   dbxout_finish_symbol (0);
  341.   fprintf (asmfile, ".stabs \"");
  342.   current_sym_nchars = 0;
  343. }
  344.  
  345. /* Output a reference to a type.  If the type has not yet been
  346.    described in the dbx output, output its definition now.
  347.    For a type already defined, just refer to its definition
  348.    using the type number.
  349.  
  350.    If FULL is nonzero, and the type has been described only with
  351.    a forward-reference, output the definition now.
  352.    If FULL is zero in this case, just refer to the forward-reference
  353.    using the number previously allocated.  */
  354.  
  355. static void
  356. dbxout_type (type, full)
  357.      tree type;
  358.      int full;
  359. {
  360.   register tree tem;
  361.  
  362.   /* If there was an input error and we don't really have a type,
  363.      avoid crashing and write something that is at least valid
  364.      by assuming `int'.  */
  365.   if (type == error_mark_node)
  366.     type = integer_type_node;
  367.   else
  368.     type = TYPE_MAIN_VARIANT (type);
  369.  
  370.   if (TYPE_SYMTAB_ADDRESS (type) == 0)
  371.     {
  372.       /* Type has no dbx number assigned.  Assign next available number.  */
  373.       TYPE_SYMTAB_ADDRESS (type) = next_type_number++;
  374.  
  375.       /* Make sure type vector is long enough to record about this type.  */
  376.  
  377.       if (next_type_number == typevec_len)
  378.     {
  379.       typevec = (enum typestatus *) xrealloc (typevec, typevec_len * 2 * sizeof typevec[0]);
  380.       bzero (typevec + typevec_len, typevec_len * sizeof typevec[0]);
  381.       typevec_len *= 2;
  382.     }
  383.     }
  384.  
  385.   /* Output the number of this type, to refer to it.  */
  386.   fprintf (asmfile, "%d", TYPE_SYMTAB_ADDRESS (type));
  387.   CHARS (3);
  388.  
  389.   /* If this type's definition has been output or is now being output,
  390.      that is all.  */
  391.  
  392.   switch (typevec[TYPE_SYMTAB_ADDRESS (type)])
  393.     {
  394.     case TYPE_UNSEEN:
  395.       break;
  396.     case TYPE_XREF:
  397.       if (! full)
  398.     return;
  399.       break;
  400.     case TYPE_DEFINED:
  401.       return;
  402.     }
  403.  
  404. #ifdef DBX_NO_XREFS
  405.   /* For systems where dbx output does not allow the `=xsNAME:' syntax,
  406.      leave the type-number completely undefined rather than output
  407.      a cross-reference.  */
  408.   if (TREE_CODE (type) == RECORD_TYPE || TREE_CODE (type) == UNION_TYPE
  409.       || TREE_CODE (type) == ENUMERAL_TYPE)
  410.  
  411.     if ((TYPE_NAME (type) != 0 && !full)
  412.     || TYPE_SIZE (type) == 0)
  413.       {
  414.     typevec[TYPE_SYMTAB_ADDRESS (type)] = TYPE_XREF;
  415.     return;
  416.       }
  417. #endif
  418.  
  419.   /* Output a definition now.  */
  420.  
  421.   fprintf (asmfile, "=");
  422.   CHARS (1);
  423.  
  424.   /* Mark it as defined, so that if it is self-referent
  425.      we will not get into an infinite recursion of definitions.  */
  426.  
  427.   typevec[TYPE_SYMTAB_ADDRESS (type)] = TYPE_DEFINED;
  428.  
  429.   switch (TREE_CODE (type))
  430.     {
  431.     case VOID_TYPE:
  432.     case LANG_TYPE:
  433.       /* For a void type, just define it as itself; ie, "5=5".
  434.      This makes us consider it defined
  435.      without saying what it is.  The debugger will make it
  436.      a void type when the reference is seen, and nothing will
  437.      ever override that default.  */
  438.       fprintf (asmfile, "%d", TYPE_SYMTAB_ADDRESS (type));
  439.       CHARS (3);
  440.       break;
  441.  
  442.     case INTEGER_TYPE:
  443.       if (type == char_type_node && ! TREE_UNSIGNED (type))
  444.     /* Output the type `char' as a subrange of itself!
  445.        I don't understand this definition, just copied it
  446.        from the output of pcc.
  447.        This used to use `r2' explicitly and we used to
  448.        take care to make sure that `char' was type number 2.  */
  449.     fprintf (asmfile, "r%d;0;127;", TYPE_SYMTAB_ADDRESS (type));
  450. #ifdef WINNING_GDB
  451.       else if (TYPE_PRECISION (type) > BITS_PER_WORD)
  452.     {
  453.       /* This used to say `r1' and we used to take care
  454.          to make sure that `int' was type number 1.  */
  455.       fprintf (asmfile, "r%d;", TYPE_SYMTAB_ADDRESS (integer_type_node));
  456.       print_int_cst_octal (TYPE_MIN_VALUE (type));
  457.       fprintf (asmfile, ";");
  458.       print_int_cst_octal (TYPE_MAX_VALUE (type));
  459.       fprintf (asmfile, ";");
  460.     }
  461. #endif
  462.       else
  463.     /* Output other integer types as subranges of `int'.  */
  464.     /* This used to say `r1' and we used to take care
  465.        to make sure that `int' was type number 1.  */
  466.     fprintf (asmfile, "r%d;%d;%d;",
  467.          TYPE_SYMTAB_ADDRESS (integer_type_node),
  468.          TREE_INT_CST_LOW (TYPE_MIN_VALUE (type)),
  469.          TREE_INT_CST_LOW (TYPE_MAX_VALUE (type)));
  470.       CHARS (25);
  471.       break;
  472.  
  473.     case REAL_TYPE:
  474.       /* This used to say `r1' and we used to take care
  475.      to make sure that `int' was type number 1.  */
  476.       fprintf (asmfile, "r%d;%d;0;", TYPE_SYMTAB_ADDRESS (integer_type_node),
  477.            TREE_INT_CST_LOW (size_in_bytes (type)));
  478.       CHARS (16);
  479.       break;
  480.  
  481.     case ARRAY_TYPE:
  482.       /* Output "a" followed by a range type definition
  483.      for the index type of the array
  484.      followed by a reference to the target-type.
  485.      ar1;0;N;M for an array of type M and size N.  */
  486.       /* This used to say `r1' and we used to take care
  487.      to make sure that `int' was type number 1.  */
  488.       fprintf (asmfile, "ar%d;0;%d;", TYPE_SYMTAB_ADDRESS (integer_type_node),
  489.  
  490.            (TYPE_DOMAIN (type)
  491.         ? TREE_INT_CST_LOW (TYPE_MAX_VALUE (TYPE_DOMAIN (type)))
  492.             : -1));
  493.       CHARS (17);
  494.       dbxout_type (TREE_TYPE (type), 0);
  495.       break;
  496.  
  497.     case RECORD_TYPE:
  498.     case UNION_TYPE:
  499. #if 0
  500.       {
  501.     int i, n_baseclasses = CLASSTYPE_N_BASECLASSES (type);
  502.  
  503.     /* Output a structure type.  */
  504.     if ((TYPE_NAME (type) != 0 && !full)
  505.         || TYPE_SIZE (type) == 0)
  506.       {
  507.         /* If the type is just a cross reference, output one
  508.            and mark the type as partially described.
  509.            If it later becomes defined, we will output
  510.            its real definition.
  511.            If the type has a name, don't nest its definition within
  512.            another type's definition; instead, output an xref
  513.            and let the definition come when the name is defined.  */
  514.         fprintf (asmfile, (TREE_CODE (type) == RECORD_TYPE) ? "xs" : "xu");
  515.         CHARS (3);
  516. #if 0                /* This assertion is legitimately false in C++.  */
  517.         /* We shouldn't be outputting a reference to a type before its
  518.            definition unless the type has a tag name.
  519.            A typedef name without a tag name should be impossible.  */
  520.         if (TREE_CODE (TYPE_NAME (type)) != IDENTIFIER_NODE)
  521.           abort ();
  522. #endif
  523.         dbxout_type_name (type);
  524.         fprintf (asmfile, ":");
  525.         typevec[TYPE_SYMTAB_ADDRESS (type)] = TYPE_XREF;
  526.         break;
  527.       }
  528.     tem = size_in_bytes (type);
  529.     if (TREE_CODE (tem) != INTEGER_CST)
  530.       abort ();
  531.     fprintf (asmfile, (TREE_CODE (type) == RECORD_TYPE) ? "s%d" : "u%d",
  532.          TREE_INT_CST_LOW (tem));
  533.  
  534.     if (use_gdb_dbx_extensions)
  535.       {
  536.         if (n_baseclasses)
  537.           {
  538.         fprintf (asmfile, "!%d,", n_baseclasses);
  539.         CHARS (8);
  540.           }
  541.       }
  542.     for (i = 1; i <= n_baseclasses; i++)
  543.       {
  544.         tree basetype = CLASSTYPE_BASECLASS (type, i);
  545.         if (use_gdb_dbx_extensions)
  546.           {
  547.         putc (CLASSTYPE_VIA_VIRTUAL (type, i) ? '1'
  548.               : '0',
  549.               asmfile);
  550.         putc (CLASSTYPE_VIA_PUBLIC (type, i) ? '2'
  551.               : '0',
  552.               asmfile);
  553.         fprintf (asmfile, "%d,",
  554.              TREE_INT_CST_LOW (CLASSTYPE_OFFSET (basetype)) * BITS_PER_UNIT);
  555.         CHARS (15);
  556.         dbxout_type (basetype, 0);
  557.         putc (';', asmfile);
  558.           }
  559.         else
  560.           {
  561.         /* Print out the base class information with fields
  562.            which have the same names at the types they hold.  */
  563.         dbxout_type_name (basetype);
  564.         putc (':', asmfile);
  565.         dbxout_type (basetype, full);
  566.         fprintf (asmfile, ",%d,%d;",
  567.              TREE_INT_CST_LOW (CLASSTYPE_OFFSET (basetype)) * BITS_PER_UNIT,
  568.              TREE_INT_CST_LOW (DECL_SIZE (basetype)) * BITS_PER_UNIT);
  569.         CHARS (20);
  570.           }
  571.       }
  572.       }
  573. #endif
  574.       /* Output a structure type.  */
  575.       if ((TYPE_NAME (type) != 0 && !full)
  576.       || TYPE_SIZE (type) == 0)
  577.     {
  578.       /* If the type is just a cross reference, output one
  579.          and mark the type as partially described.
  580.          If it later becomes defined, we will output
  581.          its real definition.
  582.          If the type has a name, don't nest its definition within
  583.          another type's definition; instead, output an xref
  584.          and let the definition come when the name is defined.  */
  585.       fprintf (asmfile, (TREE_CODE (type) == RECORD_TYPE) ? "xs" : "xu");
  586.       CHARS (3);
  587. #if 0      /* This assertion is legitimately false in C++.  */
  588.       /* We shouldn't be outputting a reference to a type before its
  589.          definition unless the type has a tag name.
  590.          A typedef name without a tag name should be impossible.  */
  591.       if (TREE_CODE (TYPE_NAME (type)) != IDENTIFIER_NODE)
  592.         abort ();
  593. #endif
  594.       dbxout_type_name (type);
  595.       fprintf (asmfile, ":");
  596.       typevec[TYPE_SYMTAB_ADDRESS (type)] = TYPE_XREF;
  597.       break;
  598.     }
  599.       tem = size_in_bytes (type);
  600.       fprintf (asmfile, (TREE_CODE (type) == RECORD_TYPE) ? "s%d" : "u%d",
  601.            TREE_INT_CST_LOW (tem));
  602.  
  603.       if (TYPE_BASETYPES (type) && use_gdb_dbx_extensions)
  604.     {
  605.       putc ('!', asmfile);
  606.       putc ((TREE_PUBLIC (TYPE_BASETYPES (type)) ? '2' : '0'),
  607.         asmfile);
  608.       dbxout_type (TREE_VALUE (TYPE_BASETYPES (type)), 0);
  609.       putc (',', asmfile);
  610.       CHARS (3);
  611.     }
  612.       CHARS (11);
  613.  
  614.       for (tem = TYPE_FIELDS (type); tem; tem = TREE_CHAIN (tem))
  615.     /* Output the name, type, position (in bits), size (in bits)
  616.        of each field.  */
  617.     /* Omit here local type decls until we know how to support them.  */
  618.     if (TREE_CODE (tem) == TYPE_DECL)
  619.       continue;
  620.     /* Omit here the nameless fields that are used to skip bits.  */
  621.     else if (TREE_CODE (tem) != CONST_DECL && DECL_NAME (tem) != 0)
  622.       {
  623.         /* Continue the line if necessary,
  624.            but not before the first field.  */
  625.         if (tem != TYPE_FIELDS (type))
  626.           CONTIN;
  627.         fprintf (asmfile, "%s:", IDENTIFIER_POINTER (DECL_NAME (tem)));
  628.         CHARS (2 + IDENTIFIER_LENGTH (DECL_NAME (tem)));
  629.         if (use_gdb_dbx_extensions
  630.         && (TREE_PRIVATE (tem) || TREE_PROTECTED (tem)
  631.             || TREE_CODE (tem) != FIELD_DECL))
  632.           {
  633.         putc ('/', asmfile);
  634.         putc ((TREE_PRIVATE (tem) ? '0'
  635.                : TREE_PROTECTED (tem) ? '1' : '2'),
  636.               asmfile);
  637.         CHARS (2);
  638.         if (TREE_CODE (tem) == FUNCTION_DECL)
  639.           {
  640.             putc (':', asmfile);
  641.             CHARS (1);
  642.             dbxout_type (TREE_TYPE (tem), 0); /* FUNCTION_TYPE */
  643.             dbxout_args (TYPE_ARG_TYPES (TREE_TYPE (tem)));
  644.             fprintf (asmfile, ":%s;%c", 
  645.                  XSTR (XEXP (DECL_RTL (tem), 0), 0),
  646.                  DECL_VIRTUAL_P (tem) ? '*' : '.');
  647.             CHARS (3 + strlen (XSTR (XEXP (DECL_RTL (tem), 0), 0)));
  648.           }
  649.         else
  650.           dbxout_type (TREE_TYPE (tem), 0);
  651.           }
  652.         else
  653.           dbxout_type ((TREE_CODE (tem) == FIELD_DECL
  654.                 && DECL_BIT_FIELD_TYPE (tem))
  655.                ? DECL_BIT_FIELD_TYPE (tem)
  656.                : TREE_TYPE (tem), 0);
  657.  
  658.         if (TREE_CODE (tem) == VAR_DECL)
  659.           {
  660.         if (use_gdb_dbx_extensions)
  661.           {
  662.             fprintf (asmfile, ":%s", 
  663.                  XSTR (XEXP (DECL_RTL (tem), 0), 0));
  664.             CHARS (2 + strlen (XSTR (XEXP (DECL_RTL (tem), 0), 0)));
  665.           }
  666.         else
  667.           {
  668.             fprintf (asmfile, ",0,0;");
  669.             CHARS (5);
  670.           }
  671.           }
  672.         else if (TREE_CODE (DECL_FIELD_BITPOS (tem)) == INTEGER_CST)
  673.           {
  674.         fprintf (asmfile, ",%d,%d;",
  675.              TREE_INT_CST_LOW (DECL_FIELD_BITPOS (tem)),
  676.              TREE_INT_CST_LOW (DECL_SIZE (tem)));
  677.         CHARS (23);
  678.           }
  679.         else
  680.           /* This has yet to be implemented.  */
  681.           abort ();
  682.       }
  683.  
  684.       putc (';', asmfile);
  685.       CHARS (1);
  686. #if 0
  687.  
  688.       CHARS (11);
  689.  
  690.       /* Write out the field declarations.  */
  691.       dbxout_type_fields (type);
  692.       if (use_gdb_dbx_extensions)
  693.     dbxout_type_methods (type);
  694.       putc (';', asmfile);
  695.  
  696.       if (use_gdb_dbx_extensions && TREE_CODE (type) == RECORD_TYPE)
  697.     {
  698.       /* Tell GDB+ that it may keep reading.  */
  699.       putc ('~', asmfile);
  700.       if (TYPE_HAS_DESTRUCTOR (type) && TYPE_HAS_CONSTRUCTOR (type))
  701.         putc ('=', asmfile);
  702.       else if (TYPE_HAS_DESTRUCTOR (type))
  703.         putc ('-', asmfile);
  704.       else if (TYPE_HAS_CONSTRUCTOR (type))
  705.         putc ('+', asmfile);
  706.  
  707.       if (CLASSTYPE_VSIZE (type))
  708.         {
  709.           putc ('%', asmfile);
  710.           dbxout_type (DECL_FCONTEXT (CLASSTYPE_VFIELD (type)), 0);
  711.           fprintf (asmfile, ";");
  712.         }
  713.       else
  714.         {
  715.           putc (';', asmfile);
  716.           CHARS (3);
  717.         }
  718.     }
  719. #endif
  720.       break;
  721.  
  722.     case ENUMERAL_TYPE:
  723.       if ((TYPE_NAME (type) != 0 && !full)
  724. #if 0
  725.        && ((TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
  726.         && ! ANON_AGGRNAME_P (DECL_NAME (TYPE_NAME (type))))
  727.            || (TREE_CODE (TYPE_NAME (type)) == IDENTIFIER_NODE
  728.            && ! ANON_AGGRNAME_P (TYPE_NAME (type)))))
  729. #endif
  730.       || TYPE_SIZE (type) == 0)
  731.     {
  732.       fprintf (asmfile, "xe");
  733.       CHARS (3);
  734.       dbxout_type_name (type);
  735.       typevec[TYPE_SYMTAB_ADDRESS (type)] = TYPE_XREF;
  736.       fprintf (asmfile, ":");
  737.       return;
  738.     }
  739.       putc ('e', asmfile);
  740.       CHARS (1);
  741.       for (tem = TYPE_VALUES (type); tem; tem = TREE_CHAIN (tem))
  742.     {
  743.       fprintf (asmfile, "%s:%d,", IDENTIFIER_POINTER (TREE_PURPOSE (tem)),
  744.            TREE_INT_CST_LOW (TREE_VALUE (tem)));
  745.       CHARS (11 + IDENTIFIER_LENGTH (TREE_PURPOSE (tem)));
  746.       if (TREE_CHAIN (tem) != 0)
  747.         CONTIN;
  748.     }
  749.       putc (';', asmfile);
  750.       CHARS (1);
  751.       break;
  752.  
  753.     case POINTER_TYPE:
  754.       putc ('*', asmfile);
  755.       CHARS (1);
  756.       dbxout_type (TREE_TYPE (type), 0);
  757.       break;
  758.  
  759.     case METHOD_TYPE:
  760.       if (use_gdb_dbx_extensions)
  761.     {
  762.       putc ('#', asmfile);
  763.       CHARS (1);
  764. #if 0
  765.       if (flag_minimal_debug)
  766.         {
  767.           putc ('#', asmfile);
  768.           dbxout_type (TREE_TYPE (type), 0);
  769.           putc (';', asmfile);
  770.           CHARS (1);
  771.         }
  772. #endif
  773.       dbxout_type (TYPE_METHOD_BASETYPE (type), 0);
  774.       putc (',', asmfile);
  775.       CHARS (1);
  776.       dbxout_type (TREE_TYPE (type), 0);
  777.       dbxout_args (TYPE_ARG_TYPES (type));
  778.       putc (';', asmfile);
  779.       CHARS (1);
  780.     }
  781.       else
  782.     {
  783.       /* Treat it as a function type.  */
  784.       dbxout_type (TREE_TYPE (type), 0);
  785.     }
  786.       break;
  787.  
  788.     case OFFSET_TYPE:
  789.       if (use_gdb_dbx_extensions)
  790.     {
  791.       putc ('@', asmfile);
  792.       CHARS (1);
  793.       dbxout_type (TYPE_OFFSET_BASETYPE (type), 0);
  794.       putc (',', asmfile);
  795.       CHARS (1);
  796.       dbxout_type (TREE_TYPE (type), 0);
  797.     }
  798.       else
  799.     {
  800.       /* Should print as an int, because it is really
  801.          just an offset.  */
  802.       dbxout_type (integer_type_node, 0);
  803.     }
  804.       break;
  805.  
  806.     case REFERENCE_TYPE:
  807.       putc (use_gdb_dbx_extensions ? '&' : '*', asmfile);
  808.       CHARS (1);
  809.       dbxout_type (TREE_TYPE (type), 0);
  810.       break;
  811.  
  812.     case FUNCTION_TYPE:
  813.       putc ('f', asmfile);
  814.       CHARS (1);
  815.       dbxout_type (TREE_TYPE (type), 0);
  816.       break;
  817.  
  818.     default:
  819.       abort ();
  820.     }
  821. }
  822.  
  823. /* Print the value of integer constant C, in octal,
  824.    handling double precision.  */
  825.  
  826. static void
  827. print_int_cst_octal (c)
  828.      tree c;
  829. {
  830.   unsigned int high = TREE_INT_CST_HIGH (c);
  831.   unsigned int low = TREE_INT_CST_LOW (c);
  832.   int excess = (3 - (HOST_BITS_PER_INT % 3));
  833.  
  834.   fprintf (asmfile, "0");
  835.  
  836.   if (excess == 3)
  837.     {
  838.       print_octal (high, HOST_BITS_PER_INT / 3);
  839.       print_octal (low, HOST_BITS_PER_INT / 3);
  840.     }
  841.   else
  842.     {
  843.       unsigned int beg = high >> excess;
  844.       unsigned int middle
  845.     = ((high & ((1 << excess) - 1)) << (3 - excess)
  846.        | (low >> (HOST_BITS_PER_INT / 3 * 3)));
  847.       unsigned int end = low & ((1 << (HOST_BITS_PER_INT / 3 * 3)) - 1);
  848.       fprintf (asmfile, "%o%01o", beg, middle);
  849.       print_octal (end, HOST_BITS_PER_INT / 3);
  850.     }
  851. }
  852.  
  853. static void
  854. print_octal (value, digits)
  855.      unsigned int value;
  856.      int digits;
  857. {
  858.   int i;
  859.  
  860.   for (i = digits - 1; i >= 0; i--)
  861.     fprintf (asmfile, "%01o", ((value >> (3 * i)) & 7));
  862. }
  863.  
  864. /* Output the name of type TYPE, with no punctuation.
  865.    Such names can be set up either by typedef declarations
  866.    or by struct, enum and union tags.  */
  867.  
  868. static void
  869. dbxout_type_name (type)
  870.      register tree type;
  871. {
  872.   tree t;
  873.   if (TYPE_NAME (type) == 0)
  874.     abort ();
  875.   if (TREE_CODE (TYPE_NAME (type)) == IDENTIFIER_NODE)
  876.     {
  877.       t = TYPE_NAME (type);
  878.     }
  879.   else if (TREE_CODE (TYPE_NAME (type)) == TYPE_DECL)
  880.     {
  881.       t = DECL_NAME (TYPE_NAME (type));
  882.     }
  883.   else
  884.     abort ();
  885.  
  886.   fprintf (asmfile, "%s", IDENTIFIER_POINTER (t));
  887.   CHARS (IDENTIFIER_LENGTH (t));
  888. }
  889.  
  890. /* Output a .stabs for the symbol defined by DECL,
  891.    which must be a ..._DECL node in the normal namespace.
  892.    It may be a CONST_DECL, a FUNCTION_DECL, a PARM_DECL or a VAR_DECL.
  893.    LOCAL is nonzero if the scope is less than the entire file.  */
  894.  
  895. void
  896. dbxout_symbol (decl, local)
  897.      tree decl;
  898.      int local;
  899. {
  900.   int letter = 0;
  901.   tree type = TREE_TYPE (decl);
  902.   tree context = NULL_TREE;
  903.   int regno = -1;
  904.  
  905. #ifdef NeXT
  906.   /* Don't ouput stabs for Objective-C internal symbols. */
  907.   if (!strncmp (IDENTIFIER_POINTER (DECL_NAME (decl)), "_OBJC_", 6))
  908.     return;
  909. #endif  /* NeXT */
  910.  
  911.   /* If global, first output all types and all
  912.      struct, enum and union tags that have been created
  913.      and not yet output.  */
  914.  
  915.   if (local == 0)
  916.     {
  917.       dbxout_tags (gettags ());
  918.       dbxout_types (get_permanent_types ());
  919.     }
  920.  
  921.   /* Cast avoids warning in old compilers.  */
  922.   current_sym_code = (STAB_CODE_TYPE) 0;
  923.   current_sym_value = 0;
  924.   current_sym_addr = 0;
  925.  
  926.   /* The output will always start with the symbol name,
  927.      so count that always in the length-output-so-far.  */
  928.  
  929.   if (DECL_NAME (decl) == 0)
  930.     return;
  931.  
  932.   dbxout_prepare_symbol (decl);
  933.  
  934.   current_sym_nchars = 2 + IDENTIFIER_LENGTH (DECL_NAME (decl));
  935.  
  936.   switch (TREE_CODE (decl))
  937.     {
  938.     case CONST_DECL:
  939.       /* Enum values are defined by defining the enum type.  */
  940.       break;
  941.  
  942.     case FUNCTION_DECL:
  943.       if (DECL_RTL (decl) == 0)
  944.     return;
  945.       if (TREE_EXTERNAL (decl))
  946.     break;
  947.       /* Don't mention a nested function under its parent.  */
  948.       context = decl_function_context (decl);
  949.       if (context == current_function_decl)
  950.     break;
  951.       if (GET_CODE (DECL_RTL (decl)) != MEM
  952.       || GET_CODE (XEXP (DECL_RTL (decl), 0)) != SYMBOL_REF)
  953.     break;
  954.       FORCE_TEXT;
  955.       fprintf (asmfile, ".stabs \"%s:%c",
  956.            IDENTIFIER_POINTER (DECL_NAME (decl)),
  957.            TREE_PUBLIC (decl) ? 'F' : 'f');
  958.  
  959.       current_sym_code = N_FUN;
  960.       current_sym_addr = XEXP (DECL_RTL (decl), 0);
  961.  
  962.       if (TREE_TYPE (TREE_TYPE (decl)))
  963.     dbxout_type (TREE_TYPE (TREE_TYPE (decl)), 0);
  964.       else
  965.     dbxout_type (void_type_node, 0);
  966.  
  967.       /* For a nested function, when that function is compiled,
  968.      mention the containing function name
  969.      as well as (since dbx wants it) our own assembler-name.  */
  970.       if (context != 0)
  971.     fprintf (asmfile, ",%s,%s",
  972.          DECL_ASSEMBLER_NAME (decl),
  973.          IDENTIFIER_POINTER (DECL_NAME (context)));
  974.  
  975.       dbxout_finish_symbol (decl);
  976.       break;
  977.  
  978.     case TYPE_DECL:
  979. #if 0
  980.       /* This seems all wrong.  Outputting most kinds of types gives no name
  981.      at all.  A true definition gives no name; a cross-ref for a
  982.      structure can give the tag name, but not a type name.
  983.      It seems that no typedef name is defined by outputting a type.  */
  984.  
  985.       /* If this typedef name was defined by outputting the type,
  986.      don't duplicate it.  */
  987.       if (typevec[TYPE_SYMTAB_ADDRESS (type)] == TYPE_DEFINED
  988.       && TYPE_NAME (TREE_TYPE (decl)) == decl)
  989.     return;
  990. #endif
  991.       /* Don't output the same typedef twice.  */
  992.       if (TREE_ASM_WRITTEN (decl))
  993.     return;
  994. #if 0
  995.       /* Don't output the same typedef twice.
  996.          And don't output what language-specific stuff doesn't want output.  */
  997.       if (TREE_ASM_WRITTEN (decl)
  998.       || lang_output_debug_info (TREE_TYPE (decl)) == 0)
  999.     return;
  1000. #endif
  1001.  
  1002.       /* Output typedef name.  */
  1003.       FORCE_TEXT;
  1004.       fprintf (asmfile, ".stabs \"%s:t",
  1005.            IDENTIFIER_POINTER (DECL_NAME (decl)));
  1006.  
  1007.       current_sym_code = N_LSYM;
  1008.  
  1009.       dbxout_type (TREE_TYPE (decl), 1);
  1010.       dbxout_finish_symbol (decl);
  1011.  
  1012.       /* Prevent duplicate output of a typedef.  */
  1013.       TREE_ASM_WRITTEN (decl) = 1;
  1014.       break;
  1015.       
  1016.     case PARM_DECL:
  1017.       /* Parm decls go in their own separate chains
  1018.      and are output by dbxout_reg_parms and dbxout_parms.  */
  1019.       abort ();
  1020.  
  1021.     case RESULT_DECL:
  1022.       /* Named return value, treat like a VAR_DECL.  */
  1023.     case VAR_DECL:
  1024.       if (DECL_RTL (decl) == 0)
  1025.     return;
  1026.       /* Don't mention a variable that is external.
  1027.      Let the file that defines it describe it.  */
  1028.       if (TREE_EXTERNAL (decl))
  1029.     break;
  1030.  
  1031.       /* If the variable is really a constant
  1032.      and not written in memory, inform the debugger.  */
  1033.       if (TREE_STATIC (decl) && TREE_READONLY (decl)
  1034.       && DECL_INITIAL (decl) != 0
  1035.       && ! TREE_ASM_WRITTEN (decl)
  1036.       && (DECL_FIELD_CONTEXT (decl) == NULL_TREE
  1037.           || TREE_CODE (DECL_FIELD_CONTEXT (decl)) == BLOCK))
  1038.     {
  1039.       if (TREE_PUBLIC (decl) == 0)
  1040.         {
  1041.           /* The sun4 assembler does not grok this.  */
  1042.           char *name = IDENTIFIER_POINTER (DECL_NAME (decl));
  1043.           if (TREE_CODE (TREE_TYPE (decl)) == INTEGER_TYPE
  1044.           || TREE_CODE (TREE_TYPE (decl)) == ENUMERAL_TYPE)
  1045.         {
  1046.           int ival = TREE_INT_CST_LOW (DECL_INITIAL (decl));
  1047.           fprintf (asmfile, ".stabs \"%s:c=i%d\",0x%x,0,0,0\n",
  1048.                name, ival, N_LSYM);
  1049.           return;
  1050.         }
  1051.           else if (TREE_CODE (TREE_TYPE (decl)) == REAL_TYPE)
  1052.         {
  1053.           /* don't know how to do this yet.  */
  1054.         }
  1055.           break;
  1056.         }
  1057.       /* else it is something we handle like a normal variable.  */
  1058.     }
  1059.  
  1060.       /* Don't mention a variable at all
  1061.      if it was completely optimized into nothingness.
  1062.  
  1063.      If DECL was from an inline function, then it's rtl
  1064.      is not identically the rtl that was used in this
  1065.      particular compilation.  */
  1066.       if (GET_CODE (DECL_RTL (decl)) == REG)
  1067.     {
  1068.       regno = REGNO (DECL_RTL (decl));
  1069.       if (regno >= FIRST_PSEUDO_REGISTER)
  1070.         regno = reg_renumber[REGNO (DECL_RTL (decl))];
  1071.       if (regno < 0)
  1072.         break;
  1073.     }
  1074.       else if (GET_CODE (DECL_RTL (decl)) == SUBREG)
  1075.     {
  1076.       rtx value = DECL_RTL (decl);
  1077.       int offset = 0;
  1078.       while (GET_CODE (value) == SUBREG)
  1079.         {
  1080.           offset += SUBREG_WORD (value);
  1081.           value = SUBREG_REG (value);
  1082.         }
  1083.       if (GET_CODE (value) == REG)
  1084.         {
  1085.           regno = REGNO (value);
  1086.           if (regno >= FIRST_PSEUDO_REGISTER)
  1087.         regno = reg_renumber[REGNO (value)];
  1088.           if (regno >= 0)
  1089.         regno += offset;
  1090.         }
  1091.     }
  1092.  
  1093.       /* The kind-of-variable letter depends on where
  1094.      the variable is and on the scope of its name:
  1095.      G and N_GSYM for static storage and global scope,
  1096.      S for static storage and file scope,
  1097.      V for static storage and local scope,
  1098.         for those two, use N_LCSYM if data is in bss segment,
  1099.         N_STSYM if in data segment, N_FUN otherwise.
  1100.         (We used N_FUN originally, then changed to N_STSYM
  1101.         to please GDB.  However, it seems that confused ld.
  1102.         Now GDB has been fixed to like N_FUN, says Kingdon.)
  1103.      no letter at all, and N_LSYM, for auto variable,
  1104.      r and N_RSYM for register variable.  */
  1105.  
  1106.       if (GET_CODE (DECL_RTL (decl)) == MEM
  1107.       && GET_CODE (XEXP (DECL_RTL (decl), 0)) == SYMBOL_REF)
  1108.     {
  1109.       if (TREE_PUBLIC (decl))
  1110.         {
  1111.           letter = 'G';
  1112.           current_sym_code = N_GSYM;
  1113.         }
  1114.       else
  1115.         {
  1116.           current_sym_addr = XEXP (DECL_RTL (decl), 0);
  1117.  
  1118.           letter = TREE_PERMANENT (decl) ? 'S' : 'V';
  1119.  
  1120.           if (!DECL_INITIAL (decl))
  1121.         current_sym_code = N_LCSYM;
  1122.           else if (TREE_READONLY (decl) && ! TREE_THIS_VOLATILE (decl))
  1123.         /* This is not quite right, but it's the closest
  1124.            of all the codes that Unix defines.  */
  1125.         current_sym_code = N_FUN;
  1126.           else
  1127.         {
  1128. /* Ultrix `as' seems to need this.  */
  1129. #ifdef DBX_STATIC_STAB_DATA_SECTION
  1130.           data_section ();
  1131. #endif
  1132.           current_sym_code = N_STSYM;
  1133.         }
  1134.         }
  1135.     }
  1136.       else if (regno >= 0)
  1137.     {
  1138.       letter = 'r';
  1139.       current_sym_code = N_RSYM;
  1140.       current_sym_value = DBX_REGISTER_NUMBER (regno);
  1141.     }
  1142.       else if (GET_CODE (DECL_RTL (decl)) == SUBREG)
  1143.     {
  1144.       rtx value = DECL_RTL (decl);
  1145.       int offset = 0;
  1146.       while (GET_CODE (value) == SUBREG)
  1147.         {
  1148.           offset += SUBREG_WORD (value);
  1149.           value = SUBREG_REG (value);
  1150.         }
  1151.       letter = 'r';
  1152.       current_sym_code = N_RSYM;
  1153.       current_sym_value = DBX_REGISTER_NUMBER (REGNO (value) + offset);
  1154.     }
  1155.       else if (GET_CODE (DECL_RTL (decl)) == MEM
  1156.            && (GET_CODE (XEXP (DECL_RTL (decl), 0)) == MEM
  1157.            || (GET_CODE (XEXP (DECL_RTL (decl), 0)) == REG
  1158.                && REGNO (XEXP (DECL_RTL (decl), 0)) != FRAME_POINTER_REGNUM)))
  1159.     /* If the value is indirect by memory or by a register
  1160.        that isn't the frame pointer
  1161.        then it means the object is variable-sized and address through
  1162.        that register or stack slot.  DBX has no way to represent this
  1163.        so all we can do is output the variable as a pointer.
  1164.        If it's not a parameter, ignore it.
  1165.        (VAR_DECLs like this can be made by integrate.c.)  */
  1166.     {
  1167.       if (GET_CODE (XEXP (DECL_RTL (decl), 0)) == REG)
  1168.         {
  1169.           letter = 'r';
  1170.           current_sym_code = N_RSYM;
  1171.           current_sym_value = DBX_REGISTER_NUMBER (REGNO (XEXP (DECL_RTL (decl), 0)));
  1172.         }
  1173.       else
  1174.         {
  1175.           current_sym_code = N_LSYM;
  1176.           /* DECL_RTL looks like (MEM (MEM (PLUS (REG...) (CONST_INT...)))).
  1177.          We want the value of that CONST_INT.  */
  1178.           current_sym_value
  1179.         = DEBUGGER_AUTO_OFFSET (XEXP (XEXP (DECL_RTL (decl), 0), 0));
  1180.         }
  1181.  
  1182.       /* Effectively do build_pointer_type, but don't cache this type,
  1183.          since it might be temporary whereas the type it points to
  1184.          might have been saved for inlining.  */
  1185.       type = make_node (POINTER_TYPE);
  1186.       TREE_TYPE (type) = TREE_TYPE (decl);
  1187.     }
  1188.       else if (GET_CODE (DECL_RTL (decl)) == MEM
  1189.            && GET_CODE (XEXP (DECL_RTL (decl), 0)) == REG)
  1190.     {
  1191.       current_sym_code = N_LSYM;
  1192.       current_sym_value = DEBUGGER_AUTO_OFFSET (XEXP (DECL_RTL (decl), 0));
  1193.     }
  1194.       else if (GET_CODE (DECL_RTL (decl)) == MEM
  1195.            && GET_CODE (XEXP (DECL_RTL (decl), 0)) == PLUS
  1196.            && GET_CODE (XEXP (XEXP (DECL_RTL (decl), 0), 1)) == CONST_INT)
  1197.     {
  1198.       current_sym_code = N_LSYM;
  1199.       /* DECL_RTL looks like (MEM (PLUS (REG...) (CONST_INT...)))
  1200.          We want the value of that CONST_INT.  */
  1201.       current_sym_value = DEBUGGER_AUTO_OFFSET (XEXP (DECL_RTL (decl), 0));
  1202.     }
  1203.       else
  1204.     /* Address might be a MEM, when DECL is a variable-sized object.
  1205.        Or it might be const0_rtx, meaning previous passes
  1206.        want us to ignore this variable.  */
  1207.     break;
  1208.  
  1209.       /* Ok, start a symtab entry and output the variable name.  */
  1210.       FORCE_TEXT;
  1211.       /* One slight hitch: if this is a VAR_DECL which is a static
  1212.      class member, we must put out the mangled name instead of the
  1213.      DECL_NAME.  */
  1214.       {
  1215.     char *name;
  1216.     /* Note also that static member (variable) names DO NOT begin
  1217.        with underscores in .stabs directives.  */
  1218.     if (DECL_LANG_SPECIFIC (decl))
  1219.       {
  1220.         name = DECL_ASSEMBLER_NAME (decl);
  1221.  
  1222.         /* Adding 1 here only works on systems
  1223.            which flush an initial underscore.  */
  1224.         if (name[0] == '_')
  1225.           name += 1;
  1226.       }
  1227.     else
  1228.       name = IDENTIFIER_POINTER (DECL_NAME (decl));
  1229.     fprintf (asmfile, ".stabs \"%s:", name);
  1230.       }
  1231.       if (letter) putc (letter, asmfile);
  1232.       dbxout_type (type, 0);
  1233.       dbxout_finish_symbol (decl);
  1234.       break;
  1235.     }
  1236. }
  1237.  
  1238. static void
  1239. dbxout_prepare_symbol (decl)
  1240.      tree decl;
  1241. {
  1242. #ifdef WINNING_GDB
  1243.   char *filename = DECL_SOURCE_FILE (decl);
  1244.  
  1245.   dbxout_source_file (asmfile, filename);
  1246. #endif
  1247. }
  1248.  
  1249. static void
  1250. dbxout_finish_symbol (sym)
  1251.      tree sym;
  1252. {
  1253.   int line = 0;
  1254. #ifdef WINNING_GDB
  1255.   if (sym != 0)
  1256.     line = DECL_SOURCE_LINE (sym);
  1257. #endif
  1258.   fprintf (asmfile, "\",%d,0,%d,", current_sym_code, line);
  1259.   if (current_sym_addr)
  1260.     output_addr_const (asmfile, current_sym_addr);
  1261.   else
  1262.     fprintf (asmfile, "%d", current_sym_value);
  1263.   putc ('\n', asmfile);
  1264. }
  1265.  
  1266. /* Output definitions of all the decls in a chain.  */
  1267.  
  1268. static void
  1269. dbxout_syms (syms)
  1270.      tree syms;
  1271. {
  1272.   while (syms)
  1273.     {
  1274.       dbxout_symbol (syms, 1);
  1275.       syms = TREE_CHAIN (syms);
  1276.     }
  1277. }
  1278.  
  1279. /* The following two functions output definitions of function parameters.
  1280.    Each parameter gets a definition locating it in the parameter list.
  1281.    Each parameter that is a register variable gets a second definition
  1282.    locating it in the register.
  1283.  
  1284.    Printing or argument lists in gdb uses the definitions that
  1285.    locate in the parameter list.  But reference to the variable in
  1286.    expressions uses preferentially the definition as a register.  */
  1287.  
  1288. /* Output definitions, referring to storage in the parmlist,
  1289.    of all the parms in PARMS, which is a chain of PARM_DECL nodes.  */
  1290.  
  1291. static void
  1292. dbxout_parms (parms)
  1293.      tree parms;
  1294. {
  1295.   for (; parms; parms = TREE_CHAIN (parms))
  1296.     if (DECL_NAME (parms))
  1297.       {
  1298.     dbxout_prepare_symbol (parms);
  1299.  
  1300.     if (PARM_PASSED_IN_MEMORY (parms))
  1301.       {
  1302.         rtx addr = XEXP (DECL_INCOMING_RTL (parms), 0);
  1303.  
  1304.         /* ??? Here we assume that the parm address is indexed
  1305.            off the frame pointer or arg pointer.
  1306.            If that is not true, we produce meaningless results,
  1307.            but do not crash.  */
  1308.         if (GET_CODE (addr) == PLUS
  1309.         && GET_CODE (XEXP (addr, 1)) == CONST_INT)
  1310.           current_sym_value = INTVAL (XEXP (addr, 1));
  1311.         else
  1312.           current_sym_value = 0;
  1313.  
  1314.         current_sym_code = N_PSYM;
  1315.         current_sym_addr = 0;
  1316.  
  1317.         FORCE_TEXT;
  1318.         if (DECL_NAME (parms))
  1319.           {
  1320.         current_sym_nchars = 2 + IDENTIFIER_LENGTH (DECL_NAME (parms));
  1321.  
  1322.         fprintf (asmfile, ".stabs \"%s:p",
  1323.              IDENTIFIER_POINTER (DECL_NAME (parms)));
  1324.           }
  1325.         else
  1326.           {
  1327.         current_sym_nchars = 8;
  1328.         fprintf (asmfile, ".stabs \"(anon):p");
  1329.           }
  1330.  
  1331.         if (GET_CODE (DECL_RTL (parms)) == REG
  1332.         && REGNO (DECL_RTL (parms)) >= 0
  1333.         && REGNO (DECL_RTL (parms)) < FIRST_PSEUDO_REGISTER)
  1334.           dbxout_type (DECL_ARG_TYPE (parms), 0);
  1335.         else
  1336.           {
  1337.         int original_value = current_sym_value;
  1338.  
  1339.         /* This is the case where the parm is passed as an int or double
  1340.            and it is converted to a char, short or float and stored back
  1341.            in the parmlist.  In this case, describe the parm
  1342.            with the variable's declared type, and adjust the address
  1343.            if the least significant bytes (which we are using) are not
  1344.            the first ones.  */
  1345. #if BYTES_BIG_ENDIAN
  1346.         if (TREE_TYPE (parms) != DECL_ARG_TYPE (parms))
  1347.           current_sym_value += (GET_MODE_SIZE (TYPE_MODE (DECL_ARG_TYPE (parms)))
  1348.                     - GET_MODE_SIZE (GET_MODE (DECL_RTL (parms))));
  1349. #endif
  1350.  
  1351.         if (GET_CODE (DECL_RTL (parms)) == MEM
  1352.             && GET_CODE (XEXP (DECL_RTL (parms), 0)) == PLUS
  1353.             && GET_CODE (XEXP (XEXP (DECL_RTL (parms), 0), 1)) == CONST_INT
  1354.             && INTVAL (XEXP (XEXP (DECL_RTL (parms), 0), 1)) == current_sym_value)
  1355.           dbxout_type (TREE_TYPE (parms), 0);
  1356.         else
  1357.           {
  1358.             current_sym_value = original_value;
  1359.             dbxout_type (DECL_ARG_TYPE (parms), 0);
  1360.           }
  1361.           }
  1362.         current_sym_value = DEBUGGER_ARG_OFFSET (current_sym_value, addr);
  1363.         dbxout_finish_symbol (parms);
  1364.       }
  1365.     else if (GET_CODE (DECL_RTL (parms)) == REG
  1366.          && REGNO (DECL_RTL (parms)) >= 0
  1367.          && REGNO (DECL_RTL (parms)) < FIRST_PSEUDO_REGISTER)
  1368.       {
  1369.         /* Parm was passed in registers and lives in registers. 
  1370.            Output a "regparm" symbol for the register it lives in.  */
  1371.  
  1372.         current_sym_code = N_RSYM;
  1373.         current_sym_value = DBX_REGISTER_NUMBER (REGNO (DECL_RTL (parms)));
  1374.         current_sym_addr = 0;
  1375.  
  1376.         FORCE_TEXT;
  1377.         if (DECL_NAME (parms))
  1378.           {
  1379.         current_sym_nchars = 2 + IDENTIFIER_LENGTH (DECL_NAME (parms));
  1380.         fprintf (asmfile, ".stabs \"%s:P",
  1381.              IDENTIFIER_POINTER (DECL_NAME (parms)));
  1382.           }
  1383.         else
  1384.           {
  1385.         current_sym_nchars = 8;
  1386.         fprintf (asmfile, ".stabs \"(anon):P");
  1387.           }
  1388.  
  1389.         dbxout_type (DECL_ARG_TYPE (parms), 0);
  1390.         dbxout_finish_symbol (parms);
  1391.       }
  1392.     else if (GET_CODE (DECL_RTL (parms)) == MEM
  1393.          && XEXP (DECL_RTL (parms), 0) != const0_rtx)
  1394.       {
  1395.         /* Parm was passed in registers but lives on the stack.  */
  1396.  
  1397.         current_sym_code = N_PSYM;
  1398.         /* DECL_RTL looks like (MEM (PLUS (REG...) (CONST_INT...))),
  1399.            in which case we want the value of that CONST_INT, or
  1400.            (MEM (REG ...)), in which case we use a value of zero.  */
  1401.         if (GET_CODE (XEXP (DECL_RTL (parms), 0)) == REG)
  1402.           current_sym_value = 0;
  1403.         else
  1404.           current_sym_value = INTVAL (XEXP (XEXP (DECL_RTL (parms), 0), 1));
  1405.         current_sym_addr = 0;
  1406.  
  1407.         FORCE_TEXT;
  1408.         if (DECL_NAME (parms))
  1409.           {
  1410.         current_sym_nchars = 2 + strlen (IDENTIFIER_POINTER (DECL_NAME (parms)));
  1411.  
  1412.         fprintf (asmfile, ".stabs \"%s:p",
  1413.              IDENTIFIER_POINTER (DECL_NAME (parms)));
  1414.           }
  1415.         else
  1416.           {
  1417.         current_sym_nchars = 8;
  1418.         fprintf (asmfile, ".stabs \"(anon):p");
  1419.           }
  1420.  
  1421.         current_sym_value
  1422.           = DEBUGGER_ARG_OFFSET (current_sym_value,
  1423.                      XEXP (DECL_RTL (parms), 0));
  1424.         dbxout_type (TREE_TYPE (parms), 0);
  1425.         dbxout_finish_symbol (parms);
  1426.       }
  1427.       }
  1428. }
  1429.  
  1430. /* Output definitions for the places where parms live during the function,
  1431.    when different from where they were passed, when the parms were passed
  1432.    in memory.
  1433.  
  1434.    It is not useful to do this for parms passed in registers
  1435.    that live during the function in different registers, because it is
  1436.    impossible to look in the passed register for the passed value,
  1437.    so we use the within-the-function register to begin with.
  1438.  
  1439.    PARMS is a chain of PARM_DECL nodes.  */
  1440.  
  1441. static void
  1442. dbxout_reg_parms (parms)
  1443.      tree parms;
  1444. {
  1445.   for (; parms; parms = TREE_CHAIN (parms))
  1446.     if (DECL_NAME (parms))
  1447.       {
  1448.     dbxout_prepare_symbol (parms);
  1449.  
  1450.     /* Report parms that live in registers during the function
  1451.        but were passed in memory.  */
  1452.     if (GET_CODE (DECL_RTL (parms)) == REG
  1453.         && REGNO (DECL_RTL (parms)) >= 0
  1454.         && REGNO (DECL_RTL (parms)) < FIRST_PSEUDO_REGISTER
  1455.         && PARM_PASSED_IN_MEMORY (parms))
  1456.       {
  1457.         current_sym_code = N_RSYM;
  1458.         current_sym_value = DBX_REGISTER_NUMBER (REGNO (DECL_RTL (parms)));
  1459.         current_sym_addr = 0;
  1460.  
  1461.         FORCE_TEXT;
  1462.         if (DECL_NAME (parms))
  1463.           {
  1464.         current_sym_nchars = 2 + IDENTIFIER_LENGTH (DECL_NAME (parms));
  1465.         fprintf (asmfile, ".stabs \"%s:r",
  1466.              IDENTIFIER_POINTER (DECL_NAME (parms)));
  1467.           }
  1468.         else
  1469.           {
  1470.         current_sym_nchars = 8;
  1471.         fprintf (asmfile, ".stabs \"(anon):r");
  1472.           }
  1473.         dbxout_type (TREE_TYPE (parms), 0);
  1474.         dbxout_finish_symbol (parms);
  1475.       }
  1476.     /* Report parms that live in memory but not where they were passed.  */
  1477.     else if (GET_CODE (DECL_RTL (parms)) == MEM
  1478.          && GET_CODE (XEXP (DECL_RTL (parms), 0)) == PLUS
  1479.          && GET_CODE (XEXP (XEXP (DECL_RTL (parms), 0), 1)) == CONST_INT
  1480.          && PARM_PASSED_IN_MEMORY (parms)
  1481.          && ! rtx_equal_p (DECL_RTL (parms), DECL_INCOMING_RTL (parms)))
  1482.       {
  1483. #if 0 /* ??? It is not clear yet what should replace this.  */
  1484.         int offset = DECL_OFFSET (parms) / BITS_PER_UNIT;
  1485.         /* A parm declared char is really passed as an int,
  1486.            so it occupies the least significant bytes.
  1487.            On a big-endian machine those are not the low-numbered ones.  */
  1488. #if BYTES_BIG_ENDIAN
  1489.         if (offset != -1 && TREE_TYPE (parms) != DECL_ARG_TYPE (parms))
  1490.           offset += (GET_MODE_SIZE (TYPE_MODE (DECL_ARG_TYPE (parms)))
  1491.              - GET_MODE_SIZE (GET_MODE (DECL_RTL (parms))));
  1492. #endif
  1493.         if (INTVAL (XEXP (XEXP (DECL_RTL (parms), 0), 1)) != offset) {...}
  1494. #endif
  1495.         current_sym_code = N_LSYM;
  1496.         current_sym_value = DEBUGGER_AUTO_OFFSET (XEXP (DECL_RTL (parms), 0));
  1497.         current_sym_addr = 0;
  1498.         FORCE_TEXT;
  1499.         if (DECL_NAME (parms))
  1500.           {
  1501.         current_sym_nchars = 2 + IDENTIFIER_LENGTH (DECL_NAME (parms));
  1502.         fprintf (asmfile, ".stabs \"%s:",
  1503.              IDENTIFIER_POINTER (DECL_NAME (parms)));
  1504.           }
  1505.         else
  1506.           {
  1507.         current_sym_nchars = 8;
  1508.         fprintf (asmfile, ".stabs \"(anon):");
  1509.           }
  1510.         dbxout_type (TREE_TYPE (parms), 0);
  1511.         dbxout_finish_symbol (parms);
  1512.       }
  1513.       }
  1514. }
  1515.  
  1516. /* Given a chain of ..._TYPE nodes (as come in a parameter list),
  1517.    output definitions of those names, in raw form */
  1518.  
  1519. void
  1520. dbxout_args (args)
  1521.      tree args;
  1522. {
  1523.   while (args)
  1524.     {
  1525.       putc (',', asmfile);
  1526.       dbxout_type (TREE_VALUE (args), 0);
  1527.       CHARS (1);
  1528.       args = TREE_CHAIN (args);
  1529.     }
  1530. }
  1531.  
  1532. /* Given a chain of ..._TYPE nodes,
  1533.    find those which have typedef names and output those names.
  1534.    This is to ensure those types get output.  */
  1535.  
  1536. void
  1537. dbxout_types (types)
  1538.      register tree types;
  1539. {
  1540.   while (types)
  1541.     {
  1542.       if (TYPE_NAME (types)
  1543.       && TREE_CODE (TYPE_NAME (types)) == TYPE_DECL
  1544.       && ! TREE_ASM_WRITTEN (TYPE_NAME (types)))
  1545.     dbxout_symbol (TYPE_NAME (types), 1);
  1546.       types = TREE_CHAIN (types);
  1547.     }
  1548. }
  1549.  
  1550. /* Output the tags (struct, union and enum definitions with names) for a block,
  1551.    given a list of them (a chain of TREE_LIST nodes) in TAGS.
  1552.    We must check to include those that have been mentioned already with
  1553.    only a cross-reference.  */
  1554.  
  1555. void
  1556. dbxout_tags (tags)
  1557.      tree tags;
  1558. {
  1559.   register tree link;
  1560.   for (link = tags; link; link = TREE_CHAIN (link))
  1561.     {
  1562.       register tree type = TYPE_MAIN_VARIANT (TREE_VALUE (link));
  1563. #if 0
  1564.       if (TREE_PURPOSE (link) != 0
  1565.       && ! TREE_ASM_WRITTEN (link)
  1566.       && TREE_VALUE (link)
  1567.       && (type = TYPE_MAIN_VARIANT (TREE_VALUE (link)))
  1568.       && TYPE_SIZE (type) != 0
  1569.       && lang_output_debug_info (type))
  1570. #endif
  1571.       if (TREE_PURPOSE (link) != 0
  1572.       && ! TREE_ASM_WRITTEN (link)
  1573.       && TYPE_SIZE (type) != 0)
  1574.     {
  1575.       TREE_ASM_WRITTEN (link) = 1;
  1576.       current_sym_code = N_LSYM;
  1577.       current_sym_value = 0;
  1578.       current_sym_addr = 0;
  1579.       current_sym_nchars = 2 + IDENTIFIER_LENGTH (TREE_PURPOSE (link));
  1580.  
  1581.       FORCE_TEXT;
  1582. #if 0
  1583.       fprintf (asmfile, ".stabs \"%s:T",
  1584.            ANON_AGGRNAME_P (TREE_PURPOSE (link))
  1585.            ? "" : IDENTIFIER_POINTER (TREE_PURPOSE (link)));
  1586. #endif
  1587.       fprintf (asmfile, ".stabs \"%s:T",
  1588.            IDENTIFIER_POINTER (TREE_PURPOSE (link)));
  1589.       /* If there is a typedecl for this type with the same name
  1590.          as the tag, output an abbreviated form for that typedecl.  */
  1591.       if (use_gdb_dbx_extensions
  1592.           && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
  1593.           && DECL_NAME (TYPE_NAME (type)) == TREE_PURPOSE (link))
  1594.         {
  1595.           putc ('t', asmfile);
  1596.           TREE_ASM_WRITTEN (TYPE_NAME (type)) = 1;
  1597.         }
  1598.       dbxout_type (type, 1);
  1599.       dbxout_finish_symbol (0);
  1600. #if 0
  1601. /* Change by Bryan Boreham, Kewill, Fri Sep 22 16:57:42 1989.
  1602.    Added to make sure all fully-output structs have typedefs.    */
  1603.  
  1604.       if (!ANON_AGGRNAME_P (TREE_PURPOSE (link))
  1605.           && (TREE_CODE (TYPE_NAME (type)) != TYPE_DECL
  1606.           || DECL_NAME (TYPE_NAME (type)) != TREE_PURPOSE (link)))
  1607.         {
  1608.           fprintf (asmfile, ".stabs \"%s:t",
  1609.                IDENTIFIER_POINTER (TREE_PURPOSE (link)));
  1610.           
  1611.           current_sym_code = N_LSYM;
  1612.  
  1613.           dbxout_type (type, 1);
  1614.           dbxout_finish_symbol ();
  1615. #endif
  1616.     }
  1617.     }
  1618. }
  1619.  
  1620. /* Output everything about a symbol block (a BLOCK node
  1621.    that represents a scope level),
  1622.    including recursive output of contained blocks.
  1623.  
  1624.    BLOCK is the BLOCK node.
  1625.    DEPTH is its depth within containing symbol blocks.
  1626.    ARGS is usually zero; but for the outermost block of the
  1627.    body of a function, it is a chain of PARM_DECLs for the function parameters.
  1628.    We output definitions of all the register parms
  1629.    as if they were local variables of that block.
  1630.  
  1631.    Actually, BLOCK may be several blocks chained together.
  1632.    We handle them all in sequence.  */
  1633.  
  1634. static void
  1635. dbxout_block (block, depth, args)
  1636.      register tree block;
  1637.      int depth;
  1638.      tree args;
  1639. {
  1640.   int blocknum;
  1641.  
  1642.   while (block)
  1643.     {
  1644.       /* Ignore blocks never expanded or otherwise marked as real.  */
  1645.       if (TREE_USED (block))
  1646.     {
  1647.       /* In dbx format, the syms of a block come before the N_LBRAC.  */
  1648.       dbxout_tags (BLOCK_TYPE_TAGS (block));
  1649.       dbxout_syms (BLOCK_VARS (block));
  1650.       if (args)
  1651.         dbxout_reg_parms (args);
  1652.  
  1653.       /* Now output an N_LBRAC symbol to represent the beginning of
  1654.          the block.  Use the block's tree-walk order to generate
  1655.          the assembler symbols LBBn and LBEn
  1656.          that final will define around the code in this block.  */
  1657.       if (depth > 0)
  1658.         {
  1659.           char buf[20];
  1660.           blocknum = next_block_number++;
  1661.           ASM_GENERATE_INTERNAL_LABEL (buf, "LBB", blocknum);
  1662.  
  1663. #if 0 /* This would be ok if the flags were not language-dependent.
  1664.      If exception handling is a feature of the back end, all the
  1665.      relevant parts of the feature should be language-indep.  */
  1666.           if (TREE_LANG_FLAG_1 (block) == 0
  1667.           && TREE_LANG_FLAG_2 (block) == 1)
  1668.         {
  1669.           /* A catch block.  Must precede N_LBRAC.  */
  1670.           tree decl = BLOCK_VARS (block);
  1671.           char *name = DECL_NAME (decl) == NULL_TREE
  1672.             ? "default" : EXCEPTION_NAME_LENGTH + IDENTIFIER_POINTER (DECL_NAME (decl));
  1673.           fprintf (asmfile, ".stabs \"%s:C1\",%d,0,0,", name, N_CATCH);
  1674.           assemble_name (asmfile, buf);
  1675.           fprintf (asmfile, "\n");
  1676.         }
  1677. #endif
  1678.           fprintf (asmfile, ".stabn %d,0,0,", N_LBRAC);
  1679.           assemble_name (asmfile, buf);
  1680.           fprintf (asmfile, "\n");
  1681.         }
  1682.  
  1683.       /* Output the subblocks.  */
  1684.       dbxout_block (BLOCK_SUBBLOCKS (block), depth + 1, 0);
  1685.  
  1686.       /* Refer to the marker for the end of the block.  */
  1687.       if (depth > 0)
  1688.         {
  1689.           char buf[20];
  1690.           ASM_GENERATE_INTERNAL_LABEL (buf, "LBE", blocknum);
  1691.           fprintf (asmfile, ".stabn %d,0,0,", N_RBRAC);
  1692.           assemble_name (asmfile, buf);
  1693.           fprintf (asmfile, "\n");
  1694.         }
  1695.     }
  1696.       block = BLOCK_CHAIN (block);
  1697.     }
  1698. }
  1699.  
  1700. /* Output dbx data for a function definition.
  1701.    This includes a definition of the function name itself (a symbol),
  1702.    definitions of the parameters (locating them in the parameter list)
  1703.    and then output the block that makes up the function's body
  1704.    (including all the auto variables of the function).  */
  1705.  
  1706. void
  1707. dbxout_function (decl)
  1708.      tree decl;
  1709. {
  1710.   dbxout_symbol (decl, 0);
  1711.   dbxout_parms (DECL_ARGUMENTS (decl));
  1712.   if (DECL_NAME (DECL_RESULT (decl)) != 0)
  1713.     dbxout_symbol (DECL_RESULT (decl), 1);
  1714.   dbxout_block (DECL_INITIAL (decl), 0, DECL_ARGUMENTS (decl));
  1715.   
  1716.   /* If we made any temporary types in this fn that weren't
  1717.      output, output them now.  */
  1718.   dbxout_types (get_temporary_types ());
  1719. }
  1720.  
  1721. #else /* not DBX_DEBUGGING_INFO */
  1722.  
  1723. void
  1724. dbxout_init (asm_file, input_file_name)
  1725.      FILE *asm_file;
  1726.      char *input_file_name;
  1727. {}
  1728.  
  1729. void
  1730. dbxout_symbol (decl, local)
  1731.      tree decl;
  1732.      int local;
  1733. {}
  1734.  
  1735. void
  1736. dbxout_types (types)
  1737.      register tree types;
  1738. {}
  1739.  
  1740. void
  1741. dbxout_tags (tags)
  1742.      tree tags;
  1743. {}
  1744.  
  1745. void
  1746. dbxout_function (decl)
  1747.      tree decl;
  1748. {}
  1749.  
  1750. #endif /* DBX_DEBUGGING_INFO */
  1751.