From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24481 invoked by alias); 3 Jun 2012 17:21:19 -0000 Received: (qmail 24462 invoked by uid 22791); 3 Jun 2012 17:21:17 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from gw1.transmode.se (HELO gw1.transmode.se) (195.58.98.146) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 03 Jun 2012 17:21:05 +0000 Received: from mail1.transmode.se (mail1.transmode.se [192.168.201.18]) by gw1.transmode.se (Postfix) with ESMTP id 8063225801D; Sun, 3 Jun 2012 19:21:04 +0200 (CEST) In-Reply-To: <20120603165813.GA20143@host2.jankratochvil.net> References: <20120603151603.GA16834@host2.jankratochvil.net> <20120603165813.GA20143@host2.jankratochvil.net> Subject: Re: Disabling stack access for remote targets? X-KeepSent: B96592A6:7A0A8336-C1257A12:005EC63F; type=4; name=$KeepSent To: Jan Kratochvil Cc: gdb@sourceware.org Message-ID: From: Joakim Tjernlund Date: Sun, 03 Jun 2012 17:21:00 -0000 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2012-06/txt/msg00020.txt.bz2 Jan Kratochvil wrote on 2012/06/03 18:58:13: > > On Sun, 03 Jun 2012 18:42:10 +0200, Joakim Tjernlund wrote: > > Not quite, I don't see memeor attribute "no-access", just ro, wo, and rw. > > There is "set mem inaccessible-by-default" for that purpose, default "on", > just do not definy any memory area in that range you do not want to touch. That could work, I need to test that though. > > > > Testing for sp == 0 (or sp == ~0) would be much nicer. It would automatically > > disable/enable stack access. > > sp == 0 or sp == ~0 are perfectly valid stack addresses on embedded targets. In theory yes, I think you will have a very hard time finding a system using 0 or ~0(which is odd too). If that is still a concern one could make the address configurable. I think this feature would be really nice to have because it adapts dynamically without the user having to know about mem regions. Jocke