Wanted debugger! Reward 10 Euro!

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by stfighter.

I (and everybody i believe) REALLY need a better debugger.
I had to debug every line what i code, because my lines looking like this one:

If (((sp\y >= punkt1\y) And (sp\y = punkt2\y))) And(((sp\y >= punkt3\y) And (sp\y = punkt4\y)))

and it is so hard and annoying for me to use the DEBUG command to make every variable visible.

global vars are ok, but i need to see all vars.
i think it would be usefull to see the global variables, the local variables, the dims, and the lists in the debug menu (and maybe the content of pointers).

also the debugger should make windowevents, to prevent from crashing.

this feature would be much more usefull than all the 3D support.

if someone can realize this, i will pay 10 Euro to them :wink:

hopefully st.fighter
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Rings.

i would do it for 5 Euro !

Its a long way to the top if you wanna .....CodeGuru
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Num3.

Well you could always clean up your code a bit...

Something like:

If a and b
goto commomprocedure
endif

If c and d
goto commomprocedure
endif

if e and f
goto commomprocedure
endif

It's a lot faster to execute this way too, cause it ignores the false conditions and jumps to the next :)

--
Kind Regards

Rui Carvalho
[DURON 1K - 256Mb - 40Gb - GFORCE MX2 64Mb - W2K PRO]
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Num3.

Sorry I made a mistake in my last reply :cry:

The code should be something like:

IF a = b
If c = d
IF e = f
Do stuff here
ENDIF
ENDIF
ENDIF

--
Kind Regards

Rui Carvalho

Current PB Projects:
[Construdata 2003 - 30%]
[Step by Step - 50%]
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Jondo.

well you can do what i do before that line or after it depends what u want to debug do:

Messagebox_(0,"Break","Debug",0) or something like that, and now check Show Vairables in the Debug Window and you will see everything

Or the 2nd way to do it is like that:

Messagebox_(0,"Var X= "+Str(X)+Chr(13) + Chr(10)+"Var Y= "+Str(Y),"Debug",0)

hope i helped u :)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by stfighter.

thanks to all for this good tips and tricks, but it is still a LOT of work to debug my crazy code. :)

but i will hold my head up and dry out my tears.

mfg stfighter (who never gives up :))
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Franco.
Originally posted by Jondo

well you can do what i do before that line or after it depends what u want to debug do:

Messagebox_(0,"Break","Debug",0) or something like that, and now check Show Vairables in the Debug Window and you will see everything
For this you can use:

CallDebugger

This invokes the "debugger" and freezes the programme immediately.

Have a nice day...

Franco
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.
Originally posted by Num3

Well you could always clean up your code a bit...

Something like:

If a and b
goto commomprocedure
endif

If c and d
goto commomprocedure
endif

if e and f
goto commomprocedure
endif

It's a lot faster to execute this way too, cause it ignores the false conditions and jumps to the next :)
You're wrong, PureBasic is smart enough to skip all the unuseful tests. In the following case, the second test will be never ever done (jump is done when the condition is wrong):

Code: Select all

a = 0
If a>0 and a < 10

EndIf

Fred - AlphaSND
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Num3.

That's kool, didn't know about that.
Usually most compilers don't do that (as you may know).

Thanks for the tip anyaway! :)

--
Kind Regards

Rui Carvalho

Current PB Projects:
[Construdata 2003 - 30%]
[Step by Step - 50%]
Post Reply