Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: gdb-patches@sourceware.org
Cc: Ulrich Weigand <uweigand@de.ibm.com>,
	       Joel Brobecker <brobecker@adacore.com>
Subject: [patch] Fix gdb.cp/gdb2495.exp regression with gcc-4.7 #4  [Re: [revert] Regression on PowerPC]
Date: Thu, 08 Mar 2012 23:24:00 -0000	[thread overview]
Message-ID: <20120308232345.GA32618@host2.jankratochvil.net> (raw)
In-Reply-To: <20120104140104.GA22254@host2.jankratochvil.net>

On Wed, 04 Jan 2012 15:01:04 +0100, Jan Kratochvil wrote:
> On Tue, 03 Jan 2012 15:44:53 +0100, Ulrich Weigand wrote:
> > Maybe there should be a default implementation based on
> > gdbarch_inner_than/gdbarch_frame_align_p and the breakpoint length?
> 
> I will return to it in some time.

I made a copy from dicos-tdep.

No regressions on {x86_64,x86_64-m32,i686} many Fedora distros tried.


Thanks,
Jan


2012-03-09  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* amd64-linux-tdep.c: Include inferior.h.
	(amd64_linux_init_abi): Set ON_STACK and i386_linux_push_dummy_code.
	* i386-linux-tdep.c (i386_linux_push_dummy_code): New function.
	(i386_linux_init_abi): Set ON_STACK and i386_linux_push_dummy_code.
	* i386-tdep.h (i386_linux_push_dummy_code): New declaration.

--- a/gdb/amd64-linux-tdep.c
+++ b/gdb/amd64-linux-tdep.c
@@ -32,6 +32,7 @@
 #include "i386-linux-tdep.h"
 #include "linux-tdep.h"
 #include "i386-xstate.h"
+#include "inferior.h"
 
 #include "gdb_string.h"
 
@@ -1530,6 +1531,9 @@ amd64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   amd64_linux_record_tdep.arg6 = AMD64_R9_REGNUM;
 
   tdep->i386_syscall_record = amd64_linux_syscall_record;
+
+  set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
+  set_gdbarch_push_dummy_code (gdbarch, i386_linux_push_dummy_code);
 }
 \f
 
--- a/gdb/i386-linux-tdep.c
+++ b/gdb/i386-linux-tdep.c
@@ -704,6 +704,26 @@ i386_linux_displaced_step_copy_insn (struct gdbarch *gdbarch,
   return closure;
 }
 
+/* Implementation for set_gdbarch_push_dummy_code.  */
+
+CORE_ADDR
+i386_linux_push_dummy_code (struct gdbarch *gdbarch,
+			    CORE_ADDR sp, CORE_ADDR funaddr,
+			    struct value **args, int nargs,
+			    struct type *value_type,
+			    CORE_ADDR *real_pc, CORE_ADDR *bp_addr,
+			    struct regcache *regcache)
+{
+  int bplen;
+  CORE_ADDR bppc = sp;
+
+  gdbarch_breakpoint_from_pc (gdbarch, &bppc, &bplen);
+  *bp_addr = sp - bplen;
+  *real_pc = funaddr;
+
+  return *bp_addr;
+}
+
 static void
 i386_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
@@ -965,6 +985,9 @@ i386_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
                                   i386_linux_get_syscall_number);
 
   set_gdbarch_get_siginfo_type (gdbarch, linux_get_siginfo_type);
+
+  set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
+  set_gdbarch_push_dummy_code (gdbarch, i386_linux_push_dummy_code);
 }
 
 /* Provide a prototype to silence -Wmissing-prototypes.  */
--- a/gdb/i386-tdep.h
+++ b/gdb/i386-tdep.h
@@ -379,6 +379,14 @@ extern void i386_svr4_init_abi (struct gdbarch_info, struct gdbarch *);
 
 extern int i386_process_record (struct gdbarch *gdbarch,
                                 struct regcache *regcache, CORE_ADDR addr);
+
+extern CORE_ADDR i386_linux_push_dummy_code (struct gdbarch *gdbarch,
+					     CORE_ADDR sp, CORE_ADDR funaddr,
+					     struct value **args, int nargs,
+					     struct type *value_type,
+					     CORE_ADDR *real_pc,
+					     CORE_ADDR *bp_addr,
+					     struct regcache *regcache);
 \f
 
 /* Functions and variables exported from i386bsd-tdep.c.  */


  parent reply	other threads:[~2012-03-08 23:24 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-22 20:49 [patch] Fix gdb.cp/gdb2495.exp regression with gcc-4.7 Jan Kratochvil
2011-12-27  6:23 ` Joel Brobecker
2011-12-28 16:30   ` Jan Kratochvil
2011-12-28 18:47     ` [patch] Fix gdb.cp/gdb2495.exp regression with gcc-4.7 #2 Jan Kratochvil
2011-12-28 20:40       ` Mark Kettenis
2011-12-30  2:45         ` [patch] Fix gdb.cp/gdb2495.exp regression with gcc-4.7 #3 Jan Kratochvil
2011-12-30  8:46           ` Joel Brobecker
2011-12-30 11:11             ` Mark Kettenis
2011-12-30 14:16               ` Jan Kratochvil
2011-12-31  2:56               ` Peter Schauer
2011-12-30 11:25             ` Jan Kratochvil
2012-01-01 22:22               ` Jan Kratochvil
2012-01-02  2:45                 ` Joel Brobecker
2012-01-02  2:58                   ` Jan Kratochvil
2012-01-03 14:45                     ` Regression on PowerPC (Re: [patch] Fix gdb.cp/gdb2495.exp regression with gcc-4.7 #3) Ulrich Weigand
2012-01-03 15:52                       ` Joel Brobecker
2012-01-04 14:01                       ` [revert] " Jan Kratochvil
2012-01-04 14:09                         ` Joel Brobecker
2012-03-08 23:24                         ` Jan Kratochvil [this message]
2012-03-09  7:22                           ` cancel: [patch] Fix gdb.cp/gdb2495.exp regression with gcc-4.7 #4 [Re: [revert] Regression on PowerPC] Jan Kratochvil
2012-01-02 14:10 ` [patch] Fix gdb.cp/gdb2495.exp regression with gcc-4.7 Pedro Alves
2012-01-02 14:20   ` Jan Kratochvil
2012-01-02 14:44     ` Pedro Alves
2012-01-02 14:53       ` 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=20120308232345.GA32618@host2.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=uweigand@de.ibm.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