FB debugger : 3.02 32/64 BIT WDS/LNX..... (2023/07/05)

User projects written in or related to FreeBASIC.
Post Reply
Dinosaur
Posts: 1478
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: FB debugger : 2.98.1 32/64 BIT ..... (2021/01/30)

Post by Dinosaur »

Hi SARG

I can make a minimized version that simply calls the library, which will then draw a screen.
Then post the libraries and code for you to test.

If on the other hand you don't want to pursue the Linux angle I won't blame you.
Although it surprises me that the same issue hasn't arisen in Windows.

Let me know.

Regards
SARG
Posts: 1756
Joined: May 27, 2005 7:15
Location: FRANCE

Re: FB debugger : 2.98.1 32/64 BIT ..... (2021/01/30)

Post by SARG »

Dinosaur wrote:I can make a minimized version that simply calls the library, which will then draw a screen.
Then post the libraries and code for you to test.
yes please do it, sure it will help much.
Dinosaur wrote:If on the other hand you don't want to pursue the Linux angle I won't blame you.
Although it surprises me that the same issue hasn't arisen in Windows.
I'll continue with linux, I already spent on much time and I never (rarely) give up ;-)

Handling is very different between WDS and LNX. For example there are 2 threads in the debugger but on WDS both can access to the GUI and the debuggee memory unlike LNX where one thread handles the GUI and the other waits signal from debuggees and accesses to the memory. Then they exchange messages for exexcuting functions in their perimeter.

Also as I wrote, handling multi-threaded debuggees is tricky and I just begin this part.
Dinosaur
Posts: 1478
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: FB debugger : 2.98.1 32/64 BIT ..... (2021/01/30)

Post by Dinosaur »

Hi SARG

Below the files for a simple CGUI project with very little beautification.
It shows a message for 3 sec's then clears the screen and draws a Quit button.
Also a uSec per scan Text box updated every second.

The code is below, but I will send you a PM with a link to download the libraries etc.
LibAllegro4 may be easier to simply install liballegro4-dev.
LibCgui relies heavily on Allegro library and I will include that and the cgui.bi

Code: Select all

#include once "Project.bi"
Sub Win_Startup
    InitCgui(1024,768,16)               ' set to full screen
    CguiYieldTimeslice (1)              ' Allow slower loop time for faster mouse control.
    MkDialogue(500,38,"Please Wait: Testing & Initialising Environment", 0)
    DisplayWin()
    Sleep 3000	                              'just to show message.
    CloseWin(NULL)
    Main_Window0()
End Sub
Sub MachineProcess cdecl (byval userdata as any ptr)
'========================================================================
'Generate an Event that will be called, so Slaves get attention.
'This routine is called once before ProcessEvents, after that it
'sets an Event in the queue so it gets called every loop.
'========================================================================
    TimeShow
    GenEvent(@MachineProcess, userdata, 0, 0)
End Sub
Sub TimeShow ()
    With Times
        .PassCount  += 1
        .Raw  = Timer
        .mSec = CUInt(.Raw * 1000)
        .Sec  = .mSec / 1000
        '--------Scrn Refresh once every Tick-----------
        If  .mSec > (.OldmSec + 1000) Then                  'if 1 sec has elapsed
            .Increment  = (1000000 / .PassCount)            'uSec / passcount = uSec per program loop
            .OldmSec    = .mSec                             'save the ticks
            .PassCount  = 0                                 'reset Passcount
            Refresh(.WinId)                                 'refresh screen
        EndIf
    End With
End Sub
sub CreateStatusFieldText cdecl (byval userdata as Any ptr, byval buf as zstring ptr)
'========================================================================
'Called with ptr to Times.Loops
'========================================================================
   DIM Loops As Long ptr
   Loops = userdata     'get pointer from userdata
   *buf = Str(*Loops)   'at location buf, make a string from value at location Loops
end sub
Sub Main_window0()
    Button.Quit    = AddButton(500,350, "-Quit-", @Quit, @Button.Quit)
    AddTag(750,680, "uSec/Scan:")
    Times.WinId = AddStatusField(Cgui_Right, 20, @CreateStatusFieldText, @Times.Increment)
    DisplayWin()
    SetFocusOn(Tabs.Win0)
End Sub
Sub Quit Cdecl (Byval userdata As Any Ptr)
    shut_down
End Sub
Sub shut_down ()
    StopProcessEvents()
    DeInitCgui()
    Close
    End
End Sub

    Win_Startup
    MachineProcess(NULL)
    ProcessEvents()
