2008-10-03 H.J. Lu <hongjiu.lu@intel.com>
[deliverable/binutils-gdb.git] / gdb / expprint.c
index 1dba437e9a22f79466cb53551edf056923da93c6..079f2a9509e8821d3019e3c41ec7a71bed82a803 100644 (file)
@@ -1,7 +1,7 @@
 /* Print in infix form a struct expression.
 
    Copyright (C) 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-   1998, 1999, 2000, 2003, 2007 Free Software Foundation, Inc.
+   1998, 1999, 2000, 2003, 2007, 2008 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -30,6 +30,7 @@
 #include "gdb_string.h"
 #include "block.h"
 #include "objfiles.h"
+#include "gdb_assert.h"
 
 #ifdef HAVE_CTYPE_H
 #include <ctype.h>
@@ -212,6 +213,7 @@ print_subexp_standard (struct expression *exp, int *pos,
            for (tem = 0; tem < nargs; tem++)
              {
                nextS = strchr (s, ':');
+               gdb_assert (nextS);     /* Make sure we found ':'.  */
                *nextS = '\0';
                fprintf_unfiltered (stream, " %s: ", s);
                s = nextS + 1;
@@ -235,7 +237,8 @@ print_subexp_standard (struct expression *exp, int *pos,
       nargs++;
       tem = 0;
       if (exp->elts[pc + 4].opcode == OP_LONG
-         && exp->elts[pc + 5].type == builtin_type_char
+         && exp->elts[pc + 5].type
+            == builtin_type (exp->gdbarch)->builtin_char
          && exp->language_defn->la_language == language_c)
        {
          /* Attempt to print C character arrays using string syntax.
@@ -250,7 +253,8 @@ print_subexp_standard (struct expression *exp, int *pos,
          while (tem < nargs)
            {
              if (exp->elts[pc].opcode != OP_LONG
-                 || exp->elts[pc + 1].type != builtin_type_char)
+                 || exp->elts[pc + 1].type
+                    != builtin_type (exp->gdbarch)->builtin_char)
                {
                  /* Not a simple array of char, use regular array printing. */
                  tem = 0;
@@ -952,7 +956,7 @@ dump_subexp_body_standard (struct expression *exp,
       fprintf_filtered (stream, ", symbol @");
       gdb_print_host_address (exp->elts[elt + 1].symbol, stream);
       fprintf_filtered (stream, " (%s)",
-                       DEPRECATED_SYMBOL_NAME (exp->elts[elt + 1].symbol));
+                       SYMBOL_PRINT_NAME (exp->elts[elt + 1].symbol));
       elt += 3;
       break;
     case OP_LAST:
This page took 0.024095 seconds and 4 git commands to generate.