* Makefile.in (VERSION): Bump to 4.5.3

* Makefile.in (DEMANGLE_OPTS):  Remove obsolete -Dnounderscore
	* Makefile.in (demangle):  New target to create standalone
	demangler with same code and options as internal demangler.
	* cplus-dem.c:  Massive restructuring, rewriting, cleanups, etc
	to support ARM style and Lucid style demangling, improve
	maintainability, fix several demangling bugs.  More changes
	to follow.
	* defs.h (strstr):  Add ANSI compatible prototype.
	* valprint.c (type_print_1):  Demangle using ansi option.
	* config/ncr3000.mt (DEMANGLE_OPTS):  Remove -Dnounderscore.
This commit is contained in:
Fred Fish 1992-05-10 01:43:04 +00:00
parent 1e939db157
commit f9b5584c8e
4 changed files with 1288 additions and 714 deletions

View File

@ -1,3 +1,17 @@
Sat May 9 18:02:17 1992 Fred Fish (fnf at fishpond)
* Makefile.in (VERSION): Bump to 4.5.3
* Makefile.in (DEMANGLE_OPTS): Remove obsolete -Dnounderscore
* Makefile.in (demangle): New target to create standalone
demangler with same code and options as internal demangler.
* cplus-dem.c: Massive restructuring, rewriting, cleanups, etc
to support ARM style and Lucid style demangling, improve
maintainability, fix several demangling bugs. More changes
to follow.
* defs.h (strstr): Add ANSI compatible prototype.
* valprint.c (type_print_1): Demangle using ansi option.
* config/ncr3000.mt (DEMANGLE_OPTS): Remove -Dnounderscore.
Sat May 9 14:47:28 1992 Stu Grossman (grossman at cygnus.com)
* xcoffexec.c (vmap_exec): Don't assume .text and .data are the

View File

@ -165,7 +165,7 @@ CDEPS = ${XM_CDEPS} ${TM_CDEPS} ${BFD_LIB} ${MMALLOC_LIB} ${LIBIBERTY} \
ADD_FILES = ${REGEX} ${ALLOCA} ${XM_ADD_FILES} ${TM_ADD_FILES}
ADD_DEPS = ${REGEX1} ${ALLOCA1} ${XM_ADD_FILES} ${TM_ADD_FILES}
VERSION = 4.5.2
VERSION = 4.5.3
DIST=gdb
LINT=/usr/5bin/lint
@ -174,12 +174,12 @@ LINTFLAGS= -I${BFD_DIR}
# Select demangler to use.
DEMANGLER=cplus-dem
# Select options to use when compiling ${DEMANGLER}.c. The default is to
# use -Dnounderscore, which is correct for most targets, and also
# defaults to g++ style demangling. For other demangling styles, such
# as the Annotated C++ Reference Manual (section 7.2.1c) style, set
# this define in the target-dependent makefile fragment.
DEMANGLE_OPTS=-Dnounderscore
# Select options to use when compiling ${DEMANGLER}.c. The default is no
# options, which is correct for most targets, and also defaults to g++ style
# demangling. For other demangling styles, such as the Annotated C++
# Reference Manual (section 7.2.1c) style, set this define in the target-
# dependent makefile fragment.
DEMANGLE_OPTS=
# Host and target-dependent makefile fragments come in here.
####
@ -729,14 +729,17 @@ gdb.cxref: $(SFILES)
force_update:
# When used with GDB, the demangler should never look for leading
# underscores because GDB strips them off during symbol read-in. Thus
# -Dnounderscore.
# Generate the demangler linked in with gdb. Also create a standalone
# demangler if so desired ("make demangle").
${DEMANGLER}.o: ${DEMANGLER}.c
${DEMANGLER}.o: ${DEMANGLER}.c
${CC} -c ${INTERNAL_CFLAGS} ${DEMANGLE_OPTS} \
`echo ${srcdir}/${DEMANGLER}.c | sed 's,^\./,,'`
demangle: ${DEMANGLER}.c
${CC} -o $@ -DMAIN ${INTERNAL_CFLAGS} ${DEMANGLE_OPTS} \
`echo ${srcdir}/${DEMANGLER}.c | sed 's,^\./,,'`
# GNU Make has an annoying habit of putting *all* the Makefile variables
# into the environment, unless you include this target as a circumvention.
# Rumor is that this will be fixed (and this target can be removed)

