Debugger is deleting lines of code while debugging

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
PlaidFlannel
Posts: 43
Joined: Fri Aug 21, 2020 7:06 pm
Location: Denver, CO

Debugger is deleting lines of code while debugging

Post by PlaidFlannel » Mon Feb 08, 2021 2:58 am

Today I'm having a curious problem using the LiveCode debugger. I'd appreciate help tracking down the solution.

It happens when I set breakpoints in a script. Upon reaching that breakpoint, I begin stepping through the code by clicking the "step over" button at the upper left. That's this button:
Step Over Button.png
Step Over Button.png (6.73 KiB) Viewed 3208 times
After a few clicks, when I click the button, the line of source code to be executed next disappears from the script. If I cancel execution and look at the script, it is still missing. If I close the script and reopen it, it is still missing. If I close the stack and reopen it, it is still missing. If I exit from LiveCode and restart, and then reopen the stack, it is still missing.

The problem is exacerbated by the fact that if I am not paying very close attention, I don't notice it right away. Subsequently, the script will execute incorrectly, or, for example, if the missing line is the end of a handler, the script has all kinds of errors when it is reopened.

I have noticed this behavior occasionally in a few scripts over the last couple of weeks, usually once or twice a day when I'm debugging. Today it is happening ten times or more per hour or so, and in different places in more than one script.

Have you seen this before? Do you have any suggestions on the cause or the fix? Thanks.

[LiveCode Community 9.6.1; MacOS 11.1]

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9670
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Debugger is deleting lines of code while debugging

Post by dunbarx » Mon Feb 08, 2021 6:25 am

Big Sur, eh?

I have heard of issues there. Have you tried to run your stacks under OS 10.x? There is a good chance you will not have this problem. The team will take a little time to fix Big Sur problems.

Craig

PlaidFlannel
Posts: 43
Joined: Fri Aug 21, 2020 7:06 pm
Location: Denver, CO

Re: Debugger is deleting lines of code while debugging

Post by PlaidFlannel » Mon Feb 08, 2021 6:41 am

Thanks for the reply.

Actually, I upgraded to Big Sur only six days ago. The problem with the debugger has been around much longer. I'm seeing it more now because for the last two weeks, I've been spending several hours every day on a new project.

I'm still running LiveCode 9.6.1.15522 from August 18, 2020. Is there a newer version?

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9670
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Debugger is deleting lines of code while debugging

Post by dunbarx » Mon Feb 08, 2021 2:47 pm

Hi.

If you have seen this even in earlier OS versions, wait just a bit for others to chime in. I never have, ever. Have you another machine to test your stacks?

Craig

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7238
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Debugger is deleting lines of code while debugging

Post by jacque » Mon Feb 08, 2021 6:57 pm

I have never, ever seen that happen in any version of LC or on any version of OS X. I know you're using somewhat unusual scripting methods while trying to reproduce classes though, so there may be a problem of focus. The script editor is just a stack like any other, and during debugging it becomes the focused stack when a breakpoint triggers. Could one of your other scripts be deleting lines of text?

The editor goes to some lengths to avoid that but you may have hit an exception.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Debugger is deleting lines of code while debugging

Post by Klaus » Mon Feb 08, 2021 7:20 pm

PlaidFlannel wrote:
Mon Feb 08, 2021 6:41 am
I'm still running LiveCode 9.6.1.15522 from August 18, 2020. Is there a newer version?
Bookmark this page and be always uptodate:
https://downloads.livecode.com/livecode/

elanorb
Livecode Staff Member
Livecode Staff Member
Posts: 516
Joined: Fri Feb 24, 2006 9:45 am

Re: Debugger is deleting lines of code while debugging

Post by elanorb » Mon Feb 08, 2021 7:21 pm

Hi

This is something I have not seen myself either. I ran it past the team and checked the Quality Control Center and we don't have any other reports.

As Jacque said it sound like it could be an issue related to the focused stack or something similar. Is there anything common between the lines this happens on, are they anything like

Code: Select all

delete the clickline
or

Code: Select all

put empty into the selection
Or anything along those lines? I think this needs to be reported as a bug but if we can narrow it down a bit that will be helpful.

Kind regards

Elanor
Elanor Buchanan
Software Developer
LiveCode

PlaidFlannel
Posts: 43
Joined: Fri Aug 21, 2020 7:06 pm
Location: Denver, CO

Re: Debugger is deleting lines of code while debugging

Post by PlaidFlannel » Mon Feb 08, 2021 7:42 pm

Jacque: thanks for your reply.

As a LiveCode beginner, it had not occurred to me that the script editor was just a stack.

As an aside, that explains another issue that I had noticed about the script editor—its text scrolling does not reflect MacOS platform behavior with regard to the System Preference "Jump to the spot that's clicked". Some other LiveCode entities do reflect that preference.

My current project does essentially no text manipulations. It primarily uses scripted painting in image objects to represent attributes of members of a large data set.

Currently, my single card has three different, nonoverlapping image objects available for painting. Below each is a "background" image object, and above each is a transparent "click catcher" button. These give the user the ability to interact with the image, even in places where it is transparent (no paint).

To make all this work, all my handlers that do painting have to move the target image objects to the top layer prior to invoking the painting tools, and then move them back to their original layers after. I think that kind of layer manipulation is the most unusual thing I do.

One other thing that might be worth mentioning is this: I have noted that occasionally while debugging, I'm typing in code and need to scroll to a different place in the script to check on something. While scrolled elsewhere, I don't necessarily notice that my new code still has errors. If I save the script (using the "Apply" button) and close the script tab, I assume that it is saved with those errors. When that script is reopened to display a breakpoint during a debugging run, is it possible the state of the script is unstable in some way?

A symptom that something might be unstable is that sometimes scrolling the script editor window causes the code to scroll but not the line numbers.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”