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

User projects written in or related to FreeBASIC.
Post Reply
sancho3
Posts: 358
Joined: Sep 30, 2017 3:22

Re: FB debugger : 2.91 32/64 BIT ..... (Aug 20th, 2016)

Post by sancho3 »

Sorry Sarg, I actually had the break condition set wrong. The break var does work for "run to cursor" and the others.
The only one I found that ignores it is "auto step".
The default condition is break when value not equal. This is going to be a rarely used setting.
Most of the time the user is going to want to break when value equal. Could that not be the default?

There is a couple of other minor things that I see:

The default for the right hand pane is for the tree to be collapsed. So if you are stepping through your code and mouse over and unfold the tree, that pane now has the focus. Automatically I hit the 'S" key to step through the code but the keypress is now sent to the wrong pane. I have to mouse back over to the left pane and click somewhere there to start stepping. Could the default be for the tree to be unfolded to the scope of where the cursor is in the code pane?

The code text is too close to the left margin. There should be some space there similar to what most editors have.

Again, thanks.
SARG
Posts: 1755
Joined: May 27, 2005 7:15
Location: FRANCE

Re: FB debugger : 2.91 32/64 BIT ..... (Aug 20th, 2016)

Post by SARG »

sancho3 wrote:Sorry Sarg, I actually had the break condition set wrong. The break var does work for "run to cursor" and the others.
No problem I prefer that :-)
I have changed the text in the 'break on var ' box to avoid confusion.
sancho3 wrote:The only one I found that ignores it is "auto step".
Yes it's intended, the condition is not checked when "auto stepping".
sancho3 wrote:The default condition is break when value not equal. This is going to be a rarely used setting.
Most of the time the user is going to want to break when value equal. Could that not be the default?
I previously selected not equal because the current value is used by default for comparison.
Done. (see link below Beta 2.92, only source code, buttons and 32bit exe)
sancho3 wrote:There is a couple of other minor things that I see:

The default for the right hand pane is for the tree to be collapsed. So if you are stepping through your code and mouse over and unfold the tree, that pane now has the focus. Automatically I hit the 'S" key to step through the code but the keypress is now sent to the wrong pane. I have to mouse back over to the left pane and click somewhere there to start stepping. Could the default be for the tree to be unfolded to the scope of where the cursor is in the code pane?
Now when the mouse goes back to the source code panel the focus is set on this window.
sancho3 wrote:The code text is too close to the left margin. There should be some space there similar to what most editors have.

The left marging is now 10 pixels. Is it enough ?
I found a commented line doing that so it was easy.
sancho3 wrote:Again, thanks.
You are welcome. Any other improvement ?

Also added break on var for longint and ulongint.

Beta 2.92

edit : Forgot to say
added a message box when a break on var is met to better visibility and allowing to keep or remove it.
sancho3
Posts: 358
Joined: Sep 30, 2017 3:22

Re: FB debugger : 2.91 32/64 BIT ..... (Aug 20th, 2016)

Post by sancho3 »

Hey Sarg:
I found an anomaly in the following code.
Edit: No anomaly, my mistake. I left the code here for the curious.

Code: Select all

Type test 
	As Any Ptr img1
	As Any Ptr img2
	Declare Destructor()
End Type

Destructor test()
	Dim As UByte x = Peek(img2)	' x = 7
	If this.img1 <> 0 AndAlso Peek(img1) <> 0 Then 
		Cast(Integer Ptr, img1)[0] = 0
		x = Peek(img2)		' x = 0
		ImageDestroy(img1)
		x = Peek(img2)		' x = 238
		img1 = 0
	EndIf
	If this.img2 <> 0 AndAlso Peek(img2) <> 0 Then 
		Cast(Integer Ptr, img2)[0] = 0	 
		ImageDestroy(img2)
		img2 = 0
	EndIf 
End Destructor

ScreenRes 800,600
Dim As test t 
t.img1 = ImageCreate(110,110)
t.img2 = t.img1 

