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 54F8B3858C20 for ; Wed, 16 Feb 2022 15:47:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 54F8B3858C20 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-411-dVFF7wtNO7-7nhxPC86lVw-1; Wed, 16 Feb 2022 10:46:59 -0500 X-MC-Unique: dVFF7wtNO7-7nhxPC86lVw-1 Received: by mail-wm1-f69.google.com with SMTP id i30-20020a1c541e000000b0037dbf3d7efdso373616wmb.4 for ; Wed, 16 Feb 2022 07:46:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=IwZ/B8x77PjZMYgDbhggAwmSDr2XyY7HtYkbb/9IsJg=; b=swKa3F597lJs0n4eYAw1/IxuSNo4kjxPNvkgjvKi2QL7Bk9lqKLbdOt1yXw2j0sqZB BIG0kGSFaJPrVjKIKimwRlMUMQA2Qojb+aBjLYZpxX5fmkX1aNLzVOkYWGZwaxW777g1 1PXcQ0tlt69OLrJwqUUkC69iGfNW27sJTSuGAhGWRuhOdTNii7wfs9d9mIs701rE24l4 KEC/yTmL3ACrS4ypea/hesuqtFnpaAF+4LfRMIIijvJo7f9XrrCCAgq6xWCgmpwJVl8N 8jnxnz9GuI6uCST7MMNGy3rbP163M0vM7Lb3bOfF4z6uOYahTc8wZkp2mthae6RbKNcz 54jg== X-Gm-Message-State: AOAM533B9JxVt8LKup30W/s4FhUyNsqQSq9K4C1cIUj3hXbCV9tav63Z v2c7rADErW4tD7yBh0c1XZaoDW0DVlp4eGFmJpY7i8kOt+NDLn/aPKktkEzzOh633660k98LYhu sA54VNBDRAg8Ju2jWxgOvtQ== X-Received: by 2002:adf:cc92:0:b0:1e5:c7da:2c72 with SMTP id p18-20020adfcc92000000b001e5c7da2c72mr2875983wrj.573.1645026417984; Wed, 16 Feb 2022 07:46:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJzS9cy8XMykqlkvOk4iegIWbX2Do2Z3S8JOdWBHuyzBnkyrZqTmCYwkKX/kqqSuumZc1771zg== X-Received: by 2002:adf:cc92:0:b0:1e5:c7da:2c72 with SMTP id p18-20020adfcc92000000b001e5c7da2c72mr2875968wrj.573.1645026417765; Wed, 16 Feb 2022 07:46:57 -0800 (PST) Received: from localhost (host86-134-151-224.range86-134.btcentralplus.com. [86.134.151.224]) by smtp.gmail.com with ESMTPSA id p11sm10517825wrr.16.2022.02.16.07.46.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Feb 2022 07:46:57 -0800 (PST) Date: Wed, 16 Feb 2022 15:46:56 +0000 From: Andrew Burgess To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 04/18] Remove c_printstr Message-ID: <20220216154656.GH2571@redhat.com> References: <20220216135518.3162480-1-tom@tromey.com> <20220216135518.3162480-5-tom@tromey.com> MIME-Version: 1.0 In-Reply-To: <20220216135518.3162480-5-tom@tromey.com> X-Operating-System: Linux/5.8.18-100.fc31.x86_64 (x86_64) X-Uptime: 15:43:12 up 5 days, 5:22, X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-10.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Wed, 16 Feb 2022 15:47:03 -0000 * Tom Tromey [2022-02-16 06:55:04 -0700]: > This renames c_printstr, removing a layer of indirection. > --- > gdb/c-lang.c | 8 ++++---- > gdb/c-lang.h | 8 -------- > gdb/language.c | 12 ------------ > gdb/rust-lang.c | 5 +++-- > 4 files changed, 7 insertions(+), 26 deletions(-) > > diff --git a/gdb/c-lang.c b/gdb/c-lang.c > index 342109c94ef..fbbecb696b9 100644 > --- a/gdb/c-lang.c > +++ b/gdb/c-lang.c > @@ -190,10 +190,10 @@ language_defn::printchar (int c, struct type *type, > characters, or if FORCE_ELLIPSES. */ > > void > -c_printstr (struct ui_file *stream, struct type *type, > - const gdb_byte *string, unsigned int length, > - const char *user_encoding, int force_ellipses, > - const struct value_print_options *options) > +language_defn::printstr (struct ui_file *stream, struct type *type, > + const gdb_byte *string, unsigned int length, I know you didn't add them, but there's a trailing whitespace on both the preceding lines, would you mind fixing these please? > + const char *user_encoding, int force_ellipses, > + const struct value_print_options *options) const > { > c_string_type str_type; > const char *type_encoding; > diff --git a/gdb/c-lang.h b/gdb/c-lang.h > index 16c9b116393..5441bfe10c7 100644 > --- a/gdb/c-lang.h > +++ b/gdb/c-lang.h > @@ -92,14 +92,6 @@ extern void c_value_print (struct value *, struct ui_file *, > > extern void c_printchar (int, struct type *, struct ui_file *); > > -extern void c_printstr (struct ui_file * stream, > - struct type *elttype, > - const gdb_byte *string, > - unsigned int length, > - const char *user_encoding, > - int force_ellipses, > - const struct value_print_options *options); > - > extern void c_language_arch_info (struct gdbarch *gdbarch, > struct language_arch_info *lai); > > diff --git a/gdb/language.c b/gdb/language.c > index 931abcd3076..20b6d8ccf9b 100644 > --- a/gdb/language.c > +++ b/gdb/language.c > @@ -635,18 +635,6 @@ language_defn::value_print_inner > > /* See language.h. */ > > -void > -language_defn::printstr (struct ui_file *stream, struct type *elttype, > - const gdb_byte *string, unsigned int length, > - const char *encoding, int force_ellipses, > - const struct value_print_options *options) const > -{ > - c_printstr (stream, elttype, string, length, encoding, force_ellipses, > - options); > -} > - > -/* See language.h. */ > - > void > language_defn::print_typedef (struct type *type, struct symbol *new_symbol, > struct ui_file *stream) const > diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c > index 7584d2572fa..3668d2d0c6d 100644 > --- a/gdb/rust-lang.c > +++ b/gdb/rust-lang.c > @@ -283,8 +283,9 @@ rust_language::printstr (struct ui_file *stream, struct type *type, > { > /* This is probably some C string, so let's let C deal with > it. */ > - c_printstr (stream, type, string, length, user_encoding, > - force_ellipses, options); > + this->language_defn::printstr (stream, type, string, length, > + user_encoding, force_ellipses, > + options); Personally, not a fan of the 'this->' when we're already using the parent class name. In ada_language::read_var_value we don't use 'this->'. But I think it's up to you really, I'm not that offended by it. Thanks, Andrew