1992, 1993, 1994, 1997, 1998, 1999, 2000, 2003, 2004, 2005, 2007
Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor,
-Boston, MA 02110-1301, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
desc_bounds_type (thin_descriptor_type (type));
LONGEST addr;
- if (desc_bounds_type == NULL)
+ if (bounds_type == NULL)
error (_("Bad GNAT array descriptor"));
/* NOTE: The following calculation is not really kosher, but
case BINOP_REPEAT:
case BINOP_SUBSCRIPT:
case BINOP_COMMA:
+ *pos += 1;
+ nargs = 2;
+ break;
case UNOP_NEG:
case UNOP_PLUS:
case OP_TYPE:
case OP_BOOL:
case OP_LAST:
- case OP_REGISTER:
case OP_INTERNALVAR:
*pos += 3;
break;
nargs = 1;
break;
+ case OP_REGISTER:
+ *pos += 4 + BYTES_TO_EXP_ELEM (exp->elts[pc + 1].longconst + 1);
+ break;
+
case STRUCTOP_STRUCT:
*pos += 4 + BYTES_TO_EXP_ELEM (exp->elts[pc + 1].longconst + 1);
nargs = 1;
return (!(scalar_type_p (type0) && scalar_type_p (type1)));
case BINOP_CONCAT:
- return
- ((TYPE_CODE (type0) != TYPE_CODE_ARRAY
- && (TYPE_CODE (type0) != TYPE_CODE_PTR
- || TYPE_CODE (TYPE_TARGET_TYPE (type0)) != TYPE_CODE_ARRAY))
- || (TYPE_CODE (type1) != TYPE_CODE_ARRAY
- && (TYPE_CODE (type1) != TYPE_CODE_PTR
- || (TYPE_CODE (TYPE_TARGET_TYPE (type1))
- != TYPE_CODE_ARRAY))));
+ return !ada_is_array_type (type0) || !ada_is_array_type (type1);
case BINOP_EXP:
return (!(numeric_type_p (type0) && integer_type_p (type1)));
field_alignment (struct type *type, int f)
{
const char *name = TYPE_FIELD_NAME (type, f);
- int len = (name == NULL) ? 0 : strlen (name);
+ int len;
int align_offset;
+ /* The field name should never be null, unless the debugging information
+ is somehow malformed. In this case, we assume the field does not
+ require any alignment. */
+ if (name == NULL)
+ return 1;
+
+ len = strlen (name);
+
if (!isdigit (name[len - 1]))
return 1;
};
static void
-ada_language_arch_info (struct gdbarch *current_gdbarch,
+ada_language_arch_info (struct gdbarch *gdbarch,
struct language_arch_info *lai)
{
- const struct builtin_type *builtin = builtin_type (current_gdbarch);
+ const struct builtin_type *builtin = builtin_type (gdbarch);
lai->primitive_type_vector
- = GDBARCH_OBSTACK_CALLOC (current_gdbarch, nr_ada_primitive_types + 1,
+ = GDBARCH_OBSTACK_CALLOC (gdbarch, nr_ada_primitive_types + 1,
struct type *);
lai->primitive_type_vector [ada_primitive_type_int] =
init_type (TYPE_CODE_INT,
- gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
+ gdbarch_int_bit (gdbarch) / TARGET_CHAR_BIT,
0, "integer", (struct objfile *) NULL);
lai->primitive_type_vector [ada_primitive_type_long] =
init_type (TYPE_CODE_INT,
- gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
+ gdbarch_long_bit (gdbarch) / TARGET_CHAR_BIT,
0, "long_integer", (struct objfile *) NULL);
lai->primitive_type_vector [ada_primitive_type_short] =
init_type (TYPE_CODE_INT,
- gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
+ gdbarch_short_bit (gdbarch) / TARGET_CHAR_BIT,
0, "short_integer", (struct objfile *) NULL);
lai->string_char_type =
lai->primitive_type_vector [ada_primitive_type_char] =
0, "character", (struct objfile *) NULL);
lai->primitive_type_vector [ada_primitive_type_float] =
init_type (TYPE_CODE_FLT,
- gdbarch_float_bit (current_gdbarch)/ TARGET_CHAR_BIT,
+ gdbarch_float_bit (gdbarch)/ TARGET_CHAR_BIT,
0, "float", (struct objfile *) NULL);
lai->primitive_type_vector [ada_primitive_type_double] =
init_type (TYPE_CODE_FLT,
- gdbarch_double_bit (current_gdbarch) / TARGET_CHAR_BIT,
+ gdbarch_double_bit (gdbarch) / TARGET_CHAR_BIT,
0, "long_float", (struct objfile *) NULL);
lai->primitive_type_vector [ada_primitive_type_long_long] =
init_type (TYPE_CODE_INT,
- gdbarch_long_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
+ gdbarch_long_long_bit (gdbarch) / TARGET_CHAR_BIT,
0, "long_long_integer", (struct objfile *) NULL);
lai->primitive_type_vector [ada_primitive_type_long_double] =
init_type (TYPE_CODE_FLT,
- gdbarch_double_bit (current_gdbarch) / TARGET_CHAR_BIT,
+ gdbarch_double_bit (gdbarch) / TARGET_CHAR_BIT,
0, "long_long_float", (struct objfile *) NULL);
lai->primitive_type_vector [ada_primitive_type_natural] =
init_type (TYPE_CODE_INT,
- gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
+ gdbarch_int_bit (gdbarch) / TARGET_CHAR_BIT,
0, "natural", (struct objfile *) NULL);
lai->primitive_type_vector [ada_primitive_type_positive] =
init_type (TYPE_CODE_INT,
- gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
+ gdbarch_int_bit (gdbarch) / TARGET_CHAR_BIT,
0, "positive", (struct objfile *) NULL);
lai->primitive_type_vector [ada_primitive_type_void] = builtin->builtin_void;
const struct language_defn ada_language_defn = {
"ada", /* Language name */
language_ada,
- NULL,
range_check_off,
type_check_off,
case_sensitive_on, /* Yes, Ada is case-insensitive, but
ada_op_print_tab, /* expression operators for printing */
0, /* c-style arrays */
1, /* String lower bound */
- NULL,
ada_get_gdb_completer_word_break_characters,
ada_language_arch_info,
ada_print_array_index,
+ default_pass_by_reference,
LANG_MAGIC
};