82f948bd02b3d904ae503998b5b34502ba124128
[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
12 typedef struct dbg_handle dbg_handle;
13
14 /**
15  * Debug operations.
16  */
17 typedef struct debug_ops {
18         /** close the stabs handler. */
19         void (*close)(dbg_handle *handle);
20
21         /** start a new source object (compilation unit) */
22         void (*so)(dbg_handle *handle, const char *filename);
23
24         /** Main Program */
25         void (*main_program)(dbg_handle *handle);
26
27         /** dumps the stabs for a function */
28         void (*method)(dbg_handle *handle, entity *ent);
29
30         /** dumps a line number */
31         void (*line)(dbg_handle *handle, unsigned lineno, const char *address);
32
33         /** dump types */
34         void (*types)(dbg_handle *handle);
35
36         /** dump a global */
37         void (*global)(dbg_handle *h, struct obstack *obst, entity *ent);
38
39 } debug_ops;
40
41 /** The base class of all debug implementations. */
42 struct dbg_handle {
43         const debug_ops *ops;
44 };
45
46 /** close a debug handler. */
47 void be_dbg_close(dbg_handle *handle);
48
49 /** start a new source object (compilation unit) */
50 void be_dbg_so(dbg_handle *handle, const char *filename);
51
52 /** Main program */
53 void be_dbg_main_program(dbg_handle *handle);
54
55 /** debug for a function */
56 void be_dbg_method(dbg_handle *handle, entity *ent);
57
58 /** debug for line number */
59 void be_dbg_line(dbg_handle *handle, unsigned lineno, const char *address);
60
61 /** dump types */
62 void be_dbg_types(dbg_handle *handle);
63
64 /** dump a global */
65 void be_dbg_global(dbg_handle *handle, struct obstack *obst, entity *ent);
66
67 /** Opens a stabs handler. */
68 dbg_handle *be_stabs_open(FILE *out);
69
70 #endif /* __BE_DBGOUT_H__ */