From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id KOn/NeICxGq6qT4AWB0awg (envelope-from ) for ; Mon, 05 Oct 2026 16:04:50 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=oct2025 header.b=wTGJ3Iys; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id C78AE1E047; Mon, 05 Oct 2026 16:04:50 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::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 CB1201E047 for ; Mon, 05 Oct 2026 16:04:46 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 54AB64B9DB64 for ; Mon, 5 Oct 2026 20:04:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 54AB64B9DB64 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=oct2025 header.b=wTGJ3Iys Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 11CD64BA902D for ; Mon, 5 Oct 2026 20:04:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 11CD64BA902D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=polymtl.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=polymtl.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 11CD64BA902D Authentication-Results: sourceware.org; arc=none smtp.remote-ip=132.207.4.11 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1791230660; cv=none; b=uAIbWNBBh4KAyu1lFApCvCU8/uedf3e5CcXEErF5D37BQ/kngF9XcHY5NZw7YhhyRfEyJXRqRQ3BG00aqCVe2sjAJkd6y4rf8QNAXuZHPMn1G5fjqrWOIas6ukyA3VqVnnXo6YgpVUtZmYyhgaW9xJX4nocUyt1rIpv/qEXLg98= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1791230660; c=relaxed/simple; bh=AiHlG0woUsNPtSF2c3t4hrEnmW4eLGlhaEjP3b1Zkig=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=YkJZYDitWDuIpeJoPFuJFDAkgy1CTX1v8bi8uS2+Okbt06g9pGYqCSkpSyy8A3+Utdo4eK/cjFjHffIqOIOlaMgH6BrTZkeoBVUUEAj+Tk0UyJjVVWtHw4lC2fBtxakr2iMRtwWmoPW3AMr+wLqQujFC+j/gmd3yufT4TFfMqoM= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=oct2025 header.b=wTGJ3Iys DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 11CD64BA902D Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 695K48FQ043581 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 5 Oct 2026 16:04:13 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 695K48FQ043581 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=oct2025; t=1791230654; bh=BXDqGcRgJHY4PU1IDLwk/IvnuR57EFwKfTVdwsjDsyw=; h=Date:Subject:To:Cc:From:In-Reply-To:From; b=wTGJ3IysM3vL7FX0VCCTKBeGR1mjWrAUCgodQqPUUrXsgpvs8Y37VPofVp/N1KTzO hK1QGd2oAFj5tkyIIfON34qnWXGEruKM0pblu206h7l9hJNjplvGMDOfQHVTdCMWhJ xZbPZuJGg/bo+/H1GceNVGUSLz3XYXDF+s4cUbR2+NPuH5GviJCDJxbjPw9NF4Pq5E Iz0NBQqlrPOgMGaOdyQ3c/1hmjof0HaboU60h41+BMPJGCX3SHnodiL7gV3S2wNA8s Fn+fJ4tx09kfEmYD2UshAPObtnF2c47zQVai8Rvo5JIr26mXmGv/YiMFmB7PqsavDX zuJF/51y/Sstw== Received: by simark.ca (Postfix) id A478D1E047; Mon, 05 Oct 2026 16:04:07 -0400 (EDT) Message-ID: Date: Mon, 5 Oct 2026 16:04:07 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5] Fix styles in aix-thread.c to follow GNU style code. To: Aditya Vidyadhar Kamath , ulrich.weigand@de.ibm.com, tom@tromey.com Cc: gdb-patches@sourceware.org, Aditya.Kamath1@ibm.com, sangamesh.swamy@in.ibm.com References: <20261005185548.35872-2-akamath996@gmail.com> Content-Language: fr From: Simon Marchi In-Reply-To: <20261005185548.35872-2-akamath996@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Mon, 5 Oct 2026 20:04:08 +0000 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 On 10/5/26 2:55 PM, Aditya Vidyadhar Kamath wrote: > From: Aditya Vidyadhar Kamath > > This patch makes changes in aix-thread.c to follow style in > https://sourceware.org/gdb/wiki/Internals%20GDB-C-Coding-Standards > > I ran clang-format with GNU style as a starting point: > /home/clang+llvm-23.1.2-powerpc64-ibm-aix-7.2/bin/clang-format \ > -style=GNU -i gdb/aix-thread.c > > and then manually kept only the changes that match GDB's coding > standards. Thanks, I have a few comments below, but otherwise this LGTM. You can push with those fixed. Just make sure that you only have whitespace changes. Approved-By: Simon Marchi > The resulting changes include: > > 1: wrapping lines exceeding 80 columns, > 2: adding spaces before '(' where required, > 3: converting one-line switch cases to the preferred GNU style, > 4: fixing a few indentation issues, > 5: Remove tab-alignment in #define's > 6: Add space in sizeof() calls throughout. > 7: Some double spaces removed. > 8: Correct genuine misindents like in sync_threadlists (), add_thread_with_info (). > > A few clang-format changes were not kept: > > 1: brace placement changes for struct definitions, Did you mean turning struct pd_thread { pthdb_pthread_t pdtid; pthread_t pthid; pthdb_tid_t tid; }; into struct pd_thread { pthdb_pthread_t pdtid; pthread_t pthid; pthdb_tid_t tid; }; ? If so, it's a valid change, you should include it. > 2: #include reordering alphabetically, > 3: removal of blank lines separating logical sections, > 4: some cast formatting changes. > @@ -299,16 +331,16 @@ ptrace_check (int req, int id, int ret) > req, id, ret, errno); > return ret == -1 ? 0 : 1; > } > - break; > - case PTT_READ_VEC: > - case PTT_READ_VSX: > - if (debug_aix_thread) > - gdb_printf (gdb_stdlog, > - "ptrace (%d, %d) = %d (errno = %d)\n", > - req, id, ret, errno); > - if (ret == -1) > - return -1; > - break; > + break; > + case PTT_READ_VEC: > + case PTT_READ_VSX: > + if (debug_aix_thread) > + gdb_printf (gdb_stdlog, > + "ptrace (%d, %d) = %d (errno = %d)\n", > + req, id, ret, errno); This can be re-wrapped to take just 2 lines (clang-format does it). > @@ -473,49 +506,49 @@ pdc_read_regs (pthdb_user_t user_current_pid, > if (!ptrace64aix (PTT_READ_SPRS, tid, > (unsigned long) &sprs64, 0, NULL)) > memset (&sprs64, 0, sizeof (sprs64)); > - memcpy (&context->msr, &sprs64, sizeof(sprs64)); > + memcpy (&context->msr, &sprs64, sizeof (sprs64)); > } > else > { > if (!ptrace32 (PTT_READ_SPRS, tid, (uintptr_t) &sprs32, 0, NULL)) > memset (&sprs32, 0, sizeof (sprs32)); > - memcpy (&context->msr, &sprs32, sizeof(sprs32)); > + memcpy (&context->msr, &sprs32, sizeof (sprs32)); > } > } > > /* vector registers. */ > __vmx_context_t vmx; > - if (__power_vmx() && (flags & PTHDB_FLAG_REGS)) > + if (__power_vmx () && (flags & PTHDB_FLAG_REGS)) > { > if (data->arch64) > { > if (!ptrace64aix (PTT_READ_VEC, tid, (long long) &vmx, 0, 0)) > memset (&vmx, 0, sizeof (vmx)); > - memcpy (&context->vmx, &vmx, sizeof(__vmx_context_t)); > + memcpy (&context->vmx, &vmx, sizeof (__vmx_context_t)); > } > else > { > if (!ptrace32 (PTT_READ_VEC, tid, (long long) &vmx, 0, 0)) > memset (&vmx, 0, sizeof (vmx)); > - memcpy (&context->vmx, &vmx, sizeof(__vmx_context_t)); > + memcpy (&context->vmx, &vmx, sizeof (__vmx_context_t)); The indent on that line is wrong, clang-format should have fixed it... ? > @@ -1480,9 +1515,10 @@ fill_altivec (const struct regcache *regcache, __vmx_context_t *vmx) > int regno; > > for (regno = 0; regno < ppc_num_vrs; regno++) > - if (REG_VALID == regcache->get_register_status (tdep->ppc_vr0_regnum + regno)) > + if (REG_VALID == regcache->get_register_status > + (tdep->ppc_vr0_regnum + regno)) > regcache->raw_collect (tdep->ppc_vr0_regnum + regno, > - &(vmx->__vr[regno])); > + &(vmx->__vr[regno])); The indent on this line seems still off. > @@ -1860,55 +1897,55 @@ store_regs_kernel_thread (const struct regcache *regcache, int regno, > } > } > > - /* Vector registers. */ > - if (tdep->ppc_vr0_regnum != -1 && tdep->ppc_vrsave_regnum != -1 > - && (regno == -1 || (regno >= tdep->ppc_vr0_regnum > - && regno <= tdep->ppc_vrsave_regnum))) > - { > - __vmx_context_t vmx; > - if (__power_vmx()) > - { > - if (data->arch64) > - ret = ptrace64aix (PTT_READ_VEC, tid, (long long) &vmx, 0, 0); > - else > - ret = ptrace32 (PTT_READ_VEC, tid, (long long) &vmx, 0, 0); > - if (ret > 0) > - { > - fill_altivec(regcache, &vmx); > - if (data->arch64) > - ret = ptrace64aix (PTT_WRITE_VEC, tid, (long long) &vmx, 0, 0); > - else > - ret = ptrace32 (PTT_WRITE_VEC, tid, (long long) &vmx, 0, 0); > - if (ret < 0) > - perror_with_name (_("Unable to store AltiVec register after read")); > - } > - } > - } > + /* Vector registers. */ > + if (tdep->ppc_vr0_regnum != -1 && tdep->ppc_vrsave_regnum != -1 > + && (regno == -1 || (regno >= tdep->ppc_vr0_regnum > + && regno <= tdep->ppc_vrsave_regnum))) Indent of the last line seems off. > + { > + __vmx_context_t vmx; > + if (__power_vmx ()) > + { > + if (data->arch64) > + ret = ptrace64aix (PTT_READ_VEC, tid, (long long) &vmx, 0, 0); > + else > + ret = ptrace32 (PTT_READ_VEC, tid, (long long) &vmx, 0, 0); > + if (ret > 0) > + { > + fill_altivec (regcache, &vmx); > + if (data->arch64) > + ret = ptrace64aix (PTT_WRITE_VEC, tid, (long long) &vmx, 0, 0); > + else > + ret = ptrace32 (PTT_WRITE_VEC, tid, (long long) &vmx, 0, 0); > + if (ret < 0) > + perror_with_name (_("Unable to store AltiVec register after read")); > + } > + } > + } > > - /* VSX registers. */ > - if (tdep->ppc_vsr0_upper_regnum != -1 && (regno == -1 > - || (regno >=tdep->ppc_vsr0_upper_regnum > - && regno < tdep->ppc_vsr0_upper_regnum + ppc_num_vshrs))) > - { > - __vsx_context_t vsx; > - if (__power_vsx()) > - { > - if (data->arch64) > - ret = ptrace64aix (PTT_READ_VSX, tid, (long long) &vsx, 0, 0); > - else > - ret = ptrace32 (PTT_READ_VSX, tid, (long long) &vsx, 0, 0); > - if (ret > 0) > - { > - fill_vsx (regcache, &vsx); > - if (data->arch64) > - ret = ptrace64aix (PTT_WRITE_VSX, tid, (long long) &vsx, 0, 0); > - else > - ret = ptrace32 (PTT_WRITE_VSX, tid, (long long) &vsx, 0, 0); > - if (ret < 0) > - perror_with_name (_("Unable to store VSX register after read")); > - } > - } > - } > + /* VSX registers. */ > + if (tdep->ppc_vsr0_upper_regnum != -1 > + && (regno == -1 || (regno >= tdep->ppc_vsr0_upper_regnum > + && regno < tdep->ppc_vsr0_upper_regnum + ppc_num_vshrs))) This last line ends up too long, clang-format rewrites it like this, which I like: if (tdep->ppc_vsr0_upper_regnum != -1 && (regno == -1 || (regno >= tdep->ppc_vsr0_upper_regnum && regno < tdep->ppc_vsr0_upper_regnum + ppc_num_vshrs))) It also indents an if a few lines above in a similar way, if you want to have a consistent formatting. Simon