From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 3FMrChA4dGKZhQQAWB0awg (envelope-from ) for ; Thu, 05 May 2022 16:48:16 -0400 Received: by simark.ca (Postfix, from userid 112) id 1EA991E058; Thu, 5 May 2022 16:48:16 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=wJZz9WgC; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_DYNAMIC, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [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 A0D0D1E00E for ; Thu, 5 May 2022 16:48:15 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D9B203857365 for ; Thu, 5 May 2022 20:48:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D9B203857365 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1651783694; bh=MZn1FdoHz90gDMnkqJtuqPL/7P579vYTlBmfWf4+ApQ=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=wJZz9WgCDeE5FU/vkBi4JamQ5mdt5s0d2Y4CjE30PiHYLAPbNaBQkhMaiknbCgcmE qEfZLIJ37TbbkJsDbHqrPQhrKu64vpsQwSxdkiIRDG8cc06lvBzbMBaGBXHystUuTq qqInU1xFHM9fVkCl2W3AFgIbmwbnBqZ02JWpX3q0= Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [170.10.133.74]) by sourceware.org (Postfix) with ESMTPS id CA5CC3858D3C for ; Thu, 5 May 2022 20:47:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CA5CC3858D3C 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-650-XBYPb0BnMISqfA9PF6Vgfw-1; Thu, 05 May 2022 16:47:50 -0400 X-MC-Unique: XBYPb0BnMISqfA9PF6Vgfw-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 AC6B018A0161; Thu, 5 May 2022 20:47:49 +0000 (UTC) Received: from [10.2.17.61] (unknown [10.2.17.61]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6930CC2811A; Thu, 5 May 2022 20:47:49 +0000 (UTC) Message-ID: Date: Thu, 5 May 2022 13:47:48 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH 2/3] Always pass an explicit language down to c_type_print To: Pedro Alves , gdb-patches@sourceware.org References: <20220505185020.3648774-1-pedro@palves.net> <20220505185020.3648774-3-pedro@palves.net> In-Reply-To: <20220505185020.3648774-3-pedro@palves.net> X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 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-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: , From: Keith Seitz via Gdb-patches Reply-To: Keith Seitz Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 5/5/22 11:50, Pedro Alves wrote: > In gnuv3_print_method_ptr, I wasn't sure whether we could hardcode C++ > here, and we don't have an enum language handy, so I made it use the > current language, just like today. Can always be improved later. I like this philosophy. :-) I just have one comment for you to double-check. Otherwise, I also encourage you to approve your patch. Keith > Change-Id: Ib54fab4cf0fd307bfd55bf1dd5056830096a653b > --- > gdb/ada-typeprint.c | 2 +- > gdb/c-exp.y | 1 + > gdb/c-lang.c | 8 ++++---- > gdb/c-lang.h | 17 +++++++++-------- > gdb/c-typeprint.c | 25 +++++-------------------- > gdb/d-lang.c | 2 +- > gdb/gnu-v3-abi.c | 3 ++- > gdb/go-typeprint.c | 2 +- > gdb/objc-lang.c | 2 +- > gdb/opencl-lang.c | 2 +- > gdb/rust-lang.c | 5 +++-- > 11 files changed, 29 insertions(+), 40 deletions(-) > > diff --git a/gdb/c-lang.h b/gdb/c-lang.h > index 46e562df055..c81c3bbc3b8 100644 > --- a/gdb/c-lang.h > +++ b/gdb/c-lang.h > @@ -65,16 +65,17 @@ extern int c_parse (struct parser_state *); > extern int c_parse_escape (const char **, struct obstack *); > > /* Defined in c-typeprint.c */ > -extern void c_print_type (struct type *, const char *, > - struct ui_file *, int, int, > - const struct type_print_options *); > > -/* Print a type but allow the precise language to be specified. */ > +/* LEVEL is the depth to indent lines by. Allows the precise language > + to be specified, because many languages defer to C type > + printing. */ The actual description of the function (if brief) has been removed. The new comment explains the LEVEL argument, but the decl only contains types. A casual reader (like myself) would have to go figure out to which argument this refers. I have to ask: Is this what you intended? It seems like a cut-n-paste error? > -extern void c_print_type (struct type *, const char *, > - struct ui_file *, int, int, > - enum language, > - const struct type_print_options *); > +extern void c_print_type (struct type *type, > + const char *varstring, > + struct ui_file *stream, > + int show, int level, > + enum language language, > + const struct type_print_options *flags); > > extern void c_print_typedef (struct type *, > struct symbol *,