Regards

EDIT:email with link for download sent to your private email.
wallyg
Posts: 267
Joined: May 08, 2009 7:08
Location: Tucson Arizona

Request to make ithe debugger easier for us old guys

Post by wallyg »

As I have gotten older, my hand is not as steady as it used to be. I was wondering if you could make the feature of bringing up an additional window of the contents of a variable or an error message that indicated I selected something, not a variable, as I move my mouse over the right portion of the screen optional. My hand is a little shaky and trying to get the mouse over the tiny squared + in order to expand a level, it moves over some other item on the way there and causes this extra window to appear. So now I have to move the mouse away from where I was going,Than to get rid of the unwanted window in order to try again. And guess what, another unwanted window sometimes pops up.

Could you put an option somewhere to disable this feature?

The second request is to make the font and squared box a larger size. Again an option somewhere to allow me to select a larger font (I know less will be displayed)?

Thanks
Wally
fxm
Moderator
Posts: 12082
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: FB debugger : 2.98.1 32/64 BIT ..... (2021/01/30)

Post by fxm »

@wallyg,
It is not advisable to change the title of a thread, even temporarily to highlight the content of your own post.
Instead, you can bold it as the first line of your post.
wallyg
Posts: 267
Joined: May 08, 2009 7:08
Location: Tucson Arizona

Re: FB debugger : 2.98.1 32/64 BIT ..... (2021/01/30)

Post by wallyg »

Sorry, my mistake.
SARG
Posts: 1756
Joined: May 27, 2005 7:15
Location: FRANCE

Re: FB debugger : 2.98.1 32/64 BIT ..... (2021/01/30)

Post by SARG »

wallyg wrote: Mar 09, 2022 19:07 Sorry, my mistake.
No problem, forgiven :-)

wallyg wrote:Could you put an option somewhere to disable this feature?
If I correctly understand your request :
- click on 'tools' button
- select 'settings'
- uncheck "Shw/exp when hovering" (at the bottom right)
- then click on 'ok'


Your second request is about only this window or also all other ones ?
wallyg
Posts: 267
Joined: May 08, 2009 7:08
Location: Tucson Arizona

Re: FB debugger : 2.98.1 32/64 BIT ..... (2021/01/30)

Post by wallyg »

It does seem to get harder each year to read the smaller print, even with my prescription glasses on. So at least the right value window, but everywhere would be nice. Again an option for those of us that just cannot see as well. The larger the square with the +, the easier it would be to move the mouse and click.

Thanks for everything
Wally
SARG
Posts: 1756
Joined: May 27, 2005 7:15
Location: FRANCE

Re: FB debugger : 2.98.1 32/64 BIT ..... (2021/01/30)

Post by SARG »

You can change the font size of all the prints (source code/treeview) also in Settings : 'Change font' button.
I don't know if it's possible to change the +square size in a simple way (not by a custom drawing).
However double click on a treeview item collapses/expands its childs.

Was my first answer suiting you ?

SARG.
wallyg
Posts: 267
Joined: May 08, 2009 7:08
Location: Tucson Arizona

Re: FB debugger : 2.98.1 32/64 BIT ..... (2021/01/30)

Post by wallyg »

Yes thank you. I will try it tomorrow, need to get current modifications finished in order to test.
wallyg
Posts: 267
Joined: May 08, 2009 7:08
Location: Tucson Arizona

Re: FB debugger : 2.98.1 32/64 BIT ..... (2021/01/30)

Post by wallyg »

When do you think a new non-debugging version of the debugger for Windows will be available. 2.98.1 Is getting a little long in the tooth.

It is very frustrating when my program starts up in the debugger, I have to click 50+ times on a debug error message that only varies in an address reported. (It would be easier if I could copy and paste the error messages to this forum) It starts with "onecore\com\... The service cannot be started, either because it is disabled or because it has no enabled devices associated with it." Am I doing something that is causing this (I am using the latest version of GTK 3.24 from Msys - so maybe it is causing these messages)? Any way to turn off these Debug messages completely, I certainly do not need them and I could turn them back on if you wanted any information from me.

Secondly, after running for a bit, The Proc/Var screen has hundreds(thousands of) entries. It seems that most of the subroutines/functions I call make an entry into this screen when called, but when they terminate, the entry does not get cleared and the list just grows and grows. My routine to detect the mouse movement generates one line for almost every pixel moved so you can understand how big the list gets. Any way to correct this? Trying to find a twig in the rainforest is difficult.

