LCB Debugging Strategies

LiveCode Builder is a language for extending LiveCode's capabilities, creating new object types as Widgets, and libraries that access lower-level APIs in OSes, applications, and DLLs.

Moderators: LCMark, LCfraser

Post Reply
mdoub
Posts: 14
Joined: Sun Jan 07, 2007 5:47 pm

LCB Debugging Strategies

Post by mdoub » Wed Mar 25, 2015 11:06 pm

I am clearly spoiled by having used the LCS environment for so long. What are the recommended debugging strategies to be used when developing complex libraries? Are there any LCB debugging tools in the roadmap?

-= Mike

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1209
Joined: Thu Apr 11, 2013 11:27 am

Re: LCB Debugging Strategies

Post by LCMark » Wed Mar 25, 2015 11:51 pm

@mdoub: At the moment you are limited to using the 'log' command in LCB which outputs messages into the extension builder log field. However, we are intending for there to be an out of process debugger which will allow you to step through code like the debugger in LCS and other environments.

As LCB integrates with the engine in the same way as C++ code does, it does have to be a separate process which connects to a running engine instance (indeed, given that using foreign handlers can cause crashes if you use them or define them incorrectly, a more traditional architecture for the debugger seems a wise path!)

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Re: LCB Debugging Strategies

Post by trevordevore » Thu Mar 26, 2015 3:14 am

@mdoub: Note that the docs have an overly verbose example for 'log'. Rather than building up a list using 'push' use the shorthand:

Code: Select all

variable tPoint as Point

put point [0,10] into tPoint
log "%@" with [tPoint]
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

peter-b
Posts: 182
Joined: Thu Nov 20, 2014 2:14 pm
Location: LiveCode Ltd.

Re: LCB Debugging Strategies

Post by peter-b » Thu Mar 26, 2015 10:21 am

trevordevore wrote:@mdoub: Note that the docs have an overly verbose example for 'log'. Rather than building up a list using 'push' use the shorthand:

Code: Select all

variable tPoint as Point

put point [0,10] into tPoint
log "%@" with [tPoint]
Or, even more concisely:

Code: Select all

log point [0, 10]
LiveCode Open Source Team — @PeterTBBrett — peter.brett@livecode.com

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Re: LCB Debugging Strategies

Post by trevordevore » Thu Mar 26, 2015 12:01 pm

@peter-b: true. When debugging you are usually logging the values of variables which is why I used one in my example.
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1209
Joined: Thu Apr 11, 2013 11:27 am

Re: LCB Debugging Strategies

Post by LCMark » Thu Mar 26, 2015 1:23 pm

@trevordevore: I think @peter-b was intimating that there is a 'log expr' form as well as 'log format with params' form. I.e you can do 'log tVar'

trevix
Posts: 962
Joined: Sat Feb 24, 2007 11:25 pm
Location: Italy
Contact:

Re: LCB Debugging Strategies

Post by trevix » Wed Aug 16, 2023 3:26 pm

Hello.
@mdoub: At the moment you are limited to using the 'log' command in LCB which outputs messages into the extension builder log field. However, we are intending for there to be an out of process debugger which will allow you to step through code like the debugger in LCS and other environments.
What happened to the debugger? Where is LCB going to?
Should I ask A.I. to debug for me?

Regards
Trevix
Trevix
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>

stam
Posts: 2686
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: LCB Debugging Strategies

Post by stam » Wed Aug 16, 2023 6:26 pm

I think your second question is the interesting one… where is LCB going?

I’d like to see a lot more IDE support for it and more resources as a lot of this requires a huge amount of searching for little nuggets here and there. LCB seems to be LC’s illegitimate ginger haired love child no one wants to talk about…

LCB still needed for linking external frameworks but for widgets and libraries we now have native LC tools. Script Widgets need a bit of refinement maybe but work really quite well… and have a tiny learning curve (although as per LCB documentation is a bit lacking and limited essentially to the single lesson posted by Heather).

LCB would just be too time consuming for me personally - I have very limited time to code and when I do I’m not in the frame of mind to either learn a new language or waste hours searching for clues how to do things…

I wonder how much support for either LCB or script widgets will be built into the new IDE?

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

Re: LCB Debugging Strategies

Post by mwieder » Sat Aug 19, 2023 4:55 pm

Since the arc of LC's future seems to bend toward dumbing things down to a no-code approach, I wouldn't count on either of these getting much love.
The "out of process debugger" LCMark proposed eight years ago would have been useful.
I wonder how the LC team debugs their own LCB widgets. Log statements are so 1990s.

trevix
Posts: 962
Joined: Sat Feb 24, 2007 11:25 pm
Location: Italy
Contact:

Re: LCB Debugging Strategies

Post by trevix » Sat Aug 19, 2023 5:28 pm

Monte probably knows, since he created form me a complex extension, involving a SDK.
Trevix
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>

Post Reply

Return to “LiveCode Builder”