Fix calling debuginfo-less functions in Ada
authorTom Tromey <tromey@adacore.com>
Wed, 12 Apr 2023 15:30:21 +0000 (09:30 -0600)
committerTom Tromey <tromey@adacore.com>
Fri, 12 May 2023 18:11:35 +0000 (12:11 -0600)
commit61f9fb1ea4aab3cd42bfcaaee2a05ac0dbe18a22
treeda773c5cdf0f520dd05803c61e25ff6980282db4
parent6a667807390b7091b5ec088d979c779f65d3dfa5
Fix calling debuginfo-less functions in Ada

A co-worker at AdaCore noticed that calling a function without
debuginfo yields:

(gdb) print plus_one(23)
'pck.plus_one' has unknown return type; cast the call to its declared return type

However, this also happens if you follow the directions and add the
cast.

This patch fixes the problem and adds a regression test.
gdb/ada-lang.c
gdb/testsuite/gdb.ada/call-no-debug.exp [new file with mode: 0644]
gdb/testsuite/gdb.ada/call-no-debug/pck.adb [new file with mode: 0644]
gdb/testsuite/gdb.ada/call-no-debug/pck.ads [new file with mode: 0644]
gdb/testsuite/gdb.ada/call-no-debug/prog.adb [new file with mode: 0644]
gdb/testsuite/lib/ada.exp