* config/pa/linux.mh (XDEPFILES): Remove.
[binutils-gdb.git] / gdb / parse.c
index 6b32d00a26da7e83ddda38c7bb15897e0ba6f9a2..eee1f8e7fd34c426e0b60faaac831ccfd99ae57e 100644 (file)
@@ -1,7 +1,7 @@
 /* Parse expressions for GDB.
 
    Copyright (C) 1986, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-   1998, 1999, 2000, 2001, 2004, 2005, 2007, 2008
+   1998, 1999, 2000, 2001, 2004, 2005, 2007, 2008, 2009
    Free Software Foundation, Inc.
 
    Modified from expread.y by the Department of Computer Science at the
@@ -410,7 +410,7 @@ write_exp_msymbol (struct minimal_symbol *msymbol)
 
   CORE_ADDR addr = SYMBOL_VALUE_ADDRESS (msymbol);
   struct obj_section *section = SYMBOL_OBJ_SECTION (msymbol);
-  enum minimal_symbol_type type = msymbol->type;
+  enum minimal_symbol_type type = MSYMBOL_TYPE (msymbol);
   CORE_ADDR pc;
 
   /* The minimal symbol might point to a function descriptor;
@@ -767,7 +767,7 @@ operator_length_standard (struct expression *expr, int endpos,
       break;
 
     case OP_COMPLEX:
-      oplen = 1;
+      oplen = 3;
       args = 2;
       break;
 
@@ -1027,6 +1027,7 @@ parse_exp_in_context (char **stringptr, struct block *block, int comma,
   expout = (struct expression *)
     xmalloc (sizeof (struct expression) + EXP_ELEM_TO_BYTES (expout_size));
   expout->language_defn = current_language;
+  expout->gdbarch = current_gdbarch;
 
   TRY_CATCH (except, RETURN_MASK_ALL)
     {
@@ -1089,7 +1090,8 @@ parse_expression (char *string)
 /* Parse STRING as an expression.  If parsing ends in the middle of a
    field reference, return the type of the left-hand-side of the
    reference; furthermore, if the parsing ends in the field name,
-   return the field name in *NAME.  In all other cases, return NULL.  */
+   return the field name in *NAME.  In all other cases, return NULL.
+   Returned non-NULL *NAME must be freed by the caller.  */
 
 struct type *
 parse_field_expression (char *string, char **name)
@@ -1119,6 +1121,9 @@ parse_field_expression (char *string, char **name)
       xfree (exp);
       return NULL;
     }
+  /* (*NAME) is a part of the EXP memory block freed below.  */
+  *name = xstrdup (*name);
+
   val = evaluate_subexpression_type (exp, subexp);
   xfree (exp);
 
@@ -1261,14 +1266,13 @@ follow_types (struct type *follow_type)
           done with it.  */
        range_type =
          create_range_type ((struct type *) NULL,
-                            builtin_type_int, 0,
+                            builtin_type_int32, 0,
                             array_size >= 0 ? array_size - 1 : 0);
        follow_type =
          create_array_type ((struct type *) NULL,
                             follow_type, range_type);
        if (array_size < 0)
-         TYPE_ARRAY_UPPER_BOUND_TYPE (follow_type)
-           = BOUND_CANNOT_BE_DETERMINED;
+         TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (follow_type) = 1;
        break;
       case tp_function:
        /* FIXME-type-allocation: need a way to free this type when we are