Makefiles updated to reflect new decoder registration code. Makefiles updated for changed C API
Some source changes to reflect differing requirements in MSVC and G++ compilation.
Signed-off-by: Mike Leach mike.leach@linaro.org --- decoder/build/linux/makefile | 2 + decoder/build/linux/rctdl_c_api_lib/makefile | 3 +- decoder/build/linux/ref_trace_decode_lib/makefile | 1 + decoder/include/common/ocsd_dcd_mngr.h | 6 +- decoder/include/common/ocsd_lib_dcd_register.h | 2 +- decoder/include/ocsd_if_types.h | 1 + decoder/source/c_api/ocsd_c_api_deprc_fn.cpp | 14 ++-- .../build/linux/c_api_pkt_print_test/makefile | 82 ++++++++++++++++++++++ 8 files changed, 99 insertions(+), 12 deletions(-) create mode 100644 decoder/tests/build/linux/c_api_pkt_print_test/makefile
diff --git a/decoder/build/linux/makefile b/decoder/build/linux/makefile index 4befae3..b86fafe 100644 --- a/decoder/build/linux/makefile +++ b/decoder/build/linux/makefile @@ -158,6 +158,7 @@ tests: libs cd $(OCSD_ROOT)/tests/build/linux/snapshot_parser_lib && make cd $(OCSD_ROOT)/tests/build/linux/trc_pkt_lister && make cd $(OCSD_ROOT)/tests/build/linux/simple_pkt_print_c_api && make + cd $(OCSD_ROOT)/tests/build/linux/c_api_pkt_print_test && make
############################################################# # clean targets @@ -174,3 +175,4 @@ clean_tests: cd $(OCSD_ROOT)/tests/build/linux/snapshot_parser_lib && make clean cd $(OCSD_ROOT)/tests/build/linux/trc_pkt_lister && make clean cd $(OCSD_ROOT)/tests/build/linux/simple_pkt_print_c_api && make clean + cd $(OCSD_ROOT)/tests/build/linux/c_api_pkt_print_test && make clean diff --git a/decoder/build/linux/rctdl_c_api_lib/makefile b/decoder/build/linux/rctdl_c_api_lib/makefile index 9338bfa..dfebe09 100644 --- a/decoder/build/linux/rctdl_c_api_lib/makefile +++ b/decoder/build/linux/rctdl_c_api_lib/makefile @@ -49,7 +49,8 @@ CPP_INCLUDES= \ -I$(OCSD_INCLUDE) \ -I$(OCSD_SOURCE)/c_api
-OBJECTS=$(BUILD_DIR)/ocsd_c_api.o +OBJECTS=$(BUILD_DIR)/ocsd_c_api.o \ + $(BUILD_DIR)/ocsd_c_api_deprc_fn.o
all: build_dir $(OBJECTS) diff --git a/decoder/build/linux/ref_trace_decode_lib/makefile b/decoder/build/linux/ref_trace_decode_lib/makefile index 56982bd..b650331 100644 --- a/decoder/build/linux/ref_trace_decode_lib/makefile +++ b/decoder/build/linux/ref_trace_decode_lib/makefile @@ -90,6 +90,7 @@ OBJECTS=$(BUILD_DIR)/ocsd_code_follower.o \ $(BUILD_DIR)/ocsd_error.o \ $(BUILD_DIR)/ocsd_error_logger.o \ $(BUILD_DIR)/ocsd_gen_elem_list.o \ + $(BUILD_DIR)/ocsd_lib_dcd_register.o \ $(BUILD_DIR)/ocsd_msg_logger.o \ $(BUILD_DIR)/ocsd_version.o \ $(BUILD_DIR)/trc_component.o \ diff --git a/decoder/include/common/ocsd_dcd_mngr.h b/decoder/include/common/ocsd_dcd_mngr.h index 487e1db..b70a4cc 100644 --- a/decoder/include/common/ocsd_dcd_mngr.h +++ b/decoder/include/common/ocsd_dcd_mngr.h @@ -39,7 +39,7 @@ #include "common/ocsd_dcd_mngr_i.h" #include "common/ocsd_lib_dcd_register.h" #include "common/trc_pkt_decode_base.h" - +#include "common/trc_pkt_proc_base.h"
template <class P, class Pt, class Pc> class DecoderMngrBase : public IDecoderMngr @@ -327,7 +327,7 @@ class DecodeMngrFullDcd : public DecoderMngrBase<P,Pt,Pc> { public: DecodeMngrFullDcd (const std::string &name, ocsd_trace_protocol_t builtInProtocol) - : DecoderMngrBase(name,builtInProtocol) {}; + : DecoderMngrBase<P,Pt,Pc>(name,builtInProtocol) {};
virtual ~DecodeMngrFullDcd() {};
@@ -370,7 +370,7 @@ class DecodeMngrPktProc : public DecoderMngrBase<P,Pt,Pc> { public: DecodeMngrPktProc (const std::string &name, ocsd_trace_protocol_t builtInProtocol) - : DecoderMngrBase(name,builtInProtocol) {}; + : DecoderMngrBase<P,Pt,Pc>(name,builtInProtocol) {};
virtual ~DecodeMngrPktProc() {};
diff --git a/decoder/include/common/ocsd_lib_dcd_register.h b/decoder/include/common/ocsd_lib_dcd_register.h index d059214..3e6611e 100644 --- a/decoder/include/common/ocsd_lib_dcd_register.h +++ b/decoder/include/common/ocsd_lib_dcd_register.h @@ -79,7 +79,7 @@ private: // singleton pattern - need just one of these in the library - ensure all default constructors are private. OcsdLibDcdRegister(); OcsdLibDcdRegister(OcsdLibDcdRegister const &) {}; - OcsdLibDcdRegister& operator=(OcsdLibDcdRegister const &){}; + OcsdLibDcdRegister& operator=(OcsdLibDcdRegister const &){ }; ~OcsdLibDcdRegister();
static OcsdLibDcdRegister *m_p_libMngr; diff --git a/decoder/include/ocsd_if_types.h b/decoder/include/ocsd_if_types.h index f5d1fde..f026d4e 100644 --- a/decoder/include/ocsd_if_types.h +++ b/decoder/include/ocsd_if_types.h @@ -36,6 +36,7 @@ #define ARM_OCSD_IF_TYPES_H_INCLUDED
#include <stdint.h> +#include <stddef.h>
/** @defgroup ocsd_interfaces OpenCSD Library : Interfaces @brief Set of types, structures and virtual interface classes making up the primary API diff --git a/decoder/source/c_api/ocsd_c_api_deprc_fn.cpp b/decoder/source/c_api/ocsd_c_api_deprc_fn.cpp index b5d0ff5..959ef0b 100644 --- a/decoder/source/c_api/ocsd_c_api_deprc_fn.cpp +++ b/decoder/source/c_api/ocsd_c_api_deprc_fn.cpp @@ -51,7 +51,7 @@ OCSD_C_API ocsd_err_t ocsd_dt_create_etmv4i_pkt_proc(const dcd_tree_handle_t han err = ocsd_dt_create_decoder(handle,OCSD_BUILTIN_DCD_ETMV4I,OCSD_CREATE_FLG_PACKET_PROC,etmv4_cfg,&CSID); if(err == OCSD_OK) { - err = ocsd_dt_attach_packet_callback(handle,CSID, OCSD_C_API_CB_PKT_SINK,pPktFn,p_context); + err = ocsd_dt_attach_packet_callback(handle,CSID, OCSD_C_API_CB_PKT_SINK,(void *)pPktFn,p_context); if(err != OCSD_OK) ocsd_dt_remove_decoder(handle,CSID); } @@ -79,7 +79,7 @@ OCSD_C_API ocsd_err_t ocsd_dt_attach_etmv4i_pkt_mon(const dcd_tree_handle_t hand ocsd_err_t err = OCSD_OK; if(handle != C_API_INVALID_TREE_HANDLE) { - err = ocsd_dt_attach_packet_callback(handle,trc_chan_id,OCSD_C_API_CB_PKT_MON,pPktFn,p_context); + err = ocsd_dt_attach_packet_callback(handle,trc_chan_id,OCSD_C_API_CB_PKT_MON,(void *)pPktFn,p_context); } else err = OCSD_ERR_INVALID_PARAM_VAL; @@ -95,7 +95,7 @@ OCSD_C_API ocsd_err_t ocsd_dt_create_etmv3_pkt_proc(const dcd_tree_handle_t hand err = ocsd_dt_create_decoder(handle,OCSD_BUILTIN_DCD_ETMV3,OCSD_CREATE_FLG_PACKET_PROC,etmv3_cfg,&CSID); if(err == OCSD_OK) { - err = ocsd_dt_attach_packet_callback(handle,CSID, OCSD_C_API_CB_PKT_SINK,pPktFn,p_context); + err = ocsd_dt_attach_packet_callback(handle,CSID, OCSD_C_API_CB_PKT_SINK,(void *)pPktFn,p_context); if(err != OCSD_OK) ocsd_dt_remove_decoder(handle,CSID); } @@ -123,7 +123,7 @@ OCSD_C_API ocsd_err_t ocsd_dt_attach_etmv3_pkt_mon(const dcd_tree_handle_t handl ocsd_err_t err = OCSD_OK; if(handle != C_API_INVALID_TREE_HANDLE) { - err = ocsd_dt_attach_packet_callback(handle,trc_chan_id,OCSD_C_API_CB_PKT_MON,pPktFn,p_context); + err = ocsd_dt_attach_packet_callback(handle,trc_chan_id,OCSD_C_API_CB_PKT_MON,(void *)pPktFn,p_context); } else err = OCSD_ERR_INVALID_PARAM_VAL; @@ -140,7 +140,7 @@ OCSD_C_API ocsd_err_t ocsd_dt_create_ptm_pkt_proc(const dcd_tree_handle_t handle err = ocsd_dt_create_decoder(handle,OCSD_BUILTIN_DCD_PTM,OCSD_CREATE_FLG_PACKET_PROC,ptm_cfg,&CSID); if(err == OCSD_OK) { - err = ocsd_dt_attach_packet_callback(handle,CSID, OCSD_C_API_CB_PKT_SINK,pPktFn,p_context); + err = ocsd_dt_attach_packet_callback(handle,CSID, OCSD_C_API_CB_PKT_SINK,(void *)pPktFn,p_context); if(err != OCSD_OK) ocsd_dt_remove_decoder(handle,CSID); } @@ -169,7 +169,7 @@ OCSD_C_API ocsd_err_t ocsd_dt_attach_ptm_pkt_mon(const dcd_tree_handle_t handle, ocsd_err_t err = OCSD_OK; if(handle != C_API_INVALID_TREE_HANDLE) { - err = ocsd_dt_attach_packet_callback(handle,trc_chan_id,OCSD_C_API_CB_PKT_MON,pPktFn,p_context); + err = ocsd_dt_attach_packet_callback(handle,trc_chan_id,OCSD_C_API_CB_PKT_MON,(void *)pPktFn,p_context); } else err = OCSD_ERR_INVALID_PARAM_VAL; @@ -185,7 +185,7 @@ OCSD_C_API ocsd_err_t ocsd_dt_create_stm_pkt_proc(const dcd_tree_handle_t handle err = ocsd_dt_create_decoder(handle,OCSD_BUILTIN_DCD_STM,OCSD_CREATE_FLG_PACKET_PROC,stm_cfg,&CSID); if(err == OCSD_OK) { - err = ocsd_dt_attach_packet_callback(handle,CSID, OCSD_C_API_CB_PKT_SINK,pPktFn,p_context); + err = ocsd_dt_attach_packet_callback(handle,CSID, OCSD_C_API_CB_PKT_SINK,(void *)pPktFn,p_context); if(err != OCSD_OK) ocsd_dt_remove_decoder(handle,CSID); } diff --git a/decoder/tests/build/linux/c_api_pkt_print_test/makefile b/decoder/tests/build/linux/c_api_pkt_print_test/makefile new file mode 100644 index 0000000..01d4660 --- /dev/null +++ b/decoder/tests/build/linux/c_api_pkt_print_test/makefile @@ -0,0 +1,82 @@ +######################################################## +# Copyright 2015 ARM Limited. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors +# may be used to endorse or promote products derived from this software without +# specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +################################################################################# + +######## +# RCTDL - test makefile for simple c api packet list test. +# + +CC := $(MASTER_CC) +CC_FLAGS := $(MASTER_CC_FLAGS) -Wno-switch +LINKER := $(MASTER_LINKER) +LINKER_FLAGS := $(MASTER_LINKER_FLAGS) + +PROG = c_api_pkt_print_test + +BUILD_DIR=./$(PLAT_DIR) + +VPATH = $(OCSD_TESTS)/source + +CC_INCLUDES = \ + -I$(OCSD_TESTS)/source \ + -I$(OCSD_INCLUDE) + +OBJECTS = $(BUILD_DIR)/c_api_pkt_print_test.o + +LIBS = -L$(LIB_TARGET_DIR) -l$(LIB_BASE_NAME) -l$(LIB_CAPI_NAME) + +all: build_dir test_app copy_libs + +test_app: $(OBJECTS) $(BIN_TEST_TARGET_DIR)/$(PROG) + + + $(BIN_TEST_TARGET_DIR)/$(PROG): + mkdir -p $(BIN_TEST_TARGET_DIR) + $(LINKER) $(LINKER_FLAGS) $(OBJECTS) -Wl,--start-group $(LIBS) -Wl,--end-group -o $(BIN_TEST_TARGET_DIR)/$(PROG) + cp $(LIB_TARGET_DIR)/*.so . + +build_dir: + mkdir -p $(BUILD_DIR) + +.PHONY: copy_libs + +copy_libs: + cp $(LIB_TARGET_DIR)/*.so $(BIN_TEST_TARGET_DIR)/. + + +#### build rules +$(BUILD_DIR)/%.o : %.c + $(CC) $(CC_FLAGS) $(CC_INCLUDES) $< -o $@ + +#### clean +.PHONY: clean +clean : + rm -f $(BIN_TEST_TARGET_DIR)/$(PROG) $(OBJECTS) + +# end of file makefile