This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] add-inferior: expand tilde in -exec FILENAME argument


I could not come up with a solid testcase, hints are welcome.

2013-02-28  Sanimir Agovic  <sanimir.agovic@intel.com>

	* inferior.c: Include "readline/readline.h".
	(add_inferior_command): Tilde expand filename.

Signed-off-by: Sanimir Agovic <sanimir.agovic@intel.com>
---
 gdb/inferior.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gdb/inferior.c b/gdb/inferior.c
index ed6b626..abf0afa 100644
--- a/gdb/inferior.c
+++ b/gdb/inferior.c
@@ -35,6 +35,7 @@
 #include "continuations.h"
 #include "arch-utils.h"
 #include "target-descriptions.h"
+#include "readline/readline.h"
 
 void _initialize_inferiors (void);
 
@@ -850,7 +851,8 @@ add_inferior_command (char *args, int from_tty)
 		  ++argv;
 		  if (!*argv)
 		    error (_("No argument to -exec"));
-		  exec = *argv;
+		  exec = tilde_expand (*argv);
+		  make_cleanup (xfree, exec);
 		}
 	    }
 	  else
-- 
1.7.11.7


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]