#include <errno.h>
#include "da_protocol.h"
#include "da_data.h"
+#include "utils.h"
#include "elf.h"
#include "debug.h"
int fields;
FILE *f;
+ // TODO need check this result and return error
+ dereference_tizen_exe_path(prof_session.app_info.exe_path, path);
get_build_dir(binary_path, prof_session.app_info.exe_path);
fill_data_msg_head(msg, NMSG_PROCESS_INFO, 0, 0);
- sprintf(buf, "%s%d%s%s", AWK_START, pid, AWK_END_PROCESS,
- prof_session.app_info.exe_path);
+ sprintf(buf, "%s%d%s%s", AWK_START, pid, AWK_END_PROCESS,path);
f = popen(buf, "r");
if (!f) {
if (fields != 3) {
start = 0;
end = 0;
+ LOGW("cannot find start-end values. fields=%d\n", fields);
}
pclose(f);
return ret;
}
+char *dereference_tizen_exe_path(const char *path, char *resolved)
+{
+ char *res = NULL;
+ char tmp_path[PATH_MAX];
+
+ resolved[0] = 0;
+ //try resolve <path>.exe
+ sprintf(tmp_path, "%s.exe", path);
+ if ((res = realpath(tmp_path, resolved)) == NULL) {
+ //try to resolve path <path>
+ res = realpath(path, resolved);
+ }
+
+ return res;
+}
int exec_app_tizen(const char *app_id, const char *exec_path);
int exec_app_common(const char* exec_path);
+char *dereference_tizen_exe_path(const char *path, char *resolved);
#ifdef __cplusplus
}
#endif