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 385173858431 for ; Tue, 22 Feb 2022 15:36:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 385173858431 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-179-OuBp5cEPNZG_aJvLuBRliQ-1; Tue, 22 Feb 2022 10:36:38 -0500 X-MC-Unique: OuBp5cEPNZG_aJvLuBRliQ-1 Received: by mail-wm1-f72.google.com with SMTP id 7-20020a1c1907000000b003471d9bbe8dso682176wmz.0 for ; Tue, 22 Feb 2022 07:36:38 -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=ui2GJi4W6w0hcbo4aplf+W5CKdzEZnVRujQ/M3YlsEA=; b=s+zBTjmJz2jD0SAXkLy3jwxYt6/laaCrh2S8GBHfkwLctwR7cfM0JYRds+NgEGiCro hFJ9mlbmLYBzWpy/ongovZy3Cp3vvD89S0ciQ0+bB1wl5SrGcrxGCIYQ/MO8Jl+FWSo3 wX2IagG9UDiMsnwEl4YphOWjGISUN+JrWsaE8Y1ZQArJTMbWjVpjHPn9goD0pjVCk8u9 axDHHqsYqFYmaRccA6OAGxokmS7NnMnL/APARI3iQEpIq8zaqm2EZAp8z8B+B7hJu44I g4kt6eforhGSn1suA0enKr7iXi7pfOGGs3QvDTzGqZbZsGRp3Xj+4QBlKHiL6zd3wNON PGDw== X-Gm-Message-State: AOAM532ANx/nGbDkc1MzVWZ4m7Imyw3YrwPuhAHq/e3K9nctAZdg+/Kd O6m1zrsRHxYujbNRcMgx9MJQ70wkfAB/rk/z/zovkkDFeZA8uCkCT+m9dXfyZavdg5oa5saTAJK qnoPZGkehTOwTKk2uS7nU0Q== X-Received: by 2002:a7b:c459:0:b0:34f:d1bc:2aea with SMTP id l25-20020a7bc459000000b0034fd1bc2aeamr3878028wmi.144.1645544197184; Tue, 22 Feb 2022 07:36:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJxlMTJATqO86PbnzRbsyLTX1FgZdKLGf9jhA+uJk4NGCFzwsa+WOE4E5ODbmhKWQy6bNAIJ/A== X-Received: by 2002:a7b:c459:0:b0:34f:d1bc:2aea with SMTP id l25-20020a7bc459000000b0034fd1bc2aeamr3878017wmi.144.1645544196922; Tue, 22 Feb 2022 07:36:36 -0800 (PST) Received: from localhost (host86-169-131-29.range86-169.btcentralplus.com. [86.169.131.29]) by smtp.gmail.com with ESMTPSA id l15sm2664589wmi.29.2022.02.22.07.36.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Feb 2022 07:36:36 -0800 (PST) Date: Tue, 22 Feb 2022 15:36:35 +0000 From: Andrew Burgess To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [PATCH v2 05/18] Don't use wchar_printable in print_wchar Message-ID: <20220222153635.GS2571@redhat.com> References: <20220217220547.3874030-1-tom@tromey.com> <20220217220547.3874030-6-tom@tromey.com> MIME-Version: 1.0 In-Reply-To: <20220217220547.3874030-6-tom@tromey.com> X-Operating-System: Linux/5.8.18-100.fc31.x86_64 (x86_64) X-Uptime: 15:34:07 up 11 days, 5:13, 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=-11.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, 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: Tue, 22 Feb 2022 15:36:42 -0000 * Tom Tromey [2022-02-17 15:05:33 -0700]: > print_wchar uses wchar_printable, but this isn't needed -- all the > relevant cases are already handled by the 'switch'. This changes the > code to use gdb_iswprint, and removes a somewhat confusing comment > related to this code. > --- > gdb/valprint.c | 9 +++------ > 1 file changed, 3 insertions(+), 6 deletions(-) > > diff --git a/gdb/valprint.c b/gdb/valprint.c > index e758c1d1066..17ad46c87b5 100644 > --- a/gdb/valprint.c > +++ b/gdb/valprint.c > @@ -2197,9 +2197,6 @@ print_wchar (gdb_wint_t w, const gdb_byte *orig, > > *need_escapep = false; > > - /* iswprint implementation on Windows returns 1 for tab character. > - In order to avoid different printout on this host, we explicitly > - use wchar_printable function. */ I wonder if we should leave some comment here that just says something like: /* If any additional cases are added to this switch block, then the function wchar_printable will likely need updating too. */ Though I guess we'd figure out soon enough if the two came out of step, so it's up to you. Otherwise, this, and all the patches up to this point, LGTM. Thanks, Andrew > switch (w) > { > case LCST ('\a'): > @@ -2225,9 +2222,9 @@ print_wchar (gdb_wint_t w, const gdb_byte *orig, > break; > default: > { > - if (wchar_printable (w) && (!need_escape || (!gdb_iswdigit (w) > - && w != LCST ('8') > - && w != LCST ('9')))) > + if (gdb_iswprint (w) && (!need_escape || (!gdb_iswdigit (w) > + && w != LCST ('8') > + && w != LCST ('9')))) > { > gdb_wchar_t wchar = w; > > -- > 2.31.1 >