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

User projects written in or related to FreeBASIC.
Post Reply
SARG
Posts: 1766
Joined: May 27, 2005 7:15
Location: FRANCE

Re: FB debugger : 2.58 (2 FEB 2012) TOC in HELP FILE

Post by SARG »

Hi All,

For now a beta version.
The watched vars are kept as the breakpoints, only in case of rerun.
And the best of the best : the watchs for local break points vars and parameters (inside sub/func) are also kept between every call. Obviously nothing can be done with them (no alert at this moment) when there are in this state, except deleting.

http://jafile.com/uploads/sarg/fbdebugg ... ETA_01.bas

To come : session to reuse (watch and breakpoint), fix of the issue with wndproc (previous post).
jmg
Posts: 89
Joined: Mar 11, 2009 3:42

Re: FB debugger : 2.59 BETA 01 (25 FEB 2012) keep watched va

Post by jmg »

For now a beta version.
The watched vars are kept as the breakpoints, only in case of rerun.
And the best of the best : the watchs for local break points vars and parameters (inside sub/func) are also kept between every call. Obviously nothing can be done with them (no alert at this moment) when there are in this state, except deleting.
I'm not sure I followed this ?
Is there a special step needed to keep these on next-reload, or is that not what you are saying ?

What I found:
Local var works nicely if you step in/out - cool ... but I think break, and re-attach exe seem to loose correlation, and a new local watch is needed (delete the old ones on list showing invalid )
SARG
Posts: 1766
Joined: May 27, 2005 7:15
Location: FRANCE

Re: FB debugger : 2.59 BETA 01 (25 FEB 2012) keep watched va

Post by SARG »

@jmg

For now you can't debug then modify, compil and reexecute keeping all the previous breakpoints and watchs. In fact, only if you immediatly use the restart button it works.
but I think break, and re-attach exe seem to loose correlation, and a new local watch is needed (delete the old ones on list showing invalid )
Sry, I guess that I don't understand what you exactly request. Perhaps in a next release with the 'session' feature ;-)
Also I didn't test the result with the attaching running process option.

Try this code. Put in watch test1, ubt and ush (when they exist). You should see 'var name'<var type LOCAL NON-EXISTENT> when executed lines are outside a sub and the right values inside.

Code: Select all

Sub foo1(test1 As integer)
Dim As UByte ubt=12
Print test1;ubt
ubt=15
Print ubt
End Sub

Sub foo2(test1 As Single)
Dim As Short ush=99
Print ush
End Sub


foo1(25)
foo1(37)
foo2(50)
foo2(99)
foo1(28)
jmg
Posts: 89
Joined: Mar 11, 2009 3:42

Re: FB debugger : 2.59 BETA 01 (25 FEB 2012) keep watched va

Post by jmg »

In fact, only if you immediatly use the restart button it works.
Ah, I was miss understanding what restart meant.... ever the optimist ;)
Try this code. Put in watch test1, ubt and ush (when they exist). You should see 'var name'<var type LOCAL NON-EXISTENT> when executed lines are outside a sub and the right values inside.
That also has the problem I mentioned.
It works fine, provided you step.
To duplicate Set up the Local Var as watch, and confirm Step is OK, now set a bkpt on a SUB line like
Print test1;ubt
and Run - when it hits that breakpoint, it does not 'see' ubt
- so it seems to depend on how you get to that Sub..



Minor comment : I see Run [R] is missing from the right click prompt menu
VANYA
Posts: 1837
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FB debugger : 2.59 BETA 01 (25 FEB 2012) keep watched va

Post by VANYA »

Hi SARG!

IT seems now works correctly under windows 7.
SARG
Posts: 1766
Joined: May 27, 2005 7:15
Location: FRANCE

Re: FB debugger : 2.59 BETA 01 (25 FEB 2012) keep watched va

Post by SARG »

Ok, jmg you're right. Thanks for testing.
As always I wanted to save some nanoseconds and the optimization worked badly. Just delete a test and all works ok.

The [R] option is added in the context menu. That was so easy LOL.

http://jafile.com/uploads/sarg/fbdebugg ... ETA_02.bas
SARG wrote:In fact, only if you immediatly use the restart button it works.
That's not really true : it's possible to do some mods and recompile then restart. But if there are changes in the order of variables or some added variables in the sub/func where you set watchs, the current way for watchs doesn't work.
To explain : the offset in the stack (local vars) is saved and reapplied when the sub is executed again. So if the real offset has been changed nothing will be correct.
SARG
Posts: 1766
Joined: May 27, 2005 7:15
Location: FRANCE

Re: FB debugger : 2.59 BETA 03 (11 APR 2012) keep watched bi

Post by SARG »

In this version (2.59 BETA 03) the watched are also kept when you close FBdebugger. Two exceptions : arrays and memories watched that are removed.
When loading the debuggee a check is done to verify if every watched is still matching a running variable with these criteria : proc, name, array and pointer.

http://jafile.com/uploads/sarg/fbdebugg ... eta_03.bas

