[gnu.gdb.bug] Can't display "this" in C++, with fix.

bryan@UUNET.UU.NET (Bryan Boreham) (08/15/89)

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.