code hierarchy refactoring
This commit is contained in:
@@ -43,19 +43,16 @@ BIN = $(RESULT_DIR)/trace
|
||||
# )
|
||||
|
||||
#source file search path. add here new directories which contains files specified for $(SRC)
|
||||
VPATH = ./
|
||||
VPATH = ./tests
|
||||
|
||||
SRC = $(shell find . -name '*.cpp')
|
||||
#OBJ = $(patsubst %.cpp,%.o,$(addprefix $(BUILD_DIR)/,$(notdir $(SRC))))
|
||||
OBJ = $(BUILD_DIR)/main.o
|
||||
|
||||
LIBS = -L./ -lpthread -luuid -ldl -ldw -lunwind -lunwind-x86_64 -lstdc++
|
||||
ATR_LIBS = ./build/libframework.a
|
||||
LIBS = -L./ -lpthread -ldl -ldw -lunwind -lunwind-x86_64 -lstdc++
|
||||
PST_LIBS = ./build/libpst.a
|
||||
|
||||
INCS = -I./ \
|
||||
-I/usr/include/postgresql -I /usr/include/libxml2 -I./thirdparty -I/opt/swifttest/include -I/usr/include/GraphicsMagick \
|
||||
-I./framework -I./framework/swi -I./framework/utils -I./framework/rmq -I./framework/logger -I$(BUILD_DIR)
|
||||
#FLAGS = -Wall -gdwarf-4 -fPIC -O3 -rdynamic -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -std=c++11
|
||||
INCS = -I./include -I./src
|
||||
FLAGS = -Wall -ggdb -fPIC -O3 -rdynamic -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
|
||||
|
||||
|
||||
@@ -63,12 +60,12 @@ FLAGS = -Wall -ggdb -fPIC -O3 -rdynamic -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_M
|
||||
|
||||
all: $(BIN)
|
||||
|
||||
$(ATR_LIBS):
|
||||
@make -C ./framework
|
||||
$(PST_LIBS):
|
||||
@make -C ./src
|
||||
|
||||
clean:
|
||||
${RM} $(BUILD_DIR)/*.o $(BUILD_DIR)/*.dep $(BIN) $(BUILD_DIR)/prepare.bld $(RESULT_DIR)/prepare.res $(BUILD_DIR)/version.h
|
||||
@make clean -C ./framework
|
||||
@make clean -C ./src
|
||||
@if [ -z "$$(ls -A $(BUILD_DIR) 2>&1)" ]; then ${RM} -r $(BUILD_DIR); fi
|
||||
@if [ -z "$$(ls -A $(RESULT_DIR) 2>&1)" ]; then ${RM} -r $(RESULT_DIR); fi
|
||||
|
||||
@@ -80,11 +77,11 @@ $(RESULT_DIR)/prepare.res:
|
||||
@if [ ! -e $(RESULT_DIR) ]; then mkdir -vp $(RESULT_DIR); fi
|
||||
@touch $@
|
||||
|
||||
$(BIN): $(BUILD_DIR)/prepare.bld $(RESULT_DIR)/prepare.res $(OBJ) $(ATR_LIBS)
|
||||
gcc -ggdb -O3 -o $(BUILD_DIR)/simple simple.cpp
|
||||
@make -C ./framework
|
||||
$(BIN): $(BUILD_DIR)/prepare.bld $(RESULT_DIR)/prepare.res $(OBJ) $(PST_LIBS)
|
||||
gcc -ggdb -O3 -o $(BUILD_DIR)/simple ./tests/simple.cpp
|
||||
@make -C ./src
|
||||
@printf "Create %-60s" $@
|
||||
@OUT=$$($(CXX) $(COLOR) -o $@ $(OBJ) $(ATR_LIBS) $(LIBS) 2>&1); \
|
||||
@OUT=$$($(CXX) $(COLOR) -o $@ $(OBJ) $(PST_LIBS) $(LIBS) 2>&1); \
|
||||
if [ $$? -ne "0" ]; \
|
||||
then echo -e "${RED}[FAILED]${NC}"; echo -e "$$OUT"; \
|
||||
else \
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
/build/
|
||||
/libframework.a
|
||||
@@ -5,31 +5,26 @@
|
||||
* Author: nnosov
|
||||
*/
|
||||
|
||||
#ifndef SC_SYSUTILS_H_
|
||||
#define SC_SYSUTILS_H_
|
||||
#ifndef PST_HANDLER_H_
|
||||
#define PST_HANDLER_H_
|
||||
|
||||
//system
|
||||
#include <ucontext.h>
|
||||
/*
|
||||
#include <netdb.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <vector>
|
||||
#include <string.h>
|
||||
#include <ucontext.h>
|
||||
#include <libunwind.h>
|
||||
#include <elfutils/libdwfl.h>
|
||||
#include <dlfcn.h>
|
||||
#include <stdlib.h>
|
||||
*/
|
||||
|
||||
#include "allocator.h"
|
||||
#include "common.h"
|
||||
#include "utils/list_head.h"
|
||||
#include "context.h"
|
||||
#include "allocator.h"
|
||||
#include "list_head.h"
|
||||
#include "dwarf_expression.h"
|
||||
#include "dwarf_parameter.h"
|
||||
#include "dwarf_utils.h"
|
||||
#include "dwarf_function.h"
|
||||
|
||||
typedef struct pst_handler {
|
||||
pst_context ctx; // context of unwinding
|
||||
@@ -42,4 +37,4 @@ bool pst_handler_handle_dwarf(pst_handler* h);
|
||||
void pst_handler_print_dwarf(pst_handler* h);
|
||||
bool pst_handler_unwind(pst_handler* h);
|
||||
|
||||
#endif /* SC_SYSUTILS_H_ */
|
||||
#endif /* PST_HANDLER_H_ */
|
||||
@@ -23,7 +23,7 @@ AR = ar rvs
|
||||
|
||||
BUILD_DIR = ./build
|
||||
RESULT_DIR = ../build
|
||||
LIB_STATIC = $(RESULT_DIR)/libframework.a
|
||||
LIB_STATIC = $(RESULT_DIR)/libpst.a
|
||||
|
||||
#Software LABEL, BUILD number, and DATE of build
|
||||
$(shell mkdir -p ${BUILD_DIR})
|
||||
@@ -31,12 +31,12 @@ SOFT_BUILD = $(shell STR=`cat $(BUILD_DIR)/version.h 2> /dev/null | grep 'SOFT_B
|
||||
DATE_BUILD = $(shell date +"%D %T")
|
||||
|
||||
#source and header files search path. add here new directories which contains files specified for $(SRC)
|
||||
VPATH = . logger storage http/client http/server utils swi rmq interfaces swi/protocols
|
||||
VPATH = . dwarf arch utils
|
||||
|
||||
SRC = $(wildcard $(addsuffix /*.cpp,${VPATH}))
|
||||
OBJ = $(patsubst %.cpp,%.o,$(addprefix $(BUILD_DIR)/,$(notdir $(SRC))))
|
||||
|
||||
INCS = -I"../thirdparty" -I"./" -I"./utils" -I"./rmq" -I"/usr/include/json-c" -I"/usr/include/postgresql" -I /usr/include/libxml2 -I"/opt/swifttest/include" -I"../thirdparty/libswiftclient/src/lib"
|
||||
INCS = -I"./dwarf" -I"./" -I"./utils" -I"./arch"
|
||||
FLAGS = -Wall -ggdb -fPIC -O3 -rdynamic -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DSOFT_BUILD=$(SOFT_BUILD) -DUSER_BUILD=$(USER) -DDATE_BUILD="$(DATE_BUILD)"
|
||||
|
||||
.PHONY: all clean
|
||||
@@ -10,7 +10,6 @@
|
||||
|
||||
#include "common.h"
|
||||
#include "registers.h"
|
||||
#include "dwarf_operations.h"
|
||||
|
||||
dwarf_reg_map reg_map[] = {
|
||||
// GP Registers
|
||||
@@ -14,20 +14,11 @@
|
||||
#include <elfutils/libdwfl.h>
|
||||
#include <libunwind.h>
|
||||
|
||||
#include "logger/log.h"
|
||||
#include "common.h"
|
||||
#include "dwarf_operations.h"
|
||||
#include "registers.h"
|
||||
|
||||
bool is_location_form(int form)
|
||||
{
|
||||
if (form == DW_FORM_block1 || form == DW_FORM_block2 || form == DW_FORM_block4 || form == DW_FORM_block ||
|
||||
form == DW_FORM_data4 || form == DW_FORM_data8 || form == DW_FORM_sec_offset) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#include "dwarf/dwarf_operations.h"
|
||||
#include "utils/log.h"
|
||||
#include "arch/registers.h"
|
||||
|
||||
int32_t decode_sleb128(uint8_t *sleb128)
|
||||
{
|
||||
@@ -13,6 +13,5 @@
|
||||
|
||||
int32_t decode_sleb128(uint8_t *sleb128);
|
||||
uint32_t decode_uleb128(uint8_t *uleb128);
|
||||
bool is_location_form(int form);
|
||||
|
||||
#endif // __PST_COMMON_H__
|
||||
@@ -9,8 +9,9 @@
|
||||
#include <dwarf.h>
|
||||
|
||||
#include "context.h"
|
||||
|
||||
#include "../src/dwarf/dwarf_operations.h"
|
||||
#include "registers.h"
|
||||
#include "dwarf_operations.h"
|
||||
|
||||
|
||||
extern dwarf_reg_map reg_map[];
|
||||
@@ -14,8 +14,8 @@
|
||||
#include <libunwind.h>
|
||||
#include <elfutils/libdwfl.h>
|
||||
|
||||
#include "logger/log.h"
|
||||
#include "allocator.h"
|
||||
#include "../src/utils/allocator.h"
|
||||
#include "../src/utils/log.h"
|
||||
|
||||
extern pst_log logger; // logger for whole PST library
|
||||
extern pst_allocator allocator; // custom allocator for PST library
|
||||
@@ -5,14 +5,15 @@
|
||||
* Author: nnosov
|
||||
*/
|
||||
|
||||
#include "../src/dwarf/dwarf_call_site.h"
|
||||
|
||||
#include <dwarf.h>
|
||||
#include <elfutils/libdw.h>
|
||||
|
||||
#include "dwarf_call_site.h"
|
||||
#include "dwarf_utils.h"
|
||||
#include "hash_multimap.h"
|
||||
#include "dwarf_utils.h"
|
||||
#include "dwarf_function.h"
|
||||
#include "../src/dwarf/dwarf_function.h"
|
||||
#include "../src/dwarf/dwarf_utils.h"
|
||||
#include "../src/dwarf/dwarf_utils.h"
|
||||
#include "../utils/hash_multimap.h"
|
||||
|
||||
// -----------------------------------------------------------------------------------
|
||||
// pst_call_site_param
|
||||
@@ -104,7 +105,6 @@ bool call_site_handle_dwarf(pst_call_site* site, Dwarf_Die* child)
|
||||
// expression represent where callee parameter will be stored
|
||||
pst_call_site_param* param = add_param(site);
|
||||
if(dwarf_hasattr(child, DW_AT_location)) {
|
||||
// handle location expression here
|
||||
// determine location of parameter in stack/heap or CPU registers
|
||||
attr = dwarf_attr(child, DW_AT_location, &attr_mem);
|
||||
if(!handle_location(site->ctx, attr, ¶m->location, pc, NULL)) {
|
||||
@@ -5,16 +5,16 @@
|
||||
* Author: nnosov
|
||||
*/
|
||||
|
||||
#ifndef FRAMEWORK_DWARF_CALL_SITE_H_
|
||||
#define FRAMEWORK_DWARF_CALL_SITE_H_
|
||||
#ifndef SRC_DWARF_DWARF_CALL_SITE_H_
|
||||
#define SRC_DWARF_DWARF_CALL_SITE_H_
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <elfutils/libdw.h>
|
||||
|
||||
#include "list_head.h"
|
||||
#include "../src/dwarf/dwarf_expression.h"
|
||||
#include "../utils/hash_multimap.h"
|
||||
#include "../utils/list_head.h"
|
||||
#include "context.h"
|
||||
#include "dwarf_expression.h"
|
||||
#include "hash_multimap.h"
|
||||
|
||||
typedef struct pst_callee_info {
|
||||
Dwarf_Addr target;
|
||||
@@ -87,4 +87,4 @@ void pst_call_site_storage_del(pst_call_site_storage* storage, pst_call_site* st
|
||||
void pst_call_site_storage_del(pst_call_site_storage* storage, pst_call_site* st);
|
||||
|
||||
|
||||
#endif /* FRAMEWORK_DWARF_CALL_SITE_H_ */
|
||||
#endif /* SRC_DWARF_DWARF_CALL_SITE_H_ */
|
||||
@@ -5,11 +5,12 @@
|
||||
* Author: nnosov
|
||||
*/
|
||||
|
||||
#include "../src/dwarf/dwarf_expression.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "dwarf_expression.h"
|
||||
#include "../utils/allocator.h"
|
||||
#include "common.h"
|
||||
#include "allocator.h"
|
||||
#include "context.h"
|
||||
|
||||
//
|
||||
@@ -5,14 +5,14 @@
|
||||
* Author: nnosov
|
||||
*/
|
||||
|
||||
#ifndef FRAMEWORK_DWARF_EXPRESSION_H_
|
||||
#define FRAMEWORK_DWARF_EXPRESSION_H_
|
||||
#ifndef SRC_DWARF_DWARF_EXPRESSION_H_
|
||||
#define SRC_DWARF_DWARF_EXPRESSION_H_
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <elfutils/libdwfl.h>
|
||||
|
||||
#include "list_head.h"
|
||||
#include "allocator.h"
|
||||
#include "../utils/allocator.h"
|
||||
#include "../utils/list_head.h"
|
||||
|
||||
// DWARF operation (represents our own DW_OP_XXX)
|
||||
typedef struct {
|
||||
@@ -46,4 +46,4 @@ bool pst_dwarf_expr_equal(pst_dwarf_expr* lhs, pst_dwarf_expr* rhs);
|
||||
bool pst_dwarf_expr_print_op(pst_dwarf_expr* expr, const char* fmt, ...);
|
||||
void pst_dwarf_expr_set_value(pst_dwarf_expr* expr, uint64_t v);
|
||||
|
||||
#endif /* FRAMEWORK_DWARF_EXPRESSION_H_ */
|
||||
#endif /* SRC_DWARF_DWARF_EXPRESSION_H_ */
|
||||
@@ -5,13 +5,14 @@
|
||||
* Author: nnosov
|
||||
*/
|
||||
|
||||
#include "../src/dwarf/dwarf_function.h"
|
||||
|
||||
#include <dwarf.h>
|
||||
#include <stdlib.h>
|
||||
#include <cxxabi.h>
|
||||
|
||||
#include "dwarf_function.h"
|
||||
#include "dwarf_utils.h"
|
||||
#include "dwarf_stack.h"
|
||||
#include "../src/dwarf/dwarf_stack.h"
|
||||
#include "../src/dwarf/dwarf_utils.h"
|
||||
|
||||
// -----------------------------------------------------------------------------------
|
||||
// pst_function
|
||||
@@ -5,14 +5,14 @@
|
||||
* Author: nnosov
|
||||
*/
|
||||
|
||||
#ifndef FRAMEWORK_DWARF_FUNCTION_H_
|
||||
#define FRAMEWORK_DWARF_FUNCTION_H_
|
||||
#ifndef SRC_DWARF_DWARF_FUNCTION_H_
|
||||
#define SRC_DWARF_DWARF_FUNCTION_H_
|
||||
|
||||
#include "../src/dwarf/dwarf_call_site.h"
|
||||
#include "../src/dwarf/dwarf_expression.h"
|
||||
#include "../src/dwarf/dwarf_parameter.h"
|
||||
#include "../utils/list_head.h"
|
||||
#include "context.h"
|
||||
#include "dwarf_expression.h"
|
||||
#include "list_head.h"
|
||||
#include "dwarf_call_site.h"
|
||||
#include "dwarf_parameter.h"
|
||||
|
||||
// -----------------------------------------------------------------------------------
|
||||
// pst_function
|
||||
@@ -46,4 +46,4 @@ 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_ */
|
||||
#endif /* SRC_DWARF_DWARF_FUNCTION_H_ */
|
||||
@@ -10,14 +10,15 @@
|
||||
#include <unistd.h>
|
||||
#include <limits.h>
|
||||
|
||||
#include <dwarf.h>
|
||||
#include <elfutils/libdwfl.h>
|
||||
#include <cxxabi.h>
|
||||
#include <execinfo.h>
|
||||
#include <dwarf.h>
|
||||
#include <inttypes.h>
|
||||
#include <dlfcn.h>
|
||||
|
||||
#include "dwarf_handler.h"
|
||||
#include "logger/log.h"
|
||||
|
||||
|
||||
#define USE_LIBUNWIND
|
||||
|
||||
@@ -26,9 +27,11 @@
|
||||
#endif
|
||||
|
||||
#include "common.h"
|
||||
#include "dwarf_operations.h"
|
||||
#include "allocator.h"
|
||||
#include "dwarf_stack.h"
|
||||
#include "utils/log.h"
|
||||
#include "utils/allocator.h"
|
||||
#include "dwarf/dwarf_operations.h"
|
||||
#include "dwarf/dwarf_stack.h"
|
||||
#include "dwarf/dwarf_function.h"
|
||||
|
||||
// dwfl_addrsegment() possibly can be used to check address validity
|
||||
// dwarf_getattrs() allows to enumerate all DIE attributes
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* sysutils.h
|
||||
*
|
||||
* Created on: Dec 28, 2019
|
||||
* Author: nnosov
|
||||
*/
|
||||
|
||||
#ifndef PST_HANDLER_H_
|
||||
#define PST_HANDLER_H_
|
||||
|
||||
//system
|
||||
#include <ucontext.h>
|
||||
|
||||
#include "utils/list_head.h"
|
||||
#include "common.h"
|
||||
#include "context.h"
|
||||
|
||||
typedef struct pst_context pst_context;
|
||||
|
||||
typedef struct pst_handler {
|
||||
pst_context ctx; // context of unwinding
|
||||
list_head functions; // list of functions in stack frame
|
||||
} pst_handler;
|
||||
|
||||
void pst_handler_init(pst_handler* h, ucontext_t* hctx);
|
||||
void pst_handler_fini(pst_handler* h);
|
||||
|
||||
bool pst_handler_handle_dwarf(pst_handler* h);
|
||||
void pst_handler_print_dwarf(pst_handler* h);
|
||||
bool pst_handler_unwind(pst_handler* h);
|
||||
|
||||
#endif /* PST_HANDLER_H_ */
|
||||
@@ -5,10 +5,11 @@
|
||||
* Author: nnosov
|
||||
*/
|
||||
|
||||
#include "../src/dwarf/dwarf_operations.h"
|
||||
|
||||
#include <dwarf.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "dwarf_operations.h"
|
||||
#include "common.h"
|
||||
#include "registers.h"
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
|
||||
#include <elfutils/libdwfl.h>
|
||||
|
||||
#include "../src/dwarf/dwarf_stack.h"
|
||||
#include "../utils/list_head.h"
|
||||
#include "common.h"
|
||||
#include "list_head.h"
|
||||
#include "context.h"
|
||||
#include "dwarf_handler.h"
|
||||
|
||||
#include "dwarf_stack.h"
|
||||
|
||||
typedef struct __dwarf_op_map dwarf_op_map;
|
||||
|
||||
@@ -5,11 +5,12 @@
|
||||
* Author: nnosov
|
||||
*/
|
||||
|
||||
#include "../src/dwarf/dwarf_parameter.h"
|
||||
|
||||
#include <dwarf.h>
|
||||
#include <elfutils/libdw.h>
|
||||
|
||||
#include "dwarf_parameter.h"
|
||||
#include "dwarf_utils.h"
|
||||
#include "../src/dwarf/dwarf_utils.h"
|
||||
#include "context.h"
|
||||
|
||||
//
|
||||
@@ -5,15 +5,15 @@
|
||||
* Author: nnosov
|
||||
*/
|
||||
|
||||
#ifndef FRAMEWORK_DWARF_PARAMETER_H_
|
||||
#define FRAMEWORK_DWARF_PARAMETER_H_
|
||||
#ifndef SRC_DWARF_DWARF_PARAMETER_H_
|
||||
#define SRC_DWARF_DWARF_PARAMETER_H_
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <elfutils/libdwfl.h>
|
||||
|
||||
#include "list_head.h"
|
||||
#include "../src/dwarf/dwarf_expression.h"
|
||||
#include "../utils/list_head.h"
|
||||
#include "context.h"
|
||||
#include "dwarf_expression.h"
|
||||
|
||||
typedef struct __pst_type {
|
||||
list_node node; // uplink
|
||||
@@ -56,4 +56,4 @@ bool pst_parameter_print_dwarf(pst_parameter* param);
|
||||
bool pst_parameter_handle_type(pst_parameter* param, Dwarf_Attribute* base);
|
||||
pst_type* pst_parameter_add_type(pst_parameter* param, const char* name, int type);
|
||||
|
||||
#endif /* FRAMEWORK_DWARF_PARAMETER_H_ */
|
||||
#endif /* SRC_DWARF_DWARF_PARAMETER_H_ */
|
||||
@@ -5,17 +5,16 @@
|
||||
* Author: nnosov
|
||||
*/
|
||||
|
||||
#include "../src/dwarf/dwarf_stack.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <dwarf.h>
|
||||
|
||||
#include "allocator.h"
|
||||
#include "list_head.h"
|
||||
|
||||
#include "dwarf_stack.h"
|
||||
|
||||
#include "../src/dwarf/dwarf_operations.h"
|
||||
#include "../utils/allocator.h"
|
||||
#include "../utils/list_head.h"
|
||||
#include "dwarf_handler.h"
|
||||
#include "dwarf_operations.h"
|
||||
|
||||
// -----------------------------------------------------------------------------------
|
||||
// DWARF Stack value
|
||||
@@ -5,15 +5,15 @@
|
||||
* Author: nnosov
|
||||
*/
|
||||
|
||||
#ifndef FRAMEWORK_DWARF_STACK_H_
|
||||
#define FRAMEWORK_DWARF_STACK_H_
|
||||
#ifndef SRC_DWARF_DWARF_STACK_H_
|
||||
#define SRC_DWARF_DWARF_STACK_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "common.h"
|
||||
#include "allocator.h"
|
||||
#include "context.h"
|
||||
#include "dwarf_handler.h"
|
||||
#include "utils/allocator.h"
|
||||
#include "dwarf/dwarf_function.h"
|
||||
|
||||
// -----------------------------------------------------------------------------------
|
||||
// DWARF Stack value
|
||||
@@ -94,4 +94,4 @@ pst_dwarf_value* pst_dwarf_stack_pop(pst_dwarf_stack* st);
|
||||
void pst_dwarf_stack_push_value(pst_dwarf_stack* st, pst_dwarf_value* value);
|
||||
void pst_dwarf_stack_push(pst_dwarf_stack* st, void* v, uint32_t s, int t);
|
||||
|
||||
#endif /* FRAMEWORK_DWARF_STACK_H_ */
|
||||
#endif /* SRC_DWARF_DWARF_STACK_H_ */
|
||||
@@ -9,6 +9,17 @@
|
||||
|
||||
#include "dwarf_utils.h"
|
||||
#include "dwarf_stack.h"
|
||||
#include "dwarf_function.h"
|
||||
|
||||
|
||||
bool is_location_form(int form)
|
||||
{
|
||||
if (form == DW_FORM_block1 || form == DW_FORM_block2 || form == DW_FORM_block4 || form == DW_FORM_block ||
|
||||
form == DW_FORM_data4 || form == DW_FORM_data8 || form == DW_FORM_sec_offset) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
int regname_callback (void *arg, int regno, const char *setname, const char *prefix, const char *regname, int bits, int type)
|
||||
{
|
||||
@@ -5,14 +5,14 @@
|
||||
* Author: nnosov
|
||||
*/
|
||||
|
||||
#ifndef FRAMEWORK_DWARF_UTILS_H_
|
||||
#define FRAMEWORK_DWARF_UTILS_H_
|
||||
#ifndef SRC_DWARF_DWARF_UTILS_H_
|
||||
#define SRC_DWARF_DWARF_UTILS_H_
|
||||
|
||||
#include <elfutils/libdw.h>
|
||||
|
||||
#include "dwarf_expression.h"
|
||||
#include "context.h"
|
||||
#include "dwarf_handler.h"
|
||||
#include "dwarf_expression.h"
|
||||
#include "dwarf_function.h"
|
||||
|
||||
typedef struct __reginfo {
|
||||
__reginfo() {
|
||||
@@ -25,5 +25,6 @@ typedef struct __reginfo {
|
||||
|
||||
int regname_callback (void *arg, int regno, const char *setname, const char *prefix, const char *regname, int bits, int type);
|
||||
bool handle_location(pst_context* ctx, Dwarf_Attribute* attr, pst_dwarf_expr* loc, Dwarf_Addr pc, pst_function* fun);
|
||||
bool is_location_form(int form);
|
||||
|
||||
#endif /* FRAMEWORK_DWARF_UTILS_H_ */
|
||||
#endif /* SRC_DWARF_DWARF_UTILS_H_ */
|
||||
@@ -5,12 +5,13 @@
|
||||
* Author: nnosov
|
||||
*/
|
||||
|
||||
#include "../src/utils/allocator.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <malloc.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "common.h"
|
||||
#include "allocator.h"
|
||||
|
||||
void heap_free(pst_allocator* alloc, void* buff)
|
||||
{
|
||||
@@ -11,10 +11,11 @@
|
||||
* http://nsoft.volgocity.ru/cdl or
|
||||
* http://cdl.sourceforge.net
|
||||
* ===========================================================================*/
|
||||
#include "../src/utils/hash_multimap.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include "hash_multimap.h"
|
||||
|
||||
/* Default hash function
|
||||
@param key hash key
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef HASH_MULTIMAP_H
|
||||
#define HASH_MULTIMAP_H
|
||||
|
||||
#include "list_head.h"
|
||||
#include "../src/utils/list_head.h"
|
||||
|
||||
#define HASH_MIN_SHIFT (8)
|
||||
#define HASH_MAX_SHIFT (15)
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "log.h"
|
||||
#include "../../src/utils/log.h"
|
||||
|
||||
#include <time.h>
|
||||
#include <stdlib.h>
|
||||
@@ -2,8 +2,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "dwarf/dwarf_handler.h"
|
||||
#include "context.h"
|
||||
#include "dwarf_handler.h"
|
||||
|
||||
typedef enum {
|
||||
DEF_1 = 1,
|
||||
Reference in New Issue
Block a user