* NEWS: Update for --args.
authorTom Tromey <tromey@redhat.com>
Tue, 27 Nov 2001 03:09:44 +0000 (03:09 +0000)
committerTom Tromey <tromey@redhat.com>
Tue, 27 Nov 2001 03:09:44 +0000 (03:09 +0000)
* infcmd.c (construct_inferior_arguments): Moved from ...
* fork-child.c: ... here.

gdb/ChangeLog
gdb/NEWS
gdb/fork-child.c
gdb/infcmd.c

index 6d9bd8847e5950300be2bb53869d9bba9b68bac2..99aa1202f5cd82e7064a1d6b2c1c63e4fd2e7d7b 100644 (file)
@@ -1,3 +1,9 @@
+2001-11-26  Tom Tromey  <tromey@redhat.com>
+
+       * NEWS: Update for --args.
+       * infcmd.c (construct_inferior_arguments): Moved from ...
+       * fork-child.c: ... here.
+
 2001-11-26  Jim Blandy  <jimb@redhat.com>
 
        * symtab.c (find_pc_sect_line): Revert change of 2001-11-13; add
index 5d9468566b961b3bf3d38bba768cfef6fd1aac58..7f874392f64e4310a5c01bce7214b1ca2c2c9e46 100644 (file)
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -7,6 +7,11 @@
 
 x86 OpenBSD                                    i[3456]86-*-openbsd*
 
+* Changes to command line processing
+
+The new `--args' feature can be used to specify command-line arguments
+for the inferior from gdb's command line.
+
 *** Changes in GDB 5.1:
 
 * New native configurations
index 24cd00a5b1dbbcc0b589f0cd9a75bc769a2fd36e..21e508939b6fb65076b514e3e80e030f43c0a97d 100644 (file)
@@ -568,74 +568,3 @@ startup_inferior (int ntraps)
 #endif /* STARTUP_INFERIOR */
   stop_soon_quietly = 0;
 }
-
-/* Compute command-line string given argument vector.  This does the
-   same shell processing as fork_inferior.  */
-/* ARGSUSED */
-char *
-construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv)
-{
-  char *result;
-
-  if (STARTUP_WITH_SHELL)
-    {
-      /* This holds all the characters considered special to the
-        typical Unix shells.  We include `^' because the SunOS
-        /bin/sh treats it as a synonym for `|'.  */
-      char *special = "\"!#$&*()\\|[]{}<>?'\"`~^; \t\n";
-      int i;
-      int length = 0;
-      char *out, *cp;
-
-      /* We over-compute the size.  It shouldn't matter.  */
-      for (i = 0; i < argc; ++i)
-       length += 2 * strlen (argv[i]) + 1;
-
-      result = (char *) xmalloc (length);
-      out = result;
-
-      for (i = 0; i < argc; ++i)
-       {
-         if (i > 0)
-           *out++ = ' ';
-
-         for (cp = argv[i]; *cp; ++cp)
-           {
-             if (strchr (special, *cp) != NULL)
-               *out++ = '\\';
-             *out++ = *cp;
-           }
-       }
-      *out = '\0';
-    }
-  else
-    {
-      /* In this case we can't handle arguments that contain spaces,
-        tabs, or newlines -- see breakup_args().  */
-      int i;
-      int length = 0;
-
-      for (i = 0; i < argc; ++i)
-       {
-         char *cp = strchr (argv[i], ' ');
-         if (cp == NULL)
-           cp = strchr (argv[i], '\t');
-         if (cp == NULL)
-           cp = strchr (argv[i], '\n');
-         if (cp != NULL)
-           error ("can't handle command-line argument containing whitespace");
-         length += strlen (argv[i]) + 1;
-       }
-
-      result = (char *) xmalloc (length);
-      result[0] = '\0';
-      for (i = 0; i < argc; ++i)
-       {
-         if (i > 0)
-           strcat (result, " ");
-         strcat (result, argv[i]);
-       }
-    }
-
-  return result;
-}
index b0d74eede2ffa8f3bceeead1aedff7b67c5bdd76..f05da5aef9b06825037715c88b7355bbc1cbc101 100644 (file)
@@ -256,6 +256,77 @@ notice_args_read (struct cmd_list_element *c)
   get_inferior_args ();
 }
 
+\f
+/* Compute command-line string given argument vector.  This does the
+   same shell processing as fork_inferior.  */
+/* ARGSUSED */
+char *
+construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv)
+{
+  char *result;
+
+  if (STARTUP_WITH_SHELL)
+    {
+      /* This holds all the characters considered special to the
+        typical Unix shells.  We include `^' because the SunOS
+        /bin/sh treats it as a synonym for `|'.  */
+      char *special = "\"!#$&*()\\|[]{}<>?'\"`~^; \t\n";
+      int i;
+      int length = 0;
+      char *out, *cp;
+
+      /* We over-compute the size.  It shouldn't matter.  */
+      for (i = 0; i < argc; ++i)
+       length += 2 * strlen (argv[i]) + 1;
+
+      result = (char *) xmalloc (length);
+      out = result;
+
+      for (i = 0; i < argc; ++i)
+       {
+         if (i > 0)
+           *out++ = ' ';
+
+         for (cp = argv[i]; *cp; ++cp)
+           {
+             if (strchr (special, *cp) != NULL)
+               *out++ = '\\';
+             *out++ = *cp;
+           }
+       }
+      *out = '\0';
+    }
+  else
+    {
+      /* In this case we can't handle arguments that contain spaces,
+        tabs, or newlines -- see breakup_args().  */
+      int i;
+      int length = 0;
+
+      for (i = 0; i < argc; ++i)
+       {
+         char *cp = strchr (argv[i], ' ');
+         if (cp == NULL)
+           cp = strchr (argv[i], '\t');
+         if (cp == NULL)
+           cp = strchr (argv[i], '\n');
+         if (cp != NULL)
+           error ("can't handle command-line argument containing whitespace");
+         length += strlen (argv[i]) + 1;
+       }
+
+      result = (char *) xmalloc (length);
+      result[0] = '\0';
+      for (i = 0; i < argc; ++i)
+       {
+         if (i > 0)
+           strcat (result, " ");
+         strcat (result, argv[i]);
+       }
+    }
+
+  return result;
+}
 \f
 
 /* This function detects whether or not a '&' character (indicating
This page took 0.032521 seconds and 4 git commands to generate.