Thanks for testing. I'll upload soon a full version with the updated manual.
VANYA
Posts: 1837
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FB debugger : 2.59 BETA 03 (11 APR 2012) keep watched bi

Post by VANYA »

HI SARG!

Not compiles files with Russian names.

Although if you run the compiler directly everything is fine:
fbc "Привет.bas" <- That's right
SARG
Posts: 1766
Joined: May 27, 2005 7:15
Location: FRANCE

Re: FB debugger : 2.59 BETA 03 (11 APR 2012) keep watched bi

Post by SARG »

Hi VANYA,

What messages do you get ?
The command to compile is in fbdebug.bat.
All the resulting messages are in fbdebug_compil.log.
These 2 files are in the fbdebugger directory. Eventually post them.

In source code see the 'prep_debug' function.
Roland Chastain
Posts: 1004
Joined: Nov 24, 2011 19:49
Location: France
Contact:

Re: FB debugger : 2.59 BETA 03 (11 APR 2012) keep watched bi

Post by Roland Chastain »

Hello !

This seems to be a very useful program but unfortunately after ten minutes I was unable to obtain anything else than various error messages. Could you give a short explanation of the way to use it ?

Roland
VANYA
Posts: 1837
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FB debugger : 2.59 BETA 03 (11 APR 2012) keep watched bi

Post by VANYA »

SARG wrote:Hi VANYA,

What messages do you get ?
The command to compile is in fbdebug.bat.
All the resulting messages are in fbdebug_compil.log.
These 2 files are in the fbdebugger directory. Eventually post them.

In source code see the 'prep_debug' function.
C:\тчЁvт.bas() error 24: File not found, C:\тчЁvт.bas
тчЁvт <- Scribble in the file name. It must be: Взрыв
VANYA
Posts: 1837
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FB debugger : 2.59 BETA 03 (11 APR 2012) keep watched bi

Post by VANYA »

And if you use the SHELL, it all works:

shell ("fbc.exe " & " C:\Взрыв.bas" & " -w 1 -g >" & "fbdebug_compil.log")

Added last:

That is if we write the function so that everything compiles and do not have BAT file:

Code: Select all

function prep_debug(fname As string) As Integer
dim as integer fileout
'start compil
if fbcexe<>"" Then
    Shell(""+fbcexe+" """+fname+""" -w 1 -g "+cmdlfbc+" >"""+ExePath+"\fbdebug_compil.log")
    exename=Mid(fname,1,Len(fname)-3) & "exe"
    if dir(exename)="" Then
        if helpbx then destroywindow(helpbx)
        helptyp=3
        fb_dialog(@help_box,"Exe not created : Compilation log",windmain,2,2,400,250)
        return 0
    else
        'fb_message("Compile ok","start debugging...")
        return 1
    end if
else
    fb_message("Compile error","[FBC]=<path><fbc.exe> not in fbdebugger.ini")
    return 0
end if
end function
SARG
Posts: 1766
Joined: May 27, 2005 7:15
Location: FRANCE

Re: FB debugger : 2.59 BETA 03 (11 APR 2012) keep watched bi

Post by SARG »

@VANYA
You have fixed yourself this issue. Fine.
The 'master version' will be changed with your mod. Thanks.
Please do some tests with watched ;-)

@Roland
For now at work, not possible to do a lot.
Have you compiled the beta version or the 2.58 version with all the needed files or used directly the provided exe (see first page of the post) ?

Read the txt and chm files. Don't forget to add the 'fbdebugger.rc'.

In the case you have fbdebugger fully operational (with icons, ...) just compile a small piece of code with the -g option (compulsary). Open fbdebugger, drap and drop the exe. That's all.

If you still have problems, I'll give more help later.
VANYA
Posts: 1837
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FB debugger : 2.59 BETA 03 (11 APR 2012) keep watched bi

Post by VANYA »

I do not understand ...

If the path to the compiler with no spaces, then the function is working properly. If the path contains a space, then a compilation error.

I tried to enter the path in quotes does not work. SARG, please take a look, maybe it just me?

From among the FBEDIT compiles all right (it uses ShellExecute)
Last edited by VANYA on Apr 11, 2012 16:47, edited 1 time in total.
Roland Chastain
Posts: 1004
Joined: Nov 24, 2011 19:49
Location: France
Contact:

Re: FB debugger : 2.59 BETA 03 (11 APR 2012) keep watched bi

Post by Roland Chastain »

SARG wrote:@Roland
For now at work, not possible to do a lot.
Have you compiled the beta version or the 2.58 version with all the needed files or used directly the provided exe (see first page of the post) ?

Read the txt and chm files. Don't forget to add the 'fbdebugger.rc'.

In the case you have fbdebugger fully operational (with icons, ...) just compile a small piece of code with the -g option (compulsary). Open fbdebugger, drap and drop the exe. That's all.

If you still have problems, I'll give more help later.
Thanks for your answer. I've downloaded the version 2.59 BETA 03. I didn't know there was another one. I will have a look at it. The explanations you gave to me should be enough.

Roland
Post Reply