Corona CIDER Advanced Debugger with IDE - v 1.5.1- Update

@M.Y: Thanks for the explanations. I will use Profiler mode 4 then. I still have the following questions when you get the time (no show stopper)

1- How to collapse code lines

2- How to use Cider with Dropbox. To test Cider I had to download my app (folder) from Dropbox to my desktop (PC) since I could not figured a way to open a project from Dropbox.

In any event, this is was lacking in Corona (as with the Profiler) and thank you for coming up with a great solution!

Mo [import]uid: 49236 topic_id: 23072 reply_id: 93420[/import]

hi carlos
can you help me ?
this is a big question
http://developer.anscamobile.com/forum/2012/03/15/how-make-effect-islash [import]uid: 134538 topic_id: 23072 reply_id: 93438[/import]

@robmiracle,
Segment Violations/Bus Errors We have never got that error. Seems like something very low level, perhaps on the C side of things? The debugger will only look at Lua code.

@Mo
How to use Cider with Dropbox
Your dropbox folder should be located somewhere in your mydocuments account. You can find out for sure by opening your dropbox folder and copy and paste the path that comes up. For us its something like “D:\Dropbox”. Its just like any other folder you can paste it into Cider.
Thanks,
M.Y. Developers [import]uid: 55057 topic_id: 23072 reply_id: 93466[/import]

Got it! Thanks. Any idea about collapsing the code lines?

Mo [import]uid: 49236 topic_id: 23072 reply_id: 93474[/import]

@RSCdev
Thanks for your support!

@robmiracle,
Just to get an idea of a situation that will result in a segmentation error. The following should cause a seg error correct?

local function main()  
 local someUpValue = {}  
 local function f1()  
 someUpValue[1] = "something"  
 print(someUpValue)  
 end  
 Runtime:addEventListener("enterFrame", f1)  
 local function f2()  
 someUpValue = nil  
 end  
 f2()  
end  
main()  

However, when we run this we never get a seg fault. It seems to be properly caught by the lua runtime. Can you provide us with a code sample that causes a seg fault? We are thinking about implementing a call graph so you can visualize where your code has stopped working.

@Mo,
Any idea about collapsing the code lines?
Sorry about this but this release will focus on the debugger. Our next release cycle will focus on advance IDE features that we all expect. We expect to have auto-indent, code folding, a function navigator, and Corona hints due next update.

@liuhm,
Perhaps what you need to achieve that effect is vector masks. This is not implemented yet in Corona, however there probably is another clever way to do it that we do not know of. Maybe you can just use vector polygons instead?

Thanks,
M.Y. Developers [import]uid: 55057 topic_id: 23072 reply_id: 93520[/import]

Thanks! No problem, I just thought it was me.

Great job!

Mo [import]uid: 49236 topic_id: 23072 reply_id: 93543[/import]

Couple of more items. I won’t call these bugs and one is more of a feature request…

  1. I can’t tell if a file needs saved. Most editors will put a little icon in the tab showing the file has not been saved, or maybe an indicator in the file list on the left. It’s kind of an important feature.
  2. This is in the “Would be nice” category. When you switch projects, the open files tabs changed to your last open files in that project. Sure there are times you may want files open in multiple projects, but more often than not, you may be working on several projects at once and its a pain to close out the tabs you’re not using at the moment, then go open the files you want to work on. With Sublime, I can have multiple windows, each with its own tabs, so I can kind of “hack” this by having a window per project and each window keeps open the files I need for that projects.

[import]uid: 19626 topic_id: 23072 reply_id: 93545[/import]

@robmiracle
The file name is bold when it needs to be saved. It is so subtle that I didn’t notice it for a while, and was thinking it needed something like you said. It might be a good idea, so it is really clear.

M.Y.
I don’t see print statements showing up in the output tab. Should they be there?

I know I don’t have to use print statements now, and since I didn’t see them, I placed a break at that print statement, uncommented the require for CiderDebugger and saved. Relaunch came up for the Sim, and magic. It stopped on my print statement, confirming that my function was working. This is the way things are meant to work. Finally a window into the code itself, instead installing tracers to track it.

I was pleasantly surprised, that the relaunch caused the debugger to work, without stopping and starting the sim.

I was testing the editing portion, and can’t wait until you get more basic functionality going for it, so I don’t have to switch out to something else. [import]uid: 47723 topic_id: 23072 reply_id: 93549[/import]

Just to make sure we are talking the same thing:

@robmiracle,
Segment Violations/Bus Errors We have never got that error. Seems like something very low level, perhaps on the C side of things? The debugger will only look at Lua code.

This is my game that is crashing not CIDER. In my old C days, I’d have a lovely core dump and I could run GDB on it and it would show me my C source line that caused the core dump. But when the Simulator hits something it can’t handle, it just dies. I’d love to have a snapshot when my app dies and know what line I was on and a peak at the variables as it died.
[import]uid: 19626 topic_id: 23072 reply_id: 93553[/import]

@flyingaudio thanks for pointing that out. I guess it wasn’t enough of a change, but I see that now and I’ll be fine with it.

I don’t think I can ever fully get away from print statements. Yes, I don’t need them to watch variables any more, but with as event oriented as Corona is, it helps to understand the flow of your program.

[import]uid: 19626 topic_id: 23072 reply_id: 93554[/import]

Hi,

I got Cider running fine on the PC but on the MAC I do not see how to tell the app to use the simulator path so it can launch it?

Any ideas?

Thanks!

Mo [import]uid: 49236 topic_id: 23072 reply_id: 93556[/import]

