From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6990 invoked by alias); 8 Mar 2012 23:24:31 -0000 Received: (qmail 6979 invoked by uid 22791); 8 Mar 2012 23:24:30 -0000 X-SWARE-Spam-Status: No, hits=-6.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_EG,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 08 Mar 2012 23:24:14 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q28NNoNT032017 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 8 Mar 2012 18:23:50 -0500 Received: from host2.jankratochvil.net (ovpn-116-19.ams2.redhat.com [10.36.116.19]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q28NNjkR011085 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 8 Mar 2012 18:23:48 -0500 Date: Thu, 08 Mar 2012 23:24:00 -0000 From: Jan Kratochvil To: gdb-patches@sourceware.org Cc: Ulrich Weigand , Joel Brobecker Subject: [patch] Fix gdb.cp/gdb2495.exp regression with gcc-4.7 #4 [Re: [revert] Regression on PowerPC] Message-ID: <20120308232345.GA32618@host2.jankratochvil.net> References: <20120103155206.GM2730@adacore.com> <201201031444.q03Eir77009359@d06av02.portsmouth.uk.ibm.com> <20120104140104.GA22254@host2.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120104140104.GA22254@host2.jankratochvil.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-03/txt/msg00305.txt.bz2 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 * 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); } --- 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); /* Functions and variables exported from i386bsd-tdep.c. */