2001-01-24 Fernando Nasser <fnasser@redhat.com>
authorFernando Nasser <fnasser@redhat.com>
Wed, 24 Jan 2001 16:28:20 +0000 (16:28 +0000)
committerFernando Nasser <fnasser@redhat.com>
Wed, 24 Jan 2001 16:28:20 +0000 (16:28 +0000)
        * infcmd.c (get_inferior_args, set_inferior_args): Accessor functions
        for the inferior program arguments.
        (run_command, run_no_args_command, init_infcmd)): Use accessor
        functions to set the inferior program arguments.
        * inferior.h: Add definitions to the accessor functions above.

gdb/ChangeLog
gdb/infcmd.c
gdb/inferior.h

index d17d68b48318d85d336f2f4bf2612413c89a2018..16268067284cf165fb385f827790c4088d626e68 100644 (file)
@@ -1,3 +1,11 @@
+2001-01-24  Fernando Nasser  <fnasser@redhat.com>
+
+       * infcmd.c (get_inferior_args, set_inferior_args): Accessor functions
+       for the inferior program arguments.
+       (run_command, run_no_args_command, init_infcmd)): Use accessor
+       functions to set the inferior program arguments.
+       * inferior.h: Add definitions to the accessor functions above.
+
 2001-01-23  Jim Blandy  <jimb@redhat.com>
 
        * dwarf2read.c (read_tag_const_type, read_tag_volatile_type):
index d4a6fc0834e9e49b3a38c2e3cf86678e6991a952..91c6fac16e1b7a777929077d22f42b816b5bddaa 100644 (file)
@@ -191,6 +191,23 @@ int step_multi;
 
 struct environ *inferior_environ;
 \f
+/* Accessor routines. */
+
+char *
+get_inferior_args (void)
+{
+  return inferior_args;
+}
+
+char *
+set_inferior_args (char *newargs)
+{
+  char *saved_args = inferior_args;
+
+  inferior_args = newargs;
+
+  return saved_args;
+}
 
 /* This function detects whether or not a '&' character (indicating
    background execution) has been added as *the last* of the arguments ARGS
@@ -280,7 +297,6 @@ Start it from the beginning? "))
     }
   else
     {
-      char *cmd;
       int async_exec = strip_bg_char (&args);
 
       /* If we get a request for running in the bg but the target
@@ -299,9 +315,8 @@ Start it from the beginning? "))
       /* If there were other args, beside '&', process them. */
       if (args)
        {
-         cmd = concat ("set args ", args, NULL);
-         make_cleanup (xfree, cmd);
-         execute_command (cmd, from_tty);
+          char *old_args = set_inferior_args (xstrdup (args));
+          xfree (old_args);
        }
     }
 
@@ -335,8 +350,8 @@ Start it from the beginning? "))
 static void
 run_no_args_command (char *args, int from_tty)
 {
-  execute_command ("set args", from_tty);
-  run_command ((char *) NULL, from_tty);
+  char *old_args = set_inferior_args (xstrdup (""));
+  xfree (old_args);
 }
 \f
 
@@ -1944,7 +1959,7 @@ Register name as argument means describe only that register.");
   add_info ("float", float_info,
            "Print the status of the floating point unit\n");
 
-  inferior_args = savestring ("", 1);  /* Initially no args */
+  set_inferior_args (xstrdup (""));    /* Initially no args */
   inferior_environ = make_environ ();
   init_environ (inferior_environ);
 }
index 474d2788a1fc0f99ca92a98e461d5b1e1830f172..79fe5693d1df9ef7f42ea3481b333ac6296e6367 100644 (file)
@@ -285,6 +285,10 @@ extern void tty_command (char *, int);
 
 extern void attach_command (char *, int);
 
+extern char *get_inferior_arg (void);
+
+extern char *set_inferior_arg (char *);
+
 /* Last signal that the inferior received (why it stopped).  */
 
 extern enum target_signal stop_signal;
This page took 0.028603 seconds and 4 git commands to generate.