2 * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved.
4 * This file is part of libFirm.
6 * This file may be distributed and/or modified under the terms of the
7 * GNU General Public License version 2 as published by the Free Software
8 * Foundation and appearing in the file LICENSE.GPL included in the
9 * packaging of this file.
11 * Licensees holding valid libFirm Professional Edition licenses may use
12 * this file in accordance with the libFirm Commercial License.
13 * Agreement provided with the Software.
15 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * @brief Debug output support.
23 * @author Michael Beck
27 #ifndef FIRM_BE_BE_DBGOUT_H
28 #define FIRM_BE_BE_DBGOUT_H
33 typedef struct dbg_handle dbg_handle;
38 typedef struct debug_ops {
39 /** close the stabs handler. */
40 void (*close)(dbg_handle *handle);
42 /** start a new source object (compilation unit) */
43 void (*so)(dbg_handle *handle, const char *filename);
45 /** start an include file */
46 void (*include_begin)(dbg_handle *handle, const char *filename);
48 /** end an include file */
49 void (*include_end)(dbg_handle *handle);
52 void (*main_program)(dbg_handle *handle);
54 /** dumps the stabs for a method begin */
55 void (*method_begin)(dbg_handle *handle, ir_entity *ent, const be_stack_layout_t *layout);
57 /** dumps the stabs for a method end */
58 void (*method_end)(dbg_handle *handle);
60 /** dumps a line number */
61 void (*line)(dbg_handle *handle, unsigned lineno, const char *address);
64 void (*types)(dbg_handle *handle);
66 /** dump a variable in the global type */
67 void (*variable)(dbg_handle *h, struct obstack *obst, ir_entity *ent);
71 /** The base class of all debug implementations. */
76 /** close a debug handler. */
77 void be_dbg_close(dbg_handle *handle);
79 /** start a new source object (compilation unit) */
80 void be_dbg_so(dbg_handle *handle, const char *filename);
82 /** start an include file */
83 void be_dbg_include_begin(dbg_handle *handle, const char *filename);
85 /** end an include file */
86 void be_dbg_include_end(dbg_handle *handle);
89 void be_dbg_main_program(dbg_handle *handle);
91 /** debug for a method begin */
92 void be_dbg_method_begin(dbg_handle *handle, ir_entity *ent, const be_stack_layout_t *layout);
94 /** debug for a method end */
95 void be_dbg_method_end(dbg_handle *handle);
97 /** debug for line number */
98 void be_dbg_line(dbg_handle *handle, unsigned lineno, const char *address);
101 void be_dbg_types(dbg_handle *handle);
103 /** dump a variable in the global type */
104 void be_dbg_variable(dbg_handle *handle, struct obstack *obst, ir_entity *ent);
106 /** Opens the NULL handler: no debug support. */
107 dbg_handle *be_nulldbg_open(void);
109 /** Opens a stabs handler. */
110 dbg_handle *be_stabs_open(FILE *out);
112 #endif /* FIRM_BE_BE_DBGOUT_H */