Article View: gnu.gdb.bug
Article #237Can't display "this" in C++, with fix.
From: Bryan Boreham
Date: Tue, 15 Aug 1989 15:39
Date: Tue, 15 Aug 1989 15:39
35 lines
1316 bytes
1316 bytes
There was no provision in print_subexp for OP_THIS in C++, so I
added it, plus the max and min operators. I'm not sure if I got
the precedences right, or if the code for OP_THIS should add
something to *pos.
kewill% diff -c expprint.c~ expprint.c
*** expprint.c~ Fri Jul 7 22:22:13 1989
--- expprint.c Tue Aug 15 16:32:12 1989
***************
*** 82,87 ****
--- 82,89 ----
{"++", UNOP_PREINCREMENT, PREC_PREFIX, 0},
{"--", UNOP_PREDECREMENT, PREC_PREFIX, 0},
/* C++ */
+ {"<?", BINOP_MIN, PREC_ORDER, 0},
+ {">?", BINOP_MAX, PREC_ORDER, 0},
{"::", BINOP_SCOPE, PREC_PREFIX, 0},
};
***************
*** 122,127 ****
--- 124,133 ----
opcode = exp->elts[pc].opcode;
switch (opcode)
{
+ case OP_THIS:
+ fprintf(stream, "this");
+ return;
+
case OP_SCOPE:
myprec = PREC_PREFIX;
assoc = 0;
Bryan.
Technical Details
Message-ID:
<8908151539.AA12021@edinburgh.kewill.uucp>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!UUNET.UU.NET!kewill!bryanShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!UUNET.UU.NET!kewill!bryan From: kewill!bryan@UUNET.UU.NET (Bryan Boreham) Newsgroups: gnu.gdb.bug Subject: Can't display "this" in C++, with fix. Message-ID: <8908151539.AA12021@edinburgh.kewill.uucp> Date: 15 Aug 89 15:39:54 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 35