+Tue Oct 14 12:01:00 1997 Mark Mitchell <mmitchell@usa.net>
+
+ * cplus-dem.c (demangle_signature): Don't look for return types on
+ constructors. Handle member template constructors.
+
+Fri Oct 3 17:53:30 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * README: Fix configuration instructions.
+
+Mon Sep 29 12:28:41 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * pexecute.c: Update to current version from /gd/gnu/lib:
+
+ Mon Sep 29 12:27:59 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * pexecute.c: Use spawn if __CYGWIN32__.
+
+ 1997-08-08 Paul Eggert <eggert@twinsun.com>
+
+ * pexecute.c: Include "config.h" first, as per autoconf manual.
+
+ Fri Jun 27 15:20:29 1997 Scott Christley <scottc@net-community.com>
+
+ * pexecute.c (fix_argv): New function.
+ (pexecute): Win32 but not Cygwin32 needs its arguments fixed.
+ Add underscore to cwait function call.
+
Sun Sep 28 12:00:52 1997 Mark Mitchell <mmitchell@usa.net>
* cplus-dem.c (demangle_template): Add new parameter. Handle new
(consume_count_with_underscores): New function.
(demangle_signature): Handle new name-mangling scheme.
+Sun Sep 28 12:00:52 1997 Mark Mitchell <mmitchell@usa.net>
+
+ * cplus-dem.c (demangle_template): Add new parameter. Handle new
+ template-function mangling.
+ (consume_count_with_underscores): New function.
+ (demangle_signature): Handle new name-mangling scheme.
+
+Wed Sep 24 00:31:59 1997 Felix Lee <flee@yin.cygnus.com>
+
+ * asprintf.c: stdarg.h when ALMOST_STDC
+ * config/mh-windows (EXTRA_OFILES): add asprintf.o and
+ strncasecmp.o.
+
+Thu Aug 28 14:27:15 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * vasprintf.c (vasprintf): Allow for _BSD_VA_LIST_.
+
+ * config.table: Add case for FreeBSD 2.1 and 2.2, needs mh-fbsd21.
+
+ * config/mh-fbsd21 (EXTRA_OFILES): Force vasprintf.o
+
+Wed Sep 10 12:43:10 1997 Jason Merrill <jason@yorick.cygnus.com>
+
+ * cplus-dem.c (demangle_fund_type): Change "complex" to "__complex".
+
Tue Sep 9 19:39:12 1997 Jim Wilson <wilson@cygnus.com>
* Makefile.in (install_to_libdir, install_to_tooldir): Add MULTISUBDIR
* Makefile.in (distclean): Do MULTICLEAN before deleting Makefile.
+Fri Sep 5 16:34:42 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * asprintf.c (asprintf): New file.
+ * Makefile.in (CFILES): Add asprintf.c
+ * functions.def: Ditto.
+
Wed Sep 3 14:35:52 1997 Jim Wilson <wilson@cygnus.com>
* Makefile.in (stamp-needed, stamp-config): Add MULTISRCTOP to
pathname for move-if-change.
+Thu Aug 28 18:53:34 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * argv.c (dupargv): New function, duplicate an argument vector.
+
Tue Aug 19 20:28:45 1997 Geoffrey Noer <noer@cygnus.com>
* config/mh-cygwin32: also build random.o
# NOTE: If you add new files to the library, add them to this list
# (alphabetical), and add them to REQUIRED_OFILES or 'functions.def'.
-CFILES = alloca.c argv.c atexit.c basename.c bcmp.c bcopy.c bzero.c \
+CFILES = asprintf.c alloca.c argv.c atexit.c basename.c bcmp.c bcopy.c bzero.c \
choose-temp.c clock.c concat.c cplus-dem.c fdmatch.c fnmatch.c \
getcwd.c getopt.c getopt1.c getpagesize.c getruntime.c \
floatformat.c hex.c index.c insque.c \
We expect many of the GNU subroutines that are floating around to
eventually arrive here.
-To build the library, do:
-
- ./configure HOSTTYPE
- make
+The library must be configured from the top source directory. Don't
+try to run configure in this directory. Follow the configuration
+instructions in ../README.
Please report bugs and fixes to "bug-gnu-utils@prep.ai.mit.edu". Thank you.
#define INITIAL_MAXARGC 8 /* Number of args + NULL in initial argv */
+/*
+
+NAME
+
+ dupargv -- duplicate an argument vector
+
+SYNOPSIS
+
+ char **dupargv (vector)
+ char **vector;
+
+DESCRIPTION
+
+ Duplicate an argument vector. Simply scans through the
+ vector, duplicating each argument argument until the
+ terminating NULL is found.
+
+RETURNS
+
+ Returns a pointer to the argument vector if
+ successful. Returns NULL if there is insufficient memory to
+ complete building the argument vector.
+
+*/
+
+char **
+dupargv (argv)
+ char **argv;
+{
+ int argc;
+ char **copy;
+
+ if (argv == NULL)
+ return NULL;
+
+ /* the vector */
+ for (argc = 0; argv[argc] != NULL; argc++);
+ copy = (char **) malloc ((argc + 1) * sizeof (char *));
+ if (copy == NULL)
+ return NULL;
+
+ /* the strings */
+ for (argc = 0; argv[argc] != NULL; argc++)
+ {
+ int len = strlen (argv[argc]);
+ copy[argc] = malloc (sizeof (char *) * (len + 1));
+ if (copy[argc] == NULL)
+ {
+ freeargv (copy);
+ return NULL;
+ }
+ strcpy (copy[argc], argv[argc]);
+ }
+ copy[argc] = NULL;
+ return copy;
+}
+
/*
NAME
*-*-cxux7*) frag=mh-cxux7 ;;
*-*-cygwin32) frag=mh-cygwin32 ;;
*-*-dgux*) frag=mh-sysv ;;
+ *-*-freebsd2.1.*) frag=mh-fbsd21 ;;
+ *-*-freebsd2.2.*) frag=mh-fbsd21 ;;
hppa*-hp-bsd*) frag=mh-hpbsd ;;
*-*-hpux*) frag=mh-hpux ;;
*-*-hiux*) frag=mh-hpux ;;
HDEFINES=-DNEED_basename -DNEED_sys_siglist -DNEED_strsignal -DNO_SYS_FILE_H
-EXTRA_OFILES=strcasecmp.o vasprintf.o
+EXTRA_OFILES=asprintf.o strcasecmp.o strncasecmp.o vasprintf.o
static int
get_count PARAMS ((const char **, int *));
+static int
+consume_count_with_underscores PARAMS ((const char**));
+
static int
consume_count PARAMS ((const char **));
}
+/* Like consume_count, but for counts that are preceeded and followed
+ by '_' if they are greater than 10. Also, -1 is returned for
+ failure, since 0 can be a valid value. */
+
+static int
+consume_count_with_underscores (mangled)
+ const char **mangled;
+{
+ int idx;
+
+ if (**mangled == '_')
+ {
+ (*mangled)++;
+ if (!isdigit (**mangled))
+ return -1;
+
+ idx = consume_count (mangled);
+ if (**mangled != '_')
+ /* The trailing underscore was missing. */
+ return -1;
+
+ (*mangled)++;
+ }
+ else
+ {
+ if (**mangled < '0' || **mangled > '9')
+ return -1;
+
+ idx = **mangled - '0';
+ (*mangled)++;
+ }
+
+ return idx;
+}
+
+
/* Like consume_count, but for counts that are preceeded and followed
by '_' if they are greater than 10. Also, -1 is returned for
failure, since 0 can be a valid value. */
{
/* A G++ template function. Read the template arguments. */
success = demangle_template (work, mangled, declp, 0, 0);
- expect_return_type = 1;
+ if (!(work->constructor & 1))
+ expect_return_type = 1;
(*mangled)++;
break;
}
}
}
else if ((scan == *mangled)
- && (isdigit (scan[2]) || (scan[2] == 'Q') || (scan[2] == 't')))
+ && (isdigit (scan[2]) || (scan[2] == 'Q') || (scan[2] == 't')
+ || (scan[2] == 'H')))
{
/* The ARM says nothing about the mangling of local variables.
But cfront mangles local variables by prepending __<nesting_level>
{
/* A GNU style constructor starts with __[0-9Qt]. But cfront uses
names like __Q2_3foo3bar for nested type names. So don't accept
- this style of constructor for cfront demangling. */
+ this style of constructor for cfront demangling. A GNU
+ style member-template constructor starts with 'H'. */
if (!(LUCID_DEMANGLING || ARM_DEMANGLING))
work -> constructor += 1;
*mangled = scan + 2;
}
break;
+ case 'X':
+ case 'Y':
+ /* A template parm. We substitute the corresponding argument. */
+ {
+ int idx;
+ int lvl;
+
+ (*mangled)++;
+ idx = consume_count_with_underscores (mangled);
+
+ if (idx == -1
+ || (work->tmpl_argvec && idx >= work->ntmpl_args)
+ || consume_count_with_underscores (mangled) == -1)
+ {
+ success = 0;
+ break;
+ }
+
+ if (work->tmpl_argvec)
+ string_append (result, work->tmpl_argvec[idx]);
+ else
+ {
+ char buf[10];
+ sprintf(buf, "T%d", idx);
+ string_append (result, buf);
+ }
+
+ success = 1;
+ }
+ break;
+
default:
success = demangle_fund_type (work, mangled, result);
break;
case 'J':
(*mangled)++;
APPEND_BLANK (result);
- string_append (result, "complex");
+ string_append (result, "__complex");
break;
default:
done = 1;
* the corresponding function in libc.
*/
+DEF(asprintf, int, (), NOTHING)
DEF(atexit, int, (f), void (*f)())
DEF(bcmp, int, (s1, s2, length), char *s1 AND char *s2 AND int length )
DEF(bcopy, void, (s1, s2, length), char *s1 AND char *s2 AND int length )
/* This file lives in at least two places: libiberty and gcc.
Don't change one without the other. */
+#ifdef IN_GCC
+#include "config.h"
+#endif
+
#include <stdio.h>
#include <errno.h>
#ifdef IN_GCC
-#include "config.h"
#include "gansidecl.h"
/* ??? Need to find a suitable header file. */
#define PEXECUTE_FIRST 1
extern int _spawnv ();
extern int _spawnvp ();
+#ifdef __CYGWIN32__
+
+#define fix_argv(argvec) (argvec)
+
+#else
+
+/* This is a kludge to get around the Microsoft C spawn functions' propensity
+ to remove the outermost set of double quotes from all arguments. */
+
+const char * const *
+fix_argv (argvec)
+ char **argvec;
+{
+ int i;
+
+ for (i = 1; argvec[i] != 0; i++)
+ {
+ int len, j;
+ char *temp, *newtemp;
+
+ temp = argvec[i];
+ len = strlen (temp);
+ for (j = 0; j < len; j++)
+ {
+ if (temp[j] == '"')
+ {
+ newtemp = xmalloc (len + 2);
+ strncpy (newtemp, temp, j);
+ newtemp [j] = '\\';
+ strncpy (&newtemp [j+1], &temp [j], len-j);
+ newtemp [len+1] = 0;
+ temp = newtemp;
+ len++;
+ j++;
+ }
+ }
+
+ argvec[i] = temp;
+ }
+
+ return (const char * const *) argvec;
+}
+
+#endif /* ! defined (__CYGWIN32__) */
+
int
pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags)
const char *program;
if ((flags & PEXECUTE_ONE) != PEXECUTE_ONE)
abort ();
- pid = (flags & PEXECUTE_SEARCH ? _spawnvp : _spawnv) (_P_NOWAIT, program, argv);
+ pid = (flags & PEXECUTE_SEARCH ? _spawnvp : _spawnv)
+ (_P_NOWAIT, program, fix_argv(argv));
if (pid == -1)
{
*errmsg_fmt = install_error_msg;
{
/* ??? Here's an opportunity to canonicalize the values in STATUS.
Needed? */
- return cwait (status, pid, WAIT_CHILD);
+ return _cwait (status, pid, WAIT_CHILD);
}
#endif /* _WIN32 */
vasprintf (result, format, args)
char **result;
const char *format;
+#if defined (_BSD_VA_LIST_) && defined (__FreeBSD__)
+ _BSD_VA_LIST_ args;
+#else
va_list args;
+#endif
{
return int_vasprintf (result, format, &args);
}