home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / D / GDB / GDB-4.13 / GDB-4 / gdb-4.13 / gdb / expprint.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-02  |  19.7 KB  |  625 lines

  1. /* Print in infix form a struct expression.
  2.    Copyright (C) 1986, 1989, 1991 Free Software Foundation, Inc.
  3.  
  4. This file is part of GDB.
  5.  
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2 of the License, or
  9. (at your option) any later version.
  10.  
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with this program; if not, write to the Free Software
  18. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  19.  
  20. #include "defs.h"
  21. #include "symtab.h"
  22. #include "gdbtypes.h"
  23. #include "expression.h"
  24. #include "value.h"
  25. #include "language.h"
  26. #include "parser-defs.h"
  27.  
  28. /* Prototypes for local functions */
  29.  
  30. static void
  31. print_subexp PARAMS ((struct expression *, int *, GDB_FILE *, enum precedence));
  32.  
  33. static void
  34. print_simple_m2_func PARAMS ((char *, struct expression *, int *, GDB_FILE *));
  35.  
  36. void
  37. print_expression (exp, stream)
  38.      struct expression *exp;
  39.      GDB_FILE *stream;
  40. {
  41.   int pc = 0;
  42.   print_subexp (exp, &pc, stream, PREC_NULL);
  43. }
  44.  
  45. /* Print the subexpression of EXP that starts in position POS, on STREAM.
  46.    PREC is the precedence of the surrounding operator;
  47.    if the precedence of the main operator of this subexpression is less,
  48.    parentheses are needed here.  */
  49.  
  50. static void
  51. print_subexp (exp, pos, stream, prec)
  52.      register struct expression *exp;
  53.      register int *pos;
  54.      GDB_FILE *stream;
  55.      enum precedence prec;
  56. {
  57.   register unsigned tem;
  58.   register const struct op_print *op_print_tab;
  59.   register int pc;
  60.   unsigned nargs;
  61.   register char *op_str;
  62.   int assign_modify = 0;
  63.   enum exp_opcode opcode;
  64.   enum precedence myprec = PREC_NULL;
  65.   /* Set to 1 for a right-associative operator.  */
  66.   int assoc = 0;
  67.   value_ptr val;
  68.   char *tempstr = NULL;
  69.  
  70.   op_print_tab = exp->language_defn->la_op_print_tab;
  71.   pc = (*pos)++;
  72.   opcode = exp->elts[pc].opcode;
  73.   switch (opcode)
  74.     {
  75.     /* Common ops */
  76.  
  77.     case OP_SCOPE:
  78.       myprec = PREC_PREFIX;
  79.       assoc = 0;
  80.       fputs_filtered (type_name_no_tag (exp->elts[pc + 1].type), stream);
  81.       fputs_filtered ("::", stream);
  82.       nargs = longest_to_int (exp->elts[pc + 2].longconst);
  83.       (*pos) += 4 + BYTES_TO_EXP_ELEM (nargs + 1);
  84.       fputs_filtered (&exp->elts[pc + 3].string, stream);
  85.       return;
  86.  
  87.     case OP_LONG:
  88.       (*pos) += 3;
  89.       value_print (value_from_longest (exp->elts[pc + 1].type,
  90.                        exp->elts[pc + 2].longconst),
  91.            stream, 0, Val_no_prettyprint);
  92.       return;
  93.  
  94.     case OP_DOUBLE:
  95.       (*pos) += 3;
  96.       value_print (value_from_double (exp->elts[pc + 1].type,
  97.                       exp->elts[pc + 2].doubleconst),
  98.            stream, 0, Val_no_prettyprint);
  99.       return;
  100.  
  101.     case OP_VAR_VALUE:
  102.       {
  103.     struct block *b;
  104.     (*pos) += 3;
  105.     b = exp->elts[pc + 1].block;
  106.     if (b != NULL
  107.         && BLOCK_FUNCTION (b) != NULL
  108.         && SYMBOL_SOURCE_NAME (BLOCK_FUNCTION (b)) != NULL)
  109.       {
  110.         fputs_filtered (SYMBOL_SOURCE_NAME (BLOCK_FUNCTION (b)), stream);
  111.         fputs_filtered ("::", stream);
  112.       }
  113.     fputs_filtered (SYMBOL_SOURCE_NAME (exp->elts[pc + 2].symbol), stream);
  114.       }
  115.       return;
  116.  
  117.     case OP_LAST:
  118.       (*pos) += 2;
  119.       fprintf_filtered (stream, "$%d",
  120.             longest_to_int (exp->elts[pc + 1].longconst));
  121.       return;
  122.  
  123.     case OP_REGISTER:
  124.       (*pos) += 2;
  125.       fprintf_filtered (stream, "$%s",
  126.            reg_names[longest_to_int (exp->elts[pc + 1].longconst)]);
  127.       return;
  128.  
  129.     case OP_BOOL:
  130.       (*pos) += 2;
  131.       fprintf_filtered (stream, "%s",
  132.             longest_to_int (exp->elts[pc + 1].longconst)
  133.             ? "TRUE" : "FALSE");
  134.       return;
  135.  
  136.     case OP_INTERNALVAR:
  137.       (*pos) += 2;
  138.       fprintf_filtered (stream, "$%s",
  139.            internalvar_name (exp->elts[pc + 1].internalvar));
  140.       return;
  141.  
  142.     case OP_FUNCALL:
  143.       (*pos) += 2;
  144.       nargs = longest_to_int (exp->elts[pc + 1].longconst);
  145.       print_subexp (exp, pos, stream, PREC_SUFFIX);
  146.       fputs_filtered (" (", stream);
  147.       for (tem = 0; tem < nargs; tem++)
  148.     {
  149.       if (tem != 0)
  150.         fputs_filtered (", ", stream);
  151.       print_subexp (exp, pos, stream, PREC_ABOVE_COMMA);
  152.     }
  153.       fputs_filtered (")", stream);
  154.       return;
  155.  
  156.     case OP_STRING:
  157.       nargs = longest_to_int (exp -> elts[pc + 1].longconst);
  158.       (*pos) += 3 + BYTES_TO_EXP_ELEM (nargs + 1);
  159.       /* LA_PRINT_STRING will print using the current repeat count threshold.
  160.      If necessary, we can temporarily set it to zero, or pass it as an
  161.      additional parameter to LA_PRINT_STRING.  -fnf */
  162.       LA_PRINT_STRING (stream, &exp->elts[pc + 2].string, nargs, 0);
  163.       return;
  164.  
  165.     case OP_BITSTRING:
  166.       error ("support for OP_BITSTRING unimplemented");
  167.       break;
  168.  
  169.     case OP_ARRAY:
  170.       (*pos) += 3;
  171.       nargs = longest_to_int (exp->elts[pc + 2].longconst);
  172.       nargs -= longest_to_int (exp->elts[pc + 1].longconst);
  173.       nargs++;
  174.       tem = 0;
  175.       if (exp->elts[pc + 4].opcode == OP_LONG
  176.       && exp->elts[pc + 5].type == builtin_type_char
  177.       && exp->language_defn->la_language == language_c)
  178.     {
  179.       /* Attempt to print C character arrays using string syntax.
  180.          Walk through the args, picking up one character from each
  181.          of the OP_LONG expression elements.  If any array element
  182.          does not match our expection of what we should find for
  183.          a simple string, revert back to array printing.  Note that
  184.          the last expression element is an explicit null terminator
  185.          byte, which doesn't get printed. */
  186.       tempstr = alloca (nargs);
  187.       pc += 4;
  188.       while (tem < nargs)
  189.         {
  190.           if (exp->elts[pc].opcode != OP_LONG
  191.           || exp->elts[pc + 1].type != builtin_type_char)
  192.         {
  193.           /* Not a simple array of char, use regular array printing. */
  194.           tem = 0;
  195.           break;
  196.         }
  197.           else
  198.         {
  199.           tempstr[tem++] =
  200.             longest_to_int (exp->elts[pc + 2].longconst);
  201.           pc += 4;
  202.         }
  203.         }
  204.     }
  205.       if (tem > 0)
  206.     {
  207.       LA_PRINT_STRING (stream, tempstr, nargs - 1, 0);
  208.       (*pos) = pc;
  209.     }
  210.       else
  211.     {
  212.       fputs_filtered (" {", stream);
  213.       for (tem = 0; tem < nargs; tem++)
  214.         {
  215.           if (tem != 0)
  216.         {
  217.           fputs_filtered (", ", stream);
  218.         }
  219.           print_subexp (exp, pos, stream, PREC_ABOVE_COMMA);
  220.         }
  221.       fputs_filtered ("}", stream);
  222.     }
  223.       return;
  224.  
  225.     case TERNOP_COND:
  226.       if ((int) prec > (int) PREC_COMMA)
  227.     fputs_filtered ("(", stream);
  228.       /* Print the subexpressions, forcing parentheses
  229.      around any binary operations within them.
  230.      This is more parentheses than are strictly necessary,
  231.      but it looks clearer.  */
  232.       print_subexp (exp, pos, stream, PREC_HYPER);
  233.       fputs_filtered (" ? ", stream);
  234.       print_subexp (exp, pos, stream, PREC_HYPER);
  235.       fputs_filtered (" : ", stream);
  236.       print_subexp (exp, pos, stream, PREC_HYPER);
  237.       if ((int) prec > (int) PREC_COMMA)
  238.     fputs_filtered (")", stream);
  239.       return;
  240.  
  241.     case STRUCTOP_STRUCT:
  242.       tem = longest_to_int (exp->elts[pc + 1].longconst);
  243.       (*pos) += 3 + BYTES_TO_EXP_ELEM (tem + 1);
  244.       print_subexp (exp, pos, stream, PREC_SUFFIX);
  245.       fputs_filtered (".", stream);
  246.       fputs_filtered (&exp->elts[pc + 2].string, stream);
  247.       return;
  248.  
  249.     /* Will not occur for Modula-2 */
  250.     case STRUCTOP_PTR:
  251.       tem = longest_to_int (exp->elts[pc + 1].longconst);
  252.       (*pos) += 3 + BYTES_TO_EXP_ELEM (tem + 1);
  253.       print_subexp (exp, pos, stream, PREC_SUFFIX);
  254.       fputs_filtered ("->", stream);
  255.       fputs_filtered (&exp->elts[pc + 2].string, stream);
  256.       return;
  257.  
  258.     case BINOP_SUBSCRIPT:
  259.       print_subexp (exp, pos, stream, PREC_SUFFIX);
  260.       fputs_filtered ("[", stream);
  261.       print_subexp (exp, pos, stream, PREC_ABOVE_COMMA);
  262.       fputs_filtered ("]", stream);
  263.       return;
  264.  
  265.     case UNOP_POSTINCREMENT:
  266.       print_subexp (exp, pos, stream, PREC_SUFFIX);
  267.       fputs_filtered ("++", stream);
  268.       return;
  269.  
  270.     case UNOP_POSTDECREMENT:
  271.       print_subexp (exp, pos, stream, PREC_SUFFIX);
  272.       fputs_filtered ("--", stream);
  273.       return;
  274.  
  275.     case UNOP_CAST:
  276.       (*pos) += 2;
  277.       if ((int) prec > (int) PREC_PREFIX)
  278.         fputs_filtered ("(", stream);
  279.       fputs_filtered ("(", stream);
  280.       type_print (exp->elts[pc + 1].type, "", stream, 0);
  281.       fputs_filtered (") ", stream);
  282.       print_subexp (exp, pos, stream, PREC_PREFIX);
  283.       if ((int) prec > (int) PREC_PREFIX)
  284.         fputs_filtered (")", stream);
  285.       return;
  286.  
  287.     case UNOP_MEMVAL:
  288.       (*pos) += 2;
  289.       if ((int) prec > (int) PREC_PREFIX)
  290.         fputs_filtered ("(", stream);
  291.       if (exp->elts[pc + 1].type->code == TYPE_CODE_FUNC &&
  292.       exp->elts[pc + 3].opcode == OP_LONG) {
  293.     /* We have a minimal symbol fn, probably.  It's encoded
  294.        as a UNOP_MEMVAL (function-type) of an OP_LONG (int, address).
  295.        Swallow the OP_LONG (including both its opcodes); ignore
  296.        its type; print the value in the type of the MEMVAL.  */
  297.     (*pos) += 4;
  298.     val = value_at_lazy (exp->elts[pc + 1].type,
  299.                  (CORE_ADDR) exp->elts[pc + 5].longconst);
  300.     value_print (val, stream, 0, Val_no_prettyprint);
  301.       } else {
  302.     fputs_filtered ("{", stream);
  303.     type_print (exp->elts[pc + 1].type, "", stream, 0);
  304.     fputs_filtered ("} ", stream);
  305.         print_subexp (exp, pos, stream, PREC_PREFIX);
  306.       }
  307.       if ((int) prec > (int) PREC_PREFIX)
  308.         fputs_filtered (")", stream);
  309.       return;
  310.  
  311.     case BINOP_ASSIGN_MODIFY:
  312.       opcode = exp->elts[pc + 1].opcode;
  313.       (*pos) += 2;
  314.       myprec = PREC_ASSIGN;
  315.       assoc = 1;
  316.       assign_modify = 1;
  317.       op_str = "???";
  318.       for (tem = 0; op_print_tab[tem].opcode != OP_NULL; tem++)
  319.     if (op_print_tab[tem].opcode == opcode)
  320.       {
  321.         op_str = op_print_tab[tem].string;
  322.         break;
  323.       }
  324.       if (op_print_tab[tem].opcode != opcode)
  325.     /* Not found; don't try to keep going because we don't know how
  326.        to interpret further elements.  */
  327.     error ("Invalid expression");
  328.       break;
  329.  
  330.     /* C++ ops */
  331.  
  332.     case OP_THIS:
  333.       ++(*pos);
  334.       fputs_filtered ("this", stream);
  335.       return;
  336.  
  337.     /* Modula-2 ops */
  338.  
  339.     case MULTI_SUBSCRIPT:
  340.       (*pos) += 2;
  341.       nargs = longest_to_int (exp->elts[pc + 1].longconst);
  342.       print_subexp (exp, pos, stream, PREC_SUFFIX);
  343.       fprintf_unfiltered (stream, " [");
  344.       for (tem = 0; tem < nargs; tem++)
  345.     {
  346.       if (tem != 0)
  347.         fprintf_unfiltered (stream, ", ");
  348.       print_subexp (exp, pos, stream, PREC_ABOVE_COMMA);
  349.     }
  350.       fprintf_unfiltered (stream, "]");
  351.       return;
  352.  
  353.     case BINOP_VAL:
  354.       (*pos)+=2;
  355.       fprintf_unfiltered(stream,"VAL(");
  356.       type_print(exp->elts[pc+1].type,"",stream,0);
  357.       fprintf_unfiltered(stream,",");
  358.       print_subexp(exp,pos,stream,PREC_PREFIX);
  359.       fprintf_unfiltered(stream,")");
  360.       return;
  361.  
  362.     case UNOP_CAP:
  363.       print_simple_m2_func("CAP",exp,pos,stream);
  364.       return;
  365.  
  366.     case UNOP_CHR:
  367.       print_simple_m2_func("CHR",exp,pos,stream);
  368.       return;
  369.  
  370.     case UNOP_ORD:
  371.       print_simple_m2_func("ORD",exp,pos,stream);
  372.       return;
  373.       
  374.     case UNOP_ABS:
  375.       print_simple_m2_func("ABS",exp,pos,stream);
  376.       return;
  377.  
  378.     case UNOP_FLOAT:
  379.       print_simple_m2_func("FLOAT",exp,pos,stream);
  380.       return;
  381.  
  382.     case UNOP_HIGH:
  383.       print_simple_m2_func("HIGH",exp,pos,stream);
  384.       return;
  385.  
  386.     case UNOP_MAX:
  387.       print_simple_m2_func("MAX",exp,pos,stream);
  388.       return;
  389.  
  390.     case UNOP_MIN:
  391.       print_simple_m2_func("MIN",exp,pos,stream);
  392.       return;
  393.  
  394.     case UNOP_ODD:
  395.       print_simple_m2_func("ODD",exp,pos,stream);
  396.       return;
  397.  
  398.     case UNOP_TRUNC:
  399.       print_simple_m2_func("TRUNC",exp,pos,stream);
  400.       return;
  401.       
  402.     case BINOP_INCL:
  403.     case BINOP_EXCL:
  404.       error("print_subexp:  Not implemented.");
  405.  
  406.     /* Default ops */
  407.  
  408.     default:
  409.       op_str = "???";
  410.       for (tem = 0; op_print_tab[tem].opcode != OP_NULL; tem++)
  411.     if (op_print_tab[tem].opcode == opcode)
  412.       {
  413.         op_str = op_print_tab[tem].string;
  414.         myprec = op_print_tab[tem].precedence;
  415.         assoc = op_print_tab[tem].right_assoc;
  416.         break;
  417.       }
  418.       if (op_print_tab[tem].opcode != opcode)
  419.     /* Not found; don't try to keep going because we don't know how
  420.        to interpret further elements.  For example, this happens
  421.        if opcode is OP_TYPE.  */
  422.     error ("Invalid expression");
  423.    }
  424.  
  425.   if ((int) myprec < (int) prec)
  426.     fputs_filtered ("(", stream);
  427.   if ((int) opcode > (int) BINOP_END)
  428.     {
  429.       /* Unary prefix operator.  */
  430.       fputs_filtered (op_str, stream);
  431.       print_subexp (exp, pos, stream, PREC_PREFIX);
  432.     }
  433.   else
  434.     {
  435.       /* Binary operator.  */
  436.       /* Print left operand.
  437.      If operator is right-associative,
  438.      increment precedence for this operand.  */
  439.       print_subexp (exp, pos, stream,
  440.             (enum precedence) ((int) myprec + assoc));
  441.       /* Print the operator itself.  */
  442.       if (assign_modify)
  443.     fprintf_filtered (stream, " %s= ", op_str);
  444.       else if (op_str[0] == ',')
  445.     fprintf_filtered (stream, "%s ", op_str);
  446.       else
  447.     fprintf_filtered (stream, " %s ", op_str);
  448.       /* Print right operand.
  449.      If operator is left-associative,
  450.      increment precedence for this operand.  */
  451.       print_subexp (exp, pos, stream,
  452.             (enum precedence) ((int) myprec + !assoc));
  453.     }
  454.  
  455.   if ((int) myprec < (int) prec)
  456.     fputs_filtered (")", stream);
  457. }
  458.  
  459. /* Print out something of the form <s>(<arg>).
  460.    This is used to print out some builtin Modula-2
  461.    functions.
  462.    FIXME:  There is probably some way to get the precedence
  463.    rules to do this (print a unary operand with parens around it).  */
  464. static void
  465. print_simple_m2_func(s,exp,pos,stream)
  466.    char *s;
  467.    register struct expression *exp;
  468.    register int *pos;
  469.    GDB_FILE *stream;
  470. {
  471.    fprintf_unfiltered(stream,"%s(",s);
  472.    print_subexp(exp,pos,stream,PREC_PREFIX);
  473.    fprintf_unfiltered(stream,")");
  474. }
  475.    
  476. /* Return the operator corresponding to opcode OP as
  477.    a string.   NULL indicates that the opcode was not found in the
  478.    current language table.  */
  479. char *
  480. op_string(op)
  481.    enum exp_opcode op;
  482. {
  483.   int tem;
  484.   register const struct op_print *op_print_tab;
  485.  
  486.   op_print_tab = current_language->la_op_print_tab;
  487.   for (tem = 0; op_print_tab[tem].opcode != OP_NULL; tem++)
  488.     if (op_print_tab[tem].opcode == op)
  489.       return op_print_tab[tem].string;
  490.   return NULL;
  491. }
  492.  
  493. #ifdef DEBUG_EXPRESSIONS
  494.  
  495. /* Support for dumping the raw data from expressions in a human readable
  496.    form.  */
  497.  
  498. void
  499. dump_expression (exp, stream, note)
  500.      struct expression *exp;
  501.      GDB_FILE *stream;
  502.      char *note;
  503. {
  504.   int elt;
  505.   char *opcode_name;
  506.   char *eltscan;
  507.   int eltsize;
  508.  
  509.   fprintf_filtered (stream, "Dump of expression @ ");
  510.   gdb_print_address (exp, stream);
  511.   fprintf_filtered (stream, ", %s:\n", note);
  512.   fprintf_filtered (stream, "\tLanguage %s, %d elements, %d bytes each.\n",
  513.             exp->language_defn->la_name, exp -> nelts,
  514.             sizeof (union exp_element));
  515.   fprintf_filtered (stream, "\t%5s  %20s  %16s  %s\n", "Index", "Opcode",
  516.             "Hex Value", "String Value");
  517.   for (elt = 0; elt < exp -> nelts; elt++)
  518.     {
  519.       fprintf_filtered (stream, "\t%5d  ", elt);
  520.       switch (exp -> elts[elt].opcode)
  521.     {
  522.       default: opcode_name = "<unknown>"; break;
  523.       case OP_NULL: opcode_name = "OP_NULL"; break;
  524.       case BINOP_ADD: opcode_name = "BINOP_ADD"; break;
  525.       case BINOP_SUB: opcode_name = "BINOP_SUB"; break;
  526.       case BINOP_MUL: opcode_name = "BINOP_MUL"; break;
  527.       case BINOP_DIV: opcode_name = "BINOP_DIV"; break;
  528.       case BINOP_REM: opcode_name = "BINOP_REM"; break;
  529.       case BINOP_MOD: opcode_name = "BINOP_MOD"; break;
  530.       case BINOP_LSH: opcode_name = "BINOP_LSH"; break;
  531.       case BINOP_RSH: opcode_name = "BINOP_RSH"; break;
  532.       case BINOP_LOGICAL_AND: opcode_name = "BINOP_LOGICAL_AND"; break;
  533.       case BINOP_LOGICAL_OR: opcode_name = "BINOP_LOGICAL_OR"; break;
  534.       case BINOP_BITWISE_AND: opcode_name = "BINOP_BITWISE_AND"; break;
  535.       case BINOP_BITWISE_IOR: opcode_name = "BINOP_BITWISE_IOR"; break;
  536.       case BINOP_BITWISE_XOR: opcode_name = "BINOP_BITWISE_XOR"; break;
  537.       case BINOP_EQUAL: opcode_name = "BINOP_EQUAL"; break;
  538.       case BINOP_NOTEQUAL: opcode_name = "BINOP_NOTEQUAL"; break;
  539.       case BINOP_LESS: opcode_name = "BINOP_LESS"; break;
  540.       case BINOP_GTR: opcode_name = "BINOP_GTR"; break;
  541.       case BINOP_LEQ: opcode_name = "BINOP_LEQ"; break;
  542.       case BINOP_GEQ: opcode_name = "BINOP_GEQ"; break;
  543.       case BINOP_REPEAT: opcode_name = "BINOP_REPEAT"; break;
  544.       case BINOP_ASSIGN: opcode_name = "BINOP_ASSIGN"; break;
  545.       case BINOP_COMMA: opcode_name = "BINOP_COMMA"; break;
  546.       case BINOP_SUBSCRIPT: opcode_name = "BINOP_SUBSCRIPT"; break;
  547.       case MULTI_SUBSCRIPT: opcode_name = "MULTI_SUBSCRIPT"; break;
  548.       case BINOP_EXP: opcode_name = "BINOP_EXP"; break;
  549.       case BINOP_MIN: opcode_name = "BINOP_MIN"; break;
  550.       case BINOP_MAX: opcode_name = "BINOP_MAX"; break;
  551.       case BINOP_SCOPE: opcode_name = "BINOP_SCOPE"; break;
  552.       case STRUCTOP_MEMBER: opcode_name = "STRUCTOP_MEMBER"; break;
  553.       case STRUCTOP_MPTR: opcode_name = "STRUCTOP_MPTR"; break;
  554.       case BINOP_INTDIV: opcode_name = "BINOP_INTDIV"; break;
  555.       case BINOP_ASSIGN_MODIFY: opcode_name = "BINOP_ASSIGN_MODIFY"; break;
  556.       case BINOP_VAL: opcode_name = "BINOP_VAL"; break;
  557.       case BINOP_INCL: opcode_name = "BINOP_INCL"; break;
  558.       case BINOP_EXCL: opcode_name = "BINOP_EXCL"; break;
  559.       case BINOP_CONCAT: opcode_name = "BINOP_CONCAT"; break;
  560.       case BINOP_END: opcode_name = "BINOP_END"; break;
  561.       case TERNOP_COND: opcode_name = "TERNOP_COND"; break;
  562.       case OP_LONG: opcode_name = "OP_LONG"; break;
  563.       case OP_DOUBLE: opcode_name = "OP_DOUBLE"; break;
  564.       case OP_VAR_VALUE: opcode_name = "OP_VAR_VALUE"; break;
  565.       case OP_LAST: opcode_name = "OP_LAST"; break;
  566.       case OP_REGISTER: opcode_name = "OP_REGISTER"; break;
  567.       case OP_INTERNALVAR: opcode_name = "OP_INTERNALVAR"; break;
  568.       case OP_FUNCALL: opcode_name = "OP_FUNCALL"; break;
  569.       case OP_STRING: opcode_name = "OP_STRING"; break;
  570.       case OP_BITSTRING: opcode_name = "OP_BITSTRING"; break;
  571.       case OP_ARRAY: opcode_name = "OP_ARRAY"; break;
  572.       case UNOP_CAST: opcode_name = "UNOP_CAST"; break;
  573.       case UNOP_MEMVAL: opcode_name = "UNOP_MEMVAL"; break;
  574.       case UNOP_NEG: opcode_name = "UNOP_NEG"; break;
  575.       case UNOP_LOGICAL_NOT: opcode_name = "UNOP_LOGICAL_NOT"; break;
  576.       case UNOP_COMPLEMENT: opcode_name = "UNOP_COMPLEMENT"; break;
  577.       case UNOP_IND: opcode_name = "UNOP_IND"; break;
  578.       case UNOP_ADDR: opcode_name = "UNOP_ADDR"; break;
  579.       case UNOP_PREINCREMENT: opcode_name = "UNOP_PREINCREMENT"; break;
  580.       case UNOP_POSTINCREMENT: opcode_name = "UNOP_POSTINCREMENT"; break;
  581.       case UNOP_PREDECREMENT: opcode_name = "UNOP_PREDECREMENT"; break;
  582.       case UNOP_POSTDECREMENT: opcode_name = "UNOP_POSTDECREMENT"; break;
  583.       case UNOP_SIZEOF: opcode_name = "UNOP_SIZEOF"; break;
  584.       case UNOP_PLUS: opcode_name = "UNOP_PLUS"; break;
  585.       case UNOP_CAP: opcode_name = "UNOP_CAP"; break;
  586.       case UNOP_CHR: opcode_name = "UNOP_CHR"; break;
  587.       case UNOP_ORD: opcode_name = "UNOP_ORD"; break;
  588.       case UNOP_ABS: opcode_name = "UNOP_ABS"; break;
  589.       case UNOP_FLOAT: opcode_name = "UNOP_FLOAT"; break;
  590.       case UNOP_HIGH: opcode_name = "UNOP_HIGH"; break;
  591.       case UNOP_MAX: opcode_name = "UNOP_MAX"; break;
  592.       case UNOP_MIN: opcode_name = "UNOP_MIN"; break;
  593.       case UNOP_ODD: opcode_name = "UNOP_ODD"; break;
  594.       case UNOP_TRUNC: opcode_name = "UNOP_TRUNC"; break;
  595.       case OP_BOOL: opcode_name = "OP_BOOL"; break;
  596.       case OP_M2_STRING: opcode_name = "OP_M2_STRING"; break;
  597.       case STRUCTOP_STRUCT: opcode_name = "STRUCTOP_STRUCT"; break;
  598.       case STRUCTOP_PTR: opcode_name = "STRUCTOP_PTR"; break;
  599.       case OP_THIS: opcode_name = "OP_THIS"; break;
  600.       case OP_SCOPE: opcode_name = "OP_SCOPE"; break;
  601.       case OP_TYPE: opcode_name = "OP_TYPE"; break;
  602.     }
  603.       fprintf_filtered (stream, "%20s  ", opcode_name);
  604.       fprintf_filtered (stream,
  605. #if defined (PRINTF_HAS_LONG_LONG)
  606.             "%ll16x  ",
  607. #else
  608.             "%l16x  ",
  609. #endif
  610.             exp -> elts[elt].longconst);
  611.  
  612.       for (eltscan = (char *) &exp->elts[elt],
  613.          eltsize = sizeof (union exp_element) ;
  614.        eltsize-- > 0;
  615.        eltscan++)
  616.     {
  617.       fprintf_filtered (stream, "%c",
  618.                 isprint (*eltscan) ? (*eltscan & 0xFF) : '.');
  619.     }
  620.       fprintf_filtered (stream, "\n");
  621.     }
  622. }
  623.  
  624. #endif    /* DEBUG_EXPRESSIONS */
  625.