From 6a5ae2fe6d4b96eecaebcb527d03b979ea865426 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Fri, 27 Feb 2015 15:44:06 +0300 Subject: [PATCH] [IMPROVE] Preload: Breakpoint probe msg saving Change-Id: Ifcc1cb1fc73b4e19b498c76b3cefe010a0213bf8 Signed-off-by: Alexander Aksenov --- daemon/da_protocol_inst.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/daemon/da_protocol_inst.c b/daemon/da_protocol_inst.c index ec8a6f9..5eff3f3 100644 --- a/daemon/da_protocol_inst.c +++ b/daemon/da_protocol_inst.c @@ -560,7 +560,10 @@ static int create_preload_probe_func(struct probe_list_t **probe, int add_preload_probes(struct lib_list_t **lib_list) { struct lib_list_t *preload_lib; - struct probe_list_t *get_caller_probe, *get_call_type_probe; + struct probe_list_t + *get_caller_probe, + *get_call_type_probe, + *write_msg_probe; int ret = 0; struct us_func_inst_plane_t *func = NULL; @@ -573,14 +576,15 @@ int add_preload_probes(struct lib_list_t **lib_list) get_caller_probe = new_probe(); get_call_type_probe = new_probe(); - if (get_caller_probe == NULL || get_call_type_probe == NULL) { + write_msg_probe = new_probe(); + if (get_caller_probe == NULL || get_call_type_probe == NULL || write_msg_probe == NULL) { LOGE("probe alloc error\n"); ret = 0; goto free_caller_probe; } preload_lib->lib->bin_path = probe_lib; - preload_lib->func_num = 2; + preload_lib->func_num = 3; /* Add get_caller probe */ ret = create_preload_probe_func(&get_caller_probe, get_caller_addr, 4); @@ -596,7 +600,13 @@ int add_preload_probes(struct lib_list_t **lib_list) probe_list_append(preload_lib, get_call_type_probe); - preload_lib->func_num = 2; + /* Add write_msg probe */ + ret = create_preload_probe_func(&write_msg_probe, write_msg_addr, 6); + if (ret != 0) + return ret; + probe_list_append(preload_lib, write_msg_probe); + + preload_lib->func_num = 3; preload_lib->size += strlen(preload_lib->lib->bin_path) + 1 + sizeof(preload_lib->func_num); preload_lib->hash = calc_lib_hash(preload_lib->lib); -- 2.7.4