ajwillia-ms pushed a commit to branch master.

http://git.enlightenment.org/tools/edi.git/commit/?id=f274063917e167372af3eb6ad6d350f99219b880

commit f274063917e167372af3eb6ad6d350f99219b880
Author: Al Poole <nets...@gmail.com>
Date:   Wed May 10 06:35:33 2017 +0100

    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 |

-- 


Reply via email to