debugpanel: fix segv if "make clean" has removed debug executable.

Summary:
Didn't really want to add any more dialogues without discussing properly with
Andy. For now this stops a potential crash.

Reviewers: ajwillia.ms

Reviewed By: ajwillia.ms

Differential Revision: https://phab.enlightenment.org/D4984
This commit is contained in:
Al Poole 2017-06-25 10:57:16 +01:00 committed by Andy Williams
parent 6f4113bcac
commit 650dd308d0
1 changed files with 9 additions and 1 deletions

View File

@ -400,7 +400,7 @@ void edi_debugpanel_start(void)
char cmd[1024];
char *args;
int len;
const char *mime, *fmt = "set args %s\n";
const char *warning, *mime, *fmt;
if (!_edi_project_config->launch.path)
{
@ -410,6 +410,13 @@ void edi_debugpanel_start(void)
if (_debug_exe) return;
if (!ecore_file_exists(_edi_project_config->launch.path))
{
warning = "Warning: executable does not exists (run make?)";
elm_code_file_line_append(_debug_output->file, warning, strlen(warning), NULL);
return;
}
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);
@ -429,6 +436,7 @@ void edi_debugpanel_start(void)
if (_edi_project_config->launch.args)
{
fmt = "set args %s\n";
len = strlen(fmt) + strlen(_edi_project_config->launch.args) + 1;
args = malloc(len);
snprintf(args, len, fmt, _edi_project_config->launch.args);