* Makefile.in (gencode): Provide explicit path to gencode.c.
[deliverable/binutils-gdb.git] / gdb / wrapper.c
index 4ee8fa248c1d5d4643a4568274eee5109a412c90..87e46fe511108d0919c4a1f5f35ccd349b9f37cc 100644 (file)
@@ -1,5 +1,5 @@
 /* Longjump free calls to gdb internal routines.
-   Copyright 1999 Free Software Foundation, Inc.
+   Copyright 1999, 2000 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
@@ -18,7 +18,6 @@
 
 #include "defs.h"
 #include "value.h"
-#include "frame.h"
 #include "wrapper.h"
 
 /* Use this struct to pass arguments to wrapper routines. We assume
@@ -50,6 +49,8 @@ static int wrap_value_fetch_lazy (char *);
 
 static int wrap_value_equal (char *);
 
+static int wrap_value_assign (char *);
+
 static int wrap_value_subscript (char *);
 
 static int wrap_value_ind (char *opaque_arg);
@@ -57,11 +58,8 @@ static int wrap_value_ind (char *opaque_arg);
 static int wrap_parse_and_eval_type (char *);
 
 int
-gdb_parse_exp_1 (stringptr, block, comma, expression)
-     char **stringptr;
-     struct block *block;
-     int comma;
-     struct expression **expression;
+gdb_parse_exp_1 (char **stringptr, struct block *block, int comma,
+                struct expression **expression)
 {
   struct gdb_wrapper_arguments args;
   args.args[0].pointer = stringptr;
@@ -81,8 +79,7 @@ gdb_parse_exp_1 (stringptr, block, comma, expression)
 }
 
 static int
-wrap_parse_exp_1 (argptr)
-     char *argptr;
+wrap_parse_exp_1 (char *argptr)
 {
   struct gdb_wrapper_arguments *args 
     = (struct gdb_wrapper_arguments *) argptr;
@@ -93,9 +90,7 @@ wrap_parse_exp_1 (argptr)
 }
 
 int
-gdb_evaluate_expression (exp, value)
-     struct expression *exp;
-     value_ptr *value;
+gdb_evaluate_expression (struct expression *exp, value_ptr *value)
 {
   struct gdb_wrapper_arguments args;
   args.args[0].pointer = exp;
@@ -112,8 +107,7 @@ gdb_evaluate_expression (exp, value)
 }
 
 static int
-wrap_evaluate_expression (a)
-     char *a;
+wrap_evaluate_expression (char *a)
 {
   struct gdb_wrapper_arguments *args = (struct gdb_wrapper_arguments *) a;
 
@@ -123,8 +117,7 @@ wrap_evaluate_expression (a)
 }
 
 int
-gdb_value_fetch_lazy (value)
-     value_ptr value;
+gdb_value_fetch_lazy (value_ptr value)
 {
   struct gdb_wrapper_arguments args;
 
@@ -134,8 +127,7 @@ gdb_value_fetch_lazy (value)
 }
 
 static int
-wrap_value_fetch_lazy (a)
-     char *a;
+wrap_value_fetch_lazy (char *a)
 {
   struct gdb_wrapper_arguments *args = (struct gdb_wrapper_arguments *) a;
 
@@ -144,10 +136,7 @@ wrap_value_fetch_lazy (a)
 }
 
 int
-gdb_value_equal (val1, val2, result)
-     value_ptr val1;
-     value_ptr val2;
-     int *result;
+gdb_value_equal (value_ptr val1, value_ptr val2, int *result)
 {
   struct gdb_wrapper_arguments args;
 
@@ -166,8 +155,7 @@ gdb_value_equal (val1, val2, result)
 }
 
 static int
-wrap_value_equal (a)
-     char *a;
+wrap_value_equal (char *a)
 {
   struct gdb_wrapper_arguments *args = (struct gdb_wrapper_arguments *) a;
   value_ptr val1, val2;
@@ -180,10 +168,39 @@ wrap_value_equal (a)
 }
 
 int
-gdb_value_subscript (val1, val2, rval)
-     value_ptr val1;
-     value_ptr val2;
-     value_ptr * rval;
+gdb_value_assign (value_ptr val1, value_ptr val2, value_ptr *result)
+{
+  struct gdb_wrapper_arguments args;
+
+  args.args[0].pointer = val1;
+  args.args[1].pointer = val2;
+
+  if (!catch_errors ((catch_errors_ftype *) wrap_value_assign, &args,
+                    "", RETURN_MASK_ERROR))
+    {
+      /* An error occurred */
+      return 0;
+    }
+
+  *result = (value_ptr) args.result.pointer;
+  return 1;
+}
+
+static int
+wrap_value_assign (char *a)
+{
+  struct gdb_wrapper_arguments *args = (struct gdb_wrapper_arguments *) a;
+  value_ptr val1, val2;
+
+  val1 = (value_ptr) (args)->args[0].pointer;
+  val2 = (value_ptr) (args)->args[1].pointer;
+
+  (args)->result.pointer = value_assign (val1, val2);
+  return 1;
+}
+
+int
+gdb_value_subscript (value_ptr val1, value_ptr val2, value_ptr *rval)
 {
   struct gdb_wrapper_arguments args;
 
@@ -202,8 +219,7 @@ gdb_value_subscript (val1, val2, rval)
 }
 
 static int
-wrap_value_subscript (a)
-     char *a;
+wrap_value_subscript (char *a)
 {
   struct gdb_wrapper_arguments *args = (struct gdb_wrapper_arguments *) a;
   value_ptr val1, val2;
@@ -216,9 +232,7 @@ wrap_value_subscript (a)
 }
 
 int
-gdb_value_ind (val, rval)
-     value_ptr val;
-     value_ptr *rval;
+gdb_value_ind (value_ptr val, value_ptr *rval)
 {
   struct gdb_wrapper_arguments args;
 
@@ -236,8 +250,7 @@ gdb_value_ind (val, rval)
 }
 
 static int
-wrap_value_ind (opaque_arg)
-     char *opaque_arg;
+wrap_value_ind (char *opaque_arg)
 {
   struct gdb_wrapper_arguments *args = (struct gdb_wrapper_arguments *) opaque_arg;
   value_ptr val;
This page took 0.025272 seconds and 4 git commands to generate.