From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23430 invoked by alias); 1 Feb 2004 17:48:29 -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 23412 invoked from network); 1 Feb 2004 17:48:28 -0000 Received: from unknown (HELO walton.kettenis.dyndns.org) (213.93.115.144) by sources.redhat.com with SMTP; 1 Feb 2004 17:48:28 -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 i11HmPsk000468; Sun, 1 Feb 2004 18:48:25 +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 i11HmPAX000563; Sun, 1 Feb 2004 18:48:25 +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 i11HmJRR000558; Sun, 1 Feb 2004 18:48:19 +0100 (CET) Date: Sun, 01 Feb 2004 17:48:00 -0000 Message-Id: <200402011748.i11HmJRR000558@elgar.kettenis.dyndns.org> From: Mark Kettenis To: eliz@elta.co.il CC: gdb@sources.redhat.com In-reply-to: (message from Eli Zaretskii on 27 Jan 2004 09:56:52 +0200) Subject: Re: [RFC] Non-executable stack on SPARC References: <200401252350.i0PNoB1O021806@elgar.kettenis.dyndns.org> <200401261242.i0QCgUoB026534@elgar.kettenis.dyndns.org> X-SW-Source: 2004-02/txt/msg00002.txt.bz2 Date: 27 Jan 2004 09:56:52 +0200 From: Eli Zaretskii > Date: Mon, 26 Jan 2004 13:42:30 +0100 (CET) > From: Mark Kettenis > > With my patch, > or with the suggestions I made below, GDB will usually still see > SIGSEG under normal circumstances. GDB will only convert such a > signal into SIGTRAP if there's a breakpoint inserted at the point > where the inferior stopped. Where is this last condition tested to be true? The if clause where you wanted to add SIGSEGV doesn't test that, I think. It's quite a bit further down where this gets resolved; see infrun.c:1962. The signal is only converted into SIGTRAP if the signal can be explained by a breakpoint. > As to punting the SIGSEGV to SIGTRAP conversion to the architecture: > we could do this in target_wait() or target_wait_hook(), but that > would offload it to the target we're running on and not to the > architecture. So perhaps we need an architecture way to do such conversions. My line of thought is that it's IMHO fundamentally wrong to push target- or architecture-specific details into the application level of GDB, which is what infrun.c is. infrun.c should deal with high-level logic of handling a stopped inferior, it should not IMHO know about intricacies of specific targets. The question is to what extent this is an intricacy of a specific target. All targets that use ON_STACK call dummies and have a non-executable stack will need this adjustment. More and more systems gain non-executable stacks. Hopefully no other ABI's besides SPARC will require ON_STACK call dummies, but that's probably wishful thinking. Anyway, the SIGSEGV would be handled exactly as we already handle SIGILL and SIGEMT. Pushing things off to the target/architecture vector would involve code duplication that I'd rather avoid. Mark