Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Jiang, Haochen" <haochen.jiang@intel.com>
To: Tom de Vries <tdevries@suse.de>,
	Alexander Monakov <amonakov@ispras.ru>,
	Sam James <sam@gentoo.org>
Cc: "Beulich, Jan" <JBeulich@suse.com>,
	Binutils <binutils@sourceware.org>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
	"H.J. Lu" <hjl.tools@gmail.com>
Subject: RE: Inconsistent usage on onebyte_modrm and twobyte_modrm table in x86 disassembler and gdb?
Date: Tue, 26 Aug 2025 06:02:26 +0000	[thread overview]
Message-ID: <SJ5PPF77D28E3C29FB97F2BCB7DD32251A8EC39A@SJ5PPF77D28E3C2.namprd11.prod.outlook.com> (raw)
In-Reply-To: <34bc7418-6d00-45f7-b385-55d687307677@suse.de>

> From: Tom de Vries <tdevries@suse.de>
> Sent: Monday, August 25, 2025 10:34 PM
> 
> On 8/25/25 11:26, Alexander Monakov wrote:
> >
> > On Mon, 25 Aug 2025, Sam James wrote:
> >
> >> Jan Beulich <jbeulich@suse.com> writes:
> >>
> >>> On 25.08.2025 04:42, Jiang, Haochen wrote:
> >>>> Does anyone know the reason on that? It is weird to me.
> >>>
> >>> Same here; see https://sourceware.org/pipermail/gdb-patches/2019-
> February/155347.html.
> >>> That patch might require re-basing and some work to be up-to-date again,
> >>> but fundamentally it still looks applicable. I don't really understand why stuff
> >>> like this isn't allowed in. Pedro's desire for a testcase is understandable,
> >>> but shouldn't block such a patch (there was a 2nd one s well) for this
> >>> many years.
> >>
> >> I didn't realise a patch was rotting for this. There's Alexander's
> >> PR28999 (and a few other either dupes or very-related bugs) too.
> >>
> >> While I can understand wanting a testcase, tdep is really in a sorry
> >> state for x86 anyway, and this clearly makes it better. Perhaps with
> >> Haochen's interest, we can finally get it in. But I don't see any
> >> specific x86 maintainers for gdb.
> >
> > I hope the bug is fixed by a more comprehensive patchset from Tom, which
> > has already landed:
> > https://inbox.sourceware.org/gdb-patches/e5282a4b-5d9f-4891-b9b8-
> 45ded54ec6ee@suse.de/
> >
> > Haochen's question still stands, I guess.

I happened to have a look at gdb code since someone encountered similar
rip relative address issue and asking me why. And we finally found that the
problem is on the usage of that table.

I still believe we need to do something in the table handling to eliminate the
gap between disassembler and gdb since it is said to be the table is the same,
indicating the usage should also be the same.

Jan's patch in 2019 is doing that (while we need to work around VZEROALL and
VZEROUPPER). And I knew that a testcase to cover everything is tricky since ...

> 
> I grepped a bit in the gas testsuite for VPBLENDW and constructed a gdb
> unit test that passes with workaround but fails without:

... I suppose VPBLENDW might not be the only inst meeting the issue.

We need to either work on the similar way Jan's patch does and polish them
or totally separate the usage of the table if gdb would like to still keep the
current logic (which I do not prefer since it is make things over complicated).

Thx,
Haochen

  reply	other threads:[~2025-08-26  6:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <SJ5PPF77D28E3C228C975969E2B0BDB2853EC3EA@SJ5PPF77D28E3C2.namprd11.prod.outlook.com>
     [not found] ` <92aea037-9c0e-438f-8a0a-fd52dd2df7bc@suse.com>
2025-08-25  8:45   ` Sam James
2025-08-25  9:26     ` Alexander Monakov
2025-08-25 14:33       ` Tom de Vries
2025-08-26  6:02         ` Jiang, Haochen [this message]
2025-08-26  8:19     ` Gerlicher, Klaus
2025-08-26  9:31       ` Tom de Vries
2025-08-27 10:32         ` Schimpe, Christina
2025-08-27 12:20           ` Jan Beulich
2025-08-27 15:23             ` Schimpe, Christina

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=SJ5PPF77D28E3C29FB97F2BCB7DD32251A8EC39A@SJ5PPF77D28E3C2.namprd11.prod.outlook.com \
    --to=haochen.jiang@intel.com \
    --cc=JBeulich@suse.com \
    --cc=amonakov@ispras.ru \
    --cc=binutils@sourceware.org \
    --cc=gdb-patches@sourceware.org \
    --cc=hjl.tools@gmail.com \
    --cc=sam@gentoo.org \
    --cc=tdevries@suse.de \
    /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