From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30675 invoked by alias); 11 Apr 2002 19:08:28 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 30666 invoked from network); 11 Apr 2002 19:08:24 -0000 Received: from unknown (HELO nevyn.them.org) (128.2.145.6) by sources.redhat.com with SMTP; 11 Apr 2002 19:08:24 -0000 Received: from drow by nevyn.them.org with local (Exim 3.35 #1 (Debian)) id 16vjvv-0003yF-00 for ; Thu, 11 Apr 2002 15:08:35 -0400 Date: Thu, 11 Apr 2002 12:08:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sources.redhat.com Subject: Re: [RFA] Avoid recursivly defined user functions. Message-ID: <20020411150835.A15229@nevyn.them.org> Mail-Followup-To: gdb-patches@sources.redhat.com References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.23i X-SW-Source: 2002-04/txt/msg00422.txt.bz2 On Thu, Apr 11, 2002 at 10:55:26AM -0700, Don Howard wrote: > On Tue, 9 Apr 2002, Don Howard wrote: > > > On Tue, 9 Apr 2002, Paul Hilfinger wrote: > > > > > > > > > How about something even simpler - track user command depth at runtime? > > > > Set an absurd limit, like 1024 deep, if we can handle that in a > > > > normal-sized stack limit. Then complain if we hit it at runtime. > > > > > > I completely agree with this. After all, if you were willing to > > > contemplate outlawing recursion altogether, you certainly won't LOSE > > > anything by Daniel's approach, and you gain everything you wanted in > > > the first place---to avoid crashing GDB. > > > > > > Paul > > > > > > > > > I like this approach, also. > > > > > 2002-04-11 Don Howard > > * cli/cli-cmds.c (init_cli_cmds): Add new user settable value: > max_user_call_depth. > (init_cmd_lists): Initialize the new value; > * cli/cli-script.c (execute_user_command): Limit the call depth of > user defined commands. This avoids a core-dump when user commands > are infinitly recursive. Well, I like it. -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer