From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id EC21A3858D33 for ; Wed, 19 Apr 2023 20:33:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EC21A3858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681936393; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UF/S6nYOrMi+UVwc2HlKj/GQ3E4gBYUC+C8xCQQG32g=; b=BBYLdmlLm664Mrz5PzLnr+vxfh34W8lPADD9dYPaHIyUzfLHxnYzEUET42u+0obpepvNmF CA39hWZzo8BjVs8p6Bd91hdTv1qkpDDGxw7yzGC+azSIAOAUWLess72HM24dIkDmp1E0+j WEsDL2UJ+bV9NuHR11v6hfG1zTSrCsc= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-301-qUUfFVh_OOWYGoH4TZnsIQ-1; Wed, 19 Apr 2023 16:33:10 -0400 X-MC-Unique: qUUfFVh_OOWYGoH4TZnsIQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2D2FE3801F67; Wed, 19 Apr 2023 20:33:10 +0000 (UTC) Received: from [10.2.17.111] (unknown [10.2.17.111]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E22331121314; Wed, 19 Apr 2023 20:33:09 +0000 (UTC) Message-ID: <7de29fb8-f5d4-897e-026c-ad2432f466e2@redhat.com> Date: Wed, 19 Apr 2023 13:33:09 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [PATCH] Fix calling debuginfo-less functions in Ada To: Tom Tromey , gdb-patches@sourceware.org References: <20230417134149.511889-1-tromey@adacore.com> From: Keith Seitz In-Reply-To: <20230417134149.511889-1-tromey@adacore.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 4/17/23 06:41, Tom Tromey via Gdb-patches wrote: > 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. I'm no Ada expert (or even novice!), but I do have one tiny question/comment. > diff --git a/gdb/testsuite/lib/ada.exp b/gdb/testsuite/lib/ada.exp > index 4395f31ad94..211aa77e366 100644 > --- a/gdb/testsuite/lib/ada.exp > +++ b/gdb/testsuite/lib/ada.exp > @@ -66,7 +66,9 @@ proc gdb_compile_ada_1 {source dest type options} { > # and it avoids using a stray objfile file from a long-past > # run, for instance. > append options " ada" > - append options " additional_flags=-f" > + if {[lsearch -exact $options no-force] == -1} { > + append options " additional_flags=-f" > + } > append options " additional_flags=-I$srcdir" > > set result [target_compile_ada_from_dir \ This "no-force" option is new -- should it be mentioned somewhere? I'm just thinking that if I end up hacking on this sometime, it would save me some grief to see any/all Ada-specific options listed or explained somewhere. [I guess this is really the first one, though.] Otherwise, I see no issues with your patch. Keith