Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: Mark Kettenis <kettenis@gnu.org>, gdb-patches@sourceware.org
Subject: Re: ping: [patch 2/2] Fix gdb.cp/gdb2495.exp regression with gcc-4.7 #5
Date: Mon, 11 Jun 2012 15:24:00 -0000	[thread overview]
Message-ID: <20120611152428.GB31854@adacore.com> (raw)
In-Reply-To: <201203271853.q2RIrbWf024897@glazunov.sibelius.xs4all.nl>

Hi Jan,

> So the simplified version below is perfectly adequate.  We have some
> freedom on where to place the breakpoint in the 16-byte stack gap we
> create.  I chose to put it up hight such that a small buffer overflow
> isn't likely to overwrite the breakpoint instruction.

Just wanted to make sure that you'd be OK with Mark's version of
this part of your change... If that's the case, then all is good,
and as soon as part #1 is good to go, so should this one.

Thanks!

> Index: i386-tdep.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/i386-tdep.c,v
> retrieving revision 1.346
> diff -u -p -r1.346 i386-tdep.c
> --- i386-tdep.c	29 Feb 2012 14:59:41 -0000	1.346
> +++ i386-tdep.c	27 Mar 2012 18:30:24 -0000
> @@ -2327,6 +2327,21 @@ i386_16_byte_align_p (struct type *type)
>  }
>  
>  static CORE_ADDR
> +i386_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp,
> +		      CORE_ADDR funcaddr,
> +		      struct value **args, int nargs,
> +		      struct type *value_type,
> +		      CORE_ADDR *real_pc, CORE_ADDR *bp_addr,
> +		      struct regcache *regcache)
> +{
> +  *bp_addr = sp - 1;
> +  *real_pc = funcaddr;
> +
> +  /* Keep the stack aligned.  */
> +  return sp - 16;
> +}
> +
> +static CORE_ADDR
>  i386_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
>  		      struct regcache *regcache, CORE_ADDR bp_addr, int nargs,
>  		      struct value **args, CORE_ADDR sp, int struct_return,
> @@ -7372,6 +7387,8 @@ i386_gdbarch_init (struct gdbarch_info i
>    set_gdbarch_get_longjmp_target (gdbarch, i386_get_longjmp_target);
>  
>    /* Call dummy code.  */
> +  set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
> +  set_gdbarch_push_dummy_code(gdbarch, i386_push_dummy_code);
>    set_gdbarch_push_dummy_call (gdbarch, i386_push_dummy_call);
>    set_gdbarch_frame_align (gdbarch, i386_frame_align);
>  

-- 
Joel


  reply	other threads:[~2012-06-11 15:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-09 21:01 Jan Kratochvil
2012-03-26 19:04 ` ping: " Jan Kratochvil
2012-03-27 18:53   ` Mark Kettenis
2012-06-11 15:24     ` Joel Brobecker [this message]
2012-06-11 19:10     ` Jan Kratochvil
2012-06-11 21:29       ` Mark Kettenis
2012-06-12  7:37         ` Jan Kratochvil

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=20120611152428.GB31854@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=kettenis@gnu.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