File diff suppressed because it is too large Load Diff

View File

@ -52,7 +52,7 @@ static void
type_print_base PARAMS ((struct type *, FILE *, int, int));
static void
type_print_varspec_suffix PARAMS ((struct type *, FILE *, int, int));
type_print_varspec_suffix PARAMS ((struct type *, FILE *, int, int, int));
static void
type_print_varspec_prefix PARAMS ((struct type *, FILE *, int, int));
@ -1350,6 +1350,8 @@ type_print_1 (type, varstring, stream, show, level)
int level;
{
register enum type_code code;
char *demangled;
type_print_base (type, stream, show, level);
code = TYPE_CODE (type);
if ((varstring && *varstring)
@ -1365,13 +1367,23 @@ type_print_1 (type, varstring, stream, show, level)
|| code == TYPE_CODE_REF)))
fprintf_filtered (stream, " ");
type_print_varspec_prefix (type, stream, show, 0);
/* FIXME: Previously this printed demangled names without function args,
which is a lose since you can't distinguish between overloaded function
names (try "info func" for example). This change is still not optimal,
since you now get a superflous pair of parens for functions, but at
least you can distinguish them. */
fputs_demangled (varstring, stream, DMGL_PARAMS);
type_print_varspec_suffix (type, stream, show, 0);
if (demangle)
{
demangled = cplus_demangle (varstring, DMGL_ANSI | DMGL_PARAMS);
}
if ((demangled != NULL) && (code == TYPE_CODE_FUNC))
{
/* For demangled function names, we have the arglist as part
of the name, so don't print an additional pair of ()'s */
fputs_filtered (demangled, stream);
type_print_varspec_suffix (type, stream, show, 0, 1);
free (demangled);
}
else
{
fputs_filtered (varstring, stream);
type_print_varspec_suffix (type, stream, show, 0, 0);
}
}
/* Print the method arguments ARGS to the file STREAM. */
@ -1550,11 +1562,12 @@ type_print_varspec_prefix (type, stream, show, passed_a_ptr)
Args work like type_print_varspec_prefix. */
static void
type_print_varspec_suffix (type, stream, show, passed_a_ptr)
type_print_varspec_suffix (type, stream, show, passed_a_ptr, demangled_args)
struct type *type;
FILE *stream;
int show;
int passed_a_ptr;
int demangled_args;
{
if (type == 0)
return;
@ -1579,19 +1592,19 @@ type_print_varspec_suffix (type, stream, show, passed_a_ptr)
fprintf_filtered (stream, "]");
type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
0);
0, 0);
break;
case TYPE_CODE_MEMBER:
if (passed_a_ptr)
fprintf_filtered (stream, ")");
type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 0);
type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 0, 0);
break;
case TYPE_CODE_METHOD:
if (passed_a_ptr)
fprintf_filtered (stream, ")");
type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 0);
type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 0, 0);
if (passed_a_ptr)
{
int i;
@ -1616,15 +1629,16 @@ type_print_varspec_suffix (type, stream, show, passed_a_ptr)
case TYPE_CODE_PTR:
case TYPE_CODE_REF:
type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 1);
type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 1, 0);
break;
case TYPE_CODE_FUNC:
type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
passed_a_ptr);
passed_a_ptr, 0);
if (passed_a_ptr)
fprintf_filtered (stream, ")");
fprintf_filtered (stream, "()");
if (!demangled_args)
fprintf_filtered (stream, "()");
break;
case TYPE_CODE_UNDEF: