From 571b5addac069964df3c30ca5b5b993d9912ca8c Mon Sep 17 00:00:00 2001 From: sgranjoux Date: Sun, 17 Feb 2008 11:52:15 +0000 Subject: [PATCH] * plugins/gdb/debugger.c: Load executable in gdb with space in path name git-svn-id: http://svn.gnome.org/svn/anjuta/trunk@3683 1dbfb86a-d425-0410-a06b-cb591aac69f6 --- ChangeLog | 5 +++++ plugins/gdb/debugger.c | 10 +++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 74dc6aec..9e245053 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-02-17 Sébastien Granjoux + + * plugins/gdb/debugger.c: + Load executable in gdb with space in path name + 2008-02-17 Johannes Schmid * plugins/language-support-cpp-java/plugin.c: diff --git a/plugins/gdb/debugger.c b/plugins/gdb/debugger.c index 787e7627..048e09c6 100644 --- a/plugins/gdb/debugger.c +++ b/plugins/gdb/debugger.c @@ -733,7 +733,9 @@ debugger_start (Debugger *debugger, const GList *search_dirs, if (exec_dir) { - dir = g_strconcat (" -directory=", exec_dir, NULL); + gchar *quoted_exec_dir = g_shell_quote (exec_dir); + dir = g_strconcat (" -directory=", quoted_exec_dir, NULL); + g_free (quoted_exec_dir); dir_list = g_list_prepend (dir_list, exec_dir); } else @@ -782,21 +784,23 @@ debugger_start (Debugger *debugger, const GList *search_dirs, if (prog && strlen(prog) > 0) { + gchar *quoted_prog = g_shell_quote (prog); if (exec_dir) chdir (exec_dir); if (is_libtool_prog == FALSE) { command_str = g_strdup_printf (GDB_PATH " -f -n -i=mi2 %s %s " "-x %s/gdb.init %s", dir, term == NULL ? "" : term, - PACKAGE_DATA_DIR, prog); + PACKAGE_DATA_DIR, quoted_prog); } else { command_str = g_strdup_printf ("libtool --mode=execute " GDB_PATH " -f -n -i=mi2 %s %s " "-x %s/gdb.init %s", dir, term == NULL ? "" : term, - PACKAGE_DATA_DIR, prog); + PACKAGE_DATA_DIR, quoted_prog); } + g_free (quoted_prog); } else { -- 2.11.4.GIT