home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 4 / FreshFish_May-June1994.bin / bbs / gnu / gcc-2.5.8-bin.lha / info / gcc.info-21 < prev    next >
Encoding:
GNU Info File  |  1994-02-21  |  36.1 KB  |  841 lines

  1. This is Info file gcc.info, produced by Makeinfo-1.55 from the input
  2. file gcc.texi.
  3.  
  4.    This file documents the use and the internals of the GNU compiler.
  5.  
  6.    Published by the Free Software Foundation 675 Massachusetts Avenue
  7. Cambridge, MA 02139 USA
  8.  
  9.    Copyright (C) 1988, 1989, 1992, 1993 Free Software Foundation, Inc.
  10.  
  11.    Permission is granted to make and distribute verbatim copies of this
  12. manual provided the copyright notice and this permission notice are
  13. preserved on all copies.
  14.  
  15.    Permission is granted to copy and distribute modified versions of
  16. this manual under the conditions for verbatim copying, provided also
  17. that the sections entitled "GNU General Public License" and "Protect
  18. Your Freedom--Fight `Look And Feel'" are included exactly as in the
  19. original, and provided that the entire resulting derived work is
  20. distributed under the terms of a permission notice identical to this
  21. one.
  22.  
  23.    Permission is granted to copy and distribute translations of this
  24. manual into another language, under the above conditions for modified
  25. versions, except that the sections entitled "GNU General Public
  26. License" and "Protect Your Freedom--Fight `Look And Feel'", and this
  27. permission notice, may be included in translations approved by the Free
  28. Software Foundation instead of in the original English.
  29.  
  30. 
  31. File: gcc.info,  Node: Macros for Initialization,  Next: Instruction Output,  Prev: Initialization,  Up: Assembler Format
  32.  
  33. Macros Controlling Initialization Routines
  34. ------------------------------------------
  35.  
  36.    Here are the macros that control how the compiler handles
  37. initialization and termination functions:
  38.  
  39. `INIT_SECTION_ASM_OP'
  40.      If defined, a C string constant for the assembler operation to
  41.      identify the following data as initialization code.  If not
  42.      defined, GNU CC will assume such a section does not exist.  When
  43.      you are using special sections for initialization and termination
  44.      functions, this macro also controls how `crtstuff.c' and
  45.      `libgcc2.c' arrange to run the initialization functions.
  46.  
  47. `ASM_OUTPUT_CONSTRUCTOR (STREAM, NAME)'
  48.      Define this macro as a C statement to output on the stream STREAM
  49.      the assembler code to arrange to call the function named NAME at
  50.      initialization time.
  51.  
  52.      Assume that NAME is the name of a C function generated
  53.      automatically by the compiler.  This function takes no arguments.
  54.      Use the function `assemble_name' to output the name NAME; this
  55.      performs any system-specific syntactic transformations such as
  56.      adding an underscore.
  57.  
  58.      If you don't define this macro, nothing special is output to
  59.      arrange to call the function.  This is correct when the function
  60.      will be called in some other manner--for example, by means of the
  61.      `collect2' program, which looks through the symbol table to find
  62.      these functions by their names.
  63.  
  64. `ASM_OUTPUT_DESTRUCTOR (STREAM, NAME)'
  65.      This is like `ASM_OUTPUT_CONSTRUCTOR' but used for termination
  66.      functions rather than initialization functions.
  67.  
  68.    If your system uses `collect2' as the means of processing
  69. constructors, then that program normally uses `nm' to scan an object
  70. file for constructor functions to be called.  On certain kinds of
  71. systems, you can define these macros to make `collect2' work faster
  72. (and, in some cases, make it work at all):
  73.  
  74. `OBJECT_FORMAT_COFF'
  75.      Define this macro if the system uses COFF (Common Object File
  76.      Format) object files, so that `collect2' can assume this format
  77.      and scan object files directly for dynamic constructor/destructor
  78.      functions.
  79.  
  80. `OBJECT_FORMAT_ROSE'
  81.      Define this macro if the system uses ROSE format object files, so
  82.      that `collect2' can assume this format and scan object files
  83.      directly for dynamic constructor/destructor functions.
  84.  
  85.    These macros are effective only in a native compiler; `collect2' as
  86. part of a cross compiler always uses `nm'.
  87.  
  88. `REAL_NM_FILE_NAME'
  89.      Define this macro as a C string constant containing the file name
  90.      to use to execute `nm'.  The default is to search the path
  91.      normally for `nm'.
  92.  
  93. 
  94. File: gcc.info,  Node: Instruction Output,  Next: Dispatch Tables,  Prev: Macros for Initialization,  Up: Assembler Format
  95.  
  96. Output of Assembler Instructions
  97. --------------------------------
  98.  
  99. `REGISTER_NAMES'
  100.      A C initializer containing the assembler's names for the machine
  101.      registers, each one as a C string constant.  This is what
  102.      translates register numbers in the compiler into assembler
  103.      language.
  104.  
  105. `ADDITIONAL_REGISTER_NAMES'
  106.      If defined, a C initializer for an array of structures containing
  107.      a name and a register number.  This macro defines additional names
  108.      for hard registers, thus allowing the `asm' option in declarations
  109.      to refer to registers using alternate names.
  110.  
  111. `ASM_OUTPUT_OPCODE (STREAM, PTR)'
  112.      Define this macro if you are using an unusual assembler that
  113.      requires different names for the machine instructions.
  114.  
  115.      The definition is a C statement or statements which output an
  116.      assembler instruction opcode to the stdio stream STREAM.  The
  117.      macro-operand PTR is a variable of type `char *' which points to
  118.      the opcode name in its "internal" form--the form that is written
  119.      in the machine description.  The definition should output the
  120.      opcode name to STREAM, performing any translation you desire, and
  121.      increment the variable PTR to point at the end of the opcode so
  122.      that it will not be output twice.
  123.  
  124.      In fact, your macro definition may process less than the entire
  125.      opcode name, or more than the opcode name; but if you want to
  126.      process text that includes `%'-sequences to substitute operands,
  127.      you must take care of the substitution yourself.  Just be sure to
  128.      increment PTR over whatever text should not be output normally.
  129.  
  130.      If you need to look at the operand values, they can be found as the
  131.      elements of `recog_operand'.
  132.  
  133.      If the macro definition does nothing, the instruction is output in
  134.      the usual way.
  135.  
  136. `FINAL_PRESCAN_INSN (INSN, OPVEC, NOPERANDS)'
  137.      If defined, a C statement to be executed just prior to the output
  138.      of assembler code for INSN, to modify the extracted operands so
  139.      they will be output differently.
  140.  
  141.      Here the argument OPVEC is the vector containing the operands
  142.      extracted from INSN, and NOPERANDS is the number of elements of
  143.      the vector which contain meaningful data for this insn.  The
  144.      contents of this vector are what will be used to convert the insn
  145.      template into assembler code, so you can change the assembler
  146.      output by changing the contents of the vector.
  147.  
  148.      This macro is useful when various assembler syntaxes share a single
  149.      file of instruction patterns; by defining this macro differently,
  150.      you can cause a large class of instructions to be output
  151.      differently (such as with rearranged operands).  Naturally,
  152.      variations in assembler syntax affecting individual insn patterns
  153.      ought to be handled by writing conditional output routines in
  154.      those patterns.
  155.  
  156.      If this macro is not defined, it is equivalent to a null statement.
  157.  
  158. `PRINT_OPERAND (STREAM, X, CODE)'
  159.      A C compound statement to output to stdio stream STREAM the
  160.      assembler syntax for an instruction operand X.  X is an RTL
  161.      expression.
  162.  
  163.      CODE is a value that can be used to specify one of several ways of
  164.      printing the operand.  It is used when identical operands must be
  165.      printed differently depending on the context.  CODE comes from the
  166.      `%' specification that was used to request printing of the
  167.      operand.  If the specification was just `%DIGIT' then CODE is 0;
  168.      if the specification was `%LTR DIGIT' then CODE is the ASCII code
  169.      for LTR.
  170.  
  171.      If X is a register, this macro should print the register's name.
  172.      The names can be found in an array `reg_names' whose type is `char
  173.      *[]'.  `reg_names' is initialized from `REGISTER_NAMES'.
  174.  
  175.      When the machine description has a specification `%PUNCT' (a `%'
  176.      followed by a punctuation character), this macro is called with a
  177.      null pointer for X and the punctuation character for CODE.
  178.  
  179. `PRINT_OPERAND_PUNCT_VALID_P (CODE)'
  180.      A C expression which evaluates to true if CODE is a valid
  181.      punctuation character for use in the `PRINT_OPERAND' macro.  If
  182.      `PRINT_OPERAND_PUNCT_VALID_P' is not defined, it means that no
  183.      punctuation characters (except for the standard one, `%') are used
  184.      in this way.
  185.  
  186. `PRINT_OPERAND_ADDRESS (STREAM, X)'
  187.      A C compound statement to output to stdio stream STREAM the
  188.      assembler syntax for an instruction operand that is a memory
  189.      reference whose address is X.  X is an RTL expression.
  190.  
  191.      On some machines, the syntax for a symbolic address depends on the
  192.      section that the address refers to.  On these machines, define the
  193.      macro `ENCODE_SECTION_INFO' to store the information into the
  194.      `symbol_ref', and then check for it here.  *Note Assembler
  195.      Format::.
  196.  
  197. `DBR_OUTPUT_SEQEND(FILE)'
  198.      A C statement, to be executed after all slot-filler instructions
  199.      have been output.  If necessary, call `dbr_sequence_length' to
  200.      determine the number of slots filled in a sequence (zero if not
  201.      currently outputting a sequence), to decide how many no-ops to
  202.      output, or whatever.
  203.  
  204.      Don't define this macro if it has nothing to do, but it is helpful
  205.      in reading assembly output if the extent of the delay sequence is
  206.      made explicit (e.g. with white space).
  207.  
  208.      Note that output routines for instructions with delay slots must be
  209.      prepared to deal with not being output as part of a sequence (i.e.
  210.      when the scheduling pass is not run, or when no slot fillers could
  211.      be found.)  The variable `final_sequence' is null when not
  212.      processing a sequence, otherwise it contains the `sequence' rtx
  213.      being output.
  214.  
  215. `REGISTER_PREFIX'
  216. `LOCAL_LABEL_PREFIX'
  217. `USER_LABEL_PREFIX'
  218. `IMMEDIATE_PREFIX'
  219.      If defined, C string expressions to be used for the `%R', `%L',
  220.      `%U', and `%I' options of `asm_fprintf' (see `final.c').  These
  221.      are useful when a single `md' file must support multiple assembler
  222.      formats.  In that case, the various `tm.h' files can define these
  223.      macros differently.
  224.  
  225. `ASSEMBLER_DIALECT'
  226.      If your target supports multiple dialects of assembler language
  227.      (such as different opcodes), define this macro as a C expression
  228.      that gives the numeric index of the assembler langauge dialect to
  229.      use, with zero as the first variant.
  230.  
  231.      If this macro is defined, you may use
  232.      `{option0|option1|option2...}' constructs in the output templates
  233.      of patterns (*note Output Template::.) or in the first argument of
  234.      `asm_fprintf'.  This construct outputs `option0', `option1' or
  235.      `option2', etc., if the value of `ASSEMBLER_DIALECT' is zero, one
  236.      or two, etc.  Any special characters within these strings retain
  237.      their usual meaning.
  238.  
  239.      If you do not define this macro, the characters `{', `|' and `}'
  240.      do not have any special meaning when used in templates or operands
  241.      to `asm_fprintf'.
  242.  
  243.      Define the macros `REGISTER_PREFIX', `LOCAL_LABEL_PREFIX',
  244.      `USER_LABEL_PREFIX' and `IMMEDIATE_PREFIX' if you can express the
  245.      variations in assemble language syntax with that mechanism.  Define
  246.      `ASSEMBLER_DIALECT' and use the `{option0|option1}' syntax if the
  247.      syntax variant are larger and involve such things as different
  248.      opcodes or operand order.
  249.  
  250. `ASM_OUTPUT_REG_PUSH (STREAM, REGNO)'
  251.      A C expression to output to STREAM some assembler code which will
  252.      push hard register number REGNO onto the stack.  The code need not
  253.      be optimal, since this macro is used only when profiling.
  254.  
  255. `ASM_OUTPUT_REG_POP (STREAM, REGNO)'
  256.      A C expression to output to STREAM some assembler code which will
  257.      pop hard register number REGNO off of the stack.  The code need
  258.      not be optimal, since this macro is used only when profiling.
  259.  
  260. 
  261. File: gcc.info,  Node: Dispatch Tables,  Next: Alignment Output,  Prev: Instruction Output,  Up: Assembler Format
  262.  
  263. Output of Dispatch Tables
  264. -------------------------
  265.  
  266. `ASM_OUTPUT_ADDR_DIFF_ELT (STREAM, VALUE, REL)'
  267.      This macro should be provided on machines where the addresses in a
  268.      dispatch table are relative to the table's own address.
  269.  
  270.      The definition should be a C statement to output to the stdio
  271.      stream STREAM an assembler pseudo-instruction to generate a
  272.      difference between two labels.  VALUE and REL are the numbers of
  273.      two internal labels.  The definitions of these labels are output
  274.      using `ASM_OUTPUT_INTERNAL_LABEL', and they must be printed in the
  275.      same way here.  For example,
  276.  
  277.           fprintf (STREAM, "\t.word L%d-L%d\n",
  278.                    VALUE, REL)
  279.  
  280. `ASM_OUTPUT_ADDR_VEC_ELT (STREAM, VALUE)'
  281.      This macro should be provided on machines where the addresses in a
  282.      dispatch table are absolute.
  283.  
  284.      The definition should be a C statement to output to the stdio
  285.      stream STREAM an assembler pseudo-instruction to generate a
  286.      reference to a label.  VALUE is the number of an internal label
  287.      whose definition is output using `ASM_OUTPUT_INTERNAL_LABEL'.  For
  288.      example,
  289.  
  290.           fprintf (STREAM, "\t.word L%d\n", VALUE)
  291.  
  292. `ASM_OUTPUT_CASE_LABEL (STREAM, PREFIX, NUM, TABLE)'
  293.      Define this if the label before a jump-table needs to be output
  294.      specially.  The first three arguments are the same as for
  295.      `ASM_OUTPUT_INTERNAL_LABEL'; the fourth argument is the jump-table
  296.      which follows (a `jump_insn' containing an `addr_vec' or
  297.      `addr_diff_vec').
  298.  
  299.      This feature is used on system V to output a `swbeg' statement for
  300.      the table.
  301.  
  302.      If this macro is not defined, these labels are output with
  303.      `ASM_OUTPUT_INTERNAL_LABEL'.
  304.  
  305. `ASM_OUTPUT_CASE_END (STREAM, NUM, TABLE)'
  306.      Define this if something special must be output at the end of a
  307.      jump-table.  The definition should be a C statement to be executed
  308.      after the assembler code for the table is written.  It should write
  309.      the appropriate code to stdio stream STREAM.  The argument TABLE
  310.      is the jump-table insn, and NUM is the label-number of the
  311.      preceding label.
  312.  
  313.      If this macro is not defined, nothing special is output at the end
  314.      of the jump-table.
  315.  
  316. 
  317. File: gcc.info,  Node: Alignment Output,  Prev: Dispatch Tables,  Up: Assembler Format
  318.  
  319. Assembler Commands for Alignment
  320. --------------------------------
  321.  
  322. `ASM_OUTPUT_ALIGN_CODE (FILE)'
  323.      A C expression to output text to align the location counter in the
  324.      way that is desirable at a point in the code that is reached only
  325.      by jumping.
  326.  
  327.      This macro need not be defined if you don't want any special
  328.      alignment to be done at such a time.  Most machine descriptions do
  329.      not currently define the macro.
  330.  
  331. `ASM_OUTPUT_LOOP_ALIGN (FILE)'
  332.      A C expression to output text to align the location counter in the
  333.      way that is desirable at the beginning of a loop.
  334.  
  335.      This macro need not be defined if you don't want any special
  336.      alignment to be done at such a time.  Most machine descriptions do
  337.      not currently define the macro.
  338.  
  339. `ASM_OUTPUT_SKIP (STREAM, NBYTES)'
  340.      A C statement to output to the stdio stream STREAM an assembler
  341.      instruction to advance the location counter by NBYTES bytes.
  342.      Those bytes should be zero when loaded.  NBYTES will be a C
  343.      expression of type `int'.
  344.  
  345. `ASM_NO_SKIP_IN_TEXT'
  346.      Define this macro if `ASM_OUTPUT_SKIP' should not be used in the
  347.      text section because it fails put zeros in the bytes that are
  348.      skipped.  This is true on many Unix systems, where the pseudo-op
  349.      to skip bytes produces no-op instructions rather than zeros when
  350.      used in the text section.
  351.  
  352. `ASM_OUTPUT_ALIGN (STREAM, POWER)'
  353.      A C statement to output to the stdio stream STREAM an assembler
  354.      command to advance the location counter to a multiple of 2 to the
  355.      POWER bytes.  POWER will be a C expression of type `int'.
  356.  
  357. 
  358. File: gcc.info,  Node: Debugging Info,  Next: Cross-compilation,  Prev: Assembler Format,  Up: Target Macros
  359.  
  360. Controlling Debugging Information Format
  361. ========================================
  362.  
  363. * Menu:
  364.  
  365. * All Debuggers::      Macros that affect all debugging formats uniformly.
  366. * DBX Options::        Macros enabling specific options in DBX format.
  367. * DBX Hooks::          Hook macros for varying DBX format.
  368. * File Names and DBX:: Macros controlling output of file names in DBX format.
  369. * SDB and DWARF::      Macros for SDB (COFF) and DWARF formats.
  370.  
  371. 
  372. File: gcc.info,  Node: All Debuggers,  Next: DBX Options,  Up: Debugging Info
  373.  
  374. Macros Affecting All Debugging Formats
  375. --------------------------------------
  376.  
  377. `DBX_REGISTER_NUMBER (REGNO)'
  378.      A C expression that returns the DBX register number for the
  379.      compiler register number REGNO.  In simple cases, the value of this
  380.      expression may be REGNO itself.  But sometimes there are some
  381.      registers that the compiler knows about and DBX does not, or vice
  382.      versa.  In such cases, some register may need to have one number in
  383.      the compiler and another for DBX.
  384.  
  385.      If two registers have consecutive numbers inside GNU CC, and they
  386.      can be used as a pair to hold a multiword value, then they *must*
  387.      have consecutive numbers after renumbering with
  388.      `DBX_REGISTER_NUMBER'.  Otherwise, debuggers will be unable to
  389.      access such a pair, because they expect register pairs to be
  390.      consecutive in their own numbering scheme.
  391.  
  392.      If you find yourself defining `DBX_REGISTER_NUMBER' in way that
  393.      does not preserve register pairs, then what you must do instead is
  394.      redefine the actual register numbering scheme.
  395.  
  396. `DEBUGGER_AUTO_OFFSET (X)'
  397.      A C expression that returns the integer offset value for an
  398.      automatic variable having address X (an RTL expression).  The
  399.      default computation assumes that X is based on the frame-pointer
  400.      and gives the offset from the frame-pointer.  This is required for
  401.      targets that produce debugging output for DBX or COFF-style
  402.      debugging output for SDB and allow the frame-pointer to be
  403.      eliminated when the `-g' options is used.
  404.  
  405. `DEBUGGER_ARG_OFFSET (OFFSET, X)'
  406.      A C expression that returns the integer offset value for an
  407.      argument having address X (an RTL expression).  The nominal offset
  408.      is OFFSET.
  409.  
  410. `PREFERRED_DEBUGGING_TYPE'
  411.      A C expression that returns the type of debugging output GNU CC
  412.      produces when the user specifies `-g' or `-ggdb'.  Define this if
  413.      you have arranged for GNU CC to support more than one format of
  414.      debugging output.  Currently, the allowable values are `DBX_DEBUG',
  415.      `SDB_DEBUG', `DWARF_DEBUG', and `XCOFF_DEBUG'.
  416.  
  417.      The value of this macro only affects the default debugging output;
  418.      the user can always get a specific type of output by using
  419.      `-gstabs', `-gcoff', `-gdwarf', or `-gxcoff'.
  420.  
  421. 
  422. File: gcc.info,  Node: DBX Options,  Next: DBX Hooks,  Prev: All Debuggers,  Up: Debugging Info
  423.  
  424. Specific Options for DBX Output
  425. -------------------------------
  426.  
  427. `DBX_DEBUGGING_INFO'
  428.      Define this macro if GNU CC should produce debugging output for DBX
  429.      in response to the `-g' option.
  430.  
  431. `XCOFF_DEBUGGING_INFO'
  432.      Define this macro if GNU CC should produce XCOFF format debugging
  433.      output in response to the `-g' option.  This is a variant of DBX
  434.      format.
  435.  
  436. `DEFAULT_GDB_EXTENSIONS'
  437.      Define this macro to control whether GNU CC should by default
  438.      generate GDB's extended version of DBX debugging information
  439.      (assuming DBX-format debugging information is enabled at all).  If
  440.      you don't define the macro, the default is 1: always generate the
  441.      extended information if there is any occasion to.
  442.  
  443. `DEBUG_SYMS_TEXT'
  444.      Define this macro if all `.stabs' commands should be output while
  445.      in the text section.
  446.  
  447. `ASM_STABS_OP'
  448.      A C string constant naming the assembler pseudo op to use instead
  449.      of `.stabs' to define an ordinary debugging symbol.  If you don't
  450.      define this macro, `.stabs' is used.  This macro applies only to
  451.      DBX debugging information format.
  452.  
  453. `ASM_STABD_OP'
  454.      A C string constant naming the assembler pseudo op to use instead
  455.      of `.stabd' to define a debugging symbol whose value is the current
  456.      location.  If you don't define this macro, `.stabd' is used.  This
  457.      macro applies only to DBX debugging information format.
  458.  
  459. `ASM_STABN_OP'
  460.      A C string constant naming the assembler pseudo op to use instead
  461.      of `.stabn' to define a debugging symbol with no name.  If you
  462.      don't define this macro, `.stabn' is used.  This macro applies
  463.      only to DBX debugging information format.
  464.  
  465. `DBX_NO_XREFS'
  466.      Define this macro if DBX on your system does not support the
  467.      construct `xsTAGNAME'.  On some systems, this construct is used to
  468.      describe a forward reference to a structure named TAGNAME.  On
  469.      other systems, this construct is not supported at all.
  470.  
  471. `DBX_CONTIN_LENGTH'
  472.      A symbol name in DBX-format debugging information is normally
  473.      continued (split into two separate `.stabs' directives) when it
  474.      exceeds a certain length (by default, 80 characters).  On some
  475.      operating systems, DBX requires this splitting; on others,
  476.      splitting must not be done.  You can inhibit splitting by defining
  477.      this macro with the value zero.  You can override the default
  478.      splitting-length by defining this macro as an expression for the
  479.      length you desire.
  480.  
  481. `DBX_CONTIN_CHAR'
  482.      Normally continuation is indicated by adding a `\' character to
  483.      the end of a `.stabs' string when a continuation follows.  To use
  484.      a different character instead, define this macro as a character
  485.      constant for the character you want to use.  Do not define this
  486.      macro if backslash is correct for your system.
  487.  
  488. `DBX_STATIC_STAB_DATA_SECTION'
  489.      Define this macro if it is necessary to go to the data section
  490.      before outputting the `.stabs' pseudo-op for a non-global static
  491.      variable.
  492.  
  493. `DBX_TYPE_DECL_STABS_CODE'
  494.      The value to use in the "code" field of the `.stabs' directive for
  495.      a typedef.  The default is `N_LSYM'.
  496.  
  497. `DBX_STATIC_CONST_VAR_CODE'
  498.      The value to use in the "code" field of the `.stabs' directive for
  499.      a static variable located in the text section.  DBX format does not
  500.      provide any "right" way to do this.  The default is `N_FUN'.
  501.  
  502. `DBX_REGPARM_STABS_CODE'
  503.      The value to use in the "code" field of the `.stabs' directive for
  504.      a parameter passed in registers.  DBX format does not provide any
  505.      "right" way to do this.  The default is `N_RSYM'.
  506.  
  507. `DBX_REGPARM_STABS_LETTER'
  508.      The letter to use in DBX symbol data to identify a symbol as a
  509.      parameter passed in registers.  DBX format does not customarily
  510.      provide any way to do this.  The default is `'P''.
  511.  
  512. `DBX_MEMPARM_STABS_LETTER'
  513.      The letter to use in DBX symbol data to identify a symbol as a
  514.      stack parameter.  The default is `'p''.
  515.  
  516. `DBX_FUNCTION_FIRST'
  517.      Define this macro if the DBX information for a function and its
  518.      arguments should precede the assembler code for the function.
  519.      Normally, in DBX format, the debugging information entirely
  520.      follows the assembler code.
  521.  
  522. `DBX_LBRAC_FIRST'
  523.      Define this macro if the `N_LBRAC' symbol for a block should
  524.      precede the debugging information for variables and functions
  525.      defined in that block.  Normally, in DBX format, the `N_LBRAC'
  526.      symbol comes first.
  527.  
  528. 
  529. File: gcc.info,  Node: DBX Hooks,  Next: File Names and DBX,  Prev: DBX Options,  Up: Debugging Info
  530.  
  531. Open-Ended Hooks for DBX Format
  532. -------------------------------
  533.  
  534. `DBX_OUTPUT_LBRAC (STREAM, NAME)'
  535.      Define this macro to say how to output to STREAM the debugging
  536.      information for the start of a scope level for variable names.  The
  537.      argument NAME is the name of an assembler symbol (for use with
  538.      `assemble_name') whose value is the address where the scope begins.
  539.  
  540. `DBX_OUTPUT_RBRAC (STREAM, NAME)'
  541.      Like `DBX_OUTPUT_LBRAC', but for the end of a scope level.
  542.  
  543. `DBX_OUTPUT_ENUM (STREAM, TYPE)'
  544.      Define this macro if the target machine requires special handling
  545.      to output an enumeration type.  The definition should be a C
  546.      statement (sans semicolon) to output the appropriate information
  547.      to STREAM for the type TYPE.
  548.  
  549. `DBX_OUTPUT_FUNCTION_END (STREAM, FUNCTION)'
  550.      Define this macro if the target machine requires special output at
  551.      the end of the debugging information for a function.  The
  552.      definition should be a C statement (sans semicolon) to output the
  553.      appropriate information to STREAM.  FUNCTION is the
  554.      `FUNCTION_DECL' node for the function.
  555.  
  556. `DBX_OUTPUT_STANDARD_TYPES (SYMS)'
  557.      Define this macro if you need to control the order of output of the
  558.      standard data types at the beginning of compilation.  The argument
  559.      SYMS is a `tree' which is a chain of all the predefined global
  560.      symbols, including names of data types.
  561.  
  562.      Normally, DBX output starts with definitions of the types for
  563.      integers and characters, followed by all the other predefined
  564.      types of the particular language in no particular order.
  565.  
  566.      On some machines, it is necessary to output different particular
  567.      types first.  To do this, define `DBX_OUTPUT_STANDARD_TYPES' to
  568.      output those symbols in the necessary order.  Any predefined types
  569.      that you don't explicitly output will be output afterward in no
  570.      particular order.
  571.  
  572.      Be careful not to define this macro so that it works only for C.
  573.      There are no global variables to access most of the built-in
  574.      types, because another language may have another set of types.
  575.      The way to output a particular type is to look through SYMS to see
  576.      if you can find it.  Here is an example:
  577.  
  578.           {
  579.             tree decl;
  580.             for (decl = syms; decl; decl = TREE_CHAIN (decl))
  581.               if (!strcmp (IDENTIFIER_POINTER (DECL_NAME (decl)),
  582.                            "long int"))
  583.                 dbxout_symbol (decl);
  584.             ...
  585.           }
  586.  
  587.      This does nothing if the expected type does not exist.
  588.  
  589.      See the function `init_decl_processing' in `c-decl.c' to find the
  590.      names to use for all the built-in C types.
  591.  
  592.      Here is another way of finding a particular type:
  593.  
  594.           {
  595.             tree decl;
  596.             for (decl = syms; decl; decl = TREE_CHAIN (decl))
  597.               if (TREE_CODE (decl) == TYPE_DECL
  598.                   && (TREE_CODE (TREE_TYPE (decl))
  599.                       == INTEGER_CST)
  600.                   && TYPE_PRECISION (TREE_TYPE (decl)) == 16
  601.                   && TYPE_UNSIGNED (TREE_TYPE (decl)))
  602.           /* This must be `unsigned short'.  */
  603.                 dbxout_symbol (decl);
  604.             ...
  605.           }
  606.  
  607. 
  608. File: gcc.info,  Node: File Names and DBX,  Next: SDB and DWARF,  Prev: DBX Hooks,  Up: Debugging Info
  609.  
  610. File Names in DBX Format
  611. ------------------------
  612.  
  613. `DBX_WORKING_DIRECTORY'
  614.      Define this if DBX wants to have the current directory recorded in
  615.      each object file.
  616.  
  617.      Note that the working directory is always recorded if GDB
  618.      extensions are enabled.
  619.  
  620. `DBX_OUTPUT_MAIN_SOURCE_FILENAME (STREAM, NAME)'
  621.      A C statement to output DBX debugging information to the stdio
  622.      stream STREAM which indicates that file NAME is the main source
  623.      file--the file specified as the input file for compilation.  This
  624.      macro is called only once, at the beginning of compilation.
  625.  
  626.      This macro need not be defined if the standard form of output for
  627.      DBX debugging information is appropriate.
  628.  
  629. `DBX_OUTPUT_MAIN_SOURCE_DIRECTORY (STREAM, NAME)'
  630.      A C statement to output DBX debugging information to the stdio
  631.      stream STREAM which indicates that the current directory during
  632.      compilation is named NAME.
  633.  
  634.      This macro need not be defined if the standard form of output for
  635.      DBX debugging information is appropriate.
  636.  
  637. `DBX_OUTPUT_MAIN_SOURCE_FILE_END (STREAM, NAME)'
  638.      A C statement to output DBX debugging information at the end of
  639.      compilation of the main source file NAME.
  640.  
  641.      If you don't define this macro, nothing special is output at the
  642.      end of compilation, which is correct for most machines.
  643.  
  644. `DBX_OUTPUT_SOURCE_FILENAME (STREAM, NAME)'
  645.      A C statement to output DBX debugging information to the stdio
  646.      stream STREAM which indicates that file NAME is the current source
  647.      file.  This output is generated each time input shifts to a
  648.      different source file as a result of `#include', the end of an
  649.      included file, or a `#line' command.
  650.  
  651.      This macro need not be defined if the standard form of output for
  652.      DBX debugging information is appropriate.
  653.  
  654. 
  655. File: gcc.info,  Node: SDB and DWARF,  Prev: File Names and DBX,  Up: Debugging Info
  656.  
  657. Macros for SDB and DWARF Output
  658. -------------------------------
  659.  
  660. `SDB_DEBUGGING_INFO'
  661.      Define this macro if GNU CC should produce COFF-style debugging
  662.      output for SDB in response to the `-g' option.
  663.  
  664. `DWARF_DEBUGGING_INFO'
  665.      Define this macro if GNU CC should produce dwarf format debugging
  666.      output in response to the `-g' option.
  667.  
  668. `PUT_SDB_...'
  669.      Define these macros to override the assembler syntax for the
  670.      special SDB assembler directives.  See `sdbout.c' for a list of
  671.      these macros and their arguments.  If the standard syntax is used,
  672.      you need not define them yourself.
  673.  
  674. `SDB_DELIM'
  675.      Some assemblers do not support a semicolon as a delimiter, even
  676.      between SDB assembler directives.  In that case, define this macro
  677.      to be the delimiter to use (usually `\n').  It is not necessary to
  678.      define a new set of `PUT_SDB_OP' macros if this is the only change
  679.      required.
  680.  
  681. `SDB_GENERATE_FAKE'
  682.      Define this macro to override the usual method of constructing a
  683.      dummy name for anonymous structure and union types.  See
  684.      `sdbout.c' for more information.
  685.  
  686. `SDB_ALLOW_UNKNOWN_REFERENCES'
  687.      Define this macro to allow references to unknown structure, union,
  688.      or enumeration tags to be emitted.  Standard COFF does not allow
  689.      handling of unknown references, MIPS ECOFF has support for it.
  690.  
  691. `SDB_ALLOW_FORWARD_REFERENCES'
  692.      Define this macro to allow references to structure, union, or
  693.      enumeration tags that have not yet been seen to be handled.  Some
  694.      assemblers choke if forward tags are used, while some require it.
  695.  
  696. 
  697. File: gcc.info,  Node: Cross-compilation,  Next: Misc,  Prev: Debugging Info,  Up: Target Macros
  698.  
  699. Cross Compilation and Floating Point
  700. ====================================
  701.  
  702.    While all modern machines use 2's complement representation for
  703. integers, there are a variety of representations for floating point
  704. numbers.  This means that in a cross-compiler the representation of
  705. floating point numbers in the compiled program may be different from
  706. that used in the machine doing the compilation.
  707.  
  708.    Because different representation systems may offer different amounts
  709. of range and precision, the cross compiler cannot safely use the host
  710. machine's floating point arithmetic.  Therefore, floating point
  711. constants must be represented in the target machine's format.  This
  712. means that the cross compiler cannot use `atof' to parse a floating
  713. point constant; it must have its own special routine to use instead.
  714. Also, constant folding must emulate the target machine's arithmetic (or
  715. must not be done at all).
  716.  
  717.    The macros in the following table should be defined only if you are
  718. cross compiling between different floating point formats.
  719.  
  720.    Otherwise, don't define them.  Then default definitions will be set
  721. up which use `double' as the data type, `==' to test for equality, etc.
  722.  
  723.    You don't need to worry about how many times you use an operand of
  724. any of these macros.  The compiler never uses operands which have side
  725. effects.
  726.  
  727. `REAL_VALUE_TYPE'
  728.      A macro for the C data type to be used to hold a floating point
  729.      value in the target machine's format.  Typically this would be a
  730.      `struct' containing an array of `int'.
  731.  
  732. `REAL_VALUES_EQUAL (X, Y)'
  733.      A macro for a C expression which compares for equality the two
  734.      values, X and Y, both of type `REAL_VALUE_TYPE'.
  735.  
  736. `REAL_VALUES_LESS (X, Y)'
  737.      A macro for a C expression which tests whether X is less than Y,
  738.      both values being of type `REAL_VALUE_TYPE' and interpreted as
  739.      floating point numbers in the target machine's representation.
  740.  
  741. `REAL_VALUE_LDEXP (X, SCALE)'
  742.      A macro for a C expression which performs the standard library
  743.      function `ldexp', but using the target machine's floating point
  744.      representation.  Both X and the value of the expression have type
  745.      `REAL_VALUE_TYPE'.  The second argument, SCALE, is an integer.
  746.  
  747. `REAL_VALUE_FIX (X)'
  748.      A macro whose definition is a C expression to convert the
  749.      target-machine floating point value X to a signed integer.  X has
  750.      type `REAL_VALUE_TYPE'.
  751.  
  752. `REAL_VALUE_UNSIGNED_FIX (X)'
  753.      A macro whose definition is a C expression to convert the
  754.      target-machine floating point value X to an unsigned integer.  X
  755.      has type `REAL_VALUE_TYPE'.
  756.  
  757. `REAL_VALUE_RNDZINT (X)'
  758.      A macro whose definition is a C expression to round the
  759.      target-machine floating point value X towards zero to an integer
  760.      value (but still as a floating point number).  X has type
  761.      `REAL_VALUE_TYPE', and so does the value.
  762.  
  763. `REAL_VALUE_UNSIGNED_RNDZINT (X)'
  764.      A macro whose definition is a C expression to round the
  765.      target-machine floating point value X towards zero to an unsigned
  766.      integer value (but still represented as a floating point number).
  767.      x has type `REAL_VALUE_TYPE', and so does the value.
  768.  
  769. `REAL_VALUE_ATOF (STRING, MODE)'
  770.      A macro for a C expression which converts STRING, an expression of
  771.      type `char *', into a floating point number in the target machine's
  772.      representation for mode MODE.  The value has type
  773.      `REAL_VALUE_TYPE'.
  774.  
  775. `REAL_INFINITY'
  776.      Define this macro if infinity is a possible floating point value,
  777.      and therefore division by 0 is legitimate.
  778.  
  779. `REAL_VALUE_ISINF (X)'
  780.      A macro for a C expression which determines whether X, a floating
  781.      point value, is infinity.  The value has type `int'.  By default,
  782.      this is defined to call `isinf'.
  783.  
  784. `REAL_VALUE_ISNAN (X)'
  785.      A macro for a C expression which determines whether X, a floating
  786.      point value, is a "nan" (not-a-number).  The value has type `int'.
  787.      By default, this is defined to call `isnan'.
  788.  
  789.    Define the following additional macros if you want to make floating
  790. point constant folding work while cross compiling.  If you don't define
  791. them, cross compilation is still possible, but constant folding will
  792. not happen for floating point values.
  793.  
  794. `REAL_ARITHMETIC (OUTPUT, CODE, X, Y)'
  795.      A macro for a C statement which calculates an arithmetic operation
  796.      of the two floating point values X and Y, both of type
  797.      `REAL_VALUE_TYPE' in the target machine's representation, to
  798.      produce a result of the same type and representation which is
  799.      stored in OUTPUT (which will be a variable).
  800.  
  801.      The operation to be performed is specified by CODE, a tree code
  802.      which will always be one of the following: `PLUS_EXPR',
  803.      `MINUS_EXPR', `MULT_EXPR', `RDIV_EXPR', `MAX_EXPR', `MIN_EXPR'.
  804.  
  805.      The expansion of this macro is responsible for checking for
  806.      overflow.  If overflow happens, the macro expansion should execute
  807.      the statement `return 0;', which indicates the inability to
  808.      perform the arithmetic operation requested.
  809.  
  810. `REAL_VALUE_NEGATE (X)'
  811.      A macro for a C expression which returns the negative of the
  812.      floating point value X.  Both X and the value of the expression
  813.      have type `REAL_VALUE_TYPE' and are in the target machine's
  814.      floating point representation.
  815.  
  816.      There is no way for this macro to report overflow, since overflow
  817.      can't happen in the negation operation.
  818.  
  819. `REAL_VALUE_TRUNCATE (MODE, X)'
  820.      A macro for a C expression which converts the floating point value
  821.      X to mode MODE.
  822.  
  823.      Both X and the value of the expression are in the target machine's
  824.      floating point representation and have type `REAL_VALUE_TYPE'.
  825.      However, the value should have an appropriate bit pattern to be
  826.      output properly as a floating constant whose precision accords
  827.      with mode MODE.
  828.  
  829.      There is no way for this macro to report overflow.
  830.  
  831. `REAL_VALUE_TO_INT (LOW, HIGH, X)'
  832.      A macro for a C expression which converts a floating point value X
  833.      into a double-precision integer which is then stored into LOW and
  834.      HIGH, two variables of type INT.
  835.  
  836. `REAL_VALUE_FROM_INT (X, LOW, HIGH)'
  837.      A macro for a C expression which converts a double-precision
  838.      integer found in LOW and HIGH, two variables of type INT, into a
  839.      floating point value which is then stored into X.
  840.  
  841.