Breakpoint affecting script execution?

Deploying to Windows? Utilizing VB Script execution? This is the place to ask Windows-specific questions.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
david.silmanBUSrUeQ
Posts: 44
Joined: Thu Jul 19, 2012 1:49 pm

Breakpoint affecting script execution?

Post by david.silmanBUSrUeQ » Wed May 08, 2013 9:19 am

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)

lordmax
Posts: 15
Joined: Wed Apr 24, 2013 1:22 pm

Re: Breakpoint affecting script execution?

Post by lordmax » Wed May 08, 2013 11:44 am

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.

david.silmanBUSrUeQ
Posts: 44
Joined: Thu Jul 19, 2012 1:49 pm

Re: Breakpoint affecting script execution?

Post by david.silmanBUSrUeQ » Wed May 08, 2013 11:58 am

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

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

Re: Breakpoint affecting script execution?

Post by mwieder » Wed May 08, 2013 8:04 pm

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:

Code: Select all

try
... here's the original code
catch e
  answer e
end try
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

Code: Select all

global gRevDevelopment
put true into gRevDevelopment
and then try debugging again.

david.silmanBUSrUeQ
Posts: 44
Joined: Thu Jul 19, 2012 1:49 pm

Re: Breakpoint affecting script execution?

Post by david.silmanBUSrUeQ » Thu May 09, 2013 8:30 am

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

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

Re: Breakpoint affecting script execution?

Post by mwieder » Thu May 30, 2013 7:33 pm

@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.

Post Reply