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.133.124]) by sourceware.org (Postfix) with ESMTPS id 998393858D32 for ; Sat, 10 Sep 2022 22:02:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 998393858D32 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-228-4PNO5xbVNRG_BfuGprOsjQ-1; Sat, 10 Sep 2022 18:02:17 -0400 X-MC-Unique: 4PNO5xbVNRG_BfuGprOsjQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7B7A9800124; Sat, 10 Sep 2022 22:02:17 +0000 (UTC) Received: from f35-zws-1 (unknown [10.2.16.60]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3714AC15BB3; Sat, 10 Sep 2022 22:02:17 +0000 (UTC) Date: Sat, 10 Sep 2022 15:02:15 -0700 From: Kevin Buettner To: gdb-patches@sourceware.org Cc: Tom de Vries Subject: Re: [PATCH][gdb/symtab] Fix handling of DW_TAG_unspecified_type Message-ID: <20220910150215.6f326aa7@f35-zws-1> In-Reply-To: <20220908130531.GA19459@delia> References: <20220908130531.GA19459@delia> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Sep 2022 22:02:21 -0000 On Thu, 8 Sep 2022 15:05:32 +0200 Tom de Vries wrote: > 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 > > Any comments? Hi Tom, Thanks for adding a test and fixing this bug. LGTM. Kevin