jed-users mailing list

[2005 Date Index] [2005 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: debug: points where left on the stack


Joerg Sommer <joerg@xxxxxxxxxxxx> wrote:
>> If you are using slang2, you might try using stkcheck.  To use it, put
>>
>>   require ("stkcheck");
>>   enable_stack_check ();
>
>This is not very useful, because it prints a message for every value left
>on the stack. I'm using the stack often, which makes the output of
>stkckeck unreadable.

You can use enable_stack_check/disable_stack_check to selectively
stack-check functions:

   enable_stack_check ();
   define foo() { ... }
   disable_stack_check ();
   
   define bar() { ... }

In this case, foo would get checked but bar will not.

>I'm interested in functions they leave values on the stack after quit
>without using the return statement. I'm not interested in such constructs:
>
>do_check();
>do_something();
>if ( () )

You should try to minimize the use of such constructs.

>Do you have a tool for this?

All I can suggest is that you selectively use calls to
enable_stack_check/disable_stack_check.  Also you see the same line
appearing in the stack check output over and over again, and you
believe that it is ok, then you should rewrite it, e.g,.

   do_check ();
   if (do_something ()) ...

or

   do_check ();
   variable status = do_something ();
   if (status) ...

Good luck,
--John

--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2005 date index] [2005 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]