aboutsummaryrefslogtreecommitdiff
path: root/gdb/eval.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2009-09-22 17:39:54 +0000
committerTom Tromey <tromey@redhat.com>2009-09-22 17:39:54 +0000
commit329719ec1d3002c2e148acbf7287fee1dcd531c7 (patch)
tree6bd836db9acc4a8708ba39578e5ac0489e572e8d /gdb/eval.c
parent074d710de74bfa99c9fb9ac2c3013508149d16e5 (diff)
downloadfsf-binutils-gdb-329719ec1d3002c2e148acbf7287fee1dcd531c7.zip
fsf-binutils-gdb-329719ec1d3002c2e148acbf7287fee1dcd531c7.tar.gz
fsf-binutils-gdb-329719ec1d3002c2e148acbf7287fee1dcd531c7.tar.bz2
gdb
PR python/10680: * eval.c (evaluate_subexp_standard) <do_call_it>: Handle internal functions in EVAL_AVOID_SIDE_EFFECTS case. gdb/testsuite * gdb.python/py-function.exp: Add regression tests.
Diffstat (limited to 'gdb/eval.c')
-rw-r--r--gdb/eval.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/gdb/eval.c b/gdb/eval.c
index 7e41d39..2926465 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -1513,11 +1513,18 @@ evaluate_subexp_standard (struct type *expect_type,
gdb isn't asked for it's opinion (ie. through "whatis"),
it won't offer it. */
- struct type *ftype =
- TYPE_TARGET_TYPE (value_type (argvec[0]));
+ struct type *ftype = value_type (argvec[0]);
- if (ftype)
- return allocate_value (TYPE_TARGET_TYPE (value_type (argvec[0])));
+ if (TYPE_CODE (ftype) == TYPE_CODE_INTERNAL_FUNCTION)
+ {
+ /* We don't know anything about what the internal
+ function might return, but we have to return
+ something. */
+ return value_zero (builtin_type (exp->gdbarch)->builtin_int,
+ not_lval);
+ }
+ else if (TYPE_TARGET_TYPE (ftype))
+ return allocate_value (TYPE_TARGET_TYPE (ftype));
else
error (_("Expression of type other than \"Function returning ...\" used as function"));
}