Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Aktemur, Baris" <TankutBaris.Aktemur@amd.com>
To: Keith Seitz <keiths@redhat.com>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Cc: "tom@tromey.com" <tom@tromey.com>
Subject: RE: [PATCH 1/2] gdb: simplify code in check_typedef
Date: Thu, 30 Jul 2026 05:47:27 +0000	[thread overview]
Message-ID: <DM4PR12MB6470C9AD729F674DE86DE9F8F8C92@DM4PR12MB6470.namprd12.prod.outlook.com> (raw)
In-Reply-To: <af831c98-7c0c-4a8a-87e0-24443455a3aa@redhat.com>

AMD General

Hello Keith,

On Wednesday, July 29, 2026 7:27 PM, Keith Seitz wrote:
> Hi,
>
> On 7/27/26 2:20 AM, Tankut Baris Aktemur wrote:
> > Simplify a code portion in check_typedef where the conditions are
> > unnecessary.  Also remove the comment that says "treat address spaces
> > and address classes separately", because since the commit 92fdad7
> > "gdb: convert type instance flags to bitfields", they are separate
> > fields; so, the comment does not look useful.
>
> Thank you for the quick turnaround for such a, well, minor
> corner case. It is very appreciated.
>
> One concern I still have (maybe this is no longer an issue?):
> the old logic (and the remaining comment in check_typedef) is outer-wins
> on conflict, otherwise inherit from the inner typedef.
>
> Always clearing the RHS and having `merge` never take aspace/class from
> it fixes the outer-qualified case, but drops an aspace that appears only
> on an inner typedef.

This is absolutely right.  I didn't intend to change the existing behavior.
I think I simply didn't see the code correctly (I will increase my editor's
font size).

> How about encoding outer-wins in `merge` instead, and dropping the
> clearing in check_typedef? That would preserve the previous behavior
> (and match the comment).
>
> For example:
>
> type_instance_flags::merge:
>
>     if (harvard_aspace == HARVARD_ASPACE_NONE)
>       harvard_aspace = other.harvard_aspace;
>     if (address_class == 0)
>       address_class = other.address_class;
>
> and check_typedef:
>
>     instance_flags.merge (type->instance_flags ());
>
> I completely agree with the naming change to `merge'. That is
> certainly clearer for me.
>
> Thanks,
> Keith

I'll send the update with these changes.

Thank you for taking the time to review.

-Baris


  reply	other threads:[~2026-07-30  5:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-27  9:20 Tankut Baris Aktemur
2026-07-27  9:20 ` [PATCH 2/2] gdb: preserve lhs type's address spaces/classes " Tankut Baris Aktemur
2026-07-29 17:27 ` [PATCH 1/2] gdb: simplify code " Keith Seitz
2026-07-30  5:47   ` Aktemur, Baris [this message]
2026-07-30  9:13 ` [PATCH v2] gdb: prefer lhs type's address spaces/classes " Tankut Baris Aktemur
2026-07-30 18:12   ` Keith Seitz
2026-08-03  7:57     ` Aktemur, Baris

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=DM4PR12MB6470C9AD729F674DE86DE9F8F8C92@DM4PR12MB6470.namprd12.prod.outlook.com \
    --to=tankutbaris.aktemur@amd.com \
    --cc=gdb-patches@sourceware.org \
    --cc=keiths@redhat.com \
    --cc=tom@tromey.com \
    /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