Page 2 of 2

Re: Opening a version 8 stack in LiveCode 9

Posted: Tue Sep 01, 2020 12:19 am
by mwieder
The problem area is actually in the revdebuggerlibrary in a private handler used by the revGetContexts() function.
But thanks to the OP for having a stack with the cause of the problem. It also enabled me to throw a patch into PowerDebug, since I'm relying on revGetContexts now, and the repercussions caused a segfault in the LC engine and subsequent crash.

I just submitted a pull request to avoid the problem.
https://github.com/livecode/livecode-ide/pull/2142

Re: Opening a version 8 stack in LiveCode 9

Posted: Tue Sep 01, 2020 1:41 am
by FourthWorld
Good work - thanks!

Curious: why use revGetContexts rather than query the execution contexts yourself?

Re: Opening a version 8 stack in LiveCode 9

Posted: Tue Sep 01, 2020 1:49 am
by mwieder
It's a different format. Trying to future-proof things.
I figured why not leverage the direction the IDE is heading in and save having to catch up later.

[update] my bad - it's revDebuggerContexts(), not revGetContexts().
If you enable gRevDevelopment and try to invoke it from anywhere other than the "revDebuggerLibrary" stack (the name string is hard-coded in the revDebuggerLibrary stack itself) then you end up with a hard crash, given the situation with an invalid watchedvariable entry.

Re: Opening a version 8 stack in LiveCode 9

Posted: Tue Sep 01, 2020 3:58 am
by FourthWorld
mwieder wrote:
Tue Sep 01, 2020 1:49 am
It's a different format. Trying to future-proof things.
Future-proofing is why I tend to use engine calls, and resort to IDE calls only when absolutely necessary (things like IDE path functions).

The IDE APIs change more often than the engine. And I've used the engine with other IDEs in the past, and can't guarantee I won't do that again someday.

Re: Opening a version 8 stack in LiveCode 9

Posted: Tue Sep 01, 2020 5:00 am
by mwieder
Hmmm... well, that's actually a good point.
With that in mind I stol^H^H^Hborrowed some routines from the revDebuggerLibrary stack (had to copy several because they use internal private functions) and placed them in my debugger. Seems a little silly to do exactly what is already in a front script from the IDE, but it *does* let me correct the error locally, so it's a net gain.

Re: Opening a version 8 stack in LiveCode 9

Posted: Tue Sep 01, 2020 3:08 pm
by minboden
You are amazing!! Thank you, I never would have found that. Not even sure how that got there?!?

Re: Opening a version 8 stack in LiveCode 9

Posted: Tue Sep 01, 2020 4:04 pm
by mwieder
Heh. The only reason I found that is because it crashed PowerDebug in an interesting way, taking LiveCode down with it. Walking the trail of forensics back I found that it was crashing while trying to set the watched variables, and I know that breakpoints and watched variables are stored as custom properties of the mainstack. But that was really a puzzler.