X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Fada-typeprint.c;h=e1ab2ac84bf17400e747426e34de7ab8434a031c;hb=8234eceb5e01be43eca70dbacdb869fc66dbed0a;hp=cb4fecd3e17a192b2ffe3e1c79eaa59b0ede1ae2;hpb=6d84d3d833b29bb5adc88f462fa5ec9c65f5b143;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/ada-typeprint.c b/gdb/ada-typeprint.c index cb4fecd3e1..e1ab2ac84b 100644 --- a/gdb/ada-typeprint.c +++ b/gdb/ada-typeprint.c @@ -1,6 +1,6 @@ /* Support for printing Ada types for GDB, the GNU debugger. Copyright (C) 1986, 1988, 1989, 1991, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2007, 2008 Free Software Foundation, Inc. + 2003, 2004, 2007, 2008, 2009 Free Software Foundation, Inc. This file is part of GDB. @@ -170,8 +170,9 @@ print_range (struct type *type, struct ui_file *stream) /* We extract the range type bounds respectively from the first element and the last element of the type->fields array */ const LONGEST lower_bound = (LONGEST) TYPE_LOW_BOUND (type); - const LONGEST upper_bound = - (LONGEST) TYPE_FIELD_BITPOS (type, TYPE_NFIELDS (type) - 1); + const LONGEST upper_bound = (TYPE_CODE (type) == TYPE_CODE_RANGE + ? (LONGEST) TYPE_HIGH_BOUND (type) + : (LONGEST) TYPE_FIELD_BITPOS (type, TYPE_NFIELDS (type) - 1)); ada_print_scalar (target_type, lower_bound, stream); fprintf_filtered (stream, " .. ");