|
|
1.1 ! root 1: This is Info file gcc.info, produced by Makeinfo-1.54 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: When this macro is defined, you may include strings of the form ! 232: `{option0|option1|option2}' within output templates (*note Output ! 233: Template::.) or the operand to `asm_fprintf'. GNU CC will output ! 234: either `option0', `option1' or `option2' if the value of ! 235: `ASSEMBLER_DIALECT' is zero, one or two, respectively. Any ! 236: special characters within these strings retain their usual meaning. ! 237: ! 238: If you do not define this macro, the characters `{', `|' and `}' ! 239: do not have any special meaning when used in templates or operands ! 240: to `asm_fprintf'. ! 241: ! 242: Define the `REGISTER_PREFIX', `LOCAL_LABEL_PREFIX', ! 243: `USER_LABEL_PREFIX' and `IMMEDIATE_PREFIX' macros above if you can ! 244: express the variations in assemble language syntax with that ! 245: mechanism. Define `ASSEMBLER_DIALECT' and use the ! 246: `{option0|option1}' syntax if the syntax variant are larger and ! 247: involve such things as different opcodes or operand order. ! 248: ! 249: `ASM_OUTPUT_REG_PUSH (STREAM, REGNO)' ! 250: A C expression to output to STREAM some assembler code which will ! 251: push hard register number REGNO onto the stack. The code need not ! 252: be optimal, since this macro is used only when profiling. ! 253: ! 254: `ASM_OUTPUT_REG_POP (STREAM, REGNO)' ! 255: A C expression to output to STREAM some assembler code which will ! 256: pop hard register number REGNO off of the stack. The code need ! 257: not be optimal, since this macro is used only when profiling. ! 258: ! 259: ! 260: File: gcc.info, Node: Dispatch Tables, Next: Alignment Output, Prev: Instruction Output, Up: Assembler Format ! 261: ! 262: Output of Dispatch Tables ! 263: ------------------------- ! 264: ! 265: `ASM_OUTPUT_ADDR_DIFF_ELT (STREAM, VALUE, REL)' ! 266: This macro should be provided on machines where the addresses in a ! 267: dispatch table are relative to the table's own address. ! 268: ! 269: The definition should be a C statement to output to the stdio ! 270: stream STREAM an assembler pseudo-instruction to generate a ! 271: difference between two labels. VALUE and REL are the numbers of ! 272: two internal labels. The definitions of these labels are output ! 273: using `ASM_OUTPUT_INTERNAL_LABEL', and they must be printed in the ! 274: same way here. For example, ! 275: ! 276: fprintf (STREAM, "\t.word L%d-L%d\n", ! 277: VALUE, REL) ! 278: ! 279: `ASM_OUTPUT_ADDR_VEC_ELT (STREAM, VALUE)' ! 280: This macro should be provided on machines where the addresses in a ! 281: dispatch table are absolute. ! 282: ! 283: The definition should be a C statement to output to the stdio ! 284: stream STREAM an assembler pseudo-instruction to generate a ! 285: reference to a label. VALUE is the number of an internal label ! 286: whose definition is output using `ASM_OUTPUT_INTERNAL_LABEL'. For ! 287: example, ! 288: ! 289: fprintf (STREAM, "\t.word L%d\n", VALUE) ! 290: ! 291: `ASM_OUTPUT_CASE_LABEL (STREAM, PREFIX, NUM, TABLE)' ! 292: Define this if the label before a jump-table needs to be output ! 293: specially. The first three arguments are the same as for ! 294: `ASM_OUTPUT_INTERNAL_LABEL'; the fourth argument is the jump-table ! 295: which follows (a `jump_insn' containing an `addr_vec' or ! 296: `addr_diff_vec'). ! 297: ! 298: This feature is used on system V to output a `swbeg' statement for ! 299: the table. ! 300: ! 301: If this macro is not defined, these labels are output with ! 302: `ASM_OUTPUT_INTERNAL_LABEL'. ! 303: ! 304: `ASM_OUTPUT_CASE_END (STREAM, NUM, TABLE)' ! 305: Define this if something special must be output at the end of a ! 306: jump-table. The definition should be a C statement to be executed ! 307: after the assembler code for the table is written. It should write ! 308: the appropriate code to stdio stream STREAM. The argument TABLE ! 309: is the jump-table insn, and NUM is the label-number of the ! 310: preceding label. ! 311: ! 312: If this macro is not defined, nothing special is output at the end ! 313: of the jump-table. ! 314: ! 315: ! 316: File: gcc.info, Node: Alignment Output, Prev: Dispatch Tables, Up: Assembler Format ! 317: ! 318: Assembler Commands for Alignment ! 319: -------------------------------- ! 320: ! 321: `ASM_OUTPUT_ALIGN_CODE (FILE)' ! 322: A C expression to output text to align the location counter in the ! 323: way that is desirable at a point in the code that is reached only ! 324: by jumping. ! 325: ! 326: This macro need not be defined if you don't want any special ! 327: alignment to be done at such a time. Most machine descriptions do ! 328: not currently define the macro. ! 329: ! 330: `ASM_OUTPUT_LOOP_ALIGN (FILE)' ! 331: A C expression to output text to align the location counter in the ! 332: way that is desirable at the beginning of a loop. ! 333: ! 334: This macro need not be defined if you don't want any special ! 335: alignment to be done at such a time. Most machine descriptions do ! 336: not currently define the macro. ! 337: ! 338: `ASM_OUTPUT_SKIP (STREAM, NBYTES)' ! 339: A C statement to output to the stdio stream STREAM an assembler ! 340: instruction to advance the location counter by NBYTES bytes. ! 341: Those bytes should be zero when loaded. NBYTES will be a C ! 342: expression of type `int'. ! 343: ! 344: `ASM_NO_SKIP_IN_TEXT' ! 345: Define this macro if `ASM_OUTPUT_SKIP' should not be used in the ! 346: text section because it fails put zeros in the bytes that are ! 347: skipped. This is true on many Unix systems, where the pseudo-op ! 348: to skip bytes produces no-op instructions rather than zeros when ! 349: used in the text section. ! 350: ! 351: `ASM_OUTPUT_ALIGN (STREAM, POWER)' ! 352: A C statement to output to the stdio stream STREAM an assembler ! 353: command to advance the location counter to a multiple of 2 to the ! 354: POWER bytes. POWER will be a C expression of type `int'. ! 355: ! 356: ! 357: File: gcc.info, Node: Debugging Info, Next: Cross-compilation, Prev: Assembler Format, Up: Target Macros ! 358: ! 359: Controlling Debugging Information Format ! 360: ======================================== ! 361: ! 362: * Menu: ! 363: ! 364: * All Debuggers:: Macros that affect all debugging formats uniformly. ! 365: * DBX Options:: Macros enabling specific options in DBX format. ! 366: * DBX Hooks:: Hook macros for varying DBX format. ! 367: * File Names and DBX:: Macros controlling output of file names in DBX format. ! 368: * SDB and DWARF:: Macros for SDB (COFF) and DWARF formats. ! 369: ! 370: ! 371: File: gcc.info, Node: All Debuggers, Next: DBX Options, Up: Debugging Info ! 372: ! 373: Macros Affecting All Debugging Formats ! 374: -------------------------------------- ! 375: ! 376: `DBX_REGISTER_NUMBER (REGNO)' ! 377: A C expression that returns the DBX register number for the ! 378: compiler register number REGNO. In simple cases, the value of this ! 379: expression may be REGNO itself. But sometimes there are some ! 380: registers that the compiler knows about and DBX does not, or vice ! 381: versa. In such cases, some register may need to have one number in ! 382: the compiler and another for DBX. ! 383: ! 384: If two registers have consecutive numbers inside GNU CC, and they ! 385: can be used as a pair to hold a multiword value, then they *must* ! 386: have consecutive numbers after renumbering with ! 387: `DBX_REGISTER_NUMBER'. Otherwise, debuggers will be unable to ! 388: access such a pair, because they expect register pairs to be ! 389: consecutive in their own numbering scheme. ! 390: ! 391: If you find yourself defining `DBX_REGISTER_NUMBER' in way that ! 392: does not preserve register pairs, then what you must do instead is ! 393: redefine the actual register numbering scheme. ! 394: ! 395: `DEBUGGER_AUTO_OFFSET (X)' ! 396: A C expression that returns the integer offset value for an ! 397: automatic variable having address X (an RTL expression). The ! 398: default computation assumes that X is based on the frame-pointer ! 399: and gives the offset from the frame-pointer. This is required for ! 400: targets that produce debugging output for DBX or COFF-style ! 401: debugging output for SDB and allow the frame-pointer to be ! 402: eliminated when the `-g' options is used. ! 403: ! 404: `DEBUGGER_ARG_OFFSET (OFFSET, X)' ! 405: A C expression that returns the integer offset value for an ! 406: argument having address X (an RTL expression). The nominal offset ! 407: is OFFSET. ! 408: ! 409: `PREFERRED_DEBUGGING_TYPE' ! 410: A C expression that returns the type of debugging output GNU CC ! 411: produces when the user specifies `-g' or `-ggdb'. Define this if ! 412: you have arranged for GNU CC to support more than one format of ! 413: debugging output. Currently, the allowable values are `DBX_DEBUG', ! 414: `SDB_DEBUG', `DWARF_DEBUG', and `XCOFF_DEBUG'. ! 415: ! 416: The value of this macro only affects the default debugging output; ! 417: the user can always get a specific type of output by using ! 418: `-gstabs', `-gcoff', `-gdwarf', or `-gxcoff'. ! 419: ! 420: ! 421: File: gcc.info, Node: DBX Options, Next: DBX Hooks, Prev: All Debuggers, Up: Debugging Info ! 422: ! 423: Specific Options for DBX Output ! 424: ------------------------------- ! 425: ! 426: `DBX_DEBUGGING_INFO' ! 427: Define this macro if GNU CC should produce debugging output for DBX ! 428: in response to the `-g' option. ! 429: ! 430: `XCOFF_DEBUGGING_INFO' ! 431: Define this macro if GNU CC should produce XCOFF format debugging ! 432: output in response to the `-g' option. This is a variant of DBX ! 433: format. ! 434: ! 435: `DEFAULT_GDB_EXTENSIONS' ! 436: Define this macro to control whether GNU CC should by default ! 437: generate GDB's extended version of DBX debugging information ! 438: (assuming DBX-format debugging information is enabled at all). If ! 439: you don't define the macro, the default is 1: always generate the ! 440: extended information if there is any occasion to. ! 441: ! 442: `DEBUG_SYMS_TEXT' ! 443: Define this macro if all `.stabs' commands should be output while ! 444: in the text section. ! 445: ! 446: `ASM_STABS_OP' ! 447: A C string constant naming the assembler pseudo op to use instead ! 448: of `.stabs' to define an ordinary debugging symbol. If you don't ! 449: define this macro, `.stabs' is used. This macro applies only to ! 450: DBX debugging information format. ! 451: ! 452: `ASM_STABD_OP' ! 453: A C string constant naming the assembler pseudo op to use instead ! 454: of `.stabd' to define a debugging symbol whose value is the current ! 455: location. If you don't define this macro, `.stabd' is used. This ! 456: macro applies only to DBX debugging information format. ! 457: ! 458: `ASM_STABN_OP' ! 459: A C string constant naming the assembler pseudo op to use instead ! 460: of `.stabn' to define a debugging symbol with no name. If you ! 461: don't define this macro, `.stabn' is used. This macro applies ! 462: only to DBX debugging information format. ! 463: ! 464: `DBX_NO_XREFS' ! 465: Define this macro if DBX on your system does not support the ! 466: construct `xsTAGNAME'. On some systems, this construct is used to ! 467: describe a forward reference to a structure named TAGNAME. On ! 468: other systems, this construct is not supported at all. ! 469: ! 470: `DBX_CONTIN_LENGTH' ! 471: A symbol name in DBX-format debugging information is normally ! 472: continued (split into two separate `.stabs' directives) when it ! 473: exceeds a certain length (by default, 80 characters). On some ! 474: operating systems, DBX requires this splitting; on others, ! 475: splitting must not be done. You can inhibit splitting by defining ! 476: this macro with the value zero. You can override the default ! 477: splitting-length by defining this macro as an expression for the ! 478: length you desire. ! 479: ! 480: `DBX_CONTIN_CHAR' ! 481: Normally continuation is indicated by adding a `\' character to ! 482: the end of a `.stabs' string when a continuation follows. To use ! 483: a different character instead, define this macro as a character ! 484: constant for the character you want to use. Do not define this ! 485: macro if backslash is correct for your system. ! 486: ! 487: `DBX_STATIC_STAB_DATA_SECTION' ! 488: Define this macro if it is necessary to go to the data section ! 489: before outputting the `.stabs' pseudo-op for a non-global static ! 490: variable. ! 491: ! 492: `DBX_TYPE_DECL_STABS_CODE' ! 493: The value to use in the "code" field of the `.stabs' directive for ! 494: a typedef. The default is `N_LSYM'. ! 495: ! 496: `DBX_STATIC_CONST_VAR_CODE' ! 497: The value to use in the "code" field of the `.stabs' directive for ! 498: a static variable located in the text section. DBX format does not ! 499: provide any "right" way to do this. The default is `N_FUN'. ! 500: ! 501: `DBX_REGPARM_STABS_CODE' ! 502: The value to use in the "code" field of the `.stabs' directive for ! 503: a parameter passed in registers. DBX format does not provide any ! 504: "right" way to do this. The default is `N_RSYM'. ! 505: ! 506: `DBX_REGPARM_STABS_LETTER' ! 507: The letter to use in DBX symbol data to identify a symbol as a ! 508: parameter passed in registers. DBX format does not customarily ! 509: provide any way to do this. The default is `'P''. ! 510: ! 511: `DBX_MEMPARM_STABS_LETTER' ! 512: The letter to use in DBX symbol data to identify a symbol as a ! 513: stack parameter. The default is `'p''. ! 514: ! 515: `DBX_FUNCTION_FIRST' ! 516: Define this macro if the DBX information for a function and its ! 517: arguments should precede the assembler code for the function. ! 518: Normally, in DBX format, the debugging information entirely ! 519: follows the assembler code. ! 520: ! 521: `DBX_LBRAC_FIRST' ! 522: Define this macro if the `N_LBRAC' symbol for a block should ! 523: precede the debugging information for variables and functions ! 524: defined in that block. Normally, in DBX format, the `N_LBRAC' ! 525: symbol comes first. ! 526: ! 527: ! 528: File: gcc.info, Node: DBX Hooks, Next: File Names and DBX, Prev: DBX Options, Up: Debugging Info ! 529: ! 530: Open-Ended Hooks for DBX Format ! 531: ------------------------------- ! 532: ! 533: `DBX_OUTPUT_LBRAC (STREAM, NAME)' ! 534: Define this macro to say how to output to STREAM the debugging ! 535: information for the start of a scope level for variable names. The ! 536: argument NAME is the name of an assembler symbol (for use with ! 537: `assemble_name') whose value is the address where the scope begins. ! 538: ! 539: `DBX_OUTPUT_RBRAC (STREAM, NAME)' ! 540: Like `DBX_OUTPUT_LBRAC', but for the end of a scope level. ! 541: ! 542: `DBX_OUTPUT_ENUM (STREAM, TYPE)' ! 543: Define this macro if the target machine requires special handling ! 544: to output an enumeration type. The definition should be a C ! 545: statement (sans semicolon) to output the appropriate information ! 546: to STREAM for the type TYPE. ! 547: ! 548: `DBX_OUTPUT_FUNCTION_END (STREAM, FUNCTION)' ! 549: Define this macro if the target machine requires special output at ! 550: the end of the debugging information for a function. The ! 551: definition should be a C statement (sans semicolon) to output the ! 552: appropriate information to STREAM. FUNCTION is the ! 553: `FUNCTION_DECL' node for the function. ! 554: ! 555: `DBX_OUTPUT_STANDARD_TYPES (SYMS)' ! 556: Define this macro if you need to control the order of output of the ! 557: standard data types at the beginning of compilation. The argument ! 558: SYMS is a `tree' which is a chain of all the predefined global ! 559: symbols, including names of data types. ! 560: ! 561: Normally, DBX output starts with definitions of the types for ! 562: integers and characters, followed by all the other predefined ! 563: types of the particular language in no particular order. ! 564: ! 565: On some machines, it is necessary to output different particular ! 566: types first. To do this, define `DBX_OUTPUT_STANDARD_TYPES' to ! 567: output those symbols in the necessary order. Any predefined types ! 568: that you don't explicitly output will be output afterward in no ! 569: particular order. ! 570: ! 571: Be careful not to define this macro so that it works only for C. ! 572: There are no global variables to access most of the built-in ! 573: types, because another language may have another set of types. ! 574: The way to output a particular type is to look through SYMS to see ! 575: if you can find it. Here is an example: ! 576: ! 577: { ! 578: tree decl; ! 579: for (decl = syms; decl; decl = TREE_CHAIN (decl)) ! 580: if (!strcmp (IDENTIFIER_POINTER (DECL_NAME (decl)), ! 581: "long int")) ! 582: dbxout_symbol (decl); ! 583: ... ! 584: } ! 585: ! 586: This does nothing if the expected type does not exist. ! 587: ! 588: See the function `init_decl_processing' in `c-decl.c' to find the ! 589: names to use for all the built-in C types. ! 590: ! 591: Here is another way of finding a particular type: ! 592: ! 593: { ! 594: tree decl; ! 595: for (decl = syms; decl; decl = TREE_CHAIN (decl)) ! 596: if (TREE_CODE (decl) == TYPE_DECL ! 597: && (TREE_CODE (TREE_TYPE (decl)) ! 598: == INTEGER_CST) ! 599: && TYPE_PRECISION (TREE_TYPE (decl)) == 16 ! 600: && TYPE_UNSIGNED (TREE_TYPE (decl))) ! 601: /* This must be `unsigned short'. */ ! 602: dbxout_symbol (decl); ! 603: ... ! 604: } ! 605: ! 606: ! 607: File: gcc.info, Node: File Names and DBX, Next: SDB and DWARF, Prev: DBX Hooks, Up: Debugging Info ! 608: ! 609: File Names in DBX Format ! 610: ------------------------ ! 611: ! 612: `DBX_WORKING_DIRECTORY' ! 613: Define this if DBX wants to have the current directory recorded in ! 614: each object file. ! 615: ! 616: Note that the working directory is always recorded if GDB ! 617: extensions are enabled. ! 618: ! 619: `DBX_OUTPUT_MAIN_SOURCE_FILENAME (STREAM, NAME)' ! 620: A C statement to output DBX debugging information to the stdio ! 621: stream STREAM which indicates that file NAME is the main source ! 622: file--the file specified as the input file for compilation. This ! 623: macro is called only once, at the beginning of compilation. ! 624: ! 625: This macro need not be defined if the standard form of output for ! 626: DBX debugging information is appropriate. ! 627: ! 628: `DBX_OUTPUT_MAIN_SOURCE_DIRECTORY (STREAM, NAME)' ! 629: A C statement to output DBX debugging information to the stdio ! 630: stream STREAM which indicates that the current directory during ! 631: compilation is named NAME. ! 632: ! 633: This macro need not be defined if the standard form of output for ! 634: DBX debugging information is appropriate. ! 635: ! 636: `DBX_OUTPUT_MAIN_SOURCE_FILE_END (STREAM, NAME)' ! 637: A C statement to output DBX debugging information at the end of ! 638: compilation of the main source file NAME. ! 639: ! 640: If you don't define this macro, nothing special is output at the ! 641: end of compilation, which is correct for most machines. ! 642: ! 643: `DBX_OUTPUT_SOURCE_FILENAME (STREAM, NAME)' ! 644: A C statement to output DBX debugging information to the stdio ! 645: stream STREAM which indicates that file NAME is the current source ! 646: file. This output is generated each time input shifts to a ! 647: different source file as a result of `#include', the end of an ! 648: included file, or a `#line' command. ! 649: ! 650: This macro need not be defined if the standard form of output for ! 651: DBX debugging information is appropriate. ! 652: ! 653: ! 654: File: gcc.info, Node: SDB and DWARF, Prev: File Names and DBX, Up: Debugging Info ! 655: ! 656: Macros for SDB and DWARF Output ! 657: ------------------------------- ! 658: ! 659: `SDB_DEBUGGING_INFO' ! 660: Define this macro if GNU CC should produce COFF-style debugging ! 661: output for SDB in response to the `-g' option. ! 662: ! 663: `DWARF_DEBUGGING_INFO' ! 664: Define this macro if GNU CC should produce dwarf format debugging ! 665: output in response to the `-g' option. ! 666: ! 667: `PUT_SDB_...' ! 668: Define these macros to override the assembler syntax for the ! 669: special SDB assembler directives. See `sdbout.c' for a list of ! 670: these macros and their arguments. If the standard syntax is used, ! 671: you need not define them yourself. ! 672: ! 673: `SDB_DELIM' ! 674: Some assemblers do not support a semicolon as a delimiter, even ! 675: between SDB assembler directives. In that case, define this macro ! 676: to be the delimiter to use (usually `\n'). It is not necessary to ! 677: define a new set of `PUT_SDB_OP' macros if this is the only change ! 678: required. ! 679: ! 680: `SDB_GENERATE_FAKE' ! 681: Define this macro to override the usual method of constructing a ! 682: dummy name for anonymous structure and union types. See ! 683: `sdbout.c' for more information. ! 684: ! 685: `SDB_ALLOW_UNKNOWN_REFERENCES' ! 686: Define this macro to allow references to unknown structure, union, ! 687: or enumeration tags to be emitted. Standard COFF does not allow ! 688: handling of unknown references, MIPS ECOFF has support for it. ! 689: ! 690: `SDB_ALLOW_FORWARD_REFERENCES' ! 691: Define this macro to allow references to structure, union, or ! 692: enumeration tags that have not yet been seen to be handled. Some ! 693: assemblers choke if forward tags are used, while some require it. ! 694: ! 695: ! 696: File: gcc.info, Node: Cross-compilation, Next: Misc, Prev: Debugging Info, Up: Target Macros ! 697: ! 698: Cross Compilation and Floating Point ! 699: ==================================== ! 700: ! 701: While all modern machines use 2's complement representation for ! 702: integers, there are a variety of representations for floating point ! 703: numbers. This means that in a cross-compiler the representation of ! 704: floating point numbers in the compiled program may be different from ! 705: that used in the machine doing the compilation. ! 706: ! 707: Because different representation systems may offer different amounts ! 708: of range and precision, the cross compiler cannot safely use the host ! 709: machine's floating point arithmetic. Therefore, floating point ! 710: constants must be represented in the target machine's format. This ! 711: means that the cross compiler cannot use `atof' to parse a floating ! 712: point constant; it must have its own special routine to use instead. ! 713: Also, constant folding must emulate the target machine's arithmetic (or ! 714: must not be done at all). ! 715: ! 716: The macros in the following table should be defined only if you are ! 717: cross compiling between different floating point formats. ! 718: ! 719: Otherwise, don't define them. Then default definitions will be set ! 720: up which use `double' as the data type, `==' to test for equality, etc. ! 721: ! 722: You don't need to worry about how many times you use an operand of ! 723: any of these macros. The compiler never uses operands which have side ! 724: effects. ! 725: ! 726: `REAL_VALUE_TYPE' ! 727: A macro for the C data type to be used to hold a floating point ! 728: value in the target machine's format. Typically this would be a ! 729: `struct' containing an array of `int'. ! 730: ! 731: `REAL_VALUES_EQUAL (X, Y)' ! 732: A macro for a C expression which compares for equality the two ! 733: values, X and Y, both of type `REAL_VALUE_TYPE'. ! 734: ! 735: `REAL_VALUES_LESS (X, Y)' ! 736: A macro for a C expression which tests whether X is less than Y, ! 737: both values being of type `REAL_VALUE_TYPE' and interpreted as ! 738: floating point numbers in the target machine's representation. ! 739: ! 740: `REAL_VALUE_LDEXP (X, SCALE)' ! 741: A macro for a C expression which performs the standard library ! 742: function `ldexp', but using the target machine's floating point ! 743: representation. Both X and the value of the expression have type ! 744: `REAL_VALUE_TYPE'. The second argument, SCALE, is an integer. ! 745: ! 746: `REAL_VALUE_FIX (X)' ! 747: A macro whose definition is a C expression to convert the ! 748: target-machine floating point value X to a signed integer. X has ! 749: type `REAL_VALUE_TYPE'. ! 750: ! 751: `REAL_VALUE_UNSIGNED_FIX (X)' ! 752: A macro whose definition is a C expression to convert the ! 753: target-machine floating point value X to an unsigned integer. X ! 754: has type `REAL_VALUE_TYPE'. ! 755: ! 756: `REAL_VALUE_RNDZINT (X)' ! 757: A macro whose definition is a C expression to round the ! 758: target-machine floating point value X towards zero to an integer ! 759: value (but still as a floating point number). X has type ! 760: `REAL_VALUE_TYPE', and so does the value. ! 761: ! 762: `REAL_VALUE_UNSIGNED_RNDZINT (X)' ! 763: A macro whose definition is a C expression to round the ! 764: target-machine floating point value X towards zero to an unsigned ! 765: integer value (but still represented as a floating point number). ! 766: x has type `REAL_VALUE_TYPE', and so does the value. ! 767: ! 768: `REAL_VALUE_ATOF (STRING, MODE)' ! 769: A macro for a C expression which converts STRING, an expression of ! 770: type `char *', into a floating point number in the target machine's ! 771: representation for mode MODE. The value has type ! 772: `REAL_VALUE_TYPE'. ! 773: ! 774: `REAL_INFINITY' ! 775: Define this macro if infinity is a possible floating point value, ! 776: and therefore division by 0 is legitimate. ! 777: ! 778: `REAL_VALUE_ISINF (X)' ! 779: A macro for a C expression which determines whether X, a floating ! 780: point value, is infinity. The value has type `int'. By default, ! 781: this is defined to call `isinf'. ! 782: ! 783: `REAL_VALUE_ISNAN (X)' ! 784: A macro for a C expression which determines whether X, a floating ! 785: point value, is a "nan" (not-a-number). The value has type `int'. ! 786: By default, this is defined to call `isnan'. ! 787: ! 788: Define the following additional macros if you want to make floating ! 789: point constant folding work while cross compiling. If you don't define ! 790: them, cross compilation is still possible, but constant folding will ! 791: not happen for floating point values. ! 792: ! 793: `REAL_ARITHMETIC (OUTPUT, CODE, X, Y)' ! 794: A macro for a C statement which calculates an arithmetic operation ! 795: of the two floating point values X and Y, both of type ! 796: `REAL_VALUE_TYPE' in the target machine's representation, to ! 797: produce a result of the same type and representation which is ! 798: stored in OUTPUT (which will be a variable). ! 799: ! 800: The operation to be performed is specified by CODE, a tree code ! 801: which will always be one of the following: `PLUS_EXPR', ! 802: `MINUS_EXPR', `MULT_EXPR', `RDIV_EXPR', `MAX_EXPR', `MIN_EXPR'. ! 803: ! 804: The expansion of this macro is responsible for checking for ! 805: overflow. If overflow happens, the macro expansion should execute ! 806: the statement `return 0;', which indicates the inability to ! 807: perform the arithmetic operation requested. ! 808: ! 809: `REAL_VALUE_NEGATE (X)' ! 810: A macro for a C expression which returns the negative of the ! 811: floating point value X. Both X and the value of the expression ! 812: have type `REAL_VALUE_TYPE' and are in the target machine's ! 813: floating point representation. ! 814: ! 815: There is no way for this macro to report overflow, since overflow ! 816: can't happen in the negation operation. ! 817: ! 818: `REAL_VALUE_TRUNCATE (MODE, X)' ! 819: A macro for a C expression which converts the floating point value ! 820: X to mode MODE. ! 821: ! 822: Both X and the value of the expression are in the target machine's ! 823: floating point representation and have type `REAL_VALUE_TYPE'. ! 824: However, the value should have an appropriate bit pattern to be ! 825: output properly as a floating constant whose precision accords ! 826: with mode MODE. ! 827: ! 828: There is no way for this macro to report overflow. ! 829: ! 830: `REAL_VALUE_TO_INT (LOW, HIGH, X)' ! 831: A macro for a C expression which converts a floating point value X ! 832: into a double-precision integer which is then stored into LOW and ! 833: HIGH, two variables of type INT. ! 834: ! 835: `REAL_VALUE_FROM_INT (X, LOW, HIGH)' ! 836: A macro for a C expression which converts a double-precision ! 837: integer found in LOW and HIGH, two variables of type INT, into a ! 838: floating point value which is then stored into X. ! 839:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.