Add ADL support
[deliverable/binutils-gdb.git] / gdb / expprint.c
index d7fac86c6762d6d4323d5b7fbb123d528856a957..45deffe4ab52592a5d0723477b4d2b8f1c7386cf 100644 (file)
@@ -1,7 +1,8 @@
 /* Print in infix form a struct expression.
 
    Copyright (C) 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-   1998, 1999, 2000, 2003, 2007, 2008, 2009 Free Software Foundation, Inc.
+   1998, 1999, 2000, 2003, 2007, 2008, 2009, 2010
+   Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -186,8 +187,8 @@ print_subexp_standard (struct expression *exp, int *pos,
           If necessary, we can temporarily set it to zero, or pass it as an
           additional parameter to LA_PRINT_STRING.  -fnf */
        get_user_print_options (&opts);
-       LA_PRINT_STRING (stream, &exp->elts[pc + 2].string, nargs, 1, 0,
-                        &opts);
+       LA_PRINT_STRING (stream, builtin_type (exp->gdbarch)->builtin_char,
+                        &exp->elts[pc + 2].string, nargs, NULL, 0, &opts);
       }
       return;
 
@@ -205,8 +206,8 @@ print_subexp_standard (struct expression *exp, int *pos,
        (*pos) += 3 + BYTES_TO_EXP_ELEM (nargs + 1);
        fputs_filtered ("@\"", stream);
        get_user_print_options (&opts);
-       LA_PRINT_STRING (stream, &exp->elts[pc + 2].string, nargs, 1, 0,
-                        &opts);
+       LA_PRINT_STRING (stream, builtin_type (exp->gdbarch)->builtin_char,
+                        &exp->elts[pc + 2].string, nargs, NULL, 0, &opts);
        fputs_filtered ("\"", stream);
       }
       return;
@@ -291,8 +292,8 @@ print_subexp_standard (struct expression *exp, int *pos,
        {
          struct value_print_options opts;
          get_user_print_options (&opts);
-         LA_PRINT_STRING (stream, tempstr, nargs - 1, 1, 0,
-                          &opts);
+         LA_PRINT_STRING (stream, builtin_type (exp->gdbarch)->builtin_char,
+                          tempstr, nargs - 1, NULL, 0, &opts);
          (*pos) = pc;
        }
       else
@@ -409,12 +410,24 @@ print_subexp_standard (struct expression *exp, int *pos,
        fputs_filtered (")", stream);
       return;
 
+    case UNOP_DYNAMIC_CAST:
+    case UNOP_REINTERPRET_CAST:
+      fputs_filtered (opcode == UNOP_DYNAMIC_CAST ? "dynamic_cast"
+                     : "reinterpret_cast", stream);
+      fputs_filtered ("<", stream);
+      (*pos) += 2;
+      type_print (exp->elts[pc + 1].type, "", stream, 0);
+      fputs_filtered ("> (", stream);
+      print_subexp (exp, pos, stream, PREC_PREFIX);
+      fputs_filtered (")", stream);
+      return;
+
     case UNOP_MEMVAL:
       (*pos) += 2;
       if ((int) prec > (int) PREC_PREFIX)
        fputs_filtered ("(", stream);
-      if (TYPE_CODE (exp->elts[pc + 1].type) == TYPE_CODE_FUNC &&
-         exp->elts[pc + 3].opcode == OP_LONG)
+      if (TYPE_CODE (exp->elts[pc + 1].type) == TYPE_CODE_FUNC
+         && exp->elts[pc + 3].opcode == OP_LONG)
        {
          struct value_print_options opts;
 
@@ -729,6 +742,10 @@ op_name_standard (enum exp_opcode opcode)
       return "OP_ARRAY";
     case UNOP_CAST:
       return "UNOP_CAST";
+    case UNOP_DYNAMIC_CAST:
+      return "UNOP_DYNAMIC_CAST";
+    case UNOP_REINTERPRET_CAST:
+      return "UNOP_REINTERPRET_CAST";
     case UNOP_MEMVAL:
       return "UNOP_MEMVAL";
     case UNOP_MEMVAL_TLS:
@@ -799,6 +816,8 @@ op_name_standard (enum exp_opcode opcode)
       return "OP_TYPE";
     case OP_LABELED:
       return "OP_LABELED";
+    case OP_ADL_FUNC:
+      return "OP_ADL_FUNC";
     }
 }
 
@@ -1002,7 +1021,7 @@ dump_subexp_body_standard (struct expression *exp,
       fprintf_filtered (stream, "Internal var @");
       gdb_print_host_address (exp->elts[elt].internalvar, stream);
       fprintf_filtered (stream, " (%s)",
-                       exp->elts[elt].internalvar->name);
+                       internalvar_name (exp->elts[elt].internalvar));
       elt += 2;
       break;
     case OP_FUNCALL:
@@ -1035,6 +1054,8 @@ dump_subexp_body_standard (struct expression *exp,
       break;
     case UNOP_MEMVAL:
     case UNOP_CAST:
+    case UNOP_DYNAMIC_CAST:
+    case UNOP_REINTERPRET_CAST:
       fprintf_filtered (stream, "Type @");
       gdb_print_host_address (exp->elts[elt].type, stream);
       fprintf_filtered (stream, " (");
This page took 0.025228 seconds and 4 git commands to generate.