]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/config/dbxcoff.h
dbxout.c (dbxout_source_line_counter): New global variable.
[thirdparty/gcc.git] / gcc / config / dbxcoff.h
CommitLineData
e786ce55
ILT
1/* Definitions needed when using stabs embedded in COFF sections.
2 Copyright (C) 1996 Free Software Foundation, Inc.
3
4This file is part of GNU CC.
5
6GNU CC is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2, or (at your option)
9any later version.
10
11GNU CC is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with GNU CC; see the file COPYING. If not, write to
18the Free Software Foundation, 59 Temple Place - Suite 330,
19Boston, 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
23532de9 27#define DBX_DEBUGGING_INFO 1
e786ce55 28
991b6592 29/* Generate SDB debugging information by default. */
e786ce55
ILT
30
31#ifndef PREFERRED_DEBUGGING_TYPE
32#define PREFERRED_DEBUGGING_TYPE SDB_DEBUG
33#endif
34
35/* Be function-relative for block and source line stab directives. */
36
e400d782 37#undef DBX_BLOCKS_FUNCTION_RELATIVE
e786ce55
ILT
38#define DBX_BLOCKS_FUNCTION_RELATIVE 1
39
40/* but, to make this work, functions must appear prior to line info. */
41
e400d782 42#undef DBX_FUNCTION_FIRST
e786ce55
ILT
43#define DBX_FUNCTION_FIRST
44
45/* Generate a blank trailing N_SO to mark the end of the .o file, since
46 we can't depend upon the linker to mark .o file boundaries with
47 embedded stabs. */
48
e400d782 49#undef DBX_OUTPUT_MAIN_SOURCE_FILE_END
e786ce55 50#define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME) \
3d3fcaef
AS
51 asm_fprintf (FILE, \
52 "\t.text\n\t.stabs \"\",%d,0,0,%LLetext\n%LLetext:\n", N_SO)
e786ce55
ILT
53
54/* Like block addresses, stabs line numbers are relative to the
55 current function. */
56
57#undef ASM_OUTPUT_SOURCE_LINE
a8d0467e 58#define ASM_OUTPUT_SOURCE_LINE(FILE, LINE, COUNTER) \
e786ce55
ILT
59{ if (write_symbols == SDB_DEBUG) { \
60 fprintf ((FILE), "\t.ln\t%d\n", \
61 ((sdb_begin_function_line > -1) \
62 ? (LINE) - sdb_begin_function_line : 1)); \
63 } else if (write_symbols == DBX_DEBUG) { \
1733ed29 64 char buffer[256]; \
a8d0467e 65 ASM_GENERATE_INTERNAL_LABEL (buffer, "LM", COUNTER); \
1733ed29
MM
66 fprintf (FILE, ".stabn 68,0,%d,", LINE); \
67 assemble_name (FILE, buffer); \
68 putc ('-', FILE); \
e786ce55
ILT
69 assemble_name (FILE, \
70 XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); \
1733ed29 71 putc ('\n', FILE); \
a8d0467e 72 (*targetm.asm_out.internal_label) (FILE, "LM", COUNTER); \
e786ce55 73 } }
a4f0488b
ILT
74
75/* When generating stabs debugging, use N_BINCL entries. */
76
e400d782 77#undef DBX_USE_BINCL
a4f0488b
ILT
78#define DBX_USE_BINCL
79
80/* There is no limit to the length of stabs strings. */
81
82#ifndef DBX_CONTIN_LENGTH
83#define DBX_CONTIN_LENGTH 0
84#endif