Can't see Type's Globals when debugging

BlitzMax Forums/BlitzMax Programming/Can't see Type's Globals when debugging

Hi, I have a type which has some global variables and some normal fields. When using debug mode if I look at the instance of a current type, its Globals are not shown. Nor can I find them anywhere else.

Is this just a limitation of the debugger? (I'm still on V1.28)

Can you post an example showing the problem?

You might just want to update to v1.30, I hear it has a better debugger (it could just be MaxIDE).

I heard the debugger had fixes, don't know if it has improvements like this.

Well say I have a type like this:

Type Tfoo
  Global abc%

  Field xyz%
End Type

foo: Tfoo = new TFoo

Debugstop


If I run that code, when the code stops I can click on the Debug tab in the IDE and under the application name I can see Local foo which I can expand and see Field xyz:Int=0 but I cannot see the global stored under the Tfoo Type. This would be handy!

I'm seeing this too, it's the same in 1.30 as well:

http://www.blitzbasic.com/Community/posts.php?topic=75829

Ahh, I see what your saying.

In BlitzMax 1.30, this:
SuperStrict

Framework brl.standardio
Import brl.linkedlist
Import brl.reflection

Type TDummy
 Global _list:TList = New(TList)
 
	Field v1:Int { prop_integer }
	Field v2:String { prop_string }
	
		Method New()
		   _list.AddLast(Self)
		   
		End Method
		
		Method Setv1(Value:Int)
			
			v1 = Value
			
		End Method
		
		Method Setv2(Value:String)
			
			v2 = Value
			
		End Method
		
		
		Function Create:TDummy(v1:Int, v2:String)
		  Local dummy:TDummy = New(TDummy)
			
			dummy.Setv1(v1)
			
			dummy.Setv2(v2)
			
		   Return dummy
		   
		End Function
		
End Type

Global Glo_Dummy:TDummy = tdummy.Create(10, "First Dummy")

Local tid:TTypeId = TTypeId.ForObject(Glo_Dummy)

	For Local fld:TField = EachIn tid.Fields()
		
		Print "Field: " + fld.Name() + "{" + fld.MetaData() + "}"
		
	Next
	
DebugStop
Does not show information on the type itself.



Yep - this is a known issue and was something to do with the way Type Globals are handled in the GC. Iirc, aren't tracked internally, and so the debugger isn't aware of them.

So I guess I just have to conclude with "Bummer". If the debugger can't see them, then I guess none of the other IDEs will see them either.

You could just use them as normal globals.