we don't need no stinking selfs
[libfirm] / ir / be / be_dbgout_t.h
1 /*
2  * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
3  *
4  * This file is part of libFirm.
5  *
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.
10  *
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.
14  *
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
17  * PURPOSE.
18  */
19
20 /**
21  * @file
22  * @brief   Debug output support.
23  * @author  Michael Beck
24  * @date    11.9.2006
25  * @version $Id: be_dbgout.h 17143 2008-01-02 20:56:33Z beck $
26  */
27 #ifndef FIRM_BE_BE_DBGOUT_T_H
28 #define FIRM_BE_BE_DBGOUT_T_H
29
30 #include "obst.h"
31 #include "beabi_t.h"
32 #include "firm_types.h"
33
34 typedef struct dbg_handle dbg_handle;
35
36 /**
37  * Debug operations.
38  */
39 typedef struct debug_ops {
40         /** close the stabs handler. */
41         void (*close)(dbg_handle *handle);
42
43         /** start a new source object (compilation unit) */
44         void (*so)(dbg_handle *handle, const char *filename);
45
46         /** Main Program */
47         void (*main_program)(dbg_handle *handle);
48
49         /** dumps the stabs for a method begin */
50         void (*method_begin)(dbg_handle *handle, ir_entity *ent, const be_stack_layout_t *layout);
51
52         /** dumps the stabs for a method end */
53         void (*method_end)(dbg_handle *handle);
54
55         /** dump types */
56         void (*types)(dbg_handle *handle);
57
58         /** dump a variable in the global type */
59         void (*variable)(dbg_handle *h, ir_entity *ent);
60
61         /** notify debug info about position change */
62         void (*set_dbg_info)(dbg_handle *h, dbg_info *dbgi);
63 } debug_ops;
64
65 /** The base class of all debug implementations. */
66 struct dbg_handle {
67         const debug_ops *ops;
68 };
69
70 typedef dbg_handle* (*be_create_dbgout_module_func)(void);
71 void be_register_dbgout_module(const char *name,
72                                be_create_dbgout_module_func func);
73
74 #endif