aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1991-04-26 22:58:14 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1991-04-26 22:58:14 +0000
commit55838914fd0955696a9d663570e60716c9e727e8 (patch)
treeabd046b1b426befdcbde2ce2179da2b23f07b71d
parent5cced1845900780fe787965618ff1e4e19947be7 (diff)
downloadgdb-55838914fd0955696a9d663570e60716c9e727e8.zip
gdb-55838914fd0955696a9d663570e60716c9e727e8.tar.gz
gdb-55838914fd0955696a9d663570e60716c9e727e8.tar.bz2
* cplus-dem.c (optable): Add "nw", "dl", "compound".
(cplus_mangle_opname): New function. (do_type): Add case 'Q'. * vax-opcode.h, expread.y, expprint.c, cplus-dem.c: Declare some things "const".
-rw-r--r--gdb/cplus-dem.c41
1 files changed, 37 insertions, 4 deletions
diff --git a/gdb/cplus-dem.c b/gdb/cplus-dem.c
index 3689b23..b01cb93 100644
--- a/gdb/cplus-dem.c
+++ b/gdb/cplus-dem.c
@@ -19,7 +19,9 @@
/* This is for g++ 1.36.1 (November 6 version). It will probably
require changes for any other version.
- Modified for g++ 1.36.2 (November 18 version). */
+ Modified for g++ 1.36.2 (November 18 version).
+
+ Modified for g++ 1.90.06 (December 31 version). */
/* This file exports one function
@@ -97,12 +99,14 @@ static char **typevec = 0;
static int ntypes = 0;
static int typevec_size = 0;
-static struct {
+const static struct {
const char *in;
const char *out;
} optable[] = {
- "new", " new",
- "delete", " delete",
+ "nw", " new", /* new (1.92) */
+ "dl", " delete", /* new (1.92) */
+ "new", " new", /* old (1.91, and 1.x) */
+ "delete", " delete", /* old (1.91, and 1.x) */
"ne", "!=",
"eq", "==",
"ge", ">=",
@@ -134,6 +138,7 @@ static struct {
"method_call", "->()",
"addr", "&", /* unary & */
"array", "[]",
+ "compound", ",",
"nop", "", /* for operator= */
};
@@ -188,6 +193,25 @@ static void munge_function_name ();
static void remember_type ();
#endif
+/* Takes operator name as e.g. "++" and returns mangled
+ operator name (e.g. "postincrement_expr"). */
+char *
+cplus_mangle_opname (opname)
+ char *opname;
+{
+ int i, len = strlen (opname);
+ string name;
+
+ for (i = 0; i < sizeof (optable)/sizeof (optable[0]); i++)
+ {
+ if (strlen (optable[i].out) == len
+ && memcmp (optable[i].out, opname, len) == 0)
+ return optable[i].in;
+ }
+ error ("no mangling for `%s'", opname);
+ return 0;
+}
+
char *
cplus_demangle (type, arg_mode)
const char *type;
@@ -410,6 +434,15 @@ do_type (type, result, arg_mode)
int member;
switch (**type)
{
+ case 'Q':
+ n = (*type)[1] - '0';
+ if (n < 0 || n > 9)
+ success = 0;
+ *type += 2;
+ while (n-- > 0)
+ do_type (type, result);
+ break;
+
case 'P':
*type += 1;
string_prepend (&decl, "*");