[comp.lang.perl] "Out of Memory" in debugger

worley@compass.com (Dale Worley) (01/03/91)

I am not certain, but I suspect that this problem (the debugger
reports "Out of Memory" while trying to allocate gigabytes of memory)
is due to dodb() constructing only one argument for the O_SUBR that
calls DB, whereas do_subr() requires two (one for the subroutine name,
one for the argument list).

Evidence: -D1024 shows that "&db" written by the user is compiled with
two arguments, whereas the implicit "&db" inserted by "-d" has only
one.  The code in do_subr() seems to expect two arguments, for
example:

    register int items = arglast[2] - sp;	/* sp = arglast[1] here */

    int hasargs = ((arg[2].arg_type & A_MASK) != A_NULL);

There seems to be no conditionalization in do_subr() that would allow
it to avoid executing these statements when the implicit "&db" is
called.

Dale

Dale Worley		Compass, Inc.			worley@compass.com
--
This is your brain on drugs with a side order of bacon and our world-famous
bottomless cup of coffee all for $2.99.

worley@compass.com (Dale Worley) (01/04/91)

Larry sent me this patch.  It fixes the "Out of Memory in debugger" problem.

   From: lwall@devvax.Jpl.Nasa.Gov (Larry Wall)
   Date: Thu, 3 Jan 91 10:19:24 -0800
   Newsgroups: comp.lang.perl

   That may well be it.  In dodb(), try changing

       cmd->c_expr = make_op(O_SUBR, 1,

   to

       cmd->c_expr = make_op(O_SUBR, 2,

   and see if it fixes it.

Dale Worley		Compass, Inc.			worley@compass.com
--
Klein bottle for sale ... inquire within.

usenet@carssdf.UUCP (John Watson) (01/05/91)

In article <1991Jan3.214039.26552@uvaarpa.Virginia.EDU>, worley@compass.com (Dale Worley) writes:
> Larry sent me this patch.  It fixes the "Out of Memory in debugger" problem.
>    That may well be it.  In dodb(), try changing
>        cmd->c_expr = make_op(O_SUBR, 1,
>    to
>        cmd->c_expr = make_op(O_SUBR, 2,

Thankyou very much.  I have been looking for this for 2 months.  I think
perl is finally fixed!

John Watson    ...!rutgers!carssdf!usenet