UBDebug - An Interactive Development Environment for CHDK uBasic Scripts
UBDebug is a PC-based IDE for CHDK ubasic scripts that runs under Windows, Mac OSX (10.3 "Panther" or later) and Ubuntu Linux (perhaps other flavours too). It lets you create and edit scripts, then step through them line by line while inspecting and setting variables. You can also set the values to be returned by some CHDK functions (such as get_usb_power) and any property. Here's what it looks like when it's running (under OSX 10.5):
The following files can be downloaded:
- the debugger zip file (universal version)
- a short PDF document describing how to user the debugger
- an OSX App in disk image form
UBDB.jar | this contains the five java classes which make up the debugger |
ubengine.dll | the native methods and ubasic interpreter (Windows version) |
runubdb.bat | a bat file to run the debugger under Windows (double-click to run) |
libubengine.jnilib | the native methods and ubasic interpreter (Mac OSX version - supports both PowerPC and Intel Macs) |
ubengine.so | the native methods and ubasic interpreter (Ubuntu Linux version) |
runubdb.sh | a bash script to run the debugger under Linux (double-click to run) |
test.bas | a simple test script |
Unzip the files into any convenient directory. To run the debugger simply double-click the .jar file.
Usage Notes
- only uBasic scripts are supported (not Lua)
- scripts can be edited only when not running (i.e. before Start is pressed or after Stop is pressed)
- a breakpoint (only one) can be set by double-clicking on a line. If Run is then pressed, the script executes until the breakpoint is reached (or the script ends)
Last update - January 2012 - add Ubuntu Linux version.
Experimental String Version Available
An extended version of UBDebug which supports strings as well as integers is available here
SDM Version Available
A version which supports SDM is available here
Comments, suggestions and bug reports welcome. Dave@zenoshrdlu.com
See here for other KAP and CHDK stuff of mine.
Note
The uBasic interpreter that forms part of CHDK, and is wrapped up in the DLL, was written by Adam Dunkels, to whom many thanks.
* Copyright (c) 2006, Adam Dunkels * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the author nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE.