[Gambas-user] Debugging Gambas

T Lee Davidson t.lee.davidson at gmail.com
Tue Jan 22 01:53:11 CET 2019


This reminds me of a recent thread in which it was mentioned, paraphrased, that it seems we are expected to guess exactly what 
the user's code is doing.

All I can suggest is that you look into `gdb`, `strace`, `lsof`, Valgrind, and/or perhaps trying with the latest stable Gambas 
version.


___
Lee


On 1/20/19 8:38 AM, KKing wrote:
> <<
> I don't recall exactly what your project is. But, with "Use terminal emulator" and "Redirect standard error output" enabled, 
> Print displays in the terminal and Debug displays in the IDE console. With redirection disabled, both display in the terminal.
>  >>
> 
> With the issue I have of seeming to freeze, it doesn't matter which way I have that setting I don't get any messages appearing 
> in either the terminal (which is being used for the ncurses) or in the IDE console.
> 
> I've tried the same solution on a much more powerful unit with significantly more RAM and Gambas 3.9.1 and it behaves the same.
> 
> When I say freeze, I mean that F8 does not move to next line. As mentioned if I choose Pause it crashes. What I've now noticed 
> is that Stop (Alt+Pause) works as normal.
> 
> I added a TraceLog sub to write to a log file, the code now calls that repeatedly no problem until I get the "freezing" issue 
> which now freezes in that routine where it tries to open the log file (I'm opening and closing it each time it goes into the 
> sub). I've managed to deduce the freeze comes in code that has been called repeatedly a number of time after a particular 
> separate routine is called once and returns and carries on to the previous called upto a point, though that point seems to vary 
> (possibly due to my adding of further tracelog calls). Now this separate routine also ha file calls but essentially is working 
> with completely separate files and variables than the routine the freeze occurs in.
> 
> Is there any sort of File Handle limitations and what is the correct way to free/release them? As example this is how I am 
> currently working with some of the files.
> Public Sub TraceLog(strMessage As String)
>    Dim hFile_TraceLog As File
>    Dim strDateAndTime As String
>    hFile_TraceLog = Open "/home/test1/trace.log" For Append
>    strDateAndTime = Now
>    Print #hFile_TraceLog, strDateAndTime & " " & strMessage
> 
>    Close #hFile_TraceLog
> 
> End
> 
> K.
> 
> 
> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----


More information about the User mailing list