ScriptBasic

Support => Debugger => Topic started by: dzzie on June 23, 2014, 05:35:44 PM

Title: Debugger progress
Post by: dzzie on June 23, 2014, 05:35:44 PM
The script basic debugger I have been working on is finally far enough along  to make a demo video showing its features :)
All the major design hurtles have been passed, now its just some misc wiring and cleanups left to do. Uses all open source components.

If the video looks a little fuzzy, you can set the quality to HD and it should clear up. (Click gear icon lower right, then click HD)

http://youtu.be/KQMvAA_bGdU
Title: Re: Debugger progress
Post by: dzzie on June 28, 2014, 10:51:03 AM

here is a mid beta build if anyone want to play. All of the major features are in and working. Should be quite usable.
Tested on WinXP SP3 (mostly) and Win7

https://github.com/dzzie/ScriptBasic_Control/raw/master/SBDebug_Setup.exe

Couple notes, you can only edit run time variables for types long and string. This also extends to array values of these types.
I still want to figure out how to implement a "Set Next" command to change execution to the line you want.. invalid lines and not changing scope in or out of functions being the first problem to consider in that though. I also have a mail into Peter to see what he thinks it might take to implement an eval command for an immediate window.
Title: Re: Debugger progress
Post by: Support on June 28, 2014, 11:27:42 AM
Looks great Dave!

