Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Flávio Cruz" <flaviocruz@gmail.com>
To: John Baldwin <jhb@freebsd.org>
Cc: gdb-patches@sourceware.org, bug-hurd@gnu.org,
	samuel.thibault@gnu.org,  simark@simark.ca
Subject: Re: [PATCH v2] Port GDB to Hurd x86_64.
Date: Wed, 3 Jul 2024 22:48:05 +0100	[thread overview]
Message-ID: <CAKwpGPy6eUX8oBjjLwGo+pGuL1DM6huHCgvj3x7u8iRG-HRHJw@mail.gmail.com> (raw)
In-Reply-To: <fbc9b0ee-b814-481c-b839-55c3577adc9c@FreeBSD.org>

[-- Attachment #1: Type: text/plain, Size: 2684 bytes --]

On Tue, Feb 27, 2024 at 11:15 PM John Baldwin <jhb@freebsd.org> wrote:

> On 2/23/24 9:28 PM, Flavio Cruz wrote:
> > This port extends the existing i686 port to support x86_64 by trying to
> > reuse existing code whenever it makes sense.
> >
> > * gdb/amd64-gnu-tdep.c: Adds logic for handling signal frames and
> >    position of amd64 registers in the different Hurd structs.
> >    The signal code is very similar to i686, except the trampoline code
> >    is adapted.
> > * gdb/config/i386/nm-i386gnu.h: renamed to gdb/config/i386/nm-x86-gnu.h
> >    and adapt it for x86_64.
> > * gdb/config/i386/i386gnu.mn: renamed to gdb/config/i386/nm-x86-gnu.mn
> >    and reuse it for x86_64.
> > * gdb/configure.host: recognize gnu64 as a host.
> > * gdb/configure.nat: recognize gnu64 host and update existing i386gnu to
> >    reuse the new shared files.
> > * gdb/configure.tgt: recognize x86_64-*-gnu* triplet and use
> >    amd64-gnu-tdep.c.
> > * gdb/i386-gnu-tdep.c: added i386_gnu_thread_state_reg_offset that is
> >    copied from i386-gnu-nat.c. This makes it similar to amd64.
> > * gdb/i386-gnu-nat.c: rename it to x86-gnu-nat.c since we reuse this for
> >    i386 and amd64. Updated REG_ADDR to use one of the structures. Added
> >    VALID_REGISTER to make sure it's a register we can provide at this
> time
> >    (not all of them are available in amd64). FLAGS_REGISTER is either rfl
> >    or efl depending on the arch. Renamed functions and class from i386
> to x86
> >    whenever they can be reused.
> >
> > Tested on Hurd x86_64 and i686.
> > ---
> >
> > I addressed John's comments and moved amd64_gnu_thread_state_* and
> > i386_gnu_thread_state_* to x86-gnu-nat.c. The new patch also contains a
> few
> > changes that makes backtracing through shared libraries work.
>
> Thanks, this generally looks ok to me.
>
> One question I have is if you need nat/x86-xstate.o for the native Hurd
> x86_64
> target?  The i686 target doesn't use it and I didn't see any references in
> the patches to XSAVE support, so I suspect you don't need it.  Were you
> getting
> a link error without it, or is it something you copied from Linux x86_64?
> If
> the latter, it is probably best to drop it for now until you add XSAVE
> support
> in the future (which would presumably apply to both i686 and x86_64).
>

You are right, nat/x86-xstate it's not needed yet. I mailed a second
version of this
patch without requiring nat/x86-xstate.o plus some updates to make sure the
code
still compiles with the newest changes in GDB.

Thank you


>
> Reviewed-By: John Baldwin <jhb@FreeBSD.org>
>
> --
> John Baldwin
>
>

[-- Attachment #2: Type: text/html, Size: 3553 bytes --]

  reply	other threads:[~2024-07-03 21:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-13  4:31 [PATCH] " Flavio Cruz
2024-02-23  0:25 ` John Baldwin
2024-02-24  5:28   ` [PATCH v2] " Flavio Cruz
2024-02-27 23:15     ` John Baldwin
2024-07-03 21:48       ` Flávio Cruz [this message]
     [not found] <20240214191045.e4ndamwvpzjbkudq@begin>
2024-02-15  6:56 ` Flavio Cruz
2024-07-03 21:45 Flavio Cruz

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=CAKwpGPy6eUX8oBjjLwGo+pGuL1DM6huHCgvj3x7u8iRG-HRHJw@mail.gmail.com \
    --to=flaviocruz@gmail.com \
    --cc=bug-hurd@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=jhb@freebsd.org \
    --cc=samuel.thibault@gnu.org \
    --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