About Monkey 2 › Forums › Monkey 2 Development › Clear errors and debugging
Tagged: debugger
This topic contains 12 replies, has 2 voices, and was last updated by 
 Mark Sibly
 2 years, 7 months ago.
- 
		AuthorPosts
 - 
		
			
				
September 9, 2016 at 9:41 pm #3830
I’m enjoying M2 a lot, but one thing I miss from M1 is the clear message when an error occurs in debug mode. It used to look like this, with each line that led to the error clearly shown.
Monkey1234567Monkey Runtime Error : TypeError: null is not an object (evaluating 'this.m_player.p_Update')/Applications/Leo/Blitz/Monkey/modules/gameoven/entity.monkey<102>/Applications/Leo/Blitz/Monkey/modules/gameoven/entity.monkey<204>/Applications/Leo/Blitz/Monkey/modules/gameoven/layer.monkey<80>/Applications/Leo/Blitz/Monkey/modules/gameoven/scene.monkey<90>/Applications/Leo/Blitz/Monkey/modules/gameoven/gameoven.monkey<60>/Applications/Leo/Blitz/Monkey/modules/mojo/app.monkey<89>Now a similar problem (accessing a null object) looks like this, which is basically unreadable for me:
Monkey12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970Memory access violation{{!DEBUG!}}>Check:std.collections.Stack<timelinefx.collision.tlCollisionResult>(other:timelinefx.collision.tlBox);/Users/Leo/GoogleDrive/Code/Monkey2/modules/gameoven/examples/../src/collider.monkey2;81;3802366Self:default.Collider=@0x0other:timelinefx.collision.tlBox=@0x7ff1db592148results:std.collections.Stack<timelinefx.collision.tlCollisionResult>=@0x7ff1dca51060>Check:std.collections.Stack<timelinefx.collision.tlCollisionResult>(other:timelinefx.collision.tlBox);/Users/Leo/GoogleDrive/Code/Monkey2/modules/gameoven/examples/../src/collider.monkey2;86;3802279Self:default.Collider=@0x7ff1dca46a40other:timelinefx.collision.tlBox=@0x7ff1db592148results:std.collections.Stack<timelinefx.collision.tlCollisionResult>=@0x7ff1dca510200:std.collections.Stack<default.CoreEntity>.Iterator=@0x7fff4fdb3fd0:0x10fe7eaa0child:default.CoreEntity=@0x7ff1dca46bf0c:default.Entity=@0x7ff1dca46bf0>Check:std.collections.Stack<timelinefx.collision.tlCollisionResult>(other:timelinefx.collision.tlBox);/Users/Leo/GoogleDrive/Code/Monkey2/modules/gameoven/examples/../src/collider.monkey2;86;3802052Self:default.Collider=@0x7ff1dca46180other:timelinefx.collision.tlBox=@0x7ff1db592148results:std.collections.Stack<timelinefx.collision.tlCollisionResult>=@0x7ff1dca50fe00:std.collections.Stack<default.CoreEntity>.Iterator=@0x7fff4fdb43e0:0x10fe7eaa0child:default.CoreEntity=@0x7ff1dca46480c:default.Entity=@0x7ff1dca46480>Update:Void();/Users/Leo/GoogleDrive/Code/Monkey2/modules/gameoven/examples/../src/collider.monkey2;45;3770435Self:default.Collider=@0x7ff1dca46a40hasCollided:Bool=False0:Int=01:Int=1l:default.Layer=@0x7ff1db81acf82:std.collections.Stack<default.Entity>.Iterator=@0x7fff4fdb4920:0x10fe8ca00otherEntity:default.Entity=@0x7ff1dca45af8>Update:Void();/Users/Leo/GoogleDrive/Code/Monkey2/modules/gameoven/examples/../src/collider.monkey2;71;3738790Self:default.Collider=@0x7ff1dca461804:std.collections.Stack<default.CoreEntity>.Iterator=@0x7fff4fdb4b90:0x10fe7eaa0c:default.CoreEntity=@0x7ff1dca46480child:default.Entity=@0x7ff1dca46480>UpdateCollisions:Void();/Users/Leo/GoogleDrive/Code/Monkey2/modules/gameoven/examples/../src/layer.monkey2;48;3736773Self:default.Layer=@0x7ff1db81acf80:std.collections.Stack<default.Entity>.Iterator=@0x7fff4fdb4ee0:0x10fe8ca00ent:default.Entity=@0x7ff1dca45af8>UpdateCollisions:Void();/Users/Leo/GoogleDrive/Code/Monkey2/modules/gameoven/examples/../src/scene.monkey2;58;3736756Self:default.Scene=@0x7ff1db818c180:std.collections.Stack<default.Layer>.Iterator=@0x7fff4fdb4fd0:0x10fe77af0>SendUpdateEvent:Void();/Users/Leo/GoogleDrive/Code/Monkey2/modules/gameoven/examples/../gameoven.monkey2;72;3630869Self:default.Game=@0x7ff1db564f68>OnRender:Void(windowCanvas:mojo.graphics.Canvas);/Users/Leo/GoogleDrive/Code/Monkey2/modules/gameoven/examples/../../renderwindow/renderwindow.monkey2;175;3630608Self:default.RenderWindow=@0x7ff1db564f68windowCanvas:mojo.graphics.Canvas=@0x7ff1db6ae678>Render:Void(canvas:mojo.graphics.Canvas);/Applications/Leo/Blitz/monkey2/modules/mojo/app/view.monkey2;738;3629853Self:mojo.app.View=@0x7ff1db564f68canvas:mojo.graphics.Canvas=@0x7ff1db6ae678>RenderWindow:Void();/Applications/Leo/Blitz/monkey2/modules/mojo/app/window.monkey2;350;3629070Self:mojo.app.Window=@0x7ff1db564f68bounds:std.geom.Rect<Int>=@0x7fff4fdb56a8:0x11011b610>UpdateWindow:Void(render:Bool);/Applications/Leo/Blitz/monkey2/modules/mojo/app/window.monkey2;129;3628927Self:mojo.app.Window=@0x7ff1db564f68render:Bool=True>UpdateWindows:Void();/Applications/Leo/Blitz/monkey2/modules/mojo/app/app.monkey2;477;3628916Self:mojo.app.AppInstance=@0x7ff1db415228render:Bool=True0:mojo.app.Window[]=@0x7ff1dca472c81:Int=02:Int=1window:mojo.app.Window=@0x7ff1db564f68>MainLoop:Void();/Applications/Leo/Blitz/monkey2/modules/mojo/app/app.monkey2;445;3628841Self:mojo.app.AppInstance=@0x7ff1db415228>Run:Void();/Applications/Leo/Blitz/monkey2/modules/mojo/app/app.monkey2;525;3332196Self:mojo.app.AppInstance=@0x7ff1db415228>Main:Void();/Users/Leo/GoogleDrive/Code/Monkey2/modules/gameoven/examples/test.monkey2;11;131Build error: System command '"/Users/Leo/GoogleDrive/Code/Monkey2/modules/gameoven/examples/test.buildv1.0.5/macos_debug/test.app/Contents/MacOS/test"' failed."/Users/Leo/GoogleDrive/Code/Monkey2/modules/gameoven/examples/test.buildv1.0.5/macos_debug/test.app/Contents/MacOS/test"***** Fatal mx2cc error *****Internal mx2cc build errorAre better error messages something on the roadmap?
On the same topic, I see that Ted2 has a debugger, but I’m a total newbie and have never used a debugger before. I see that you can “step” through the running code, but that goes through absolutely everything, including standard modules. Is there a way to filter things? And how do I set a debug breakpoint, watch variables, etc (all the things Google tells me are important in a debugger!). Couldn’t find any info in the docs.
Cheers!
September 9, 2016 at 10:26 pm #3831The mangled output is what Ted2 uses to produce the debugview, so I’m guessing you’re not using Ted2?
I can clean this up, but I need a way for apps to tell if they’re running in Ted2 or not.
The debugger itself is pretty primitive right now, generally only useful for ‘post mortem’ debugging (which is all I’ve ever used debuggers for anyway). More features will come, but some will likely have to wait until reflection and other features are added.
September 10, 2016 at 1:48 am #3833Yup, I’ve been using Mollusk as the ide.
I haven’t had a lot of luck with Ted2 in OS X. If I run the Monkey2 (Macos) file under the main folder I can’t even open a file. Running ted2_macos under bin gets me a little further, but not much. I can open files, but they don’t show until I close Ted and reopen it.
I’m checking the same error now with Ted2 debugger running, pretty cool!
Thanks!September 10, 2016 at 1:55 am #3834What versions of macos/monkey2 are you using?
September 10, 2016 at 2:09 am #3836Monkey2 1.0.5, OS X El Capitan 10.11.6. But I’ve been having this issue for quite a while with previous versions.
I wasn’t sure what the state of Ted was in for OS X yet, so I never filed a bug.
September 10, 2016 at 2:12 am #3837Opening a file from the “Files” side panel works fine, it’s just when I use the file open dialogue that the file refuses to show until I restart Ted2.
Even doing “open project” doesn’t work until Ted is restarted.
September 10, 2016 at 2:51 am #3838Weird, using exactly the same setup and it doesn’t happen here.
I did find one minor thing but it’s very unlikely to be the problem – have committed the fix anway, you’ll need to rebuild ted2.
Also, it does take quite a while to open the first time – but that’s true of pretty much everything on my Mac until it ‘warms up’.
Does it never show at all? Never close? What are the symptoms exactly?
September 10, 2016 at 3:16 am #3839It never shows up, and I get weird visual glitches (hovering the mouse over menus causes them to flicker) until I restart Ted. Again, using the side Files panel works fine, this only happens using “File/Open”
Here’s a video of what happens:
https://dl.dropboxusercontent.com/u/446189/monkey/tedFileOpenBug.mov
September 10, 2016 at 3:30 am #3840What’s that funky mouse circle thing – is it an addon? Can you disable it?
September 10, 2016 at 3:38 am #3842That’s just an option in the Quicktime screen recording! It shows you exactly when I click the mouse button.
I don’t have it normally, and Ted still behaves the same.
I also tried turning off OS X “dark” theme, no effect.September 10, 2016 at 3:44 am #3843Holy crap, can reproduce it!
I usually have my file browser in ‘column view’, but if I change to ‘grid view’ (ie: like yours) I get the same problem!
I can fix it by changing back to column view (or list view) after which it happens again but is fixed the next time I start Ted2.
Will look into this – very strange though!
September 10, 2016 at 9:51 pm #3854Yay, thanks! Switching to column view fixes the glitch here as well.
Getting M2 to spit out human readable info for other ide’s would be great. I imagine a quick stop gap solution would be a command line option that an ide could use (instead of trying to detect whether Ted2 is in use or not) to force human readable output, at the cost of losing debug data.
Cheers!
September 10, 2016 at 11:22 pm #3855You should be fixed on github too.
 - 
		AuthorPosts
 
You must be logged in to reply to this topic.