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] Handle ~ in the 'exec' argument of add-inferior.


Hi,
While working on something else, I noticed that exec argument of the add-inferior command does not expand the tilde in the path. It was a bit inconvenient to type the full path so I created this little patch. Does it look ok?

Regards,
Abid

2013-05-29  Hafiz Abid Qadeer  <abidh@codesourcery.com>

	* inferior.c (top level): Include tilde.h.
	(add_inferior_command): Call tilda_expand on the value of 'exec'
	argument.
---
diff --git a/gdb/inferior.c b/gdb/inferior.c
index ed6b626..b9e9a8d 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/tilde.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


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