Opening a version 8 stack in LiveCode 9

A place to discuss Version Control in LiveCode

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3173
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Opening a version 8 stack in LiveCode 9

Post by mwieder » Tue Sep 01, 2020 12:19 am

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

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 8181
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Opening a version 8 stack in LiveCode 9

Post by FourthWorld » Tue Sep 01, 2020 1:41 am

Good work - thanks!

Curious: why use revGetContexts rather than query the execution contexts yourself?
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3173
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Opening a version 8 stack in LiveCode 9

Post by mwieder » Tue Sep 01, 2020 1:49 am

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.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 8181
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Opening a version 8 stack in LiveCode 9

Post by FourthWorld » Tue Sep 01, 2020 3:58 am

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.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3173
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Opening a version 8 stack in LiveCode 9

Post by mwieder » Tue Sep 01, 2020 5:00 am

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.

minboden
Posts: 4
Joined: Fri Aug 28, 2020 8:55 pm

Re: Opening a version 8 stack in LiveCode 9

Post by minboden » Tue Sep 01, 2020 3:08 pm

You are amazing!! Thank you, I never would have found that. Not even sure how that got there?!?

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3173
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Opening a version 8 stack in LiveCode 9

Post by mwieder » Tue Sep 01, 2020 4:04 pm

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.

Post Reply

Return to “Version Control”