aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.cp/koenig.exp
diff options
context:
space:
mode:
authorRichard Bunt <richard.bunt@arm.com>2018-09-19 10:43:56 +0100
committerRichard Bunt <richard.bunt@arm.com>2018-09-19 10:43:56 +0100
commit23be8da7396ffc4d5492d976e244daaa543eaac9 (patch)
tree937a4d2e683bceb377afdbf8f97eb525651c380a /gdb/testsuite/gdb.cp/koenig.exp
parent7307a73aed246eaccec9277b11e045f974322796 (diff)
downloadbinutils-23be8da7396ffc4d5492d976e244daaa543eaac9.zip
binutils-23be8da7396ffc4d5492d976e244daaa543eaac9.tar.gz
binutils-23be8da7396ffc4d5492d976e244daaa543eaac9.tar.bz2
Logical short circuiting with argument lists
When evaluating Fortran expressions such as the following: print truth_table(1,1) .OR. truth_table(2,1) where truth_table(1,1) evaluates to true, the debugger would report that it could not perform substring operations on this type. This patch addresses this issue. Investigation revealed that EVAL_SKIP was not being handled correctly for all types serviced by the OP_F77_UNDETERMINED_ARGLIST case in evaluate_subexp_standard. While skipping an undetermined argument list the type is resolved to be an integer (as this is what evaluate_subexp returns when skipping) and so it was not possible to delegate to the appropriate case (e.g. array, function call). The solution implemented here updates OP_VAR_VALUE to return correct type information when skipping. This way OP_F77_UNDETERMINED_ARGLIST can delegate the skipping to the appropriate case or routine, which should know how to skip/evaluate the type in question. koenig.exp was updated to include a testcase which exercises the modified skip logic in OP_VAR_VALUE, as it falls through from OP_ADL_FUNC. This patch has been tested for regressions with GCC 7.3 on aarch64, ppc64le and x86_64. gdb/ChangeLog: * eval.c (skip_undetermined_arglist): Skip argument list helper. (evaluate_subexp_standard): Return a dummy type when honoring EVAL_SKIP in OP_VAR_VALUE and handle skipping in the OP_F77_UNDETERMINED_ARGLIST case. * expression.h (enum noside): Update comment. gdb/testsuite/ChangeLog: * gdb.cp/koenig.exp: Extend to test logical short circuiting. * gdb.fortran/short-circuit-argument-list.exp: New file. * gdb.fortran/short-circuit-argument-list.f90: New test.
Diffstat (limited to 'gdb/testsuite/gdb.cp/koenig.exp')
-rw-r--r--gdb/testsuite/gdb.cp/koenig.exp3
1 files changed, 3 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.cp/koenig.exp b/gdb/testsuite/gdb.cp/koenig.exp
index b7dff90..0725c1b 100644
--- a/gdb/testsuite/gdb.cp/koenig.exp
+++ b/gdb/testsuite/gdb.cp/koenig.exp
@@ -33,6 +33,9 @@ gdb_test "p first(c)" "= 11"
# the qualifying parameter
gdb_test "p second(0,0,c,0,0)" "= 33"
+# Test evaluating function under EVAL_SKIP
+gdb_test "p true || second(0,0,c,0,0)" "= true"
+
# Test the name "entry" being used for `variablename@entry' entry values.
gdb_test "p entry (c)" " = 44"