Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: Mark Kettenis <mark.kettenis@xs4all.nl>
Cc: gdb-patches@sourceware.org, jan.kratochvil@redhat.com
Subject: Re: PATCH: PR corefiles/11467: amd64 gdb generates corrupted 32bit  	core file
Date: Mon, 12 Apr 2010 18:50:00 -0000	[thread overview]
Message-ID: <m2s6dc9ffc81004121150pe337b27fx39dde43ad7593d97@mail.gmail.com> (raw)
In-Reply-To: <201004121823.o3CINtrD023513@glazunov.sibelius.xs4all.nl>

On Mon, Apr 12, 2010 at 11:23 AM, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
>> Date: Mon, 12 Apr 2010 06:22:25 -0700
>> From: "H.J. Lu" <hongjiu.lu@intel.com>
>>
>> On Sun, Apr 11, 2010 at 01:52:50PM -0700, H.J. Lu wrote:
>> > Hi,
>> >
>> > Thanks for Mark's pointer. Solution is very simple. We just need to
>> > make sure that we call the right fill_gregset for 32bit executable
>> > on both Linux/x86-64 and Linux/i386.  OK to install?
>> >
>> > Thanks.
>> >
>> >
>>
>> Small update to use tdep->gregset_reg_offset instead of
>> i386_linux_gregset_reg_offset.  OK to install?
>
> No.  Like I explained in an earlier mail, we're not supposed to end up
> in fetch_gregset() in the first place.
>

fetch_gregset is always defined and used to fill .reg section in
coredump on Linux/x86. i386-tdep.c has

const struct regset *
i386_regset_from_core_section (struct gdbarch *gdbarch,
                               const char *sect_name, size_t sect_size)
{
  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);

  if (strcmp (sect_name, ".reg") == 0 && sect_size == tdep->sizeof_gregset)
    {
      if (tdep->gregset == NULL)
        tdep->gregset = regset_alloc (gdbarch, i386_supply_gregset,
                                      i386_collect_gregset);
      return tdep->gregset;
    }

For Linux,  tdep->sizeof_gregset != the size of .reg section. In fact,
they have nothing to do with each other. sizeof_gregset includes
SSE and AVX registers, which have offset == -1 since they aren't
general-purpose registers. I don't believe we should set tdep->gregset
since general-purpose registers is a special case for Linux/x86. They
are handled differently. I don't want to change it.

Please see i386-linux-nat.c for all the details.

Thanks.


-- 
H.J.


  reply	other threads:[~2010-04-12 18:50 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-10 22:19 H.J. Lu
2010-04-10 22:27 ` H.J. Lu
2010-04-11  0:01   ` H.J. Lu
2010-04-11 20:53     ` H.J. Lu
2010-04-12 13:22       ` H.J. Lu
2010-04-12 18:24         ` Mark Kettenis
2010-04-12 18:50           ` H.J. Lu [this message]
2010-04-13 18:40             ` Mark Kettenis
2010-04-13 19:19               ` H.J. Lu
2010-04-13 20:03               ` H.J. Lu
2010-04-13 17:18         ` H.J. Lu
2010-04-13 17:27           ` Mark Kettenis
2010-04-13 17:39             ` H.J. Lu
2010-04-13 18:43               ` Mark Kettenis
2010-04-13 17:48           ` H.J. Lu
2010-04-13 20:38             ` H.J. Lu
2010-04-13 20:48               ` Mark Kettenis
2010-04-11 16:50   ` Mark Kettenis
2010-04-11 17:33     ` H.J. Lu

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=m2s6dc9ffc81004121150pe337b27fx39dde43ad7593d97@mail.gmail.com \
    --to=hjl.tools@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=mark.kettenis@xs4all.nl \
    /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