From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 1ZlsE7SF42h0WyEAWB0awg (envelope-from ) for ; Mon, 06 Oct 2025 05:02:44 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=IdfMzYRH; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 3EF271E047; Mon, 06 Oct 2025 05:02:44 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 5FBB51E047 for ; Mon, 06 Oct 2025 05:02:43 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E7EB63858D39 for ; Mon, 6 Oct 2025 09:02:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E7EB63858D39 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=IdfMzYRH Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 9B2613858D1E for ; Mon, 6 Oct 2025 09:01:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9B2613858D1E Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 9B2613858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1759741281; cv=none; b=SfQNh1xLeE9eg3u95OOe38Liwtwdl1W/QgBVQ31bwG4ScfelPqJAOsCYWDPMZppnH79/u8mQrmTdSPOFm6Z+u/UQ55eo5QeNGAnJwB49+Wm9tCXiOQxzNxtc2jqao54OUdvXu0bJLHKoQHuAoJYaE60KRraxWj3dRdN1Gqu+DzY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1759741281; c=relaxed/simple; bh=eQOowQGGMsrL7tdOxVZX9muai78OoVJUaC87je6g+w8=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=S+9brmGL0it8HZsB9RemOt6IRmlFj+nDWqpyZqDD403rxqWTO0YwgmuaaWp3Kr+YYeZIPsOYV/fW8ibEQkYV6Z8n4OpIJkro6m8DQV+UC4neb6FKyc68qjugpVSqZCcPU7TMRtWlnFmJwf0wFm6G9J5JfUQmsQ9X0wHuMfVLIPE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9B2613858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1759741281; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=RlfpEUplTEx2XRScGgEJ+kOzyAKLP+rSTmz7taNK0gg=; b=IdfMzYRH0acWXzkDoitrUgAFut52in3CQwGCBf+gaIWYYip37PxYZNQktdcA4bbYGJvT6V ffSfuZIcxI7p960mUd0wO+Cy/ilqwddGrofWYmocGOwYHUxBlz1C2eWXRNF+XzItSFqbNe Kix+WYoAUSuzv5RmiIC2MSH20NH+hjs= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-97-cGTKJEJ2MsOBFr5_QZkwfg-1; Mon, 06 Oct 2025 05:01:20 -0400 X-MC-Unique: cGTKJEJ2MsOBFr5_QZkwfg-1 X-Mimecast-MFC-AGG-ID: cGTKJEJ2MsOBFr5_QZkwfg_1759741279 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-3efe4fcc9ccso2486532f8f.3 for ; Mon, 06 Oct 2025 02:01:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1759741278; x=1760346078; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=RlfpEUplTEx2XRScGgEJ+kOzyAKLP+rSTmz7taNK0gg=; b=oNwVRUOneJHz4pSQS/75Ffb39Ac8Z9Lm2aTU4FuUh2vW+5AtN9FuuWo+w10nLI0ycw wlVBOn+hBdOS/puWcdFg1i4AZhbud38Uj2avyPscKf9GBEE5Uuvl70QCfTvfTz02Uyef qz3OH/Qq0lERhmaDzntkv+QvXqdvBVjGm6+o3B1ARIcb/bWoaWszJcME847mWKCIUF7h bu4ZLaS2WPWgUbti9m/PQyJ6dvjEP/D0BMJ7crzisH6iEedARWXK0PemYrpewfKHGRW7 rt1hezNf2LxFMuH5IXXdfH8ipYx4q8N2Ln9E9LanBeW7B3VklgtMtr87KHC2y+dBaBdS rlqw== X-Gm-Message-State: AOJu0YwwYDg3JNAnrgeSqUkidYO+bOkDv5Kl69inu1Z51+GvxRDdqQo5 yBVPKwehEBeFvThhDedhdnaiN5deQGN29jFg7xPcBpmNMn5P+ixhVhGyixNMd9Qxpkgor5itUhl ftQ9lHA5iIjP9EZhBzBxlvpxNHiGUw+IH/yMWxNnlpN2jpaGQ4Cbk7jKcOZgfSH5KuTU3uE4= X-Gm-Gg: ASbGnctpUQhJLZlzTYwImRYvdXe/9pyAQ38qzU0ch8liIfN5KWNJG1eCFe4ueYFGGU3 rV8ROkAAHpZNuawKPwVrm/R9gMrNnS2Fuf7PKfga5MtpzwHBU+Miy4PlmI3gdrXJ1MYKQaFdtbT Kpom5Z6QXXXh5+iVuLcKj7elCPmFmLM14rPljSAxX2PxDtuvu2MfZpemjFpJA3U+xymx/1tf6ch E86pTYiuxlINWDeGN9KAUwFkeheuHLNYTp90yBd74eO7OTy0CMPBo9yaPOZqc+wkEc7wnccRkFb I5xIOpmvssAlpjs/fMNzGeg0kEMrKdY+ZtNt73oO X-Received: by 2002:a05:6000:2f87:b0:424:21d8:de30 with SMTP id ffacd0b85a97d-425671ab26amr7482895f8f.62.1759741278479; Mon, 06 Oct 2025 02:01:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHD0afBhJqJQEpo56KFCuMRR1ilkVZSO0QUclvQAP2HZwMAzM9CyvBSkCzJFRFO17LRbzAGpg== X-Received: by 2002:a05:6000:2f87:b0:424:21d8:de30 with SMTP id ffacd0b85a97d-425671ab26amr7482860f8f.62.1759741277964; Mon, 06 Oct 2025 02:01:17 -0700 (PDT) Received: from localhost ([31.111.84.207]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-46e619b8507sm246980105e9.3.2025.10.06.02.01.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Oct 2025 02:01:17 -0700 (PDT) From: Andrew Burgess To: Tom de Vries , Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [PATCHv9 0/3] new gdb.Style API In-Reply-To: References: <878qhr7pm5.fsf@tromey.com> <87y0pp7br2.fsf@redhat.com> <8ca0db41-c3a2-4192-b279-88d18e34fbd4@suse.de> <87v7kt6xa5.fsf@redhat.com> Date: Mon, 06 Oct 2025 10:01:17 +0100 Message-ID: <87plb076aq.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: rjke5wTH2mkyuQ3wl6UCbejJeWYim5zlEQw4S-f0EoA_1759741279 X-Mimecast-Originator: redhat.com Content-Type: text/plain 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 de Vries writes: > On 10/5/25 20:03, Andrew Burgess wrote: >> Tom de Vries writes: >> >>> On 10/5/25 14:51, Andrew Burgess wrote: >>>> Tom Tromey writes: >>>> >>>>>>>>>> "Andrew" == Andrew Burgess writes: >>>>> >>>>> [...] >>>>> Andrew> In v9: >>>>> >>>>> Going for a record here. >>>>> >>>>> I think these are ok. Thanks for doing this. >>>>> Approved-By: Tom Tromey >>>> >>>> Pushed. >>> >>> Hi, >>> >>> I'm running into pre-commit failures: >> >> I searched on the GDB wiki, and did a grep in gdb/ and gdb/doc/ but >> could find nothing about "pre-commit" except for one comment in >> check-include-guards.py, but that doesn't say what "pre-commit" is. >> >> Is this process documented somewhere else? Or have I just failed at >> finding it? >> > > Hi Andrew, > > AFAIK there's not really a process, that is, there's no formal agreement > on a requirement to run it. [ See also this email thread ( > https://sourceware.org/pipermail/gdb-patches/2025-October/221320.html ) > on the status of tclint as pre-commit hook. ] > > There's a file called .pre-commit-config.yaml in the root dir of the > repository. I have added some information in there on how to install > pre-commit, and how to skip some/all checks. Thanks for the pointer. Out of interest, is there any reason why these tests couldn't be (also be) added as actual tests to GDB's testsuite? I haven't tried setting up the infrastructure needed to run these tests using the pre-commit framework yet, but I'm guessing the time needed to run these tests is insignificant compared to the existing GDB testsuite. Thanks, Andrew > > Thanks, > - Tom > >>> ... >>> flake8...................................................................Failed >>> - hook id: flake8 >>> - duration: 0.25s >>> - exit code: 1 >>> >>> gdb/python/lib/gdb/__init__.py:557:31: F405 'Parameter' may be >>> undefined, or defined from star imports: _gdb >>> gdb/python/lib/gdb/__init__.py:579:21: F405 'COMMAND_NONE' may be >>> undefined, or defined from star imports: _gdb >>> gdb/python/lib/gdb/__init__.py:612:21: F405 'Color' may be undefined, or >>> defined from star imports: _gdb >>> gdb/python/lib/gdb/__init__.py:613:21: F405 'PARAM_COLOR' may be >>> undefined, or defined from star imports: _gdb >>> ... >> >> The patch below doesn't break GDB's Python support. And based on the >> existing code comments, I suspect this is the required fix. But I >> haven't run the "pre-commit" tests (see comments above), so you might >> one to check this fixes the issue you reported. >> >> Thanks, >> Andrew >> >> --- >> >> commit 5812afb15e8b7774984c238eb67adcf6eaa704a9 >> Author: Andrew Burgess >> Date: Sun Oct 5 18:55:33 2025 +0100 >> >> gdb/python: fix some flake8 warnings related to Python code >> >> After these commits: >> >> * 49e4d0cdca3 gdb/python: add gdb.Style class >> * d5214580a5f gdb/python: new class gdb.StyleParameterSet >> * 3c724596812 gdb/python: extend gdb.write to support styled output >> >> the following issues were pointed out on the mailing list: >> >> I'm running into pre-commit failures: >> ... >> flake8...................................................................Failed >> - hook id: flake8 >> - duration: 0.25s >> - exit code: 1 >> >> gdb/python/lib/gdb/__init__.py:557:31: F405 'Parameter' may be undefined, or defined from star imports: _gdb >> gdb/python/lib/gdb/__init__.py:579:21: F405 'COMMAND_NONE' may be undefined, or defined from star imports: _gdb >> gdb/python/lib/gdb/__init__.py:612:21: F405 'Color' may be undefined, or defined from star imports: _gdb >> gdb/python/lib/gdb/__init__.py:613:21: F405 'PARAM_COLOR' may be undefined, or defined from star imports: _gdb >> >> I believe this patch should resolve these issues. >> >> diff --git a/gdb/python/lib/gdb/__init__.py b/gdb/python/lib/gdb/__init__.py >> index 0388c6a2c00..65f76988925 100644 >> --- a/gdb/python/lib/gdb/__init__.py >> +++ b/gdb/python/lib/gdb/__init__.py >> @@ -34,6 +34,10 @@ from _gdb import ( >> parameter, >> selected_inferior, >> write, >> + Parameter, >> + COMMAND_NONE, >> + Color, >> + PARAM_COLOR, >> ) >> >> # isort: split >>