From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id h4tpNNPEsV/3TwAAWB0awg (envelope-from ) for ; Sun, 15 Nov 2020 19:16:19 -0500 Received: by simark.ca (Postfix, from userid 112) id CABDF1F08B; Sun, 15 Nov 2020 19:16:19 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=MAILING_LIST_MULTI,RDNS_NONE, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (unknown [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 75D851E58F for ; Sun, 15 Nov 2020 19:16:19 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3003E39C2C07; Mon, 16 Nov 2020 00:16:19 +0000 (GMT) Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id BD16939C146A for ; Mon, 16 Nov 2020 00:16:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org BD16939C146A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark@simark.ca Received: from [10.0.0.11] (173-246-6-90.qc.cable.ebox.net [173.246.6.90]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 6D7911E58F; Sun, 15 Nov 2020 19:16:16 -0500 (EST) Subject: Re: [PATCH 7/9] Add ptype support for DWARF-based fixed-point types To: Joel Brobecker References: <1604817017-25807-1-git-send-email-brobecker@adacore.com> <1604817017-25807-8-git-send-email-brobecker@adacore.com> <360aa942-16f6-b81d-720e-9d5897f73135@simark.ca> <20201115065749.GE404828@adacore.com> <20201115070900.GF404828@adacore.com> From: Simon Marchi Message-ID: Date: Sun, 15 Nov 2020 19:16:16 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20201115070900.GF404828@adacore.com> Content-Type: text/plain; charset=utf-8 Content-Language: fr Content-Transfer-Encoding: 7bit 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: , Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 2020-11-15 2:09 a.m., Joel Brobecker wrote: >>>> + gdb_test_no_output "set language $lang" \ >>>> + "set language to $lang for ptype test" >>>> + >>>> + gdb_test "ptype pck__fp1_var" $fp1_re >>>> + >>>> + gdb_test "ptype pck__fp2_var" $fp2_re >>>> + >>>> + gdb_test "ptype pck__fp3_var" $fp3_re >>>> + >>>> + if { $lang == "modula-2" || $lang == "pascal" } { >>>> + setup_xfail "*-*-*" "not supported by language" >>>> + } >>> >>> Can you give more details about this? What prevents these languages >>> from printing ? I'm confused, because as far as I can tell >>> C doesn't support range types more than these two languages, and it's >>> able to print . >> >> Both trigger the following error: >> >> (gdb) ptype pck__fp1_range_var >> type = [Invalid type code in symbol table. >> >> It didn't seem to be worth the effort of going any further than that, >> because I didn't didn't think either language would have fixed point >> types. > > I should probably expand a bit: I tried to make the implementation > of this feature as generic as possible, so that all current and > future languages that provide support for these kinds of types can > benefit from it with as little work as possible. For some reason, > this doesn't work for M2 and Pascal, and the decision I made at > the time was to ignore these issues on the basis that these are errors > a real user is unlikely to hit. My guess is that it works for C just because of this single case in its type print function: https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gdb/c-typeprint.c;h=10631fff9a8006baf885dcd03720074d5f95f8b9;hb=5778e0dd5d7bb872398a136b6504b9b99d5ce434#l1683 If it's a matter of just adding this case to the m2 and pascal in their type print functions, I think it would be nice simply to avoid the special case in the test. If it's anything more complex than that, then I agree with you that it's not worth it. Simon