[Gambas-user] Trace options

Benoît Minisini g4mba5 at gmail.com
Sat Sep 28 16:58:31 CEST 2019


Le 28/09/2019 à 13:26, KKing a écrit :
> is there the ability to dump a trace say of the last 100 lines a program 
> has been through?
> 
> I have one program that yields an unexpected result every so often, the 
> cause is elusive and it appears no error is being generated / detected. 
> But the result is detectable by comparing the output from the unexpected 
> result with output from previous iteration so I could trap that, but to 
> determine the cause a trace dumped to log would (hopefully) help.
> 
> NB this so far has not happened within IDE debugging only on units 
> running the executable on runtime version of gambas.
> 
> K.
> 

Hi,

In commit 
https://gitlab.com/gambas/gambas/commit/28df31355413efb0557ab6733538fb133dc05213, 
I added a '-t" option to the interpreter that dumps to the standard 
error the position of each executed line.

So run your program with 'gbx3 -t', redirect the standard error output 
to a file, and check that you have a lot of disk space!

It could be possible to memorize the last N lines executed, but it's a 
bit more complex to implement.

I could add a System property that toggle the trace, so that you can 
check a specific part of your code. At the moment, everything is dumped.

Regards,

-- 
Benoît Minisini


More information about the User mailing list