From 2f69896bb97bb175fdfcb01f6d941a7b506f9599 Mon Sep 17 00:00:00 2001 From: Vyacheslav Cherkashin Date: Thu, 16 Jul 2015 19:57:51 +0300 Subject: [PATCH] [FIX] workaround: ignore main() function address Change-Id: I252e38d0b3111e96977d68ed3c1c853e98e21122 Signed-off-by: Vyacheslav Cherkashin --- daemon/da_inst.c | 11 +++++++++++ daemon/da_inst.h | 2 ++ daemon/da_protocol_inst.c | 9 +++++++-- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/daemon/da_inst.c b/daemon/da_inst.c index 77c9093..1dc3bee 100644 --- a/daemon/da_inst.c +++ b/daemon/da_inst.c @@ -515,6 +515,17 @@ static int resolve_collisions_for_rm_msg(struct lib_list_t **cur, struct lib_lis return 1; } +void app_list_rm_probes_by_addr(struct app_list_t *app_list, uint64_t addr) +{ + struct probe_list_t *pr = app_list->list; + + while (pr) { + pr = pr->func->func_addr == addr ? + probe_list_rm_element(app_list, pr) : + pr->next; + } +} + //--------------------------------------pack ---------------------------------- static char *pack_lib_head_to_array(char *to, void *data) diff --git a/daemon/da_inst.h b/daemon/da_inst.h index 6e7eda8..3baeace 100644 --- a/daemon/da_inst.h +++ b/daemon/da_inst.h @@ -89,6 +89,8 @@ void free_data_list(struct data_list_t **data); void free_app(struct app_list_t *app); void free_lib(struct lib_list_t *lib); +void app_list_rm_probes_by_addr(struct app_list_t *app_list, uint64_t addr); + struct app_info_t *app_info_get_first(struct app_list_t **app_list); struct app_info_t *app_info_get_next(struct app_list_t **app_list); diff --git a/daemon/da_protocol_inst.c b/daemon/da_protocol_inst.c index d62df72..f57e613 100644 --- a/daemon/da_protocol_inst.c +++ b/daemon/da_protocol_inst.c @@ -288,7 +288,8 @@ int parse_lib_inst_list(struct msg_buf_t *msg, } static int parse_inst_app_setup_data(struct msg_buf_t *msg, - struct app_info_t *app_info) + struct app_info_t *app_info, + struct app_list_t *app_list) { switch (app_info->app_type) { case APP_TYPE_TIZEN: { @@ -304,6 +305,10 @@ static int parse_inst_app_setup_data(struct msg_buf_t *msg, app_info->setup_data.size = data_len; memcpy(app_info->setup_data.data, data, data_len); + + /* FIXME: dog nail */ + app_list_rm_probes_by_addr(app_list, val); + return 0; } case APP_TYPE_RUNNING: @@ -363,7 +368,7 @@ int parse_inst_app(struct msg_buf_t *msg, struct app_list_t **dest) goto exit_free_err; } - if (parse_inst_app_setup_data(msg, app_info)) { + if (parse_inst_app_setup_data(msg, app_info, *dest)) { LOGE("setup data parsing error\n"); goto exit_free_err; } -- 2.7.4