+2017-09-04 Pedro Alves <palves@redhat.com>
+
+ * eval.c (evaluate_subexp_standard): <OP_FUNCALL>: Extract
+ function name from symbol/minsym and pass it to
+ error_call_unknown_return_type.
+
2017-09-04 Pedro Alves <palves@redhat.com>
* ada-lang.c (resolve_subexp): Handle OP_VAR_MSYM_VALUE.
int save_pos1;
struct symbol *function = NULL;
char *function_name = NULL;
+ const char *var_func_name = NULL;
pc = (*pos)++;
op = exp->elts[pc].opcode;
}
else
{
+ if (op == OP_VAR_MSYM_VALUE)
+ {
+ symbol *sym = exp->elts[*pos + 2].symbol;
+ var_func_name = SYMBOL_PRINT_NAME (sym);
+ }
+ else if (op == OP_VAR_VALUE)
+ {
+ minimal_symbol *msym = exp->elts[*pos + 2].msymbol;
+ var_func_name = MSYMBOL_PRINT_NAME (msym);
+ }
+
argvec[0] = evaluate_subexp_with_coercion (exp, pos, noside);
type = value_type (argvec[0]);
if (type && TYPE_CODE (type) == TYPE_CODE_PTR)
return_type = expect_type;
if (return_type == NULL)
- error_call_unknown_return_type (NULL);
+ error_call_unknown_return_type (var_func_name);
return allocate_value (return_type);
}
+2017-09-04 Pedro Alves <palves@redhat.com>
+
+ * gdb.base/nodebug.exp: Test that ptype's error about functions
+ with unknown return type includes the function name too.
+
2017-09-04 Pedro Alves <palves@redhat.com>
* gdb.base/break-main-file-remove-fail.exp (test_remove_bp): Cast
# This test is not as obscure as it might look. `p getenv ("TERM")'
# is a real-world example, at least on many systems.
-
- gdb_test {p/c array_index("abcdef",2)} \
- "'array_index' has unknown return type; cast the call to its declared return type"
- gdb_test {ptype array_index("abcdef",2)} \
- "function has unknown return type; cast the call to its declared return type"
- gdb_test {whatis array_index("abcdef",2)} \
- "function has unknown return type; cast the call to its declared return type"
-
+ foreach cmd {"p/c" "ptype" "whatis"} {
+ gdb_test "$cmd array_index(\"abcdef\",2)" \
+ "'array_index' has unknown return type; cast the call to its declared return type"
+ }
if [target_info exists gdb,cannot_call_functions] {
unsupported "p/c (int) array_index(\"abcdef\",2)"
} else {