From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14012 invoked by alias); 25 Jan 2004 23:50:16 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 13967 invoked from network); 25 Jan 2004 23:50:12 -0000 Received: from unknown (HELO walton.kettenis.dyndns.org) (213.93.115.144) by sources.redhat.com with SMTP; 25 Jan 2004 23:50:12 -0000 Received: from elgar.kettenis.dyndns.org (elgar.kettenis.dyndns.org [192.168.0.2]) by walton.kettenis.dyndns.org (8.12.6p3/8.12.6) with ESMTP id i0PNoBIY000520 for ; Mon, 26 Jan 2004 00:50:11 +0100 (CET) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: from elgar.kettenis.dyndns.org (localhost [127.0.0.1]) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6) with ESMTP id i0PNoBZM021809 for ; Mon, 26 Jan 2004 00:50:11 +0100 (CET) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: (from kettenis@localhost) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6/Submit) id i0PNoB1O021806; Mon, 26 Jan 2004 00:50:11 +0100 (CET) Date: Sun, 25 Jan 2004 23:50:00 -0000 Message-Id: <200401252350.i0PNoB1O021806@elgar.kettenis.dyndns.org> From: Mark Kettenis To: gdb@sources.redhat.com Subject: [RFC] Non-executable stack on SPARC X-SW-Source: 2004-01/txt/msg00294.txt.bz2 A while ago, I established that getting inferior function calls on SPARC working with a non-executable stack is remarkably simple. Just acknowledging that breakpoint instructions may cause SIGSEGV, as per the attached patch, is enough. However, some people were afraid that blindly applying this patch might cause some problems on other targets. I think there are two alternatives: 1. Only check for SIGSEGV if the target in question uses "ON_STACK" for its call_dummy_location. 2. Add a new method to the architecture vector to check whether a particular signal may have been the result of a breakpoint instruction. Suggested name & signature: int breakpoint_signal_p (struct gdbarch *gdbarch, int signal) Preferences? I'd like to get this sorted before 6.1, since OpenBSD/sparc has a non-executable stack, and some people are running SPARC Solaris with a non-executable stack too. Mark Index: infrun.c =================================================================== RCS file: /cvs/src/src/gdb/infrun.c,v retrieving revision 1.122 diff -u -p -r1.122 infrun.c --- infrun.c 25 Nov 2003 16:01:36 -0000 1.122 +++ infrun.c 25 Jan 2004 23:37:01 -0000 @@ -1864,6 +1864,7 @@ handle_inferior_event (struct execution_ if (stop_signal == TARGET_SIGNAL_TRAP || (breakpoints_inserted && (stop_signal == TARGET_SIGNAL_ILL + || stop_signal == TARGET_SIGNAL_SEGV || stop_signal == TARGET_SIGNAL_EMT)) || stop_soon == STOP_QUIETLY || stop_soon == STOP_QUIETLY_NO_SIGSTOP)