LC 4.6.6 Debugger just quits debugging

Deploying to Mac OS? Ask Mac OS specific questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
FireWorx
Posts: 362
Joined: Wed Sep 07, 2011 9:39 pm

LC 4.6.6 Debugger just quits debugging

Post by FireWorx » Tue Sep 20, 2011 8:07 pm

Frustrating when the debugger just quits working. Load a button and type in some bad script just to make the debugger come up but no luck. Re-installed 4.6.4 again and the debugger worked for about 5 minutes and them poof! Its not coming up again! Any suggestions?
Dave

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: LC 4.6.6 Debugger just quits debugging

Post by mwieder » Tue Sep 20, 2011 9:07 pm

Debuggers are weird critters sometimes.
Make sure "Script Debugger Mode" is selected from the menubar.
Otherwise check out the trial version of PowerDebug on revOnline (http://revonline2.runrev.com/stack/507/PowerDebug).

FireWorx
Posts: 362
Joined: Wed Sep 07, 2011 9:39 pm

Re: LC 4.6.6 Debugger just quits debugging

Post by FireWorx » Fri Sep 23, 2011 7:22 pm

Hi, I am having a serious issue with both LC 4.6.4 and 4.6.3 Mac IOS and android version developing on my Mac running lion. I have cleared the bundle and reloaded the programs several times to try and work this out.

The debugger will not open if you set a breakpoint in your script and you have any syntax error in that script. Once the syntax errors are fixed it will open and you can check your code execution.

ALSO
if you copy the button and paste it on the card the syntax error window will pop up but you will need to continue to copy and paste the button each time in order to get all the syntax errors worked out with this method.

ALSO
Perfectly good card button scripts will not be able to find their perfectly good handlers in the card script if you have a single syntax error in any bad handler in that card script.

Saving and closing the stack and re-opening does not help. However quitting LiveCode and reopening LiveCode will allow the buttons to access their handlers in the card script until you open the card script and edit a line of code. Once you do that if you have a single syntax error in any handler in the card script none of the perfectly good hankers can be found from perfectly good button scripts.

I tried to fill out a bug report but RunRev says I need to log in. To Log in I need a username and password which is not the same as the one I used to buy live code and was not included in any e-mail I received from you. There doesn't seem to be a way to get a username and password on the bug reporting site. Is it the same as for this forum?

This is a brand new mac with live code and Xcode the only 2 applications loaded. If anyone has any ideas i'm all ear. Thanks.

Dave
kitethewind@gmail.com

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: LC 4.6.6 Debugger just quits debugging

Post by mwieder » Fri Sep 23, 2011 7:32 pm

Dave-

Send an email to support@runrev.com and request a login to the QCC. Yes, it's a different one from either this forum or the login to download the apps.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: LC 4.6.6 Debugger just quits debugging

Post by jacque » Sat Sep 24, 2011 1:54 am

FireWorx wrote: The debugger will not open if you set a breakpoint in your script and you have any syntax error in that script. Once the syntax errors are fixed it will open and you can check your code execution.
It doesn't sound like a bug to me, it's how it works. The debugger can't work with uncompiled code, and any script with a syntax error can't be compiled. Syntax must be correct before you can debug. Or did you mean something else was wrong? All your examples seem to show that you are trying to work with uncompiled scripts.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

FireWorx
Posts: 362
Joined: Wed Sep 07, 2011 9:39 pm

Re: LC 4.6.6 Debugger just quits debugging

Post by FireWorx » Sat Sep 24, 2011 5:51 pm

Hi Jacque,
So are you saying its normal if you write a script in a button that contains a syntax error to click on the button and have nothing happen?
Normaly a message will pop up and alert you to the syntax error. (I realize now its not the debugger though its a livecode message)

Is it normal to set a breakpoint on the first line of a button script and have nothing happen when you click the button if that script contains a syntax error? And have to copy and re paste the button on the card in order to be alerted to the syntax error?

Is it normal for LiveCode to return message (in the debugger) that handler couldnt be found regarding a perfectly good button script to a perfectly good handler in the card script if there is a sytax error in one of the other unrelated handlers in the card script?

This doesn's seem like normal behavior as I remember it but I just started working on Mac's perhaps its Mac specific?

Dave

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: LC 4.6.6 Debugger just quits debugging

Post by jacque » Sun Sep 25, 2011 1:43 am

I usually fix syntax errors as soon as they are flagged so I'm not positive about this, but if memory serves, you are notified of syntax errors the first time you try to compile the script. If you don't fix the error and just close the script window, the script becomes non-operative. You don't get warned repeatedly; once it is in-op it acts as though it isn't there. This can happen if you quit LiveCode with a script window open too, if you ignore the save dialog.

If you set a breakpoint on a non-operative script, nothing will happen because an uncompiled script is not yet a functioning script, it's just a bunch of text. Anything that changes the status of the script back to active will trigger syntax warnings again. This can be pasting in a copy of the button or just making any minor change to the original script itself; anything will work as long as it flags the text as either new or "dirty." Both these conditions wake up the compiler and force it to try to recompile again. You'll get syntax errors at that point, but if you ignore them and close the script window, the script becomes inactive again and the IDE will no longer bother you about it.

If a card script remains uncompiled, then it behaves as if it does not exist (which it doesn't really; it's only text at this point. It hasn't yet been converted to bytecode.) That's why its handlers can't be found when called from a card button. Only a fully compiled script has active handlers.

You mentioned you'd copied the stack to Windows where it correctly identified errors. Unless something else happened, the newly opened stack would register as "new" for all its scripts and you would receive syntax errors there. If you close the script windows without fixing the errors, I think it would act as it does on the Mac.

That's my theory anyway. As I said, I usually fix syntax errors immediately so I could be fuzzy on some of the details. But I don't think the OS is involved in the problem. The script editor itself is just a stack and is implemented in native LiveCode, so it will work the same way on any platform.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

FireWorx
Posts: 362
Joined: Wed Sep 07, 2011 9:39 pm

Re: LC 4.6.6 Debugger just quits debugging

Post by FireWorx » Sun Sep 25, 2011 2:28 am

Thanks for that explanation Jacque. That was very informative and helpful I guess what my system is not doing then is giving me a chance to fix the syntax error in the first place. Not pointing it out and allowing me to save the script and close the window.

But fortunately I have found that by copying and pasting the button over and over I can gradually work out the syntax errors. This has also required me to test all my scripts in buttons before I move them to the card or stack script.

As far as one syntax error in a handler in the card script disabling all the other unrelated and properly coded handlers that have been compiled and have been working correctly: I haven't found that to be normal and others have proved it by testing the stack on their machines.

Thank you for your great explanation and the time that it took to educate me.

Dave

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: LC 4.6.6 Debugger just quits debugging

Post by mwieder » Sun Sep 25, 2011 2:53 am

Jacque - that's a great explanation of what's going on.

Dave - I've found that if you add a return or a space or something and then delete it you get a chance to recompile the script, so you don't have to keep copying and pasting just to get the syntax errors out.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: LC 4.6.6 Debugger just quits debugging

Post by jacque » Sun Sep 25, 2011 3:36 am

I guess what my system is not doing then is giving me a chance to fix the syntax error in the first place. Not pointing it out and allowing me to save the script and close the window.
I haven't seen that happen. You may not be noticing the error that shows up at the bottom of the script editor when a compile fails. It's shown in the "Errors" pane of the debugger panel. The offending line is marked with a red circle with an "x" in it and the error message is listed in the Errors pane. You don't get a syntax error dialog if your script has focus. That only happens when the script isn't open.

Try this: open one of the scripts that has bad syntax. Type anything, anywhere, and delete it. As Mark said, a space or just a return character will do fine. That makes the script dirty and eligible for a recompile. Click the "Apply" button at the top of the editor, or just hit the Enter key on your keypad (it does the same thing, it compiles the script.) Then look at the Error pane in the debugger panel at the bottom of the window. Do you see an error listed there? If so, double-clicking the error line will take you immediately to the corresponding line in your script, where you can see the "X" marker.

When you choose "Save" from the menu, it automatically compiles any open, changed scripts and then saves the stack. If they won't compile, you will still see the same error messages in the Errors pane, but the IDE will allow you to close the window without correcting them. That saves a bad script to disk though, so I usually try to fix all errors and compile manually before saving the stack.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: LC 4.6.6 Debugger just quits debugging

Post by jacque » Sun Sep 25, 2011 3:48 am

One picture worth a thousand words:
Error pane.png
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: LC 4.6.6 Debugger just quits debugging

Post by jacque » Sun Sep 25, 2011 3:57 am

FireWorx wrote: As far as one syntax error in a handler in the card script disabling all the other unrelated and properly coded handlers that have been compiled and have been working correctly: I haven't found that to be normal and others have proved it by testing the stack on their machines.
Point me to a link to the stack and I'll take a look. What you describe isn't really possible, so something else is going on.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: LC 4.6.6 Debugger just quits debugging

Post by mwieder » Sun Sep 25, 2011 4:13 am

Jacque- the stack in question is here:

http://forums.runrev.com/viewtopic.php? ... 063#p43703

Only seems to mess up on Dave's system, and we're stumped about what's going on. Maybe you've got some insight into it?

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: LC 4.6.6 Debugger just quits debugging

Post by jacque » Mon Sep 26, 2011 7:28 pm

The stack scripts in the test stack are all valid and as far as the engine is concerned there are no syntax errors. That's why it runs for all of us. It ran for Dave too when he first unzipped it.

He had issues after he entered some broken code and tried to debug it. In the other thread it mentions that he was closing the script window during a debugging session and clicking Save when the dialog appeared. I confess I've never closed out a debugging session that way, I always stop the debugger first, so my current line of thinking is that something in that force-close process is screwing up the script in unpredictable ways.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

FireWorx
Posts: 362
Joined: Wed Sep 07, 2011 9:39 pm

Re: LC 4.6.6 Debugger just quits debugging

Post by FireWorx » Wed Sep 28, 2011 6:33 pm

To All of you and especially to Jaque,
Thank you for sticking with me until I figured this out. The problem being I had the "Toggle the script editor tool bars" button selected in the far right upper corner of the script editor window. Thus the "Apply" button was hidden. Everything is working great now and I have a much better understanding of the entire process. After 15 years of working with HyperCard, MetaCard, Revolution, and now LiveCode this little SNAFU really had me tearing my hair out!
Best to you all! Thanks Again!
Dave

Post Reply