Handle biased types
[deliverable/binutils-gdb.git] / gdb / eval.c
index a67fd4f67162b5fb1077d55e560820d03924537e..aed89e5f85a1a6806ec4b25df6f76d6d38e4336f 100644 (file)
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-
-/* Standard C includes.  */
-#include <ctype.h>
-
-/* Local non-gdb includes.  */
-#include "block.h"
-#include "cp-abi.h"
-#include "cp-support.h"
+#include "symtab.h"
+#include "gdbtypes.h"
+#include "value.h"
 #include "expression.h"
-#include "f-lang.h"
+#include "target.h"
 #include "frame.h"
-#include "gdb_obstack.h"
 #include "gdbthread.h"
-#include "gdbtypes.h"
+#include "language.h"          /* For CAST_IS_CONVERSION.  */
+#include "f-lang.h"            /* For array bound stuff.  */
+#include "cp-abi.h"
 #include "infcall.h"
-#include "language.h"
 #include "objc-lang.h"
-#include "objfiles.h"
+#include "block.h"
 #include "parser-defs.h"
-#include "regcache.h"
-#include "symtab.h"
-#include "target.h"
-#include "typeprint.h"
+#include "cp-support.h"
 #include "ui-out.h"
+#include "regcache.h"
 #include "user-regs.h"
 #include "valprint.h"
-#include "value.h"
+#include "gdb_obstack.h"
+#include "objfiles.h"
+#include "typeprint.h"
+#include <ctype.h>
 
 /* This is defined in valops.c */
 extern int overload_resolution;
@@ -205,11 +201,11 @@ fetch_subexp_value (struct expression *exp, int *pc, struct value **valp,
   mark = value_mark ();
   result = NULL;
 
-  TRY
+  try
     {
       result = evaluate_subexp (NULL_TYPE, exp, pc, EVAL_NORMAL);
     }
-  CATCH (ex, RETURN_MASK_ALL)
+  catch (const gdb_exception &ex)
     {
       /* Ignore memory errors if we want watchpoints pointing at
         inaccessible memory to still be created; otherwise, throw the
@@ -221,11 +217,10 @@ fetch_subexp_value (struct expression *exp, int *pc, struct value **valp,
            break;
          /* Fall through.  */
        default:
-         throw_exception (ex);
+         throw;
          break;
        }
     }
-  END_CATCH
 
   new_mark = value_mark ();
   if (mark == new_mark)
@@ -242,15 +237,14 @@ fetch_subexp_value (struct expression *exp, int *pc, struct value **valp,
       else
        {
 
-         TRY
+         try
            {
              value_fetch_lazy (result);
              *valp = result;
            }
-         CATCH (except, RETURN_MASK_ERROR)
+         catch (const gdb_exception_error &except)
            {
            }
-         END_CATCH
        }
     }
 
@@ -720,19 +714,18 @@ evaluate_var_value (enum noside noside, const block *blk, symbol *var)
 
   struct value *ret = NULL;
 
-  TRY
+  try
     {
       ret = value_of_variable (var, blk);
     }
 
-  CATCH (except, RETURN_MASK_ERROR)
+  catch (const gdb_exception_error &except)
     {
       if (noside != EVAL_AVOID_SIDE_EFFECTS)
-       throw_exception (except);
+       throw;
 
       ret = value_zero (SYMBOL_TYPE (var), not_lval);
     }
-  END_CATCH
 
   return ret;
 }
@@ -961,19 +954,18 @@ evaluate_funcall (type *expect_type, expression *exp, int *pos,
          while (unop_user_defined_p (op, arg2))
            {
              struct value *value = NULL;
-             TRY
+             try
                {
                  value = value_x_unop (arg2, op, noside);
                }
 
-             CATCH (except, RETURN_MASK_ERROR)
+             catch (const gdb_exception_error &except)
                {
                  if (except.error == NOT_FOUND_ERROR)
                    break;
                  else
-                   throw_exception (except);
+                   throw;
                }
-             END_CATCH
 
                arg2 = value;
            }
@@ -2051,19 +2043,18 @@ evaluate_subexp_standard (struct type *expect_type,
       while (unop_user_defined_p (op, arg1))
        {
          struct value *value = NULL;
-         TRY
+         try
            {
              value = value_x_unop (arg1, op, noside);
            }
 
-         CATCH (except, RETURN_MASK_ERROR)
+         catch (const gdb_exception_error &except)
            {
              if (except.error == NOT_FOUND_ERROR)
                break;
              else
-               throw_exception (except);
+               throw;
            }
-         END_CATCH
 
          arg1 = value;
        }
This page took 0.026987 seconds and 4 git commands to generate.