diff options
author | Tom de Vries <tdevries@suse.de> | 2024-07-24 16:32:35 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2024-07-24 16:32:35 +0200 |
commit | de272a5e905afb20ec0a2c192538acf9c9103974 (patch) | |
tree | c52a40f5e254ab44b13e08bf49809a35b556aa30 /gdb/python | |
parent | 88141209e25ce19473ec07d7aac09cc68f06a630 (diff) | |
download | gdb-de272a5e905afb20ec0a2c192538acf9c9103974.zip gdb-de272a5e905afb20ec0a2c192538acf9c9103974.tar.gz gdb-de272a5e905afb20ec0a2c192538acf9c9103974.tar.bz2 |
[gdb/exp] Allow internal function to indicate return type
Currently an internal function handler has this prototype:
...
struct value *handler (struct gdbarch *gdbarch,
const struct language_defn *language,
void *cookie, int argc, struct value **argv);
...
Also allow an internal function with a handler with an additional
"enum noside noside" parameter:
...
struct value *handler (struct gdbarch *gdbarch,
const struct language_defn *language, void *cookie,
int argc, struct value **argv, enum noside noside);
...
In case such a handler is called with noside == EVAL_AVOID_SIDE_EFFECTS, it's
expected to return some value with the correct return type.
At least, provided it can do so without side effects, otherwise it should
throw an error.
No functional changes.
Tested on x86_64-linux and aarch64-linux.
Reviewed-By: Keith Seitz <keiths@redhat.com>
Diffstat (limited to 'gdb/python')
-rw-r--r-- | gdb/python/py-value.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/python/py-value.c b/gdb/python/py-value.c index dada8bf..5c62ef6 100644 --- a/gdb/python/py-value.c +++ b/gdb/python/py-value.c @@ -1258,7 +1258,8 @@ valpy_call (PyObject *self, PyObject *args, PyObject *keywords) if (ftype->code () == TYPE_CODE_INTERNAL_FUNCTION) return_value = call_internal_function (gdbpy_enter::get_gdbarch (), current_language, - function, args_count, vargs); + function, args_count, vargs, + EVAL_NORMAL); else return_value = call_function_by_hand (function, NULL, |