Last edited by sancho3 on Jun 03, 2018 18:34, edited 1 time in total.
fxm
Moderator
Posts: 12081
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: FB debugger : 2.91 32/64 BIT ..... (Aug 20th, 2016)

Post by fxm »

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

Re: FB debugger : 2.92 32/64 BIT ..... (June 6th, 2018)

Post by SARG »

Hi all,

It's been a long time since I had to make a new version, however not a lot of new features, see first post. Version 2.92.

http://users.freebasic-portal.de/sarg/fbdebugger292.zip
ITomi
Posts: 154
Joined: Jul 31, 2015 11:23
Location: Hungary

Re: FB debugger : 2.92 32/64 BIT ..... (June 6th, 2018)

Post by ITomi »

Hello SARG!

You wrote earlier in the topic about my RTS game, because it is bigger than 500 KBytes and I couldn't open in FB debugger:
"increase MAXSRCSIZE (at the beginning of fbdebugger) like that #Define MAXSRCSIZE xxxxxxxx 'max source size
a larger value can collide with the stack limit unless changing it with the option -t < value > Set stack size in kbytes (default: 1M)
"
But where is the beginning of FBdebugger? I tried to type this in command line: fbdebugger -t 1024 to set the limit to 1024 KBytes, but only the program started. Has FBdebugger command line options? Or how can I set MAXSRCSIZE bigger?
SARG
Posts: 1755
Joined: May 27, 2005 7:15
Location: FRANCE

Re: FB debugger : 2.92 32/64 BIT ..... (June 6th, 2018)

Post by SARG »

Hi ITomi,

Sorry not be clear, that's my fault to consider everyone has the same skills..... :-)

- The define is at the beginnig of source code, line 31 : #Define MAXSRCSIZE 500000. Changing by 700000 should be ok.

- The -t parameter is for compiling fbdebugger : fbc -s gui -t 2048 "FBdebugger.bas" "FBdebugger.rc"
It forces the compiler to increase the size of the stack (default 1024KB). With this value there is enough space for the buffer.


Anyway I have prepared a such version ready to use, see below (exe and bas)
I tested with your program without any loading problem.

SARG

http://users.freebasic-portal.de/sarg/FBdebugger.exe
http://users.freebasic-portal.de/sarg/FBdebugger.bas
ITomi
Posts: 154
Joined: Jul 31, 2015 11:23
Location: Hungary

Re: FB debugger : 2.92 32/64 BIT ..... (June 6th, 2018)

Post by ITomi »

Thanks, SARG!
I have download your prepared .exe version and it works with my little "big" game.
Interesting, but when I use FBide (v. 0.4.6), the Win10 often throws me out, but with other IDEs (e.g. Poseidon) the game runs correctly.
jmg
Posts: 89
Joined: Mar 11, 2009 3:42

Re: FB debugger : 2.92 32/64 BIT ..... (June 6th, 2018)

Post by jmg »

It's been a while since I tried FBdebugger but 2.92 seems to not quite work ? (win10.64b os)

I compile in 64 bit mode the test example given in the FBdebugger PDF file....
C:\FreeBASIC\COM_tests>"C:\FreeBASIC\FreeBASIC-1.05.0-win64\fbc.exe" -g -v JTest.bas
FreeBASIC Compiler - Version 1.05.0 (01-31-2016), built for win64 (64bit)
Copyright (C) 2004-2016 The FreeBASIC development team.
standalone
target: win64, x86-64, 64bit

and launch
"C:\FreeBASIC\fbdebugger292\fbdbg 64\fbdebugger.exe"
then load then load JTest.exe - it says Debugging (64 bit) JTest.exe
- and it gives error messages - EXCEPTION trying to write FFFFFFFFFFFF9
- click No to that, and it partly updates the right side pane, click No again, and it shows the 3 vars, with zero values but I get two copies
ThID=11100 main:long
main:Long
Then it says debug session done, and click that and the buttons all go grey.
If I edit the value, only the ThID one changes correctly.
ie That's not quite the same as the PDF example...

