debugger on MacOS

BlitzMax Forums/BlitzMax Programming/debugger on MacOS

dooz(Posted 2005) [#1]
I'm using BlitzMax on my Mac (but don't know a great deal about the dev environment) can someone give me a clue about how to get the debugging using in BlitzMax? Obviously I'm using debugstop and compiling with debug on, but it doesn't stop.


SJB(Posted 2005) [#2]
If it is not stopping on the DebugStop, I would assume that it is not getting to that line. Try putting it as the first line in your app and see what happens e.g.

DebugStop()
	
For i = 1 To 1000000
	Print i
Next


Works fine for me.


jht(Posted 2005) [#3]
I just purchased BlitzMax for MacOS and DebugStop is not working for me. I have XCode 1.5 installed.
I entered DebugStop into the mainloop for one of the examples and it exits without entering the Debugger. If I turn off Debug mode, the example runs, so it appears that DebugStop is simply exiting.


Robert(Posted 2005) [#4]
Do you have the most recent version of BlitzMAX installed?


jht(Posted 2005) [#5]
I believe so. I installed it today and it reports version as 1.0 (which is a little odd since the reports versiona as 1.01).
I tried DebugStop in BlitzMAX demo too, and has same problem.

More info:
DebugStop works with a simple example:

'Keep drawing the image until you press Escape
Repeat
'Cls
DebugLog( "Trying to DebugStop" )
DebugStop();
'RuntimeError "Hay stop!"
'HumpingBlob.update
'Flip
Until KeyHit(KEY_ESCAPE)

However, the DebugStop failes in this longer example:


Strict

Const screenx=1280, screeny=1024

Type Blob
Field X,Y,r,g,b
Const size=128, sizehalf=64
Global img:TImage

Function Init()
Local divider:Float
If size=128 Then divider=64 '8x8
If size=256 Then divider=256 '16x16
If size=512 Then divider=1024 '32x32
Local lineardivider:Float
If size=128 Then lineardivider=0.5
If size=256 Then lineardivider=1
If size=512 Then lineardivider=2

'Render the gradient image
For Local r:Float=1 To size-1 Step 0.5
Local level:Float=r
level:*level
level=level/divider
SetColor level,level,level 'For blobby gradient shape
DrawOval r/2,r/2,size-r,size-r
Next

AutoMidHandle True
img=CreateImage(size,size,1,FILTEREDIMAGE)
GrabImage(img,0,0,0)
End Function
End Type



Type HumpingBlob Extends blob
Global List:TList
Field vx#,vy#

Method New()
If List=Null Then List=New TList
List.Addlast(Self)
End Method

Function Update()
For Local b:HumpingBlob=EachIn list
For Local b2:HumpingBlob=EachIn list
If b2<>b And (b2.x<>b.x Or b.x<>b2.x) Then
Local dx#=b2.x-b.x, dy#=b2.y-b.y, d1#=Sqr(dx*dx+dy*dy)
If d1<64 Then
d1=.01*(d1-40)/d1
dx:*d1
dy:*d1
b.vx:+dx
b2.vx:-dx
b.vy:+dy
b2.vy:-dy
EndIf
EndIf
Next
b.x:+b.vx
b.y:+b.vy
'If b.x<20 Or b.x>780 Or b.y<20 Or b.y>580 Then
If b.x<20 Or b.x>screenx Or b.y<20 Or b.y>screeny Then

b.y=Rand(30,screeny) ' 570)
b.x=Rand(30,screenx) ' 770)
b.vx=Rnd(-1,1)
b.vy=Rnd(-1,1)
EndIf
b.vx=b.vx*.99'+Rnd(-.5,.5)
b.vy=b.vy*.99'+Rnd(-.5,.5)
SetColor b.r,b.g,b.b
DrawImage img,b.x,b.y
Next
End Function
End Type

'Graphics 800,600
Graphics screenx, screeny, 32
blob.init
Cls

SeedRnd MilliSecs()

'Set the drawing mode
SetBlend LIGHTBLEND

For Local i=0 To 100
Local g:HumpingBlob=New HumpingBlob
g.x=Rand(10,screenx)
g.y=Rand(10,screeny)
g.vx=Rnd(-1,1)
g.vy=Rnd(-1,1)
g.r=Rand(128,255)
g.g=Rand(128,255)
g.b=Rand(128,255)
Next

'Keep drawing the image until you press Escape
Repeat
Cls
DebugLog( "Trying to DebugStop" )
DebugStop();
'RuntimeError "Hay stop!"
HumpingBlob.update
Flip
Until KeyHit(KEY_ESCAPE)


klepto2(Posted 2005) [#6]
The current Version is not 1.0 or 1.01 . it is 1.06 and as i remember in the earlier versions there are problems using the debugger.
Maybe you should take a look to the update section and download the latest Core update. Then it should work.


jht(Posted 2005) [#7]
Thanks.
Got 1.06 update. DebugStop now works correctly.