diff options
author | Vitaliy Cherepanov <v.cherepanov@samsung.com> | 2016-04-15 18:41:21 +0300 |
---|---|---|
committer | Dmitry Kovalenko <d.kovalenko@samsung.com> | 2016-05-13 07:38:17 -0700 |
commit | 5604e1a36d6b2fa460acc79d0f70b2dd54b880c5 (patch) | |
tree | 0bbe045eeb2ba9a54253f11cbd74d759c2d48d79 | |
parent | a8932f839a3311001dc85001232efe82eab06026 (diff) | |
download | swap-probe-5604e1a36d6b2fa460acc79d0f70b2dd54b880c5.tar.gz swap-probe-5604e1a36d6b2fa460acc79d0f70b2dd54b880c5.tar.bz2 swap-probe-5604e1a36d6b2fa460acc79d0f70b2dd54b880c5.zip |
[FIX] remove build warningstizen_2.4_dev
Change-Id: I795b61c520063b2adb883a9daae6a4e12d96d41d
Signed-off-by: Vitaliy Cherepanov <v.cherepanov@samsung.com>
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | helper/da_call_original.S | 4 | ||||
-rw-r--r-- | include/binproto.h | 12 | ||||
-rwxr-xr-x | scripts/gen_headers.py | 25 |
4 files changed, 24 insertions, 19 deletions
@@ -64,7 +64,7 @@ LDFLAGS = -shared \ -ldl \ -Wl,-z,noexecstack -ASMFLAG = -O0 -g +ASMFLAG = -O0 -g -Werror ## FIXME: Ideally, UTILITY_SRCS is sources for probe infrastructure and ## PROBE_SRCS is sources for actual replacement functions. Unfortunatelly, diff --git a/helper/da_call_original.S b/helper/da_call_original.S index 11119bc..ee627ec 100644 --- a/helper/da_call_original.S +++ b/helper/da_call_original.S @@ -178,7 +178,7 @@ _da_call_original: .type _da_call_original, %function _da_call_original: - push {fp, lr, r5, r6, r7, r8} + push {r5, r6, r7, r8, fp, lr} #create local stack add fp, sp, #4 sub sp, sp, #stack_size @@ -234,5 +234,5 @@ _da_call_original: #local stack restore add sp, sp, #stack_size #return - pop {fp, pc, r5, r6, r7, r8} + pop {r5, r6, r7, r8, fp, pc} #endif diff --git a/include/binproto.h b/include/binproto.h index e8ccac4..46caf8a 100644 --- a/include/binproto.h +++ b/include/binproto.h @@ -175,12 +175,12 @@ static char __attribute__((used)) *pack_string_to_file(char *to, const char *st, /* pack string to file */ char template_name[] = SCREENSHOT_DIRECTORY "/swap_XXXXXX"; char dst_path_pack[MAX_PATH_LENGTH]; - FILE *file; - mktemp(template_name); - file = fopen(template_name, "w"); - if (file != NULL) { - fwrite(st, data_len, 1, file); - fclose(file); + int file = mkstemp(template_name); + if (file != -1) { + write(file, st, data_len); + close(file); + } else { + PRINTERR("cannot pack string to file %s\n", st); } snprintf(dst_path_pack, sizeof(dst_path_pack), "FILE:%s", template_name); to = pack_string(to, dst_path_pack); diff --git a/scripts/gen_headers.py b/scripts/gen_headers.py index 0c93244..33ba275 100755 --- a/scripts/gen_headers.py +++ b/scripts/gen_headers.py @@ -74,7 +74,7 @@ def __parse_file(libs_data, file): elif line[:7] == defines_tag: list = line.split() if len(list) < 2 or len(list) > 3: - print "WARNING: Wrong string in api_names.txt +" + str(current_line) + ": <" + line + ">" + print "[WARN]: Wrong string in api_names.txt +" + str(current_line) + ": <" + line + ">" if len(list) != 3: continue @@ -82,13 +82,13 @@ def __parse_file(libs_data, file): print "defines[" + list[1] + "] = " + list[2] defines[list[1]] = list[2] elif line[:1] == "#": - #print "WARNING: commented code : <" + line + ">" + #print "[WARN]: commented code : <" + line + ">" continue else: splitted = line.split(';') if len(splitted) < 3: - print "WARNING: Wrong string in api_names.txt +" + str(current_line) + ": <" + line + ">" + print "[WARN]: Wrong string in api_names.txt +" + str(current_line) + ": <" + line + ">" continue for i in range(0, len(splitted)): splitted[i] = re.sub(" ", "", splitted[i]) @@ -99,7 +99,7 @@ def __parse_file(libs_data, file): probe_type = splitted[2] if len(current_libs) == 1 and (current_libs[0] == "???" or current_libs[0] == "---"): - print "WARNING: Skip func <" + func + "> file <" + current_filename + "> lib <" + current_libs[0] + ">" + print "[WARN]: Skip func <" + func + "> file <" + current_filename + "> lib <" + current_libs[0] + ">" continue libs_data = __add_item(libs_data, [current_libs, [func, [current_feature]]], (handler, probe_type)) @@ -108,6 +108,7 @@ def __parse_file(libs_data, file): def parse_apis(func_list_file): + print "parse_apis" libs_data = {} with open(func_list_file) as f: @@ -138,6 +139,7 @@ def __lib_syms(libname): def parse_probe_lib(da_lib): + print "parse_probe_lib" return __lib_syms(da_lib) #################################################################### @@ -191,6 +193,7 @@ def get_function_search_error(function_name): return err_str % (function_name, err) def iterate_over_libs(data, probe_lib): + print "iterate_over_libs" feature_dict = {} for libname in data: lib_data = __lib_syms(libname) @@ -304,7 +307,7 @@ def __print_feature_list(file, features_cnt, features_list_dict): file.write("int feature_to_data_count = " + str(features_cnt) + ";\n") file.write("struct feature_list_t feature_to_data[] = {\n") for feature in features_list_dict: - file.write("\t{" + feature + ", (struct ld_feature_list_el_t **) &" + features_list_dict[feature] + "},\n") + file.write("\t{.feature_value_0 = " + feature + ", .feature_value_1 = 0, .feature_ld = &" + features_list_dict[feature] + "},\n") file.write("};\n") def __print_features(file, data): @@ -370,8 +373,9 @@ def __print_feature_list_el_t(file): def __print_feature_list_t(file): file.write("struct feature_list_t {\n") - file.write("\tenum feature_code feature_value;\n") - file.write("\tstruct ld_feature_list_el_t **feature_ld;\n") + file.write("\tenum feature_code_0 feature_value_0;\n") + file.write("\tenum feature_code_1 feature_value_1;\n") + file.write("\tstruct ld_feature_list_el_t *feature_ld;\n") file.write("};\n") def __print_types(file): @@ -389,17 +393,17 @@ def __print_types(file): def __print_probe_lib(file, da_inst_dir, da_lib, probe_lib): get_caller_addr = __get_addr_by_funcname_handler(probe_lib, "get_caller_addr") if get_caller_addr is None: - print "WARNING: <get_caller> address is not found!" + print "[WARN]: <get_caller> address is not found!" return get_call_type_addr = __get_addr_by_funcname_handler(probe_lib, "get_call_type") if get_call_type_addr is None: - print "WARNING: <get_call_type> address is not found!" + print "[WARN]: <get_call_type> address is not found!" return write_msg_addr = __get_addr_by_funcname_handler(probe_lib, "write_msg") if write_msg_addr is None: - print "WARNING: <write_msg> address is not found!" + print "[WARN]: <write_msg> address is not found!" return file.write("static const char *probe_lib = \"" + da_inst_dir + "/" + da_lib + "\";\n") @@ -409,6 +413,7 @@ def __print_probe_lib(file, da_inst_dir, da_lib, probe_lib): def generate_headers(dict, da_inst_dir, da_lib, probe_lib): + print "generate_headers" c_output="include/ld_preload_probes.h" c_output_types="include/ld_preload_types.h" c_output_probe_lib="include/ld_preload_probe_lib.h" |