Other test files cough line number errors, but it seems to be almost trying to work... ?
It seems to find valid looking symbol names/types ?


Addit:
I tried the alternative of
"C:\FreeBASIC\FreeBASIC_1.05.0_Win32\fbc.exe" -g -v JTest.bas
"C:\FreeBASIC\fbdebugger292\fbdbg 32\fbdebugger.exe"
and that seems to all work, 'as expected', - gives a single copy in right pane, and step works fine. No error messages.

So, it seems limited to 64b versions of Debug and Compiler ?
SARG
Posts: 1755
Joined: May 27, 2005 7:15
Location: FRANCE

Re: FB debugger : 2.93 32/64 BIT ..... (Sept 5th, 2018)

Post by SARG »

Hi jmg,

Thanks for reporting this issue. It's fixed.

I take advantage of the fix for releasing a more important update. See first post.

http://users.freebasic-portal.de/sarg/FBdebugger293.zip
jmg
Posts: 89
Joined: Mar 11, 2009 3:42

Re: FB debugger : 2.93 32/64 BIT ..... (Sept 5th, 2018)

Post by jmg »

Cool - I'll test that.
Minor issue - that link in your reply above works ok, but the page 1 link says no file
page1: http://users.freebasic-portal.de/sarg/fbdebugger293.zip
- perhaps case sensitive ?
SARG
Posts: 1755
Joined: May 27, 2005 7:15
Location: FRANCE

Re: FB debugger : 2.93 32/64 BIT ..... (Sept 5th, 2018)

Post by SARG »

jmg wrote:Minor issue - that link in your reply above works ok, but the page 1 link says no file
page1: http://users.freebasic-portal.de/sarg/fbdebugger293.zip
- perhaps case sensitive ?
My bad, copy and paste..... Fixed. Thanks

By way the debugger 64bit version is not safe (same 32bit with gcc) : simple program no problem but debugging more complex ones could
give wrong results. This is due to the translation to C.
Luis Babboni
Posts: 375
Joined: Mar 15, 2015 12:41

Re: FB debugger : 2.93 32/64 BIT ..... (Sept 5th, 2018)

Post by Luis Babboni »

If I make a program that use ULongInt variables, I need the 64 bit Debugger to debug it or I have another way to debug it?
SARG
Posts: 1755
Joined: May 27, 2005 7:15
Location: FRANCE

Re: FB debugger : 2.93 32/64 BIT ..... (Sept 5th, 2018)

Post by SARG »

Hi Luis,
Luis Babboni wrote:If I make a program that use ULongInt variables, I need the 64 bit Debugger to debug it or I have another way to debug it?
No problem with ulongint when using 32bit debugger. The 32bit version is used to debug 32bit compiled exes and the 64bit one for 64bit compiled exes.
In both cases 64bit variables (longint/ulongint) are handled.

However as the 64bit debugging (not the debugger itself) is not completly safe you can try to debug with the 64bit version and in case of problem use the 32bit one. But be carefull with variables defined as integer (32 <> 64).....
Luis Babboni
Posts: 375
Joined: Mar 15, 2015 12:41

Re: FB debugger : 2.93 32/64 BIT ..... (Sept 5th, 2018)

Post by Luis Babboni »

SARG wrote:Hi Luis,
Luis Babboni wrote:If I make a program that use ULongInt variables, I need the 64 bit Debugger to debug it or I have another way to debug it?
No problem with ulongint when using 32bit debugger. The 32bit version is used to debug 32bit compiled exes and the 64bit one for 64bit compiled exes.
In both cases 64bit variables (longint/ulongint) are handled.

However as the 64bit debugging (not the debugger itself) is not completly safe you can try to debug with the 64bit version and in case of problem use the 32bit one. But be carefull with variables defined as integer (32 <> 64).....
Thanks!
Post Reply