Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@redhat.com>
To: Milica Matic <milica.matic@htecgroup.com>
Cc: gdb-patches@sourceware.org,
	Djordje Todorovic <Djordje.Todorovic@htecgroup.com>,
	Milos Kalicanin <milos.kalicanin@htecgroup.com>,
	Simon Marchi <simark@simark.ca>, Chao-ying Fu <cfu@wavecomp.com>,
	Andrew Burgess <aburgess@redhat.com>,
	"Maciej W. Rozycki" <macro@orcam.me.uk>
Subject: Re: [PATCH^7] gdb: mips: Add MIPSR6 support
Date: Mon, 9 Dec 2024 14:46:02 -0700	[thread overview]
Message-ID: <20241209144602.54286b31@f40-zbm-amd> (raw)
In-Reply-To: <PR3PR09MB4361C976074212D4E41F09388F3C2@PR3PR09MB4361.eurprd09.prod.outlook.com>

Hi Milica,

Thanks for adding comments on new functions introduced by your patch.
I still found a few nits; see below...

On Mon, 9 Dec 2024 17:01:07 +0000
Milica Matic <milica.matic@htecgroup.com> wrote:

>    return extract_unsigned_integer (buf, instlen, byte_order);
>  }
>  
> +

You are still introducing a extraneous newline here.

See: https://sourceware.org/gdb/wiki/Internals%20GDB-C-Coding-Standards#Whitespaces

Relevant quote from that link:

    "..., do not use more than one blank line to separate blocks,..."

> -      if (op >> 2 == 5)
> -	/* BEQL, BNEL, BLEZL, BGTZL: bits 0101xx */
> -	{
> -	  switch (op & 0x03)
> -	    {
> -	    case 0:		/* BEQL */
> -	      goto equal_branch;
> -	    case 1:		/* BNEL */
> -	      goto neq_branch;
> -	    case 2:		/* BLEZL */
> -	      goto less_branch;
> -	    case 3:		/* BGTZL */
> -	      goto greater_branch;
> -	    default:
> -	      pc += 4;
> -	    }
> -	}
> +      if (op >> 2 == 5 && ((op & 0x02) == 0 || itype_rt (inst) == 0))
> +    /* BEQL, BNEL, BLEZL, BGTZL: bits 0101xx */
> +    {
> +      switch (op & 0x03)
> +        {
> +        case 0:		/* BEQL */
> +          goto equal_branch;
> +        case 1:		/* BNEL */
> +          goto neq_branch;
> +        case 2:		/* BLEZL */
> +          goto lez_branch;
> +        case 3:		/* BGTZL */
> +          goto greater_branch;
> +        default:
> +          pc += 4;
> +        }
> +    }

In this change, it appears that leading tabs were replaced by spaces.
The GDB project prefers that tabs be used in place of leading spaces.
See: https://sourceware.org/gdb/wiki/Internals%20GDB-C-Coding-Standards#Code_indentation

Relevant quote from that link:

    "Lines should be indented with a mix of tabs and spaces.  8 spaces
     should be replaced with Tab."


>        else if (op == 17 && itype_rs (inst) == 8)
> -	/* BC1F, BC1FL, BC1T, BC1TL: 010001 01000 */
> -	pc = mips32_bc1_pc (gdbarch, regcache, inst, pc + 4, 1);
> -      else if (op == 17 && itype_rs (inst) == 9
> +    /* BC1F, BC1FL, BC1T, BC1TL: 010001 01000 */
> +    pc = mips32_bc1_pc (gdbarch, regcache, inst, pc + 4, 1);
> +      else if (!is_mipsr6_isa (gdbarch)
> +              && op == 17
> +              && itype_rs (inst) == 9

For the above change, and elsewhere too, make sure that you use tabs
in place of 8 spaces for the leading indentation.  (See above.)

Kevin


      reply	other threads:[~2024-12-09 21:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-09 17:01 Milica Matic
2024-12-09 21:46 ` Kevin Buettner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241209144602.54286b31@f40-zbm-amd \
    --to=kevinb@redhat.com \
    --cc=Djordje.Todorovic@htecgroup.com \
    --cc=aburgess@redhat.com \
    --cc=cfu@wavecomp.com \
    --cc=gdb-patches@sourceware.org \
    --cc=macro@orcam.me.uk \
    --cc=milica.matic@htecgroup.com \
    --cc=milos.kalicanin@htecgroup.com \
    --cc=simark@simark.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox