+2019-04-01 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * eval.c (evaluate_subexp_standard): Handle internal functions
+ during Fortran function call handling.
+
2019-04-01 Andrew Burgess <andrew.burgess@embecosm.com>
* NEWS: Mention new internal functions.
case TYPE_CODE_PTR:
case TYPE_CODE_FUNC:
+ case TYPE_CODE_INTERNAL_FUNCTION:
/* It's a function call. */
/* Allocate arg vector, including space for the function to be
called in argvec[0] and a terminating NULL. */
results in malloc being called with a pointer to an integer
followed by an attempt to malloc the arguments to malloc in
target memory. Infinite recursion ensues. */
- bool is_artificial =
- TYPE_FIELD_ARTIFICIAL (value_type (arg1), tem - 1);
- argvec[tem] = fortran_argument_convert (argvec[tem],
- is_artificial);
+ if (code == TYPE_CODE_PTR || code == TYPE_CODE_FUNC)
+ {
+ bool is_artificial
+ = TYPE_FIELD_ARTIFICIAL (value_type (arg1), tem - 1);
+ argvec[tem] = fortran_argument_convert (argvec[tem],
+ is_artificial);
+ }
}
argvec[tem] = 0; /* signal end of arglist */
if (noside == EVAL_SKIP)
+2019-04-01 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * gdb.python/py-function.exp: Check calling helper function from
+ all languages.
+ * lib/gdb.exp (gdb_supported_languages): New proc.
+
2019-04-01 Andrew Burgess <andrew.burgess@embecosm.com>
* gdb.base/complex-parts.c: New file.
"Double ()" "" \
"end" ""
-gdb_test "print \$double (1)" "= 2" "call value-returning function"
+# Different languages can have different parsers, so lets check that
+# internal functions are understood by every language. Place auto
+# last in the list so we end up back in 'auto' language mode.
+foreach lang [concat [gdb_supported_languages] auto] {
+ gdb_test_no_output "set language $lang"
+ gdb_test "print \$double (1)" "= 2" "call value-returning function, language = $lang"
+}
gdb_py_test_multiple "input int-returning function" \
"python" "" \
builtin_cd $dir
}
+# Return a list of all languages supported by GDB, suitable for use in
+# 'set language NAME'. This doesn't include either the 'local' or
+# 'auto' keywords.
+proc gdb_supported_languages {} {
+ return [list c objective-c c++ d go fortran modula-2 asm pascal \
+ opencl rust minimal ada]
+}
+
# Always load compatibility stuff.
load_lib future.exp