]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
[gdb/exp] Allow internal function to indicate return type
authorTom de Vries <tdevries@suse.de>
Wed, 24 Jul 2024 14:32:35 +0000 (16:32 +0200)
committerTom de Vries <tdevries@suse.de>
Wed, 24 Jul 2024 14:32:35 +0000 (16:32 +0200)
commitde272a5e905afb20ec0a2c192538acf9c9103974
treec52a40f5e254ab44b13e08bf49809a35b556aa30
parent88141209e25ce19473ec07d7aac09cc68f06a630
[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>
gdb/ada-lang.c
gdb/eval.c
gdb/python/py-value.c
gdb/value.c
gdb/value.h