s/struct _serial_t/struct serial/
[deliverable/binutils-gdb.git] / gdb / eval.c
index fbe29a680755ad16a177a1a22f7b9ee1532e8639..fad995ee35c5b5b03501a091d21b6146fa96c3da 100644 (file)
@@ -1,5 +1,6 @@
 /* Evaluate expressions for GDB.
-   Copyright 1986, 87, 89, 91, 92, 93, 94, 95, 96, 97, 1998
+   Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+   1996, 1997, 1998, 1999, 2000
    Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -27,9 +28,9 @@
 #include "expression.h"
 #include "target.h"
 #include "frame.h"
-#include "demangle.h"
 #include "language.h"          /* For CAST_IS_CONVERSION */
 #include "f-lang.h"            /* for array bound stuff */
+#include "cp-abi.h"
 
 /* Defined in symtab.c */
 extern int hp_som_som_object_present;
@@ -61,9 +62,6 @@ static LONGEST
 init_array_element (value_ptr, value_ptr, struct expression *,
                    int *, enum noside, LONGEST, LONGEST);
 
-#if defined (__GNUC__) && !__STDC__
-inline
-#endif
 static value_ptr
 evaluate_subexp (struct type *expect_type, register struct expression *exp,
                 register int *pos, enum noside noside)
@@ -103,6 +101,21 @@ parse_and_eval_address_1 (char **expptr)
   return addr;
 }
 
+/* Like parse_and_eval_address, but treats the value of the expression
+   as an integer, not an address, returns a LONGEST, not a CORE_ADDR */
+LONGEST
+parse_and_eval_long (char *exp)
+{
+  struct expression *expr = parse_expression (exp);
+  register LONGEST retval;
+  register struct cleanup *old_chain =
+    make_cleanup (free_current_contents, &expr);
+
+  retval = value_as_long (evaluate_expression (expr));
+  do_cleanups (old_chain);
+  return (retval);
+}
+
 value_ptr
 parse_and_eval (char *exp)
 {
This page took 0.024576 seconds and 4 git commands to generate.