Thanks again for a great piece of software.
Wally
SARG
Posts: 1756
Joined: May 27, 2005 7:15
Location: FRANCE

Re: FB debugger : 2.98.1 32/64 BIT ..... (2021/01/30)

Post by SARG »

wallyg wrote: Jul 17, 2022 20:16 When do you think a new non-debugging version of the debugger for Windows will be available. 2.98.1 Is getting a little long in the tooth.

It is very frustrating when my program starts up in the debugger, I have to click 50+ times on a debug error message that only varies in an address reported. (It would be easier if I could copy and paste the error messages to this forum) It starts with "onecore\com\... The service cannot be started, either because it is disabled or because it has no enabled devices associated with it." Am I doing something that is causing this (I am using the latest version of GTK 3.24 from Msys - so maybe it is causing these messages)? Any way to turn off these Debug messages completely, I certainly do not need them and I could turn them back on if you wanted any information from me.
There is an API allowing devs to send messages that only debuggers can get. I guess it's the case here, messages sent by GTK but not really interesting.
This version, 2.98.2, outputs the messages only if a flag is set so you should not be bothered by them anymore.
https://users.freebasic-portal.de/sarg/fbdebugger.zip (source and 32/64bit exes)

wallyg wrote:Secondly, after running for a bit, The Proc/Var screen has hundreds(thousands of) entries. It seems that most of the subroutines/functions I call make an entry into this screen when called, but when they terminate, the entry does not get cleared and the list just grows and grows. My routine to detect the mouse movement generates one line for almost every pixel moved so you can understand how big the list gets. Any way to correct this? Trying to find a twig in the rainforest is difficult.
Normally when a procedure ends the entry is removed.
Is this behaviour happens always ?
Are you sure not calling the procs without exiting ?
Try a small movement and look at the tab to see if the list is cleaned.

If possible send me a short program to test.

===========================================================
The project V3 Windows/Linux is not dead but I did a long pause after struggling with Multithreaded programs that are not easy to handle on Linux.....
wallyg
Posts: 267
Joined: May 08, 2009 7:08
Location: Tucson Arizona

Re: FB debugger : 2.98.1 32/64 BIT ..... (2021/01/30)

Post by wallyg »

Thank you for your response.

I will download the 2.98.2 version and thank you, 50 clicks often causes my carpel tunnel to act up.

The procedures are returning

Code: Select all

FUNCTION on_StateDrawing_motion_notify_event CDECL ALIAS "on_StateDrawing_motion_notify_event" ( _
  BYVAL widget AS GtkWidget PTR, _
  BYVAL event AS GdkEventMotion PTR, _
  BYVAL user_data AS gpointer) AS gboolean EXPORT

'Print "Drawing Motion Notify event"
RETURN 0 ' your value here!

END FUNCTION
I have not written this code yet and this is directly from GladeToBac

It gets called by GTK when the mouse moves, I never call it but Gtk does. Could that be a problem?

But all of my routines are doing the same thing. By the time I get to the first mouse click, there must be 300 entries. Nothing seems to be cleaned up.

I will try to put together something smaller next week assuming it still happens in 2.98.2. As with any GTK program, there is no simple version.

I can understand, Multithreading is HARD and timing is everything.

Thanks for everything.
Wally
wallyg
Posts: 267
Joined: May 08, 2009 7:08
Location: Tucson Arizona

Re: FB debugger : 2.98.1 32/64 BIT ..... (2021/01/30)

Post by wallyg »

I tried clicking on the link from the forum. I am using Chrome on an up to date Windows machine. I use an up to date Chrome browser.

The download completes then a message "Failed - Virus detected" message comes up in the download subwindow. And nothing in my Download folder.

I then tried in Firefox and it worked without any error messages. I unpacked the zip and it seems to have the specified files.

Just thought you should know?

Wally
wallyg
Posts: 267
Joined: May 08, 2009 7:08
Location: Tucson Arizona

Re: FB debugger : 2.98.1 32/64 BIT ..... (2021/01/30)

Post by wallyg »

After posting the above, I tried to use the 64-bit executable and it did not appear in the directory anymore. It mysteriously disappeared from the directory. I then got a notice from Windows Defender Antivirus that it found a threat. And it quarantined a file, I assume it was your 64-bit executable.

Needless to say, I do not have a 2.98.2 64-bit executable to try. Anyway, my code is built around the 64-bit version of GTK. I do not have a 32-bit version.

Wally
Post Reply