Breakpoint affecting script execution?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 44
- Joined: Thu Jul 19, 2012 1:49 pm
Breakpoint affecting script execution?
Hi all, a slightly odd one
As a team we've started to notice that every now and again, we'll get an error, a nice repeatable error which is just a problem in the code we've written, but when using breakpoints to debug the code, the error no longer occurs, this is, as you can imagine, incredibly frustrating as it means we can't step through the code and see where and why it's going wrong, is there any reason for this behavior?
Thanks
David
(Problem noticed in livecode 5.5 all the way through to lc 6)
As a team we've started to notice that every now and again, we'll get an error, a nice repeatable error which is just a problem in the code we've written, but when using breakpoints to debug the code, the error no longer occurs, this is, as you can imagine, incredibly frustrating as it means we can't step through the code and see where and why it's going wrong, is there any reason for this behavior?
Thanks
David
(Problem noticed in livecode 5.5 all the way through to lc 6)
Re: Breakpoint affecting script execution?
Hi
Obviously I don't know if it's the case but something similar happens to me working with ajax
sometimes the answer is not fast enough to exploit the data read later and this generates an error.
Obviously in debugging, given the slowness of the manual steps the ajax call ends before any calls to objects.
Obviously I don't know if it's the case but something similar happens to me working with ajax
sometimes the answer is not fast enough to exploit the data read later and this generates an error.
Obviously in debugging, given the slowness of the manual steps the ajax call ends before any calls to objects.
-
- Posts: 44
- Joined: Thu Jul 19, 2012 1:49 pm
Re: Breakpoint affecting script execution?
I think it is the same, i get the impression that livecode tends to get ahead of itself slightly sometimes. It is an annoying problem
Re: Breakpoint affecting script execution?
Ouch! Yeah, I feel your pain there. You have a couple of options here.
The first is to place your problem code in a try/catch construct. My normal pattern for this is something like:
That way you will get an answer dialog that tells you where the error occurred.
One thing that might help is that errors in system stacks are ignored by the debugger by default. This is in general a good thing since it keeps you out of endless loops from which there is no escape. But you can change this behavior temporarily by
and then try debugging again.
The first is to place your problem code in a try/catch construct. My normal pattern for this is something like:
Code: Select all
try
... here's the original code
catch e
answer e
end try
One thing that might help is that errors in system stacks are ignored by the debugger by default. This is in general a good thing since it keeps you out of endless loops from which there is no escape. But you can change this behavior temporarily by
Code: Select all
global gRevDevelopment
put true into gRevDevelopment
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
-
- Posts: 44
- Joined: Thu Jul 19, 2012 1:49 pm
Re: Breakpoint affecting script execution?
Ahh brilliant!
Thank you so much, next time I encounter this problem I will give those a try!
That'll be much faster than my usual method of putting breakpoints after the error and moving them ever closer to it to see where the error occurs (or rather, stops occuring)
##EDIT##
After getting another of those problems I was able to step through the system stacks and find the problem, that is so incredibly useful!
Thank you again!
Cheers
David
Thank you so much, next time I encounter this problem I will give those a try!
That'll be much faster than my usual method of putting breakpoints after the error and moving them ever closer to it to see where the error occurs (or rather, stops occuring)
##EDIT##
After getting another of those problems I was able to step through the system stacks and find the problem, that is so incredibly useful!
Thank you again!
Cheers
David
Re: Breakpoint affecting script execution?
@David-
If you can localize any problems in system stacks, please report them in detail to support@runrev.com so that they can get logged and fixed.
You'll be doing all of us a favor. Thanks in advance.
If you can localize any problems in system stacks, please report them in detail to support@runrev.com so that they can get logged and fixed.
You'll be doing all of us a favor. Thanks in advance.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev