* ada-lang.c (ada_evaluate_subexp): Add cases for BINOP_LOGICAL_AND,
authorJoel Brobecker <brobecker@gnat.com>
Fri, 28 Dec 2007 06:13:51 +0000 (06:13 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Fri, 28 Dec 2007 06:13:51 +0000 (06:13 +0000)
        BINOP_LOGICAL_OR, UNOP_LOGICAL_NOT, BINOP_BITWISE_IOR,
        BINOP_BITWISE_XOR, BINOP_BITWISE_AND.
        * language.c (lang_bool_type): Add Ada case.

gdb/ChangeLog
gdb/ada-lang.c
gdb/language.c

index 75db191edfda7a3b476abfbac6a4c5df5a334fac..157745fe367ca6eb01d29f37998328005ae9e297 100644 (file)
@@ -1,3 +1,10 @@
+2007-12-27  Paul Hilfinger  <hilfinger@adacore.com>
+
+       * ada-lang.c (ada_evaluate_subexp): Add cases for BINOP_LOGICAL_AND,
+       BINOP_LOGICAL_OR, UNOP_LOGICAL_NOT, BINOP_BITWISE_IOR,
+       BINOP_BITWISE_XOR, BINOP_BITWISE_AND.
+       * language.c (lang_bool_type): Add Ada case.
+
 2007-12-26  Joel Brobecker  <brobecker@adacore.com>
 
        * dwarf2read.c (read_base_type): Fix obvious &&/|| confusion.
index c2b7d1f71aa8e4baf230e9c98a5f0e23d99ab54b..116839bee3a91ac25dd19696bdeb814a940797ed 100644 (file)
@@ -8151,6 +8151,24 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
       else
         return value_neg (arg1);
 
+    case BINOP_LOGICAL_AND:
+    case BINOP_LOGICAL_OR:
+    case UNOP_LOGICAL_NOT:
+      *pos -= 1;
+      return value_cast (LA_BOOL_TYPE, 
+                        evaluate_subexp_standard (expect_type, exp,
+                                                  pos, noside));
+
+    case BINOP_BITWISE_AND:
+    case BINOP_BITWISE_IOR:
+    case BINOP_BITWISE_XOR:
+      arg1 = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_AVOID_SIDE_EFFECTS);
+      *pos = pc;
+      return value_cast (value_type (arg1),
+                        evaluate_subexp_standard (expect_type, exp,
+                                                  pos, noside));
+                        
+
     case OP_VAR_VALUE:
       *pos -= 1;
       if (noside == EVAL_SKIP)
index 84a095fb260f48a2d1464355d7f42d532223f2e8..335547513380c11b84db043089157047fb3e99e8 100644 (file)
@@ -801,6 +801,7 @@ lang_bool_type (void)
       return builtin_type_f_logical_s2;
     case language_cplus:
     case language_pascal:
+    case language_ada:
       if (current_language->la_language==language_cplus)
         {sym = lookup_symbol ("bool", NULL, VAR_DOMAIN, NULL, NULL);}
       else
@@ -821,6 +822,7 @@ lang_bool_type (void)
            return type;
        }
       return java_boolean_type;
+      
     default:
       return builtin_type_int;
     }