From a34a90995ae7c2f0c0b79ad32d8087d507fe42db Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Sun, 11 Sep 2022 09:01:03 +0200 Subject: [gdb/symtab] Fix handling of DW_TAG_unspecified_type Currently, the test-case contained in this patch fails: ... (gdb) p (int) foo ()^M Invalid cast.^M (gdb) FAIL: gdb.dwarf2/dw2-unspecified-type.exp: p (int) foo () ... because DW_TAG_unspecified_type is translated as void. There's some code in read_unspecified_type that marks the type as stub, but that's only active for ada: ... if (cu->lang () == language_ada) type->set_is_stub (true); ... Fix this by: - marking the type as a stub for all languages, and - handling the stub return type case in call_function_by_hand_dummy. Tested on x86_64-linux. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29558 --- gdb/infcall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gdb/infcall.c') diff --git a/gdb/infcall.c b/gdb/infcall.c index 2acceed..dd70682 100644 --- a/gdb/infcall.c +++ b/gdb/infcall.c @@ -814,7 +814,7 @@ call_function_by_hand_dummy (struct value *function, "target calling convention."), get_function_name (funaddr, name_buf, sizeof (name_buf))); - if (values_type == NULL) + if (values_type == NULL || values_type->is_stub ()) values_type = default_return_type; if (values_type == NULL) { -- cgit v1.1