From 22e168d9bba940192d705162e9278d23e28887f3 Mon Sep 17 00:00:00 2001 From: Vitaliy Cherepanov Date: Mon, 7 Jul 2014 13:28:17 +0400 Subject: [PATCH] [FIX] EFL app support: application life time Change-Id: Iee13ff6e599462f5dce613e1450d4d6410aa492a Signed-off-by: Vitaliy Cherepanov --- Makefile | 11 +++-------- include/binproto.h | 1 + include/daprobe.h | 2 ++ probe_capi/capi_appfw.c | 8 ++------ 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index a8bae29..04a5c5b 100644 --- a/Makefile +++ b/Makefile @@ -89,10 +89,10 @@ PROBE_SRCS = \ DUMMY_SRCS = ./custom_chart/da_chart_dummy.c CAPI_SRCS = $(COMMON_SRCS) \ - ./probe_capi/capi_appfw.c \ - ./probe_ui/capi_capture.c + ./probe_capi/capi_appfw.c +# ./probe_ui/capi_capture.c -TIZEN_SRCS = $(COMMON_SRCS) \ +TIZEN_SRCS = $(COMMON_SRCS) $(CAPI_SRCS)\ ./helper/addr-tizen.c \ ./helper/common_probe_init.cpp \ ./probe_memory/libdanew.cpp @@ -107,7 +107,6 @@ TIZEN_OBJS = $(patsubst %.cpp,%.o, $(patsubst %.c,%.o, $(TIZEN_SRCS))) $(ASM_OBJ DUMMY_OBJS = $(patsubst %.c,%.o, $(DUMMY_SRCS)) -CAPI_TARGET = da_probe_capi.so TIZEN_TARGET = da_probe_tizen.so DUMMY_TARGET = libdaprobe.so @@ -119,7 +118,6 @@ TIZEN_CPPFLAGS = -DTIZENAPP TIZEN_LDFLAGS = -lstdc++ all: capi tizen dummy -capi: headers $(CAPI_TARGET) tizen: headers $(TIZEN_TARGET) dummy: headers $(DUMMY_TARGET) @@ -142,9 +140,6 @@ $(GENERATED_HEADERS): ./scripts/api_names.txt $(GENERATED_HEADERS): awk -f $< < $(APINAMES) > $@ -$(CAPI_TARGET): $(CAPI_OBJS) - $(CC) $(LDFLAGS) $^ -o $@ - $(TIZEN_TARGET): LDFLAGS+=$(TIZEN_LDFLAGS) $(TIZEN_TARGET): CPPFLAGS+=$(TIZEN_CPPFLAGS) $(TIZEN_TARGET): $(TIZEN_OBJS) diff --git a/include/binproto.h b/include/binproto.h index 3761efc..d3be6d1 100644 --- a/include/binproto.h +++ b/include/binproto.h @@ -203,6 +203,7 @@ static char __attribute__((used)) *pack_value_by_type(char *to, const char **t, *to++ = **t; switch (**t) { + case 'b': case 'c': c = (uint8_t)va_arg(*args, uint32_t); memcpy(to, &c, sizeof(c)); diff --git a/include/daprobe.h b/include/daprobe.h index cfe14e8..3c37edb 100644 --- a/include/daprobe.h +++ b/include/daprobe.h @@ -208,12 +208,14 @@ typedef struct { lib_handle[SONAME] = dlopen(lib_string[SONAME], RTLD_LAZY); \ if (lib_handle[SONAME] == NULL) { \ fprintf(stderr, "dlopen failed : %s\n", lib_string[SONAME]); \ + PRINTMSG("dlopen failed : %s\n", lib_string[SONAME]); \ exit(0); \ } \ } \ FUNCTIONPOINTER = dlsym(lib_handle[SONAME], FUNCNAME); \ if (FUNCTIONPOINTER == NULL || dlerror() != NULL) { \ fprintf(stderr, "dlsym failed : <" FUNCNAME ">\n"); \ + PRINTMSG("dlsym failed : <" FUNCNAME ">\n"); \ exit(0); \ } \ probeBlockEnd(); \ diff --git a/probe_capi/capi_appfw.c b/probe_capi/capi_appfw.c index 97d3cc6..291946e 100644 --- a/probe_capi/capi_appfw.c +++ b/probe_capi/capi_appfw.c @@ -59,12 +59,11 @@ static enum DaOptions _sopt = OPT_ALWAYSON; static bool _dalc_app_create(void* user_data) { - bool bret; + bool bret = false; DECLARE_VARIABLE_STANDARD; bfiltering = false; PRE_PROBEBLOCK(); - bret = gAppCallback.create(user_data); PACK_ORIGINAL_APPFWCYCLE(API_ID__dalc_app_create, 'b', bret, "p", @@ -140,10 +139,7 @@ int app_efl_main(int *argc, char ***argv, app_event_callback_s *callback, void * Ecore_Event_Handler* handler; int ret; - //set app_efl flag to determinate termination way for app - app_efl_main_flg = 1; - - GET_REAL_FUNC(app_efl_main, LIBCAPI_APPFW_APPLICATION); + GET_REAL_FUNCP_RTLD_NEXT(app_efl_main, app_efl_mainp); probeBlockStart(); handler = register_orientation_event_listener(); -- 2.7.4