From f274063917e167372af3eb6ad6d350f99219b880 Mon Sep 17 00:00:00 2001 From: Al Poole Date: Wed, 10 May 2017 06:35:33 +0100 Subject: [PATCH] debugpanel: automatically run gdb according to project type. libtool/generic. Reviewers: ajwillia.ms Reviewed By: ajwillia.ms Differential Revision: https://phab.enlightenment.org/D4852 --- src/bin/edi_debugpanel.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/bin/edi_debugpanel.c b/src/bin/edi_debugpanel.c index 61c084f..fd3331c 100644 --- a/src/bin/edi_debugpanel.c +++ b/src/bin/edi_debugpanel.c @@ -365,7 +365,7 @@ void edi_debugpanel_start(void) char cmd[1024]; char *args; int len; - const char *fmt = "set args %s\n"; + const char *mime, *fmt = "set args %s\n"; if (!_edi_project_config->launch.path) { @@ -375,7 +375,11 @@ void edi_debugpanel_start(void) if (_debug_exe) return; - snprintf(cmd, sizeof(cmd), "gdb %s", _edi_project_config->launch.path); + mime = efreet_mime_type_get(_edi_project_config->launch.path); + if (!strcmp(mime, "application/x-shellscript")) + snprintf(cmd, sizeof(cmd), "libtool --mode execute gdb %s", _edi_project_config->launch.path); + else + snprintf(cmd, sizeof(cmd), "gdb %s", _edi_project_config->launch.path); _debug_exe = ecore_exe_pipe_run(cmd, ECORE_EXE_PIPE_WRITE | ECORE_EXE_PIPE_ERROR |