Author Topic: Debugger progress  (Read 135789 times)

dzzie

  • Guest
Debugger progress
« 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
« Last Edit: June 23, 2014, 05:37:36 PM by dzzie »

dzzie

  • Guest
Re: Debugger progress
« Reply #1 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.

Support

  • Administrator
  • *****
  • Posts: 22
    • View Profile
Re: Debugger progress
« Reply #2 on: June 28, 2014, 11:27:42 AM »
Looks great Dave!



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.



Support

  • Administrator
  • *****
  • Posts: 22
    • View Profile
Re: Debugger progress
« Reply #3 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.
« Last Edit: June 29, 2014, 12:35:54 AM by support »

dzzie

  • Guest
Re: Debugger progress
« Reply #4 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

Support

  • Administrator
  • *****
  • Posts: 22
    • View Profile
Re: Debugger progress
« Reply #5 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.


Support

  • Administrator
  • *****
  • Posts: 22
    • View Profile
Re: Debugger progress
« Reply #6 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
« Last Edit: July 06, 2014, 08:05:20 PM by support »

dzzie

  • Guest
Re: Debugger progress
« Reply #7 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

« Last Edit: July 07, 2014, 08:37:12 AM by dzzie »

dzzie

  • Guest
Re: Debugger progress
« Reply #8 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

Support

  • Administrator
  • *****
  • Posts: 22
    • View Profile
Re: Debugger progress
« Reply #9 on: July 07, 2014, 10:37:36 AM »
On it!

Thanks for the reply.


Support

  • Administrator
  • *****
  • Posts: 22
    • View Profile
Re: Debugger progress
« Reply #10 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

dzzie

  • Guest
Re: Debugger progress
« Reply #11 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.

GSAC3

  • Guest
Re: Debugger progress
« Reply #12 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

Support

  • Administrator
  • *****
  • Posts: 22
    • View Profile
Re: Debugger progress
« Reply #13 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
« Last Edit: October 03, 2014, 10:24:12 PM by support »

Support

  • Administrator
  • *****
  • Posts: 22
    • View Profile
Re: Debugger progress
« Reply #14 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.
« Last Edit: October 06, 2014, 12:28:52 AM by support »