Added support for SymConst(ofs_ent)
[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         /** Main Program */
26         void (*main_program)(dbg_handle *handle);
27
28         /** dumps the stabs for a method begin */
29         void (*method_begin)(dbg_handle *handle, entity *ent, const be_stack_layout_t *layout);
30
31         /** dumps the stabs for a method end */
32         void (*method_end)(dbg_handle *handle);
33
34         /** dumps a line number */
35         void (*line)(dbg_handle *handle, unsigned lineno, const char *address);
36
37         /** dump types */
38         void (*types)(dbg_handle *handle);
39
40         /** dump a variable in the global type */
41         void (*variable)(dbg_handle *h, struct obstack *obst, entity *ent);
42
43 } debug_ops;
44
45 /** The base class of all debug implementations. */
46 struct dbg_handle {
47         const debug_ops *ops;
48 };
49
50 /** close a debug handler. */
51 void be_dbg_close(dbg_handle *handle);
52
53 /** start a new source object (compilation unit) */
54 void be_dbg_so(dbg_handle *handle, const char *filename);
55
56 /** Main program */
57 void be_dbg_main_program(dbg_handle *handle);
58
59 /** debug for a method begin */
60 void be_dbg_method_begin(dbg_handle *handle, entity *ent, const be_stack_layout_t *layout);
61
62 /** debug for a method end */
63 void be_dbg_method_end(dbg_handle *handle);
64
65 /** debug for line number */
66 void be_dbg_line(dbg_handle *handle, unsigned lineno, const char *address);
67
68 /** dump types */
69 void be_dbg_types(dbg_handle *handle);
70
71 /** dump a variable in the global type */
72 void be_dbg_variable(dbg_handle *handle, struct obstack *obst, entity *ent);
73
74 /** Opens the NULL handler: no debug support. */
75 dbg_handle *be_nulldbg_open(void);
76
77 /** Opens a stabs handler. */
78 dbg_handle *be_stabs_open(FILE *out);
79
80 #endif /* __BE_DBGOUT_H__ */