do not use struct function pointers elsewhere, use them only in case

when polymorphysm needed
This commit is contained in:
2020-02-03 15:04:09 +04:00
parent b79db14d0c
commit 810ce7519d
15 changed files with 609 additions and 749 deletions
+5 -12
View File
@@ -18,18 +18,7 @@
// pst_function
// -----------------------------------------------------------------------------------
typedef struct __pst_function {
list_node node; // uplink. !!! must be first !!!
void (*clear) (pst_function* fn);
pst_parameter* (*add_param) (pst_function* fn);
void (*del_param) (pst_parameter* p);
pst_parameter* (*next_param) (pst_function* fn, pst_parameter* p);
bool (*unwind) (pst_function* fn, Dwarf_Addr addr);
bool (*handle_dwarf) (pst_function* fn, Dwarf_Die* d);
bool (*print_dwarf) (pst_function* fn);
bool (*handle_lexical_block) (pst_function* fn, Dwarf_Die* result);
bool (*get_frame) (pst_function* fn);
list_node node;
Dwarf_Addr lowpc; // offset to start of the function against base address
Dwarf_Addr highpc; // offset to the next address after the end of the function against base address
@@ -53,4 +42,8 @@ void pst_function_init(pst_function* fn, pst_context* _ctx, __pst_function* _par
void pst_function_fini(pst_function* fn);
pst_function* pst_function_new(pst_context* _ctx, __pst_function* _parent);
bool pst_function_unwind(pst_function* fn, Dwarf_Addr addr);
bool pst_function_handle_dwarf(pst_function * fn, Dwarf_Die* d);
bool pst_function_print_dwarf(pst_function* fn);
#endif /* FRAMEWORK_DWARF_FUNCTION_H_ */