* 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:
parent
1e939db157
commit
f9b5584c8e
4 changed files with 1288 additions and 714 deletions
|
@ -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)
|
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
|
* xcoffexec.c (vmap_exec): Don't assume .text and .data are the
|
||||||
|
|
|
@ -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_FILES = ${REGEX} ${ALLOCA} ${XM_ADD_FILES} ${TM_ADD_FILES}
|
||||||
ADD_DEPS = ${REGEX1} ${ALLOCA1} ${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
|
DIST=gdb
|
||||||
|
|
||||||
LINT=/usr/5bin/lint
|
LINT=/usr/5bin/lint
|
||||||
|
@ -174,12 +174,12 @@ LINTFLAGS= -I${BFD_DIR}
|
||||||
# Select demangler to use.
|
# Select demangler to use.
|
||||||
DEMANGLER=cplus-dem
|
DEMANGLER=cplus-dem
|
||||||
|
|
||||||
# Select options to use when compiling ${DEMANGLER}.c. The default is to
|
# Select options to use when compiling ${DEMANGLER}.c. The default is no
|
||||||
# use -Dnounderscore, which is correct for most targets, and also
|
# options, which is correct for most targets, and also defaults to g++ style
|
||||||
# defaults to g++ style demangling. For other demangling styles, such
|
# demangling. For other demangling styles, such as the Annotated C++
|
||||||
# as the Annotated C++ Reference Manual (section 7.2.1c) style, set
|
# Reference Manual (section 7.2.1c) style, set this define in the target-
|
||||||
# this define in the target-dependent makefile fragment.
|
# dependent makefile fragment.
|
||||||
DEMANGLE_OPTS=-Dnounderscore
|
DEMANGLE_OPTS=
|
||||||
|
|
||||||
# Host and target-dependent makefile fragments come in here.
|
# Host and target-dependent makefile fragments come in here.
|
||||||
####
|
####
|
||||||
|
@ -729,14 +729,17 @@ gdb.cxref: $(SFILES)
|
||||||
|
|
||||||
force_update:
|
force_update:
|
||||||
|
|
||||||
# When used with GDB, the demangler should never look for leading
|
# Generate the demangler linked in with gdb. Also create a standalone
|
||||||
# underscores because GDB strips them off during symbol read-in. Thus
|
# demangler if so desired ("make demangle").
|
||||||
# -Dnounderscore.
|
|
||||||
|
|
||||||
${DEMANGLER}.o: ${DEMANGLER}.c
|
${DEMANGLER}.o: ${DEMANGLER}.c
|
||||||
${CC} -c ${INTERNAL_CFLAGS} ${DEMANGLE_OPTS} \
|
${CC} -c ${INTERNAL_CFLAGS} ${DEMANGLE_OPTS} \
|
||||||
`echo ${srcdir}/${DEMANGLER}.c | sed 's,^\./,,'`
|
`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
|
# GNU Make has an annoying habit of putting *all* the Makefile variables
|
||||||
# into the environment, unless you include this target as a circumvention.
|
# into the environment, unless you include this target as a circumvention.
|
||||||
# Rumor is that this will be fixed (and this target can be removed)
|
# Rumor is that this will be fixed (and this target can be removed)
|
||||||
|
|
1601
gdb/cplus-dem.c
1601
gdb/cplus-dem.c
File diff suppressed because it is too large
Load diff
|
@ -52,7 +52,7 @@ static void
|
||||||
type_print_base PARAMS ((struct type *, FILE *, int, int));
|
type_print_base PARAMS ((struct type *, FILE *, int, int));
|
||||||
|
|
||||||
static void
|
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
|
static void
|
||||||
type_print_varspec_prefix PARAMS ((struct type *, FILE *, int, int));
|
type_print_varspec_prefix PARAMS ((struct type *, FILE *, int, int));
|
||||||
|
@ -1350,6 +1350,8 @@ type_print_1 (type, varstring, stream, show, level)
|
||||||
int level;
|
int level;
|
||||||
{
|
{
|
||||||
register enum type_code code;
|
register enum type_code code;
|
||||||
|
char *demangled;
|
||||||
|
|
||||||
type_print_base (type, stream, show, level);
|
type_print_base (type, stream, show, level);
|
||||||
code = TYPE_CODE (type);
|
code = TYPE_CODE (type);
|
||||||
if ((varstring && *varstring)
|
if ((varstring && *varstring)
|
||||||
|
@ -1365,13 +1367,23 @@ type_print_1 (type, varstring, stream, show, level)
|
||||||
|| code == TYPE_CODE_REF)))
|
|| code == TYPE_CODE_REF)))
|
||||||
fprintf_filtered (stream, " ");
|
fprintf_filtered (stream, " ");
|
||||||
type_print_varspec_prefix (type, stream, show, 0);
|
type_print_varspec_prefix (type, stream, show, 0);
|
||||||
/* FIXME: Previously this printed demangled names without function args,
|
if (demangle)
|
||||||
which is a lose since you can't distinguish between overloaded function
|
{
|
||||||
names (try "info func" for example). This change is still not optimal,
|
demangled = cplus_demangle (varstring, DMGL_ANSI | DMGL_PARAMS);
|
||||||
since you now get a superflous pair of parens for functions, but at
|
}
|
||||||
least you can distinguish them. */
|
if ((demangled != NULL) && (code == TYPE_CODE_FUNC))
|
||||||
fputs_demangled (varstring, stream, DMGL_PARAMS);
|
{
|
||||||
type_print_varspec_suffix (type, stream, show, 0);
|
/* 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. */
|
/* 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. */
|
Args work like type_print_varspec_prefix. */
|
||||||
|
|
||||||
static void
|
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;
|
struct type *type;
|
||||||
FILE *stream;
|
FILE *stream;
|
||||||
int show;
|
int show;
|
||||||
int passed_a_ptr;
|
int passed_a_ptr;
|
||||||
|
int demangled_args;
|
||||||
{
|
{
|
||||||
if (type == 0)
|
if (type == 0)
|
||||||
return;
|
return;
|
||||||
|
@ -1579,19 +1592,19 @@ type_print_varspec_suffix (type, stream, show, passed_a_ptr)
|
||||||
fprintf_filtered (stream, "]");
|
fprintf_filtered (stream, "]");
|
||||||
|
|
||||||
type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
|
type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
|
||||||
0);
|
0, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TYPE_CODE_MEMBER:
|
case TYPE_CODE_MEMBER:
|
||||||
if (passed_a_ptr)
|
if (passed_a_ptr)
|
||||||
fprintf_filtered (stream, ")");
|
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;
|
break;
|
||||||
|
|
||||||
case TYPE_CODE_METHOD:
|
case TYPE_CODE_METHOD:
|
||||||
if (passed_a_ptr)
|
if (passed_a_ptr)
|
||||||
fprintf_filtered (stream, ")");
|
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)
|
if (passed_a_ptr)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@ -1616,14 +1629,15 @@ type_print_varspec_suffix (type, stream, show, passed_a_ptr)
|
||||||
|
|
||||||
case TYPE_CODE_PTR:
|
case TYPE_CODE_PTR:
|
||||||
case TYPE_CODE_REF:
|
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;
|
break;
|
||||||
|
|
||||||
case TYPE_CODE_FUNC:
|
case TYPE_CODE_FUNC:
|
||||||
type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
|
type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
|
||||||
passed_a_ptr);
|
passed_a_ptr, 0);
|
||||||
if (passed_a_ptr)
|
if (passed_a_ptr)
|
||||||
fprintf_filtered (stream, ")");
|
fprintf_filtered (stream, ")");
|
||||||
|
if (!demangled_args)
|
||||||
fprintf_filtered (stream, "()");
|
fprintf_filtered (stream, "()");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue