OSDN Git Service

2001-02-20 Joel Sherrill <joel@OARcorp.com>
[pf3gnuchains/gcc-fork.git] / gcc / config / dbxcoff.h
1 /* Definitions needed when using stabs embedded in COFF sections.
2    Copyright (C) 1996 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, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA.  */
20
21 /* This file may be included by any COFF target which wishes to
22    support -gstabs generating stabs in sections, as produced by gas
23    and understood by gdb.  */
24
25 /* Output DBX (stabs) debugging information if doing -gstabs.  */
26
27 #undef DBX_DEBUGGING_INFO
28 #define DBX_DEBUGGING_INFO
29
30 /* Generate SDB debugging information by default. */
31
32 #ifndef PREFERRED_DEBUGGING_TYPE
33 #define PREFERRED_DEBUGGING_TYPE SDB_DEBUG
34 #endif
35
36 /* Be function-relative for block and source line stab directives.  */
37
38 #undef DBX_BLOCKS_FUNCTION_RELATIVE
39 #define DBX_BLOCKS_FUNCTION_RELATIVE 1
40
41 /* but, to make this work, functions must appear prior to line info.  */
42
43 #undef DBX_FUNCTION_FIRST
44 #define DBX_FUNCTION_FIRST
45
46 /* Generate a blank trailing N_SO to mark the end of the .o file, since
47    we can't depend upon the linker to mark .o file boundaries with
48    embedded stabs.  */
49
50 #undef DBX_OUTPUT_MAIN_SOURCE_FILE_END
51 #define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME)                 \
52   asm_fprintf (FILE,                                                    \
53                "\t.text\n\t.stabs \"\",%d,0,0,%LLetext\n%LLetext:\n", N_SO)
54
55 /* Like block addresses, stabs line numbers are relative to the
56    current function.  */
57
58 #undef ASM_OUTPUT_SOURCE_LINE
59 #define ASM_OUTPUT_SOURCE_LINE(FILE, LINE)                      \
60 { if (write_symbols == SDB_DEBUG) {                             \
61     fprintf ((FILE), "\t.ln\t%d\n",                             \
62              ((sdb_begin_function_line > -1)                    \
63               ? (LINE) - sdb_begin_function_line : 1));         \
64   } else if (write_symbols == DBX_DEBUG) {                      \
65     static int sym_lineno = 1;                                  \
66     char buffer[256];                                           \
67     ASM_GENERATE_INTERNAL_LABEL (buffer, "LM", sym_lineno);     \
68     fprintf (FILE, ".stabn 68,0,%d,", LINE);                    \
69     assemble_name (FILE, buffer);                               \
70     putc ('-', FILE);                                           \
71     assemble_name (FILE,                                        \
72                    XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); \
73     putc ('\n', FILE);                                          \
74     ASM_OUTPUT_INTERNAL_LABEL (FILE, "LM", sym_lineno);         \
75     sym_lineno++;                                               \
76   } }
77
78 /* When generating stabs debugging, use N_BINCL entries.  */
79
80 #undef DBX_USE_BINCL
81 #define DBX_USE_BINCL
82
83 /* There is no limit to the length of stabs strings.  */
84
85 #ifndef DBX_CONTIN_LENGTH
86 #define DBX_CONTIN_LENGTH 0
87 #endif