diff options
author | Siva Chandra <sivachandra@chromium.org> | 2014-05-20 06:30:29 -0700 |
---|---|---|
committer | Siva Chandra <sivachandra@chromium.org> | 2014-06-03 09:49:26 -0700 |
commit | e81e7f5e38bf0da52d9e88a94e4df9aeecd80357 (patch) | |
tree | a6c3151a1f58f8e8453236891c12e6a0234c9e47 /gdb/value.h | |
parent | ef370185fcf955b1273c2c6bcbe0b406ec1cbd83 (diff) | |
download | gdb-e81e7f5e38bf0da52d9e88a94e4df9aeecd80357.zip gdb-e81e7f5e38bf0da52d9e88a94e4df9aeecd80357.tar.gz gdb-e81e7f5e38bf0da52d9e88a94e4df9aeecd80357.tar.bz2 |
Add xmethod interface to the extension language API.
* defs.h (enum lval_type): New enumerator "lval_xcallable".
* extension-priv.h (struct extension_language_ops): Add the
xmethod interface.
* extension.c (new_xmethod_worker, clone_xmethod_worker,
get_matching_xmethod_workers, get_xmethod_argtypes,
invoke_xmethod, free_xmethod_worker,
free_xmethod_worker_vec): New functions.
* extension.h: #include "common/vec.h".
New function declarations.
(struct xmethod_worker): New struct.
(VEC (xmethod_worker_ptr)): New vector type.
(xmethod_worker_ptr): New typedef.
(xmethod_worker_vec): Likewise.
* gdbtypes.c (gdbtypes_post_init): Initialize "xmethod" field of
builtin_type.
* gdbtypes.h (enum type_code): New enumerator TYPE_CODE_XMETHOD.
(struct builtin_type): New field "xmethod".
* valarith.c (value_ptradd): Assert that the value argument is not
lval_xcallable.
* valops.c (value_must_coerce_to_target): Return 0 for
lval_xcallable values.
* value.c (struct value): New field XM_WORKER in the field
LOCATION.
(value_address, value_raw_address): Return 0 for lval_xcallable
values.
(set_value_address): Assert that the value is not an
lval_xcallable.
(value_free): Free the associated xmethod worker when freeing
lval_xcallable values.
(set_value_component_location): Assert that the WHOLE value is not
lval_xcallable.
(value_of_xmethod, call_xmethod): New functions.
* value.h: Declare "struct xmethod_worker".
Declare new functions value_of_xmethod, call_xmethod.
Diffstat (limited to 'gdb/value.h')
-rw-r--r-- | gdb/value.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/value.h b/gdb/value.h index 144e182..65fd203 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -31,6 +31,7 @@ struct type; struct ui_file; struct language_defn; struct value_print_options; +struct xmethod_worker; /* The structure which defines the type of a value. It should never be possible for a program lval value to survive over a call to the @@ -1011,4 +1012,9 @@ struct value *call_internal_function (struct gdbarch *gdbarch, char *value_internal_function_name (struct value *); +extern struct value *value_of_xmethod (struct xmethod_worker *); + +struct value *call_xmethod (struct value *function, + int argc, struct value **argv); + #endif /* !defined (VALUE_H) */ |