Pass pointer to RTX when calling alter_subreg().
[official-gcc.git] / gcc / debug.h
blob865e5f86e1b00445c6bc70d9dc1aca513e1513b8
1 /* Debug hooks for GCC.
2 Copyright (C) 2001 Free Software Foundation, Inc.
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.
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.
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. */
18 #ifndef GCC_DEBUG_H
19 #define GCC_DEBUG_H
21 union tree_node;
22 struct rtx_def;
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
29 /* Initialise debug output. MAIN_FILENAME is the name of the main
30 input file. */
31 void (* init) PARAMS ((const char *main_filename));
33 /* Output debug symbols. */
34 void (* finish) PARAMS ((const char *main_filename));
36 /* Macro defined on line LINE with name and expansion TEXT. */
37 void (* define) PARAMS ((unsigned int line, const char *text));
39 /* MACRO undefined on line LINE. */
40 void (* undef) PARAMS ((unsigned int line, const char *macro));
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));
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));
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));
54 /* Record the end of a block. Arguments as for begin_block. */
55 void (* end_block) PARAMS ((unsigned int line, unsigned int n));
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 *));
64 /* Record a source file location at (FILE, LINE). */
65 void (* source_line) PARAMS ((unsigned int line, const char *file));
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));
72 /* Called at end of prologue code. LINE is the first line in the
73 function. */
74 void (* end_prologue) PARAMS ((unsigned int line));
76 /* Record end of epilogue code. */
77 void (* end_epilogue) PARAMS ((void));
79 /* Called at start of function DECL, before it is declared. */
80 void (* begin_function) PARAMS ((union tree_node *decl));
82 /* Record end of function. LINE is highest line number in function. */
83 void (* end_function) PARAMS ((unsigned int line));
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));
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));
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));
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));
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));
109 extern struct gcc_debug_hooks *debug_hooks;
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 *));
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 extern struct gcc_debug_hooks vmsdbg_debug_hooks;
138 /* Dwarf2 frame information. */
140 extern void dwarf2out_begin_prologue PARAMS ((unsigned int, const char *));
141 extern void dwarf2out_end_epilogue PARAMS ((void));
142 extern void dwarf2out_frame_init PARAMS ((void));
143 extern void dwarf2out_frame_finish PARAMS ((void));
144 /* Decide whether we want to emit frame unwind information for the current
145 translation unit. */
146 extern int dwarf2out_do_frame PARAMS ((void));
148 /* When writing VMS debug info, output label after the prologue of the
149 function. */
150 extern void vmsdbgout_after_prologue PARAMS ((void));
154 #endif /* !GCC_DEBUG_H */