aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul N. Hilfinger <hilfinger@adacore.com>2012-04-21 22:12:59 +0000
committerPaul N. Hilfinger <hilfinger@adacore.com>2012-04-21 22:12:59 +0000
commitc8ea197278008d76c7a04fa2813ce470a5f34072 (patch)
tree9eed7e5178665287c46ab67d818361cf6c4e7559
parent8d1b3521dbd074e72764e19fb7c9b430a968e664 (diff)
downloadgdb-c8ea197278008d76c7a04fa2813ce470a5f34072.zip
gdb-c8ea197278008d76c7a04fa2813ce470a5f34072.tar.gz
gdb-c8ea197278008d76c7a04fa2813ce470a5f34072.tar.bz2
Add proper handling for internal functions and STT_GNU_IFUNC symbols in Ada mode.
The code for handling calls to internal functions (esp., Python functions) and for handling STT_GNU_IFUNC had not been added to the Ada expression evaluator. This change adapts them from eval.c. gdb/Changelog: * ada-lang.c (ada_evaluate_subexp): Add cases for TYPE_CODE_INTERNAL_FUNCTION and for TYPE_GNU_IFUNC, following their treatment in eval.c.
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/ada-lang.c19
2 files changed, 24 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 8ad6e84..9903f0c 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2012-04-21 Paul Hilfinger <hilfinger@adacore.com>
+
+ * ada-lang.c (ada_evaluate_subexp): Add cases for
+ TYPE_CODE_INTERNAL_FUNCTION and for TYPE_GNU_IFUNC, following
+ their treatment in eval.c.
+
2012-04-21 David S. Miller <davem@davemloft.net>
* sparc-tdep.c (X_DISP10): Define.
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 52e1e59..180fadb 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -9717,8 +9717,25 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
{
case TYPE_CODE_FUNC:
if (noside == EVAL_AVOID_SIDE_EFFECTS)
- return allocate_value (TYPE_TARGET_TYPE (type));
+ {
+ struct type *rtype = TYPE_TARGET_TYPE (type);
+
+ if (TYPE_GNU_IFUNC (type))
+ return allocate_value (TYPE_TARGET_TYPE (rtype));
+ return allocate_value (rtype);
+ }
return call_function_by_hand (argvec[0], nargs, argvec + 1);
+ case TYPE_CODE_INTERNAL_FUNCTION:
+ if (noside == EVAL_AVOID_SIDE_EFFECTS)
+ /* 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
+ return call_internal_function (exp->gdbarch, exp->language_defn,
+ argvec[0], nargs, argvec + 1);
+
case TYPE_CODE_STRUCT:
{
int arity;