Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mark Kettenis <kettenis@chello.nl>
To: mec.gnu@mindspring.com
Cc: eliz@gnu.org, gdb-patches@sources.redhat.com
Subject: Re: [PATCH] Partial fix for PR backtrace/1718
Date: Sun, 01 Aug 2004 13:54:00 -0000	[thread overview]
Message-ID: <200408011354.i71DsR1E055908@elgar.kettenis.dyndns.org> (raw)

[Sorry Michael and Eli, I managed to remove the Subject: line and
 therefore the list didn't accept this message]

   Date: Sun, 01 Aug 2004 01:35:39 -0400
   From: Michael Chastain <mec.gnu@mindspring.com>

   "Eli Zaretskii" <eliz@gnu.org> wrote:
   > Perhaps, then, you could post a list of all the opcodes and subsequent
   > bytes that we need to cover in i386_analyze_frame_setup?

   The compiler could schedule just about anything into the prologue!

There are some restrictions though, given that GCC can only play with
a limited set of registers.

   Let's get empirical.  I ran cc1plus and gdb through "objdump -d" and
   some perl fu.

Thanks!  This really is the info I need.  Could you post (or mail me)
the perl fu?

   We have to have "mov 0xADDRESS, %reg".  After that, recognizing
   "cmpl $IMMEDIATE, 0xADDRESS" would help.  That instruction gets scheduled
   even before "push %ebp".  Those two additions would cover 99.9% of cc1plus
   and gdb.

On System V ABI conforming systems, yes.  On systems that use the
-freg-struct-return by default (FreeBSD, OpenBSD, Cygwin and a few
others) I guess there are a bit more possibilities.  I'll try to
address -freg-struct-return too.

Anyway, I've got some ideas to make the prologue analyzer easily
extendable.

   [snip]

   The 10 truly freaky prologues are:

     .plt : pushl 0x86039e8 | jmp *0x86039ec | add %al, (%eax) | add %al, (%eax) | jmp *0x86039f0 | push $0x0 | jmp 80494cc <_init+0x18>

That's the PLT.  GDB should already handle that one, and otherwise
it'd deserve (and need) a special frame unwinder anyway like I did for
SPARC.

     _start : xor %ebp, %ebp | pop %esi | mov %esp, %ecx | and $0xfffffff0, %esp | push %eax | push %esp | push %edx

This one is rather special since it's the entry point.

Thanks!

Mark


             reply	other threads:[~2004-08-01 13:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-01 13:54 Mark Kettenis [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-07-24 12:59 Mark Kettenis
2004-07-24 17:58 ` Eli Zaretskii
2004-07-30 18:35 ` Eli Zaretskii
2004-07-30 20:08   ` Mark Kettenis
2004-07-31 13:41     ` Eli Zaretskii
2004-07-31 15:09       ` Michael Chastain
2004-07-31 18:44         ` Eli Zaretskii
2004-08-01  5:35           ` Michael Chastain

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=200408011354.i71DsR1E055908@elgar.kettenis.dyndns.org \
    --to=kettenis@chello.nl \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sources.redhat.com \
    --cc=mec.gnu@mindspring.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