OSDN Git Service

Daily bump.
[pf3gnuchains/gcc-fork.git] / gcc / debug.h
1 /* Debug hooks for GCC.
2    Copyright (C) 2001 Free Software Foundation, Inc.
3
4 This program is free software; you can redistribute it and/or modify it
5 under the terms of the GNU General Public License as published by the
6 Free Software Foundation; either version 2, or (at your option) any
7 later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
17
18 #ifndef GCC_DEBUG_H
19 #define GCC_DEBUG_H
20
21 union tree_node;
22 struct rtx_def;
23
24 /* This structure contains hooks for the debug information output
25    functions, accessed through the global instance debug_hooks set in
26    toplev.c according to command line options.  */
27 struct gcc_debug_hooks
28 {
29   /* Initialise debug output.  MAIN_FILENAME is the name of the main
30      input file.  */
31   void (* init) PARAMS ((const char *main_filename));
32
33   /* Output debug symbols.  */
34   void (* finish) PARAMS ((const char *main_filename));
35
36   /* Macro defined on line LINE with name and expansion TEXT.  */
37   void (* define) PARAMS ((unsigned int line, const char *text));
38
39   /* MACRO undefined on line LINE.  */
40   void (* undef) PARAMS ((unsigned int line, const char *macro));
41
42   /* Record the beginning of a new source file FILE from LINE number
43      in the previous one.  */
44   void (* start_source_file) PARAMS ((unsigned int line, const char *file));
45
46   /* Record the resumption of a source file.  LINE is the line number
47      in the source file we are returning to.  */
48   void (* end_source_file) PARAMS ((unsigned int line));
49
50   /* Record the beginning of block N, counting from 1 and not
51      including the function-scope block, at LINE.  */
52   void (* begin_block) PARAMS ((unsigned int line, unsigned int n));
53
54   /* Record the end of a block.  Arguments as for begin_block.  */
55   void (* end_block) PARAMS ((unsigned int line, unsigned int n));
56
57   /* Returns nonzero if it is appropriate not to emit any debugging
58      information for BLOCK, because it doesn't contain any
59      instructions.  This may not be the case for blocks containing
60      nested functions, since we may actually call such a function even
61      though the BLOCK information is messed up.  Defaults to true.  */
62   bool (* ignore_block) PARAMS ((union tree_node *));
63
64   /* Record a source file location at (FILE, LINE).  */
65   void (* source_line) PARAMS ((unsigned int line, const char *file));
66
67   /* Called at start of prologue code.  LINE is the first line in the
68      function.  This has been given the same prototype as source_line,
69      so that the source_line hook can be substituted if appropriate.  */
70   void (* begin_prologue) PARAMS ((unsigned int line, const char *file));
71
72   /* Called at end of prologue code.  LINE is the first line in the
73      function.  */
74   void (* end_prologue) PARAMS ((unsigned int line));
75
76   /* Record end of epilogue code.  */
77   void (* end_epilogue) PARAMS ((void));
78
79   /* Called at start of function DECL, before it is declared.  */
80   void (* begin_function) PARAMS ((union tree_node *decl));
81
82   /* Record end of function.  LINE is highest line number in function.  */
83   void (* end_function) PARAMS ((unsigned int line));
84
85   /* Debug information for a function DECL.  This might include the
86      function name (a symbol), its parameters, and the block that
87      makes up the function's body, and the local variables of the
88      function.  */
89   void (* function_decl) PARAMS ((union tree_node *decl));
90
91   /* Debug information for a global DECL.  Called from toplev.c after
92      compilation proper has finished.  */
93   void (* global_decl) PARAMS ((union tree_node *decl));
94
95   /* DECL is an inline function, whose body is present, but which is
96      not being output at this point.  */
97   void (* deferred_inline_function) PARAMS ((union tree_node *decl));
98
99   /* DECL is an inline function which is about to be emitted out of
100      line.  The hook is useful to, e.g., emit abstract debug info for
101      the inline before it gets mangled by optimization.  */
102   void (* outlining_inline_function) PARAMS ((union tree_node *decl));
103
104   /* Called from final_scan_insn for any CODE_LABEL insn whose
105      LABEL_NAME is non-null.  */
106   void (* label) PARAMS ((struct rtx_def *insn));
107 };
108
109 extern struct gcc_debug_hooks *debug_hooks;
110
111 /* The do-nothing hooks.  */
112 extern void debug_nothing_void
113   PARAMS ((void));
114 extern void debug_nothing_charstar
115   PARAMS ((const char *));
116 extern void debug_nothing_int_charstar
117   PARAMS ((unsigned int, const char *));
118 extern void debug_nothing_int
119   PARAMS ((unsigned int));
120 extern void debug_nothing_int_int
121   PARAMS ((unsigned int, unsigned int));
122 extern void debug_nothing_tree
123   PARAMS ((union tree_node *));
124 extern bool debug_true_tree
125   PARAMS ((union tree_node *));
126 extern void debug_nothing_rtx
127   PARAMS ((struct rtx_def *));
128
129 /* Hooks for various debug formats.  */
130 extern struct gcc_debug_hooks do_nothing_debug_hooks;
131 extern struct gcc_debug_hooks dbx_debug_hooks;
132 extern struct gcc_debug_hooks sdb_debug_hooks;
133 extern struct gcc_debug_hooks xcoff_debug_hooks;
134 extern struct gcc_debug_hooks dwarf_debug_hooks;
135 extern struct gcc_debug_hooks dwarf2_debug_hooks;
136
137 /* Dwarf2 frame information.  */
138
139 /* FILE is NULL iff being called for frame information for non-dwarf
140    debug output.  */
141 extern void dwarf2out_begin_prologue
142   PARAMS ((unsigned int, const char * file));
143 extern void dwarf2out_end_epilogue
144   PARAMS ((void));
145 extern void dwarf2out_frame_init
146   PARAMS ((void));
147 extern void dwarf2out_frame_finish
148   PARAMS ((void));
149 /* Decide whether we want to emit frame unwind information for the current
150    translation unit.  */
151 extern int dwarf2out_do_frame
152   PARAMS ((void));
153
154 #endif /* !GCC_DEBUG_H  */