8f17729f21
This is to avoid an unnecessary multiple-choice menu for an expression involving an enumeral declared in two types, when the second type is an identical copy of the first type. This happens in the following situation: type Color is (Black, Red, Green, Blue, White); type RGB_Color is new Color range Red .. Blue; In that case, an implict type is created, and is used as the base type for type RGB_Color. This base type is a copy of type Color. We've added some extensive comments explaining the situation and our approach further. gdb/ChangeLog: * ada-lang.c (ada_identical_enum_types_p): New function. (symbols_are_identical_enums): New function. (remove_extra_symbols): Do nothing if NSYMS < 2. Use symbols_are_identical_enums. gdb/testsuite/ChangeLog: * gdb.ada/same_enum: New testcase.
24 lines
897 B
Ada
24 lines
897 B
Ada
-- Copyright 2011 Free Software Foundation, Inc.
|
|
--
|
|
-- 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.
|
|
--
|
|
-- You should have received a copy of the GNU General Public License
|
|
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
with System;
|
|
|
|
package Pck is
|
|
type Color is (Black, Red, Green, Blue, White);
|
|
type RGB_Color is new Color range Red .. Blue;
|
|
|
|
procedure Do_Nothing (A : System.Address);
|
|
end Pck;
|
|
|