From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id kZNKIy7p0mgPnQ8AWB0awg (envelope-from ) for ; Tue, 23 Sep 2025 14:38:38 -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=Yzgbb8/V; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 7CDE91E04C; Tue, 23 Sep 2025 14:38:38 -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 server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (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 C9DDB1E04C for ; Tue, 23 Sep 2025 14:38:37 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 83CCD3858031 for ; Tue, 23 Sep 2025 18:38:37 +0000 (GMT) Received: from omta34.uswest2.a.cloudfilter.net (omta34.uswest2.a.cloudfilter.net [35.89.44.33]) by sourceware.org (Postfix) with ESMTPS id 4FA583858D26 for ; Tue, 23 Sep 2025 18:38:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4FA583858D26 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 4FA583858D26 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.33 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1758652705; cv=none; b=WULD7zcfZdJPNi3l0s8O0ieHfRD3sZCOXOakCzv8KcZVMYKHbXW57LtVd0OFsq7jTKyDqIlSyn7SONkCfKEox9a45wgaZVXsCIdPdhMAhux9U1iwAUU78bZ3ZICJld1SliLMbna/tohZGAmeg2qTeWYiEXccnpiIAFUql3DgAdc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1758652705; c=relaxed/simple; bh=Wv62KtI4w5Yxc3vX0uPdhxvh7cldHiP4PWSgSTf6yGw=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=huU0NDM7neZAOnVShQzcHYLgyJ7ziDlO10I0yyod8IQsx7llGzbP7fAoHrHJz5pdN9kMQJwYeEF654+SF7UUPyQKvs6W7vrNjSREKkKI3MwZ9eB+OxuGtooWD3Ua/FgwpWtkrBJKtPz6tvOt2YgVqcgLyROE+aFdMQ9VF7ZpfcQ= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4FA583858D26 Authentication-Results: sourceware.org; dkim=policy reason="signing key too small" (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=Yzgbb8/V Received: from eig-obgw-6004b.ext.cloudfilter.net ([10.0.30.210]) by cmsmtp with ESMTPS id 16N5vwnilZx2i17uCvWSFL; Tue, 23 Sep 2025 18:38:24 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id 17uBvd93G25G717uCvQUgU; Tue, 23 Sep 2025 18:38:24 +0000 X-Authority-Analysis: v=2.4 cv=LuqSymdc c=1 sm=1 tr=0 ts=68d2e920 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=yJojWOMRYYMA:10 a=ItBw4LHWJt0A:10 a=20KFwNOVAAAA:8 a=MJyS3IQj29YYsEr2gzEA:9 a=VS4QxaUSPT0UtbFnIvSC: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=GFM8siV+tCDE9nvZnBOldmc78vozFAgra3+5uxPZT1E=; b=Yzgbb8/VRXSkJg9gffpJYQX4l9 m5SWkTHedAJgxlnT+KVN1KtsOkua46/rCSextoofw62wD43CB8OIjVVrQJ2dTWMRoUK/g5a0cECJm H+HZWr8+k6IdpVBo33NSvNRqZ; Received: from 97-122-110-68.hlrn.qwest.net ([97.122.110.68]:47628 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.1) (envelope-from ) id 1v17uB-00000000ll7-2ZqY; Tue, 23 Sep 2025 12:38:23 -0600 From: Tom Tromey To: Andrew Burgess Cc: Tom Tromey , gdb-patches@sourceware.org, Eli Zaretskii Subject: Re: [PATCHv8 3/3] gdb/python: extend gdb.write to support styled output In-Reply-To: <87ms6lf6b9.fsf@redhat.com> (Andrew Burgess's message of "Tue, 23 Sep 2025 18:05:14 +0100") References: <31de42bf45326efa2c5a58bdb96c831923971ab1.1756294307.git.aburgess@redhat.com> <87ikhil4ji.fsf@tromey.com> <87ms6lf6b9.fsf@redhat.com> X-Attribution: Tom Date: Tue, 23 Sep 2025 12:38:23 -0600 Message-ID: <87o6r1c8v4.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: 97.122.110.68 X-Source-L: No X-Exim-ID: 1v17uB-00000000ll7-2ZqY X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-110-68.hlrn.qwest.net (bapiya) [97.122.110.68]:47628 X-Source-Auth: tom+tromey.com X-Email-Count: 11 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfMRVQxYNeqUO730Y4RoPFv30kOERfx0HihDFQE1p8DvU4xhuXfhLE/AWSkV9dXud36yJb42YmPLEt22lPB8WtkUM5hcSRtTJhqaVKb1D4mOMKhxQG7Qu 5StLuQStTsloCufe97/fFMdXFRr7dXawNvmPI74yVSsDjgpV+OvPwx5S3PtOUZLiuIZguQDDBp7+HJ4TUrhY0O9pMniJ35TfeAI= 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 >>>>> "Andrew" == Andrew Burgess writes: >> FWIW if the type object is available there's a way to get Python to do >> this bit when parsing the arguments. Andrew> I think you're referring too 'O!' maybe? The reason that doesn't work Andrew> is that the argument can be a gdb.Style _or_ None. Andrew> It feels like this must be a common pattern, so I would have expected to Andrew> find a modifier that takes a named type or accepts None, but I couldn't Andrew> find anything. Andrew> Is there another trick that I'm not aware of? Would love to know Andrew> because I'm pretty sure I've had to do this elsewhere in GDB when an Andrew> argument can also be None. No, I think you're right, I missed the None bit. Sorry about that. Tom