aboutsummaryrefslogtreecommitdiff
path: root/gdb/wrapper.c
diff options
context:
space:
mode:
authorFernando Nasser <fnasser@redhat.com>2000-03-30 20:15:35 +0000
committerFernando Nasser <fnasser@redhat.com>2000-03-30 20:15:35 +0000
commit8310b29b55fa6a6d33400670331d3e6506773293 (patch)
tree32e7167635c5de4b5180eec16cd5b7b14ebfd2ee /gdb/wrapper.c
parent1d1358b6679fee0ea559723c6c9b06c900e7c330 (diff)
downloadgdb-8310b29b55fa6a6d33400670331d3e6506773293.zip
gdb-8310b29b55fa6a6d33400670331d3e6506773293.tar.gz
gdb-8310b29b55fa6a6d33400670331d3e6506773293.tar.bz2
2000-03-30 Fernando Nasser <fnasser@cygnus.com>
* wrapper.c (gdb_value_subscript, wrap_value_subscript): New functions. Safe version of value_subscript. * varobj.c (): Use gdb_value_subscript() to get an array element value.
Diffstat (limited to 'gdb/wrapper.c')
-rw-r--r--gdb/wrapper.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/gdb/wrapper.c b/gdb/wrapper.c
index 07ac39a..83405e5 100644
--- a/gdb/wrapper.c
+++ b/gdb/wrapper.c
@@ -55,6 +55,9 @@ int wrap_value_fetch_lazy PARAMS ((char *));
int gdb_value_equal PARAMS ((value_ptr, value_ptr, int *));
int wrap_value_equal PARAMS ((char *));
+int gdb_value_subscript PARAMS ((value_ptr, value_ptr, value_ptr * rval));
+int wrap_value_subscript PARAMS ((char *));
+
int gdb_value_ind PARAMS ((value_ptr val, value_ptr * rval));
int wrap_value_ind PARAMS ((char *opaque_arg));
@@ -182,6 +185,42 @@ wrap_value_equal (a)
}
int
+gdb_value_subscript (val1, val2, rval)
+ value_ptr val1;
+ value_ptr val2;
+ value_ptr * rval;
+{
+ struct gdb_wrapper_arguments args;
+
+ args.args[0].pointer = val1;
+ args.args[1].pointer = val2;
+
+ if (!catch_errors ((catch_errors_ftype *) wrap_value_subscript, &args,
+ "", RETURN_MASK_ERROR))
+ {
+ /* An error occurred */
+ return 0;
+ }
+
+ *rval = (value_ptr) args.result.pointer;
+ return 1;
+}
+
+int
+wrap_value_subscript (a)
+ 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_subscript (val1, val2);
+ return 1;
+}
+
+int
gdb_value_ind (val, rval)
value_ptr val;
value_ptr *rval;