This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] Avoid recursivly defined user functions.


On Tue, Apr 09, 2002 at 02:01:13PM -0700, Don Howard wrote:
> I think I can detect mutual recursion by walking through the body of each
> user-defined command (recursivly).  This amounts to static recursion 
> detection. 
> 
> I think I could track simple recursion depth at runtime.
> 
> I don't see how to track mutual recursion depth at runtime.  Maybe do the
> static recursion detection and recursivly flag user-defined commands in
> the body?

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.

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]