beifg: Simplify the implementation of be_ifg_foreach_node().
[libfirm] / win32 / firmEvaluator / firmEvaluator.h
1 /*
2  * Firm - Evaluator
3  *
4  * (C) 2005 Michael Beck    beck@ipd.info.uni-karlsruhe.de
5  */
6 #ifndef __FIRM_EVALUATOR_H__
7 #define __FIRM_EVALUATOR_H__
8
9 typedef struct tagDEBUGHELPER {
10   DWORD dwVersion;
11   BOOL (WINAPI *ReadDebuggeeMemory)( struct tagDEBUGHELPER *pThis, DWORD dwAddr, DWORD nWant, VOID* pWhere, DWORD *nGot );
12   /* from here only when dwVersion >= 0x20000 */
13   DWORDLONG (WINAPI *GetRealAddress)( struct tagDEBUGHELPER *pThis );
14   BOOL (WINAPI *ReadDebuggeeMemoryEx)( struct tagDEBUGHELPER *pThis, DWORDLONG qwAddr, DWORD nWant, VOID* pWhere, DWORD *nGot );
15   int (WINAPI *GetProcessorType)( struct tagDEBUGHELPER *pThis );
16 } DEBUGHELPER;
17
18 typedef HRESULT (WINAPI *CUSTOMVIEWER)( void *address, DEBUGHELPER *pHelper, int nBase, BOOL bUniStrings, char *pResult, size_t max, DWORD reserved );
19
20 /**
21  * Copy from debuggee
22  *
23  * @param address  address in debuggee's space to copy from
24  * @param pHelper  debugger helper
25  * @param dst      pointer in our space to copy to
26  * @param size     number of bytes to copy
27  */
28 HRESULT copy_from_debuggee(const void *address, DEBUGHELPER *pHelper, void *dst, DWORD size);
29
30 /**
31  * return the size of a firm object
32  *
33  * @kind  the firm kind
34  */
35 int get_firm_object_size(firm_kind kind);
36
37 /**
38  * Format an ident
39  *
40  * @param pHelper  debugger helper
41  * @param address  ident address in debuggee's space
42  * @param pResult  string buffer
43  * @param max      length of the string buffer
44  */
45 HRESULT format_ident(DEBUGHELPER *pHelper, const void *address, char *pResult, size_t max);
46
47 /**
48  * Format an ir_op
49  *
50  * @param pHelper  debugger helper
51  * @param address  ident address in debuggee's space
52  * @param pResult  string buffer
53  * @param max      length of the string buffer
54  */
55 HRESULT format_op(DEBUGHELPER *pHelper, const void *address, char *pResult, size_t max);
56
57 /**
58  * Format a pset
59  *
60  * @param pHelper  debugger helper
61  * @param nBase    base for number's
62  * @param address  pset address in debuggee's space
63  * @param pResult  string buffer
64  * @param max      length of the string buffer
65  */
66 HRESULT format_pset(DEBUGHELPER *pHelper, int nBase, const void *address, char *pResult, size_t max);
67
68 /**
69  * Format a set
70  *
71  * @param pHelper  debugger helper
72  * @param nBase    base for number's
73  * @param address  set address in debuggee's space
74  * @param pResult  string buffer
75  * @param max      length of the string buffer
76  */
77 HRESULT format_set(DEBUGHELPER *pHelper, int nBase, const void *address, char *pResult, size_t max);
78
79 /**
80  * Format an array descriptor
81  *
82  * @param pHelper  debugger helper
83  * @param nBase    base for number's
84  * @param address  array descriptor address in debuggee's space
85  * @param pResult  string buffer
86  * @param max      length of the string buffer
87  */
88 HRESULT format_arr_descr(DEBUGHELPER *pHelper, int nBase, const void *address, char *pResult, size_t max);
89
90 /**
91  * Format a pointer double ended queue
92  *
93  * @param pHelper  debugger helper
94  * @param nBase    base for number's
95  * @param address  pdeq address in debuggee's space
96  * @param pResult  string buffer
97  * @param max      length of the string buffer
98  */
99 HRESULT format_pdeq(DEBUGHELPER *pHelper, int nBase, const void *address, char *pResult, size_t max);
100
101 /*
102  * Format a bitset
103  *
104  * @param pHelper  debugger helper
105  * @param nBase    base for number's
106  * @param address  bitset address in debuggee's space
107  * @param pResult  string buffer
108  * @param max      length of the string buffer
109  */
110 HRESULT format_bitset(DEBUGHELPER *pHelper, int nBase, const void *address, char *pResult, size_t max);
111
112 /**
113  * format a firm object
114  *
115  * @param pHelper  debugger helper
116  * @param nBase    base for number's
117  * @param kind     Firm kind
118  * @param address  firm object address in debuggee's space
119  * @param pResult  string buffer
120  * @param max      length of the string buffer
121  */
122 HRESULT FormatFirmObject(DEBUGHELPER *pHelper, int nBase, firm_kind kind, const void *address, char *pResult, size_t max);
123
124 #endif /* __FIRM_EVALUATOR_H__ */