Debugging tips?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, LCMark
-
- VIP Livecode Opensource Backer
- Posts: 977
- Joined: Sat Apr 08, 2006 7:47 am
- Location: Aalst, Belgium
- Contact:
Debugging tips?
Hi guys,
While working on the filter enhancements, I ran into problems where the IDE decided to not start completely - I guess because it uses the 'filter' command extensively and I screwed the pooch
So I decided to test my work by adding a 'tinker' command and putting the code into it. I followed the recipe for the 'map' command and the script editor does recognize the 'tinker' command as a built-in thing, but fails to parse things. So obviously I made a mistake in my code.
Now I'd like to debug to see where I went wrong.
I'm using the latest Xcode on OS X Mountain Lion.
I set a breakpoint on the line where I want to start debugging, but it never seems to get there.
Can anyone give me hints as to how I can debug?
TIA,
Jan Schenkel.
While working on the filter enhancements, I ran into problems where the IDE decided to not start completely - I guess because it uses the 'filter' command extensively and I screwed the pooch
So I decided to test my work by adding a 'tinker' command and putting the code into it. I followed the recipe for the 'map' command and the script editor does recognize the 'tinker' command as a built-in thing, but fails to parse things. So obviously I made a mistake in my code.
Now I'd like to debug to see where I went wrong.
I'm using the latest Xcode on OS X Mountain Lion.
I set a breakpoint on the line where I want to start debugging, but it never seems to get there.
Can anyone give me hints as to how I can debug?
TIA,
Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com
www.quartam.com
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: Debugging tips?
<not at an OSX machine at the moment> Does OSX support strace? gdb?
Any hints in the console log?
Any hints in the console log?
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
Re: Debugging tips?
The script editor syntax highlighting is derived from the keyword tables - so if it's highlighting but not parsing it might be that you've missed adding the tinker command's constructor to the MCN_new_statement in newobj.cpp.
An alternative option is to debug your filter changes in the standalone engine with a stack that just has your script for testing it out. You can do this by running the standalone target in debug mode and setting a TEST_STACK environment variable to point to the stack to load on startup.
An alternative option is to debug your filter changes in the standalone engine with a stack that just has your script for testing it out. You can do this by running the standalone target in debug mode and setting a TEST_STACK environment variable to point to the stack to load on startup.
-
- VIP Livecode Opensource Backer
- Posts: 977
- Joined: Sat Apr 08, 2006 7:47 am
- Location: Aalst, Belgium
- Contact:
Re: Debugging tips?
Looks like I have gdb and it's running as soon as I launch LiveCode from within Xcode.
Here's the beginning of the Xcode console output:
Jan Schenkel.
Here's the beginning of the Xcode console output:
Code: Select all
GNU gdb 6.3.50-20050815 (Apple version gdb-1824) (Wed Feb 6 22:51:23 UTC 2013)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin".tty /dev/ttys000
sharedlibrary apply-load-rules all
Quartam Reports & PDF Library for LiveCode
www.quartam.com
www.quartam.com
-
- VIP Livecode Opensource Backer
- Posts: 977
- Joined: Sat Apr 08, 2006 7:47 am
- Location: Aalst, Belgium
- Contact:
Re: Debugging tips?
@runrevmark
I did extend the switch structure in newobj.cpp - as a copy+paste+adapt artist I slavishly followed your example
Anyway, I pushed it to an experiment branch here https://github.com/quartamsoftware/live ... er_command
Just in case anybody wants to take a look and point out my silly mistake.
Cheers,
Jan Schenkel.
I did extend the switch structure in newobj.cpp - as a copy+paste+adapt artist I slavishly followed your example
Anyway, I pushed it to an experiment branch here https://github.com/quartamsoftware/live ... er_command
Just in case anybody wants to take a look and point out my silly mistake.
Cheers,
Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com
www.quartam.com
Re: Debugging tips?
@Janschenkel: You've done what I have done many times... Put the entry in the command_table in the wrong place - the engine does a binary-search on the table and so things need to be in alphabetically order - tinker has to go after throw
-
- VIP Livecode Opensource Backer
- Posts: 977
- Joined: Sat Apr 08, 2006 7:47 am
- Location: Aalst, Belgium
- Contact:
Re: Debugging tips?
Well that was embarrassing - and now the debug breakpoint kicks in where I want it to.
Turns out I had a few more mistakes to fix, but your post put the train back on the rails.
Thanks, Mark! Going to add a big red note that all table entries must be in alphabetical order...
Cheers,
Jan Schenkel.
Turns out I had a few more mistakes to fix, but your post put the train back on the rails.
Thanks, Mark! Going to add a big red note that all table entries must be in alphabetical order...
Cheers,
Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com
www.quartam.com