(http://files.allbasic.info/ScriptBasic/SBCOM/sbdebugger.png)

Code: [Select]

This project aims to create a VB6 usable ScriptBasic Engine.
along with a an integrated IDE + debugger.

http://en.wikipedia.org/wiki/ScriptBasic

Features include:

 VB6 access class to ScriptBasic Engine
   - AddObject
   - AddCode
   ? Eval

 IDE as VB6 ActiveX control
   - intellisense
   - syntax highlighting
   - integrated debugger
      - breakpoints
      - single step
      - step over
      - step out
      - variable inspection
      - call stack
      - variable modification
      - run to line
 
Notes:

  - auto complete/intellisense has several scopes. hit ctrl+space to trigger.
    if there is a partial identifer already typed, with only one match, the
    string will be auto completed. If there are multiple matches, then the
    filtered results will be show in intellisense list. If no matches are found
    then entire list will be shown.

    The following scopes are supported:

      - import statements - lists *.bas in specified /include directory
      - external module functions - parses the *.bas headers to build func list.
      - built in script basic functions
      - is not currently aware of script variable names
 
   - for module functions (ex curl::) to show up, the matching import must exist
      (include file name, must match embedded module name)

   - debugger variable inspection / modification - When debugging a list view
     of variable names, scopes, and values is kept. You can edit values by right
     clicking its list entry. Array values can be viewed by double clicking on
     its variable name to bring up the array viewer form.

     You can also display a variable value, by hovering the mouse over it in
     the IDE window. A call tip will popup showing its value. Click on the call tip
     to being up the edit value form. Longs and string values are supported. You can
     also prefix a string with 0x for hex numbers.

   - parse errors will show up in their own listview. Each error will get its own entry.
     where possible line numbers, files, and error descriptions are provided. Clicking
     on the entry will jump to that line in the IDE (if one was given by SB engine)

   - changes to scripts are automatically saved each time they are executed.


Title: Re: Debugger progress
Post by: Support on June 29, 2014, 12:32:36 AM
I tried to compile test.exe using Visual Studio 2008 on XP.  (Visual Studio 6  w/VB6 is also installed) It seemed that the test.lib was built (not without warnings - see below) but popped a console window with the Hello World message then an exception error occurred. I tried to do a little debugging and see if I could produce something useful for you to view.
Title: Re: Debugger progress
Post by: dzzie on June 29, 2014, 05:38:59 AM
Sorry I havent documented the build tree at all yet. the test.sln project is up for removal, it was just the initial wrapper i used to get scriptbasic building from the VS project files, and a first run at experimenting with embedding before moving to a dll build.

dll.sln is the real project file which will build the sb_engine.dll
Title: Re: Debugger progress
Post by: Support on June 29, 2014, 09:53:59 AM
Sort of like being in a flight simulator programmed to fail.  ;D

Thanks for the reply, I'll take her up again with a new flight plan this time.

Title: Re: Debugger progress
Post by: Support on July 06, 2014, 06:42:28 PM
Hi Dave,

I have been working with your Script BASIC debugger and couldn't find a way to add to the syntax highlight list. Is this hard coded in? PRINT isn't being highlighted along with a few others. Your thoughts?

I couldn't find a single step button on the tool bar so I thought I would give the old sdbg F8 key a try and it worked. I don't think the F8 is documented anywhere.

BTW I was able to build the sb_engine.dll with my installation of Visual Studio 2008 on XP. (VirtualBox)

How would I rebuild the IDE/Debugger?


John
Title: Re: Debugger progress
Post by: dzzie on July 07, 2014, 07:23:10 AM
Hi John,

The syntax coloring definitions are in the /dependancies/vb.bin file.

The editor component we use is actually another open source vb6 ocx control
called scivb_lite, which in turn wraps the functionality of the open source
C scintilla dll.

https://github.com/dzzie/scivb_lite
http://www.scintilla.org

The syntax definitions file is a binary format. You can use the hilight_editor.exe sub project from
scivb repository to modify it.

https://github.com/dzzie/scivb_lite/raw/master/hilight_editor/hilight_editor.exe

(Note the editor does not have a browse button for the load file textbox,
but you can drag and drop a file into the path textbox to load it.)

I have not done much work with this area of scivb yet. The original scivb was done by a couple other
authors, I spent about a month reworking it for use in my own projects. The vb.bin
file is one that they had provided.

Scintilla also provides some other features that are not currently enabled in the sb debugger such as
code folding, and indentation guides. (The cold folding for basic syntax is actually purely based on
indentation which is buggy hence disabled)

There is a tool bar button for Single step, it is named Step Into. I have recently updated the readme
to show the hot keys supported:

   - special hot keys:

              ctrl-f - find/replace
              ctrl-g - goto line
              ctrl-z - undo
              ctrl-y - redo

              F2     - set breakpoint (runtime only)
              F5     - go
              F7     - single step
              F8     - step over
              F9     - step out
 
To rebuild SBDebug.exe, just open test.vbp in the top level directory in VB6. I will probably change this project file
name to sbdebug.vbp in the future now that the exe has a name.

to rebuild the SBDebug_Setup.exe installer package, you use inno setup and the install_script.iss.

There have also been some updates to SBDebug.exe since the last installer was generated. You can always see the
cutting edge progress from the commit log

https://github.com/dzzie/ScriptBasic_Control/commits/master

Title: Re: Debugger progress
Post by: dzzie on July 07, 2014, 08:34:04 AM
One other thing that could use a second set of eyes,

The function prototypes that show up when you do something like type mid(
are all taken from the file /dependancies/calltips.txt

I generated this list real quickly from the scriptbasic.com html, but still have to
review the arguments list for accuracy.

They have to have a () args list and no spaces in the command name for it to work internally
so things like line input have been omitted.

The listing holds internal sb commands as well as prototypes for functions from
extension modules which must be listed below the #modules marker line.

currently I have only added the prototypes for the nt:: module
Title: Re: Debugger progress
Post by: Support on July 07, 2014, 10:37:36 AM
On it!

Thanks for the reply.

Title: Re: Debugger progress
Post by: Support on July 17, 2014, 06:06:19 PM
Dave,

I was curious if you made any progress at allowing the IDE/Debugger to display properties and methods of COM objects?

I have been looking at your code and seeing if I could make a IUP version of the IDE/Debugger for Linux.

John
Title: Re: Debugger progress
Post by: dzzie on July 22, 2014, 11:00:10 AM
The COM.dll for scriba.exe does include the following methods:
Code: [Select]
declare sub DescribeInterface alias "DescribeInterface" lib "com"
declare sub TypeName alias "TypeName" lib "com"

Usage:
DescribeInterface(obj)
strName =  TypeName(obj)

DescribeInterfacewill pop up its own form that shows basic prototypes for each method.
TypeName will just return a string based name

I did include TypeName in the IDE\Debugger, but not DescribeInterface. Public ActiveX objects usually have
documentation that provides context, so a runtime dump isnt as helpful as initial imagined. Also you can use a
typelibrary viewer to view the same information in a better interface, usually with a search option. TLB viewer is
just a way better way to go than a dumb runtime dump.

So use typename to get the name of the object, then a type library viewer or docs is the best way to go for com
development.
Title: Re: Debugger progress
Post by: GSAC3 on October 03, 2014, 12:50:38 PM
DAVE:

Do you have a version of your Debugger that is built with ScriptBasic version 2.2b2?

The one I downloaded from GITHUB seems to be built using an older version of ScriptBasic that does not include the rad function that John added to 2,2b2.

Don
Title: Re: Debugger progress
Post by: Support on October 03, 2014, 04:05:12 PM
Don,

I hope to rebuild Dave's COM / IDE project this weekend with the current source. I don't know if I will be able to create the install program though.

FYI The RAD and other 14 math functions were added by Tom for the 2.2 release. Tom's math additions and Peter's fix for LIKE is about all that was effected in scriba. Most of the Script BASIC 2.2 release enhancements are extension module based.

John
Title: Re: Debugger progress
Post by: Support on October 05, 2014, 11:09:17 PM
Don,

Here is the rebuild of Dave's Script BASIC IDE/Debugger with the 2.2 enhancements. (Tom's math functions and Peter's LIKE fix)

John

The sb_engine.dll should be the only file you need to update. I included a VB6 recompile of the SBDebug.exe and called it SBIDE.exe.
Title: Re: Debugger progress
Post by: GSAC3 on October 06, 2014, 04:10:49 PM
John:

Thanks John -- I'll give it a try.

Don
 
Title: Re: Debugger progress
Post by: Support on October 07, 2014, 12:43:06 AM
I created a Bitbucket Repository (https://bitbucket.org/ScriptBasic/com) for Dave's Script BASIC COM and IDE/Debugger. Dave's Github repository (maintained by him) has aspirations for a VB6 Script BASIC scripting engine as an ActiveX control. 

The Bitbucket repository has been updated with the Script BASIC 2.2 version and a new Windows installer created.

Attached is the SB COM object interface viewer.

Code: Script BASIC
  1. import com.inc
  2.  
  3. 'on error resume next
  4.  
  5. oExcelApp = CreateObject("Excel.Application")
  6.  
  7. if oExcelApp = 0 then
  8.     print "Failed to create Excel Object do you have it installed?"
  9.     return
  10. end if
  11.  
  12. print "Typename = ", TypeName(oExcelApp), "\n"
  13.  
  14. print "Launching DescribeInterface dialog...\n"
  15. DescribeInterface oExcelApp
  16.  
  17. print "Shutting down Excel and releasing object...\n"
  18. CallByName(oExcelApp, "Quit")
  19. ReleaseObject(oExcelApp)
  20.  
  21. print "Script complete!\n"
  22.  


C:\ScriptBasic_Control-master\engine\COM_Extension_DLL>scriba typeinfo.sb
Typename = _Application
Launching DescribeInterface dialog...
Shutting down Excel and releasing object...
Script complete!

C:\ScriptBasic_Control-master\engine\COM_Extension_DLL>


Here is a thread showing the Script BASIC COM extension module creating an Excel Spreadsheet (http://www.scriptbasic.org/forum/index.php/topic,313.0.html).
Title: Re: Debugger progress
Post by: GSAC3 on October 07, 2014, 12:49:39 PM
JOHN:

Either I am doing something wrong or else there is a bug in the Debugger.

When i load a SB script (for example testmath.sb) an click on the RUN button, everything seems to execute OK.  But if I then click on the scroll bars on the right side of the two windows or if I click anywhere in either window or on any of the program control buttons the Debugger freezes with the "PROGRAM NOT RESPONDING" messages and I have to do several ctl-dels to kill the hung up process "test".

Don

P.S.  I have the same problem when using the previous version before your weekend update.

Title: Re: Debugger progress
Post by: Support on October 07, 2014, 01:45:23 PM
What Windows OS are you running on Don? It seems to work fine in my XP VirtualBox. I'll try it on my Windows 7 64 bit partition and see if I have issues there. Thanks for the feedback.

Hint: I always click on the window (editor/debugger, vars, ...) before scrolling. (mouse/arrows or scrollbars) See if that helps. I would also make sure you're running the latest VB redistributables. thread on the subject (http://www.vbforums.com/showthread.php?679723-Installer-for-VB6-Runtimes-on-Win-7-client-PCs)

Note: I had to use IE to download this VB6 update (http://www.microsoft.com/en-us/download/confirmation.aspx?id=7030) as Firefox gave a network error.
Title: Re: Debugger progress
Post by: Support on October 07, 2014, 04:38:07 PM
Don,

I'm here on Windows 7 64 bit and the Script BASIC IDE/Debugger seems to work fine here as well. Just like on XP.

Title: Re: Debugger progress
Post by: GSAC3 on October 07, 2014, 05:35:52 PM
JOHN:

I am the Debugger on WINDOWS-XP.

Don
Title: Re: Debugger progress
Post by: Support on October 07, 2014, 06:23:09 PM
Don,

I just applied the VB6 SP6 accumulative updates under XP and regenerated the SBDebug.exe program. Can you give this a try and see if it helps?

John
Title: Re: Debugger progress
Post by: GSAC3 on October 08, 2014, 10:43:15 AM
John:

You'r fix did not seem to help at all.

Once I start a RUN and after the execution has finished, the debugger keeps running and can't be stopped.  The debugger hangs in running status and I get the UNRESPONSIVE program message if I click anywhere, even o the STOP button.

Don
Title: Re: Debugger progress
Post by: Support on October 08, 2014, 11:01:24 AM
Do you have VB6 on your system? If not do you have the latest VB6 runtime redistributables installed?

As mentioned before, it works flawlessly on my XP VirtualBox and on my Win7 64 bit partition. How old is your PC? I have asked others to give it a try and report back if they are seeing your symptoms.

Status

Aurel (O2 forum) - XP - IDE and SAPI COM example works.
Title: Re: Debugger progress
Post by: GSAC3 on October 08, 2014, 01:43:17 PM
John:

1.  Don't have VB6 installed on system.

2.  Do have VB6 redistributable files installed.

3.  System is DELL XPS-1710 about 7 yrs old.

Don
Title: Re: Debugger progress
Post by: Support on October 08, 2014, 02:04:43 PM
Are you running XP SP3? What is the speed (mhz/ghz) of your CPU? How much memory do you have?

Title: Re: Debugger progress
Post by: GSAC3 on October 08, 2014, 05:04:42 PM
1.  XP SP2

2.  INTEL CORE 2
     T7600 @ 2.33 GHZ
     2.0 GB RAM

Don
Title: Re: Debugger progress
Post by: Support on October 08, 2014, 08:03:01 PM
Quote
1.  XP SP2

I would highly recommend finding a SP3 update. Your XP system is seriously out of date.