From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id ebHsKiMexGnaIDkAWB0awg (envelope-from ) for ; Wed, 25 Mar 2026 13:40:51 -0400 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (768-bit key; unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=Pj8Cp8RQ; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id A74271E0BC; Wed, 25 Mar 2026 13:40:51 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 8C2A51E08C for ; Wed, 25 Mar 2026 13:40:50 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id ECB794BB58D7 for ; Wed, 25 Mar 2026 17:40:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ECB794BB58D7 Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=Pj8Cp8RQ Received: from omta038.useast.a.cloudfilter.net (omta038.useast.a.cloudfilter.net [44.202.169.37]) by sourceware.org (Postfix) with ESMTPS id EC6B14B9DB6F for ; Wed, 25 Mar 2026 17:40:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EC6B14B9DB6F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org EC6B14B9DB6F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.37 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1774460423; cv=none; b=Aj207cr2M0ShkZNsHxaYLEnuZiWH65k2wpFHnPr8VpcIGT4F9um5aUboYLNx+9MGM/Y/tG8FAP9ZNiz4qNN9cxohEwcOFW5HrHo3cdX5VYHSTtUAElog7THnNb9swOTfzHe4dVc5oebF5PthUxNSLBDSMCQgG7al49aA066PXxQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1774460423; c=relaxed/simple; bh=VCAIfIqF87CFPoUMUi71OYkOGjxEsACmzzTNqyr+qTI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=vGavX32CpDIcOL7RXS1DNDAA52MMbfU/ehIHQ6RmzujAxHS+aUMe4f7ICDNEkTm6zWb8Y0STrrD7fpX1Ya8a909k3MguQAAPDqnfJku9TQzZG8UMn8SCvk5lejadaGfiZ/Unkbbo2dyS1p9/bKj5LC4w1dp2OIj1qH4jH1T5GS4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EC6B14B9DB6F Received: from eig-obgw-6004b.ext.cloudfilter.net ([10.0.30.210]) by cmsmtp with ESMTPS id 5Nq9wt8jeSkcf5SDOw9k4N; Wed, 25 Mar 2026 17:40:22 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id 5SDMwequnK8vz5SDMwiBov; Wed, 25 Mar 2026 17:40:21 +0000 X-Authority-Analysis: v=2.4 cv=cJDgskeN c=1 sm=1 tr=0 ts=69c41e05 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=Yq5XynenixoA:10 a=ItBw4LHWJt0A:10 a=CWJ3kDm8ArinIbyFvCQA:9 a=DCx65vhANUyCzuf5D8fC:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=ANy1USsBFp9vOQTB7spnGYyYux/HF/nnXPAmSdvvfGY=; b=Pj8Cp8RQyNJ7vDMiYHEtkddeo8 GWP56b1dmZnODcD8hSDiWjxy0dMwjaoDKl918sn1WvYe4ruNn1L0w8ZBICh7XxA3cqGWKrneuJHMV w75eqErXuscTCRdrTcLgkIYq/; Received: from 75-166-225-82.hlrn.qwest.net ([75.166.225.82]:49510 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w5SDM-00000003lMu-1sjC; Wed, 25 Mar 2026 11:40:20 -0600 From: Tom Tromey To: Tom de Vries Cc: gdb-patches@sourceware.org Subject: Re: [PATCH v2] [gdb] Add c_ctrl/c_unctrl In-Reply-To: <20260325123946.4072546-1-tdevries@suse.de> (Tom de Vries's message of "Wed, 25 Mar 2026 13:39:46 +0100") References: <20260325123946.4072546-1-tdevries@suse.de> X-Attribution: Tom Date: Wed, 25 Mar 2026 11:40:19 -0600 Message-ID: <87a4vv6c58.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 75.166.225.82 X-Source-L: No X-Exim-ID: 1w5SDM-00000003lMu-1sjC X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 75-166-225-82.hlrn.qwest.net (bapiya) [75.166.225.82]:49510 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfHHQ6jxuVfjOMtBTj4bdwoW65tqhGDHG6hUx+oExrsMksVlL1vUrImfDrhwb3DDixLxM8lQ5NwwHXb2NOOkivBUPPGbX0/1HS1rh0C2yRlzpFIxkDje5 +k9wYPOQiFzRiDyFOGpYzpqbbYw44LgiXQY5xUtD2235WPluhF3/PKnPAFcWloljs228oIc7+RNIhoOMUHwmN5cavV7sPeIu+Q0= X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org >>>>> "Tom" == Tom de Vries writes: Tom> Use c_iscntrl/c_ctrl/c_unctrl instead of CTRL_CHAR/CTRL/UNCTRL, removing Tom> redundant RUBOUT handling code. This looks good to me but I had a small comment on the self-test. Tom> + /* Consistency check. */ Tom> + for (unsigned int i = 0; i < 0x100; i++) Tom> + { Tom> + unsigned char ch = i; Tom> + unsigned char unctrl_ch = c_unctrl (ch); The main problem with the functions is that they accept an int but are undefined for values outside of 'unsigned char'. So calling them with an ordinary 'char' value is bad, because on some platforms char might be signed and so sign extension will apply. So I think it would be valuable to test this. A simple way might be to change this loop to iterate from -128 .. 255 and just pass that value. This would effectively emulate both signed and unsigned char I think. Tom