added initial stabs debugging support
[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 typedef struct dbg_handle dbg_handle;
11
12 /**
13  * Debug operations.
14  */
15 typedef struct debug_ops {
16         /** close the stabs handler. */
17         void (*close)(dbg_handle *h);
18
19         /** begin a new file */
20         void (*begin)(dbg_handle *handle, const char *filename);
21
22         /** prints the stabs for a function */
23         void (*method)(dbg_handle *h, entity *ent);
24
25         /** prints a line number */
26         void (*line)(dbg_handle *h, unsigned lineno, const char *address);
27 } debug_ops;
28
29 /** The base class of all debug implementations. */
30 struct dbg_handle {
31         const debug_ops *ops;
32 };
33
34 /** close a debug handler. */
35 void be_dbg_close(dbg_handle *h);
36
37 /** begin a new file */
38 void be_dbg_begin(dbg_handle *handle, const char *filename);
39
40 /** debug for a function */
41 void be_dbg_method(dbg_handle *h, entity *ent);
42
43 /** debug for line number */
44 void be_dbg_line(dbg_handle *h, unsigned lineno, const char *address);
45
46 /** Opens a stabs handler. */
47 dbg_handle *be_stabs_open(FILE *out);
48
49 #endif /* __BE_DBGOUT_H__ */