Any interest in an interactive UBasic debugger for PC or Mac (OSX now supported) - Script Writing - CHDK Forum

Any interest in an interactive UBasic debugger for PC or Mac (OSX now supported)

  • 14 Replies
  • 9182 Views
*

Offline zeno

  • *****
  • 889
Advertisements
Over the last few days I've been working on an interactive script debugger. It's written in java (+ some native methods to hook into the CHDK Ubasic interpreter (like ubasic_test.exe). There's a screen shot of its current state at CHDK UBasic Debugger on Flickr - Photo Sharing!

So far you can load scripts and step through them. You can also change parameters before you run a script though at present the changes don't get passed to ubasic. Nor is there currently any way of inspecting/setting variables or setting breakpoints, though I'm pretty sure there could be.

Is this something of interest to many people here? I should point out that it's very much a quick-and-dirty hack - it's only 5 days old and has not been written with portability or internationalisation in mind.

Dave
« Last Edit: 07 / June / 2008, 10:38:22 by zeno »
A570, S100, Ixus 127
Author of ASSIST, STICK, WASP, ACID, SDMInst, LICKS, WICKS, MacBoot, UBDB, CFGEdit

Re: Any interest in an interactive UBasic debugger for PC (or Mac?)
« Reply #1 on: 24 / May / 2008, 13:45:58 »
Im brand new here, only discovered chdk yesterday - but I definately think this is a great idea, keep it up id love to use it! So can it pin point the line where the script crashed etc?

Re: Any interest in an interactive UBasic debugger for PC (or Mac?)
« Reply #2 on: 24 / May / 2008, 13:55:27 »
That's definitely of interest to me. Keep it up.

Re: Any interest in an interactive UBasic debugger for PC (or Mac?)
« Reply #3 on: 27 / May / 2008, 06:30:14 »
zeno, could i get a copy to try? going to start writing scripts today.


*

Offline zeno

  • *****
  • 889
Re: Any interest in an interactive UBasic debugger for PC (or Mac?)
« Reply #4 on: 27 / May / 2008, 11:35:44 »
I plan to make the prototype available in the next day or so. I've added several features:

1. you can dynamicall inspect AND SET parameters and variables
2. you can step through one statement at a time or run to a breakpoint (only one breakpoint so far)
3. you can dynamically set the value to be returned by some functions (currently just get_usb_power and get_tick_count, but it's very easy to add more).

Requirements are java and Windows (more or less any versions of both I think).
A570, S100, Ixus 127
Author of ASSIST, STICK, WASP, ACID, SDMInst, LICKS, WICKS, MacBoot, UBDB, CFGEdit

*

Offline zeno

  • *****
  • 889
Re: Any interest in an interactive UBasic debugger for PC (or Mac?)
« Reply #5 on: 27 / May / 2008, 15:42:39 »
Beta-testers are welcome to download the prototype here http://www.zenonic.demon.co.uk/zips/ubdb.zip

There's a PDF document here http://www.zenonic.demon.co.uk/zips/UBDB.pdf and a screenshot here UBDB UBASIC Debugger for CHDK Scripts on Flickr - Photo Sharing!

Comments, suggestions and bug reports welcome.

Dave
« Last Edit: 27 / May / 2008, 17:45:09 by zeno »
A570, S100, Ixus 127
Author of ASSIST, STICK, WASP, ACID, SDMInst, LICKS, WICKS, MacBoot, UBDB, CFGEdit

*

Offline fe50

  • ******
  • 3132
  • IXUS50 & 860, SX10 Star WARs-Star RAWs
    • fe50
Re: Any interest in an interactive UBasic debugger for PC (or Mac?)
« Reply #6 on: 27 / May / 2008, 17:25:08 »
zeno, it's great !

Runs with Java 1.6.0_03 under Win XP SP3 fine; you asked for suggestions - ok, some ideas:

  • urun.bat:  start /B javaw -cp UBDB.jar UBDebugUI  to close the cmd console window on start automatically (Java RT required)
  • a separate window only for output (like on the cam console)



*

Offline zeno

  • *****
  • 889
Re: Any interest in an interactive UBasic debugger for PC (or Mac?)
« Reply #7 on: 28 / May / 2008, 10:00:41 »
Just to report a couple of bugs:

1. after edit, the function list in separate window does not get refreshed.
2. default statements are not properly handled (you have to set variables to the default value by hand)

Next version (available soon) fixes these, adds is_key to the list of functions (and properly implements sleep and get_day_seconds).
A570, S100, Ixus 127
Author of ASSIST, STICK, WASP, ACID, SDMInst, LICKS, WICKS, MacBoot, UBDB, CFGEdit


Re: Any interest in an interactive UBasic debugger for PC (or Mac?)
« Reply #8 on: 28 / May / 2008, 10:05:46 »
Zeno great idea!!

What do you think to expand this to universal scripting for all camera models and LUA scripting/translation in the future? ;)

Keep it up!

*

Offline zeno

  • *****
  • 889
Re: Any interest in an interactive UBasic debugger for PC (or Mac?)
« Reply #9 on: 29 / May / 2008, 07:39:09 »
The fixed version is now available - see An interactive debugger for CHDK uBasic
A570, S100, Ixus 127
Author of ASSIST, STICK, WASP, ACID, SDMInst, LICKS, WICKS, MacBoot, UBDB, CFGEdit

 

Related Topics