[Gambas-user] Debugging Gambas

Tobias Boege taboege at gmail.com
Fri Jan 4 12:49:22 CET 2019


On Wed, 02 Jan 2019, KKing wrote:
> any suggestions (or links to) that will help with debugging.
> 
> Background:
> 
> I have rather large program that appears to be hanging or looping. If
> running via the IDE and I click pause (which I'm used to in VB days stopping
> on the next instruction if it was a loop issue) causes a dialog labeled
> "this program has stopped unexpectedly!" with content "user defined signal 1
> (10)".
> 

IIRC the SIGUSR1 that causes the program to die is used by the Gambas
debugger to stop the program. Normally it is caught by the interpreter
when a program is debugged. This incompatibility could be related to
you running the program inside a terminal -- I don't know.

> The program is a Gambas 3.8.4 NCurses based.
> 
> The problem appears somewhat random, it has occurred the first time through
> or after multiple iterations (where it is calling the same set of routines
> for different inputs). If I attempt to repeat the steps exactly (with same
> inputs) it will stop at different points (get further or sometimes not so
> far). I've attempted to run as just the compiled program (to rule out IDE
> specific issue) and it also fails and each time you run it it can be at a
> different point.
> 
> What is the "Redirect Standard error output" option meant for and how to
> use?
> 

I would advise to enable this. You can then "print debug" your program
with the Debug or Error statements. Those send strings to stderr, which
is redirected as Fabien said. Otherwise these messages clutter up your
ncurs-ified terminal which make them unreadable and can cause visual
glitches. [ That is because ncurses, true to its name, reduces the amount
of changes sent to the terminal as much as it can. It assumes that you
do not print to the terminal but through ncurses functions, so that it
has an accurate idea of what is on the screen. ]

Regards,
Tobi

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk


More information about the User mailing list