Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Mark Kettenis" <mark.kettenis@xs4all.nl>
To: gdb-patches@sourceware.org
Subject: Re: [rfc] Autoselect x86_64 or i386 based on the remote g packet       size
Date: Thu, 09 Nov 2006 21:36:00 -0000	[thread overview]
Message-ID: <20030.82.92.89.47.1163108189.squirrel@webmail.xs4all.nl> (raw)
In-Reply-To: <20061109205755.GA18755@nevyn.them.org>

>  The operating principle is that a target is free to send back a "short"
>  g packet, but some sizes are plausible and others are not.  So I
>  enhanced the i386 backend to register the sizes of likely register
>  sets: core registers, core + i387, core + i387 + SSE.  The Linux
>  backend adds the %orig_eax and %orig_rax pseudo-"registers" too
>  (which, if I were inventing them today, might be target objects like
>  the sparc WCOOKIE, but are currently in the g packet).
>
>  So if you have a GDB which defaults to i386-linux, and it connects to
>  an amd64 target and gets exactly the right number of bytes to be
>  a 64-bit register set, it'll assume that's what it's got.
>
>  There's deliberately no mechanism to say "more than X bytes must be
>  amd64",
>  because I feel that's unsafe.  The current registered guesses are
>  high-confidence, since e.g the amd64 guesses would be quite odd sizes for
>  an i386 target to return.  For instance, the amd64 non-FP registers cut
>  off between fioff and foseg if interpreted as a 32-bit register set: not
>  very likely.
>
>  All comments welcome!  Tested on x86_64-pc-linux-gnu, using gdbserver for
>  the testsuite and by hand.

Hi Daniel,

I can't say I'm very enthousiastic about this patch.  It feels like a
kludge to avoid adding proper support to the remote protocol that allows
gdb to interrogate the target about this.  A very clever kludge, but still
a kludge.

Mark


  reply	other threads:[~2006-11-09 21:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-09 20:58 Daniel Jacobowitz
2006-11-09 21:36 ` Mark Kettenis [this message]
2006-11-09 21:49   ` Daniel Jacobowitz
2006-11-20  4:26     ` Daniel Jacobowitz

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=20030.82.92.89.47.1163108189.squirrel@webmail.xs4all.nl \
    --to=mark.kettenis@xs4all.nl \
    --cc=gdb-patches@sourceware.org \
    /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