use bitset for parameter state instead of separate boolean fields

This commit is contained in:
2020-04-16 13:45:26 +04:00
parent 5a1dd37dd4
commit f9f26f5f7d
3 changed files with 24 additions and 22 deletions
+8 -4
View File
@@ -8,7 +8,7 @@
#ifndef INCLUDE_LIBPST_TYPES_H_
#define INCLUDE_LIBPST_TYPES_H_
#include <stdbool.h>
#include <stdint.h>
#include <libunwind.h>
typedef struct pst_function_info {
@@ -18,14 +18,18 @@ typedef struct pst_function_info {
unw_word_t pc; ///< address between LowPC & HighPC (plus base address offset). actually, address of currently executed command in function
} pst_function_info;
typedef enum {
PARAM_RETURN = 1, ///< parameter is return value of a function
PARAM_VARIABLE = 2, ///< parameter is variable inside of a function
PARAM_HAS_VALUE = 4 ///< parameter has a valid value (if not set, then value is undefined)
} pst_param_flags;
typedef struct pst_parameter_info {
char* name; ///< parameter's name
uint32_t line; ///< line of parameter definition
unw_word_t size; ///< size of parameter in bytes
unw_word_t value; ///< value of parameter. currently only base types supported. use 'size' to determine number of actual bytes of value
bool is_return; ///< whether this parameter is return value of the function
bool is_variable; ///< whether this parameter is function variable or argument of function
bool has_value; ///< whether we got value of parameter or not
pst_param_flags flags; ///< flags of various parameter's options
} pst_parameter_info;
#endif /* INCLUDE_LIBPST_TYPES_H_ */