@robmiracle, you may be right about print statements. I have some prints in a transition area, so I can see the flow. In this case, I was checking a function call from a touch event. A break in that spot worked great. No need to drop in a print for a quick test. [import]uid: 47723 topic_id: 23072 reply_id: 93558[/import]

@lemsim
At the menu Cider > Preferences > [Corona Options] tab
Select “simulator” then click Open and OK.
I don’t know if Open is necessary. [import]uid: 47723 topic_id: 23072 reply_id: 93560[/import]

Just tried it, and for some reason auto complete (rcp tab) not working for me.

Having access to the accelerometer is cool!
Compass is neat - but a way to configure some of the gps data would make it better.

Tried it with doodle dash, and it got into some wierd state where lua was crashing inside the CiberDebugger.lua module.

Restarted and the problem went away. hmmmmm

Single stepping is awesome! [import]uid: 9070 topic_id: 23072 reply_id: 93590[/import]

@M.Y.
Debugger & editor observations on a Mac.

I found, if I don’t use the Stop Debug button between code changes, debug appears to work properly. I can add new lines, set breaks before or after the save (and after relaunch), then RELAUNCH the Sim (which comes up automatically after saving), and debugging works as expected. I thought I would have to stop/restart debugger for code changes to be seen. As a a scripting language, is this not necessary?

And if I see the OS color wheel spinning when the cursor is over the Sim, that just means I need to press play on the debugger to start execution again.

This method makes for really fast iterations, even with debug. It also doesn’t liter the launch bar with Sim icons either.
EDIT: This is crazy cool. I just confirmed what I wrote above to be true. I am jumping around changing things in different files, adding lines, breaks, saving changes and relaunching. If I need a break just click a line while things are running, and when it hits, it pauses right there. View variables, step, make changes and click play.

And if I get engrossed in the simulator, testing the app, and I see the color wheel spinning, I find that I have hit a break point when I glance back over to the Cider Debugger. If I no longer want it, click to remove and hit play. Awesome!!!

Your error indicator at the line number has been helpful also, it catches typos. Nice work M.Y. [import]uid: 47723 topic_id: 23072 reply_id: 93587[/import]

@ brindleware
rcd tab gives require “CiderDebugger”, is that what you wanted? [import]uid: 47723 topic_id: 23072 reply_id: 93597[/import]

yeah - and typing rcd(tab button) didnt do anything - but type the same chars into the file.

I had to type in the require “…” by hand.

as to the crash in the CiderDebugger.lua

Runtime error
/CiderDebugger.lua:344: calling ‘send’ on bad self (udp{connected} expected, got userdata)
stack traceback:
[C]: ?
[C]: in function ‘send’
/CiderDebugger.lua:344: in function ‘initBlock’
/CiderDebugger.lua:377: in main chunk
[C]: in function ‘require’
/main.lua:1: in main chunk
Runtime error: /CiderDebugger.lua:344: calling ‘send’ on bad self (udp{connected} expected, got userdata)
stack traceback:
[C]: ?
[C]: in function ‘send’
/CiderDebugger.lua:344: in function ‘initBlock’
/CiderDebugger.lua:377: in main chunk [import]uid: 9070 topic_id: 23072 reply_id: 93598[/import]

Try deleting CiderDebugger.lua. Cider will rebuild it. You can find it in the Project window. That has worked for me. Although, I haven’t had issues lately. [import]uid: 47723 topic_id: 23072 reply_id: 93611[/import]

@rob
We will put an icon or something next to the lua files needed to be saved. Not sure if you noticed but there is also a “save all” button.
This is my game that is crashing not CIDER
It would be nice if you could give us some code that reproducibly gives a segmentation fault. We are considering adding another debug mode that logs everything to a file so you can play it back later and see where it left off. But we would like some of your scenarios so we can make sure it works for everyone.
@flying audio
I don’t see print statements showing up in the output tab. Should they be there?
It should be piping all simulator output to Cider. Strange you do not see it. Do you have the path set to Corona Terminal?

I was pleasantly surprised, that the relaunch caused the debugger to work, without stopping and starting the sim.
Yes we designed it to work this way. For extremely rapid code iteration you can just restart Corona. However if the simulator is being paused by the debugger this is not possible because Corona hangs. The UI and Simulator code seems to be on a single thread so when the debugger deliberately hangs the Simulator, the UI hangs too. This is why we devised the stop-debug cycle because it will work in all circumstances. All future updates will work both ways, when we implement watches for instance, we will make sure to reload them into Corona when you restart.

I was testing the editing portion, and can’t wait until you get more basic functionality going for it, so I don’t have to switch out to something else.
Thanks for bearing with us, we agree its not the easiest to work with but we will work on it.

It also doesn’t liter the launch bar with Sim icons either.
This will be fixed soon, the stop button is supposed to kill Corona but it seems to fork off sub-processes that end up not getting killed. Does anyone know how to do something like pkill in mac?

Thanks,
M.Y. Developers [import]uid: 55057 topic_id: 23072 reply_id: 93620[/import]

@ brindleware

Thanks for trying it out!
but a way to configure some of the gps data would make it better.
What would you like to see here? A map that you can click on? Or just a bunch of text inputs?

crashing inside the CiberDebugger.lua
This is probably due to having multiple Simulators open. We will find a way to kill the processes so you don’t get littered with simulators on the taskbar.

Thanks,
M.Y. Developers [import]uid: 55057 topic_id: 23072 reply_id: 93621[/import]