Running on a verge

You may find yourself in a situation when your program wants all memory it can get and together with the debugger does not exactly fits into available space. There are still some things which can be done.

Keep in mind that grabs all memory it needs before a program to debug is loaded and it does not make any claims later. These requirements can be minimized. Function key definitions if non-existent will not use memory at all, discounting the supporting code. This code by itself is mostly contained in a file fkeydefs.c and it is easy to remove. The flag -nc, for no commands, gives some memory for a price of missing breakpoint requests. A more substantial memory chunk can be released with -nb, for no buffering on transcript, flag. You still can open a transcript file but all output will be direct. Beware of GEMDOS when using transcripts without buffering.

If this does not help then there is a time to trim some fat from itself. You will have to recompile it leaving some features out. On-line help is probably the first candidate.

All this effort can be wasted if you will forget about one thing. Due to an infamous design bug in TOS a Malloc system call can be invoked only a small fixed number of times. When this pool is exhausted you will get ``out of memory condition'' even if memory is still plentiful. Therefore all allocation functions, from smart libraries, request a memory from the system in bigger pieces and later try to satisfy all requests chopping from an already owned resource. The name of the game for is to use for all its needs only one chunk of a system memory which is just big enough, so not too much of an unused memory will be left. The whole symbol table of a debugged program must fit there and all requests for a space for internal structures have to be statisfied. To adjust sizes properly you may want to change a constant CHUNK which is defined at the top of a file adb.c.

If everything else fail you may still try to change a value of a global variable __STKSIZ from start.s but this would be probably the last stand.