summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHwankyu Jhun <h.jhun@samsung.com>2017-03-07 13:25:26 +0900
committerHwankyu Jhun <h.jhun@samsung.com>2017-03-07 13:35:17 +0900
commitf0af93c0943bb451acb17fed285e49b1fadcea45 (patch)
tree975707ab8356e6637d729228de568835b0f9bb0b
parentc14ef4804d320c26545f3ac28acc14bae69a375d (diff)
downloadlaunchpad-f0af93c0943bb451acb17fed285e49b1fadcea45.tar.gz
launchpad-f0af93c0943bb451acb17fed285e49b1fadcea45.tar.bz2
launchpad-f0af93c0943bb451acb17fed285e49b1fadcea45.zip
Ignore SIGILL during OpenSSL initialization
When debugging an application by using the gdbserver, SIGILL is occurred during OpenSSL initialization. After applying this patch, the launchpad will support to add the default option for the debug tools. While executing an application with the gdbserver, "--wrapper env OPENSSL_armcap=0 --" will be set by the launchpad. e.g. $ /usr/bin/gdbserver --wrapper env OPENSSL_armcap=0 -- :<port> <path> Change-Id: Id8141d2fd76daff50ad0bde9a6fbae903a3de869 Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
-rw-r--r--inc/debugger_info.h1
-rw-r--r--packaging/default.debugger.in4
-rw-r--r--src/debugger_info.c16
-rw-r--r--src/launchpad_debug.c13
4 files changed, 33 insertions, 1 deletions
diff --git a/inc/debugger_info.h b/inc/debugger_info.h
index 22bd253..ecaae3a 100644
--- a/inc/debugger_info.h
+++ b/inc/debugger_info.h
@@ -30,5 +30,6 @@ GList *_debugger_info_get_extra_env_list(debugger_info_h info);
GList *_debugger_info_get_unlink_list(debugger_info_h info);
const char *_debugger_info_get_attach(debugger_info_h info);
GList *_debugger_info_get_last_extra_key_list(debugger_info_h info);
+GList *_debugger_info_get_default_opt_list(debugger_info_h info);
#endif /* __DEBUGGER_INFO_H__ */
diff --git a/packaging/default.debugger.in b/packaging/default.debugger.in
index 7b8428d..cce288e 100644
--- a/packaging/default.debugger.in
+++ b/packaging/default.debugger.in
@@ -11,6 +11,10 @@ NAME DEBUG
EXE /opt/usr/home/owner/share/tmp/sdk_tools/gdbserver/gdbserver
APP_TYPE capp|c++app
EXTRA_KEY __DLP_DEBUG_ARG__
+DEFAULT_OPT --wrapper
+DEFAULT_OPT env
+DEFAULT_OPT OPENSSL_armcap=0
+DEFAULT_OPT --
[DEBUGGER]
NAME ATTACH
diff --git a/src/debugger_info.c b/src/debugger_info.c
index aa576ac..44bd1e9 100644
--- a/src/debugger_info.c
+++ b/src/debugger_info.c
@@ -34,6 +34,7 @@
#define TAG_UNLINK "UNLINK"
#define TAG_ATTACH "ATTACH"
#define TAG_LAST_EXTRA_KEY "LAST_EXTRA_KEY"
+#define TAG_DEFAULT_OPT "DEFAULT_OPT"
struct debugger_info_s {
char *name;
@@ -44,6 +45,7 @@ struct debugger_info_s {
GList *unlink_list;
char *attach;
GList *last_extra_key_list;
+ GList *default_opt_list;
};
static struct debugger_info_s *__create_debugger_info(void)
@@ -66,6 +68,8 @@ static void __destroy_debugger_info(gpointer data)
if (info == NULL)
return;
+ if (info->default_opt_list)
+ g_list_free_full(info->default_opt_list, free);
if (info->last_extra_key_list)
g_list_free_full(info->last_extra_key_list, free);
if (info->attach)
@@ -183,6 +187,10 @@ static GList *__parse_file(GList *list, const char *path)
info->last_extra_key_list = g_list_append(
info->last_extra_key_list,
strdup(tok2));
+ } else if (strcasecmp(TAG_DEFAULT_OPT, tok1) == 0) {
+ info->default_opt_list = g_list_append(
+ info->default_opt_list,
+ strdup(tok2));
}
}
fclose(fp);
@@ -308,3 +316,11 @@ GList *_debugger_info_get_last_extra_key_list(debugger_info_h info)
return info->last_extra_key_list;
}
+
+GList *_debugger_info_get_default_opt_list(debugger_info_h info)
+{
+ if (info == NULL)
+ return NULL;
+
+ return info->default_opt_list;
+}
diff --git a/src/launchpad_debug.c b/src/launchpad_debug.c
index 4ead375..da11576 100644
--- a/src/launchpad_debug.c
+++ b/src/launchpad_debug.c
@@ -88,6 +88,7 @@ int _debug_create_argv(int *argc, char ***argv, bool *attach)
const char *debug_argv;
const char *attach_str;
GList *iter;
+ GList *list;
int i;
if (argc == NULL || argv == NULL || attach == NULL) {
@@ -106,7 +107,8 @@ int _debug_create_argv(int *argc, char ***argv, bool *attach)
if (attach_str && strcasecmp(attach_str, "true") == 0)
*attach = true;
- new_argc = g_list_length(debug_argv_list) + 1;
+ list = _debugger_info_get_default_opt_list(debugger_info);
+ new_argc = g_list_length(debug_argv_list) + g_list_length(list) + 1;
new_argv = (char **)calloc(new_argc, sizeof(char *));
if (new_argv == NULL) {
_E("out of memory");
@@ -116,6 +118,15 @@ int _debug_create_argv(int *argc, char ***argv, bool *attach)
i = LOADER_ARG_PATH;
new_argv[i++] = strdup(exe);
+ iter = g_list_first(list);
+ while (iter) {
+ debug_argv = (const char *)iter->data;
+ if (debug_argv)
+ new_argv[i++] = strdup(debug_argv);
+
+ iter = g_list_next(iter);
+ }
+
iter = g_list_first(debug_argv_list);
while (iter) {
debug_argv = (const char *)iter->data;