aboutsummaryrefslogtreecommitdiff
path: root/gdb/extension.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/extension.c')
-rw-r--r--gdb/extension.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gdb/extension.c b/gdb/extension.c
index 77b62e0..dac203b 100644
--- a/gdb/extension.c
+++ b/gdb/extension.c
@@ -964,6 +964,31 @@ get_xmethod_arg_types (struct xmethod_worker *worker, int *nargs)
return type_array;
}
+/* Return the type of the result of the xmethod encapsulated in WORKER.
+ OBJECT, ARGS, NARGS are the same as for invoke_xmethod. */
+
+struct type *
+get_xmethod_result_type (struct xmethod_worker *worker,
+ struct value *object, struct value **args, int nargs)
+{
+ enum ext_lang_rc rc;
+ struct type *result_type;
+ const struct extension_language_defn *extlang = worker->extlang;
+
+ gdb_assert (extlang->ops->get_xmethod_arg_types != NULL);
+
+ rc = extlang->ops->get_xmethod_result_type (extlang, worker,
+ object, args, nargs,
+ &result_type);
+ if (rc == EXT_LANG_RC_ERROR)
+ {
+ error (_("Error while fetching result type of an xmethod worker "
+ "defined in %s."), extlang->capitalized_name);
+ }
+
+ return result_type;
+}
+
/* Invokes the xmethod encapsulated in WORKER and returns the result.
The method is invoked on OBJ with arguments in the ARGS array. NARGS is
the length of the this array. */