summaryrefslogtreecommitdiff
path: root/gdb/infcall.c
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2022-09-11 09:01:03 +0200
committerTom de Vries <tdevries@suse.de>2022-09-11 09:01:03 +0200
commita34a90995ae7c2f0c0b79ad32d8087d507fe42db (patch)
tree75bf74f90d3d068a2609d34fd662eaed0534742f /gdb/infcall.c
parent20a64ae9cb271e0ebcea2425e57b53f6d4a0c1d8 (diff)
downloadbinutils-gdb-a34a90995ae7c2f0c0b79ad32d8087d507fe42db.tar.gz
[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
Diffstat (limited to 'gdb/infcall.c')
-rw-r--r--gdb/infcall.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/infcall.c b/gdb/infcall.c
index 2acceed4b07..dd70682bc76 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)
{