Inconsistency in messages between script with debug breakpoint and without

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
rodneyt
Posts: 128
Joined: Wed Oct 17, 2018 7:32 am

Inconsistency in messages between script with debug breakpoint and without

Post by rodneyt » Wed Nov 03, 2021 3:53 am

This is a weird one.

I have a script which when executed is producing a strange behaviour which I think is related to (I won't get into what it does for now). The interesting thing, is if I set a breakpoint in the script, it executes normally. The problem only happens when debugger is not being used. Lock messages doesn't seem to be having any effect either way.

Has anyone else run into situations where messages appearing in message path (e.g. message watcher) change as a result of debug checkpoint being set?

~ Rodney

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10337
Joined: Wed May 06, 2009 2:28 pm

Re: Inconsistency in messages between script with debug breakpoint and without

Post by dunbarx » Wed Nov 03, 2021 6:14 pm

I have seen this, where setting a breakpoint allows a handler to work fine up to the stop, and then when I allow the process to continue, works fine to the end. But removing that breakpoint throws an error.

These all eventually resolved themselves, though I do not have a recipe. I sort of remember moving lines around, adding blank lines, whimpering, that sort of nonsense, and all of a sudden the issue went away. It seems to have something to do with the construction of the handler itself, sort of like when red dots could not remember what line they were placed in when edits were made to the overall text.

Craig

rodneyt
Posts: 128
Joined: Wed Oct 17, 2018 7:32 am

Re: Inconsistency in messages between script with debug breakpoint and without

Post by rodneyt » Thu Nov 04, 2021 1:35 am

Has anyone else run into a situation where breakpoints refuse to drop Llivecode into debugger - e.g. you've set breakpoint in code, but code executes without dropping into the debugger?

stam
Posts: 3091
Joined: Sun Jun 04, 2006 9:39 pm

Re: Inconsistency in messages between script with debug breakpoint and without

Post by stam » Thu Nov 04, 2021 1:49 am

rodneyt wrote:
Thu Nov 04, 2021 1:35 am
Has anyone else run into a situation where breakpoints refuse to drop Llivecode into debugger - e.g. you've set breakpoint in code, but code executes without dropping into the debugger?
Yep - breakpoints don't work for me when trying to debug certain situations like populating data grids (fillInData handler etc) or running actions from controls in data grids (such as a popup menu)...

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10337
Joined: Wed May 06, 2009 2:28 pm

Re: Inconsistency in messages between script with debug breakpoint and without

Post by dunbarx » Thu Nov 04, 2021 2:47 pm

I have seen red dot breakpoints not trigger, the flow of execution just running right past them, but not in several years. I am not sure if this was due to the ole unstable red dot issue or not.

These were always red dots, never explicit "breakpoint" commands.

Craig

stam
Posts: 3091
Joined: Sun Jun 04, 2006 9:39 pm

Re: Inconsistency in messages between script with debug breakpoint and without

Post by stam » Thu Nov 04, 2021 6:42 pm

dunbarx wrote:
Thu Nov 04, 2021 2:47 pm
I have seen red dot breakpoints not trigger, the flow of execution just running right past them, but not in several years. I am not sure if this was due to the ole unstable red dot issue or not.

These were always red dots, never explicit "breakpoint" commands.

Craig
The issue i mention above happens with the 'breakpoint' command as well - code execution just doesn't halt...

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10337
Joined: Wed May 06, 2009 2:28 pm

Re: Inconsistency in messages between script with debug breakpoint and without

Post by dunbarx » Fri Nov 05, 2021 12:19 am

I could be wrong about the red-dot-only thing. Cannot be certain if it happened with the breakpoint command as well.

Craig

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

Re: Inconsistency in messages between script with debug breakpoint and without

Post by jacque » Fri Nov 05, 2021 6:29 pm

I think these errors happen when the script has branched into IDE specific libraries, which apparently don't break if gRevDevelopment is false. That's my guess anyway. I usually move the breakpoint to the line above or below.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

rodneyt
Posts: 128
Joined: Wed Oct 17, 2018 7:32 am

Re: Inconsistency in messages between script with debug breakpoint and without

Post by rodneyt » Thu Nov 11, 2021 12:39 am

The situation I am in is that I cannot get this project to drop into the debugger at all, Whether I set red dot or put "breakpoint". For some reason the debugger has stopped working/invoking entirely. Stumped.

E.g. make a button

on mouseUp
breakpoint
answer "yes"
end mouseUP

Won't go into debugger....

stam
Posts: 3091
Joined: Sun Jun 04, 2006 9:39 pm

Re: Inconsistency in messages between script with debug breakpoint and without

Post by stam » Thu Nov 11, 2021 1:11 am

rodneyt wrote:
Thu Nov 11, 2021 12:39 am
Won't go into debugger....
That's definitely weird - i can't reproduce that.
Out of curiosity what version of LC are you running?

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

Re: Inconsistency in messages between script with debug breakpoint and without

Post by jacque » Thu Nov 11, 2021 1:12 am

That sounds like debug mode got turned off. Check the menu item.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

rodneyt
Posts: 128
Joined: Wed Oct 17, 2018 7:32 am

Re: Inconsistency in messages between script with debug breakpoint and without

Post by rodneyt » Thu Nov 11, 2021 3:32 am

Thanks Jacque, after posting this I did have a vague feeling I'd run into this before. It was indeed debug mode switched off - it's a feature I never intentionally use.

Still having the other issue with script behaving differently when executed vs debugged, but Im sure I will figure that out eventually...

~ Rodney

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

Re: Inconsistency in messages between script with debug breakpoint and without

Post by jacque » Thu Nov 11, 2021 5:21 am

It's happened before where debug mode accidentally gets turned off, I suspect it's a mis-hit on another menu item.

If setting the breakpoint on a different line doesn't work maybe you can post a few lines above and below the problem area and we might see what's wrong. I know I've had scripts that will run to completion without breaking, and often it has something to do with TSNet or libURL running a command and ignoring my script. When the library finally lets go, LC runs the remaining lines at breakneck speed and doesn't stop.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply