rewritten be_ssa_constr which isn't using sets anymore, started working on a 'state...
[libfirm] / ir / be / be_dbgout.h
1 #ifndef __BE_DBGOUT_H__
2 #define __BE_DBGOUT_H__
3 /**
4  * Debug output support.
5  *
6  * @author Michael Beck
7  * @date   11.9.2006
8  * @cvsid  $Id$
9  */
10 #include "obst.h"
11 #include "beabi_t.h"
12
13 typedef struct dbg_handle dbg_handle;
14
15 /**
16  * Debug operations.
17  */
18 typedef struct debug_ops {
19         /** close the stabs handler. */
20         void (*close)(dbg_handle *handle);
21
22         /** start a new source object (compilation unit) */
23         void (*so)(dbg_handle *handle, const char *filename);
24
25         /** start an include file */
26         void (*include_begin)(dbg_handle *handle, const char *filename);
27
28         /** end an include file */
29         void (*include_end)(dbg_handle *handle);
30
31         /** Main Program */
32         void (*main_program)(dbg_handle *handle);
33
34         /** dumps the stabs for a method begin */
35         void (*method_begin)(dbg_handle *handle, ir_entity *ent, const be_stack_layout_t *layout);
36
37         /** dumps the stabs for a method end */
38         void (*method_end)(dbg_handle *handle);
39
40         /** dumps a line number */
41         void (*line)(dbg_handle *handle, unsigned lineno, const char *address);
42
43         /** dump types */
44         void (*types)(dbg_handle *handle);
45
46         /** dump a variable in the global type */
47         void (*variable)(dbg_handle *h, struct obstack *obst, ir_entity *ent);
48
49 } debug_ops;
50
51 /** The base class of all debug implementations. */
52 struct dbg_handle {
53         const debug_ops *ops;
54 };
55
56 /** close a debug handler. */
57 void be_dbg_close(dbg_handle *handle);
58
59 /** start a new source object (compilation unit) */
60 void be_dbg_so(dbg_handle *handle, const char *filename);
61
62 /** start an include file */
63 void be_dbg_include_begin(dbg_handle *handle, const char *filename);
64
65 /** end an include file */
66 void be_dbg_include_end(dbg_handle *handle);
67
68 /** Main program */
69 void be_dbg_main_program(dbg_handle *handle);
70
71 /** debug for a method begin */
72 void be_dbg_method_begin(dbg_handle *handle, ir_entity *ent, const be_stack_layout_t *layout);
73
74 /** debug for a method end */
75 void be_dbg_method_end(dbg_handle *handle);
76
77 /** debug for line number */
78 void be_dbg_line(dbg_handle *handle, unsigned lineno, const char *address);
79
80 /** dump types */
81 void be_dbg_types(dbg_handle *handle);
82
83 /** dump a variable in the global type */
84 void be_dbg_variable(dbg_handle *handle, struct obstack *obst, ir_entity *ent);
85
86 /** Opens the NULL handler: no debug support. */
87 dbg_handle *be_nulldbg_open(void);
88
89 /** Opens a stabs handler. */
90 dbg_handle *be_stabs_open(FILE *out);
91
92 #endif /* __BE_DBGOUT_H__ */