Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Mark Kettenis <kettenis@chello.nl>
Cc: guitton@act-europe.fr, gdb-patches@sources.redhat.com
Subject: Re: [RFA] x86 - jump instruction after the prologue
Date: Mon, 10 May 2004 20:48:00 -0000	[thread overview]
Message-ID: <20040510202721.GB15632@nevyn.them.org> (raw)
In-Reply-To: <200404291624.i3TGO7PP003462@elgar.kettenis.dyndns.org>

On Thu, Apr 29, 2004 at 06:24:07PM +0200, Mark Kettenis wrote:
>    Date: Tue, 27 Apr 2004 18:37:25 +0200
>    From: Jerome Guitton <guitton@act-europe.fr>
> 
>    Ping? Still waiting for approval...
> 
> Sorry about that.  I've reviewed your patch.  I've tweaked the comment
> a bit and checked in the attached.

The testcase, unfortunately, fails on i386-linux using GCC 3.3 and
dwarf2 (it succeeds with stabs).

The failure occurs because we set the breakpoint in main() instead of
in jump_at_beginning.  Here's the relevant line info, in minsym_found:

(top-gdb) p/x msymbol.ginfo.value.address
$10 = 0x80483a8
(top-gdb) p/x values.sals[0]
$11 = {symtab = 0x82f4e78, section = 0x0, line = 0xc, pc = 0x804838c, end = 0x80483b2}

We use the start of the line, which is before the beginning of the
function we want to skip.  If funfirstline, should we ignore lines
which start before the beginning of the function?

Also, should we write i386-prologue.c in assembly to avoid this
problem?  That's what Fred did for SH to avoid a similar difficulty.

> 
> Thanks,
> 
> Mark
> 
> 
> Index: ChangeLog
> from  Jerome Guitton  <guitton@gnat.com>
> 	Mark Kettenis  <kettenis@gnu.org>
> 
> 	* i386-tdep.c (i386_skip_prologue): follow the last jump only if
> 	the function begins with a branch instruction.
> 
> Index: i386-tdep.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/i386-tdep.c,v
> retrieving revision 1.188
> diff -u -p -r1.188 i386-tdep.c
> --- i386-tdep.c 29 Apr 2004 16:13:21 -0000 1.188
> +++ i386-tdep.c 29 Apr 2004 16:20:47 -0000
> @@ -750,7 +750,13 @@ i386_skip_prologue (CORE_ADDR start_pc)
>  	}
>      }
>  
> -  return i386_follow_jump (pc);
> +  /* If the function starts with a branch (to startup code at the end)
> +     the last instruction should bring us back to the first
> +     instruction of the real code.  */
> +  if (i386_follow_jump (start_pc) != start_pc)
> +    pc = i386_follow_jump (pc);
> +
> +  return pc;
>  }
>  
>  /* This function is 64-bit safe.  */
> 

-- 
Daniel Jacobowitz


  parent reply	other threads:[~2004-05-10 20:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-19 17:32 Jerome Guitton
2004-04-27 16:37 ` Jerome Guitton
2004-04-29 16:24   ` Mark Kettenis
2004-04-29 16:29     ` Jerome Guitton
2004-05-10 20:48     ` Daniel Jacobowitz [this message]
2004-05-12 10:31       ` Jerome Guitton
2004-08-08 21:36         ` Daniel Jacobowitz
2004-08-08 21:46           ` Michael Chastain
2004-08-08 22:07           ` Mark Kettenis
2004-08-08 22:15             ` 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=20040510202721.GB15632@nevyn.them.org \
    --to=drow@false.org \
    --cc=gdb-patches@sources.redhat.com \
    --cc=guitton@act-europe.fr \
    --cc=kettenis@chello.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