From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30080 invoked by alias); 28 Dec 2011 20:10:07 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=sourceware.org; b=hCj2XyLzyprmov2i5ZixfwgnTWqNcJ9RTiiXDmXqxnrtbBKYOigTeeykj83f0FIhnrAJtJ5X5LEdv6aWz8YaLBmrmTUGobOhy4chN1Lhg16R7h/ROljHmX8eY95dc2Q/u5F5vRH//0wbXVLFYtg9TsCrwUSMUb67Q5AEP0SKwu4= ; Received: (qmail 30067 invoked by uid 22791); 28 Dec 2011 20:10:05 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,TW_EG X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO glazunov.sibelius.xs4all.nl) (83.163.83.176) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 28 Dec 2011 20:09:51 +0000 Received: from glazunov.sibelius.xs4all.nl (kettenis@localhost [127.0.0.1]) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3) with ESMTP id pBSK9NoE023001; Wed, 28 Dec 2011 21:09:23 +0100 (CET) Received: (from kettenis@localhost) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3/Submit) id pBSK9LHn029918; Wed, 28 Dec 2011 21:09:21 +0100 (CET) Date: Wed, 28 Dec 2011 20:40:00 -0000 Message-Id: <201112282009.pBSK9LHn029918@glazunov.sibelius.xs4all.nl> From: Mark Kettenis To: jan.kratochvil@redhat.com CC: gdb-patches@sourceware.org, brobecker@adacore.com In-reply-to: <20111228180148.GA18057@host2.jankratochvil.net> (message from Jan Kratochvil on Wed, 28 Dec 2011 19:01:48 +0100) Subject: Re: [patch] Fix gdb.cp/gdb2495.exp regression with gcc-4.7 #2 References: <20111222202047.GA16110@host2.jankratochvil.net> <20111227045606.GE23376@adacore.com> <20111228161208.GB10556@host2.jankratochvil.net> <20111228180148.GA18057@host2.jankratochvil.net> 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: 2011-12/txt/msg00879.txt.bz2 > Date: Wed, 28 Dec 2011 19:01:48 +0100 > From: Jan Kratochvil > > --- a/gdb/infcall.c > +++ b/gdb/infcall.c > @@ -627,26 +628,16 @@ call_function_by_hand (struct value *function, int nargs, struct value **args) > switch (gdbarch_call_dummy_location (gdbarch)) > { > case ON_STACK: > + /* ON_STACK has problems on some targets featuring security policies > + disabling target stack executability. */ Hmm, did you actually try using ON_STACK? We specifically treat SIGSEGV as a potential breakpoint to deal with non-executable stacks. And the diff below works just fine on OpenBSD/amd64 where stacks are non-executable. Index: i386-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/i386-tdep.c,v retrieving revision 1.340 diff -u -p -r1.340 i386-tdep.c --- i386-tdep.c 14 Nov 2011 20:07:20 -0000 1.340 +++ i386-tdep.c 28 Dec 2011 20:06:23 -0000 @@ -2321,6 +2321,19 @@ 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; + return sp - 1; +} + +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, @@ -7366,6 +7379,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);