Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Experimental TRACE module

  1. #1
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Experimental TRACE module

    Be sure to have at least thinBasic preview version 1.6.0.4 installed before testing this module
    _________________________________________________

    I am experimenting a new module called TRACE. This module will let you:
    • trace script execution line by line
    • inspect and change script variables value during execution
    • setting breakpoints
    • ... other things
    In reality I'm still very far from the above list but I wanted to show what's going on here.

    How to use:
    • download attached file
    • substitute thinCore.dll you have in \thinBasic\ directory with the attached one
    • place thinBasic_Trace* files into \thinBasic\Lib\ directory

    Done that, you can start tracing your first script just adding:
    USES "TRACE"
    
    as first line of your script. This line will invoke new TRACE module. A new window will appear (see attached image) and script will stop at every line.

    We are developing TRACE as module and not as native thinAir tool because we are adding to thinBasic Core engine some new function interfaces that will let everybody to develop its own Tracing tools exactly like we are doing now. So everyone knowing how to develop a thinBasic module in whatvever compiled language will be able to develop its own methods to interact with script execution. Done that, we will integrate tracing functionalities directly into thinAir.

    For the moment PLEASE JUST TRACE VERY SIMPLE SCRIPTS AND do not trace any script working with UI module because otherwise you will enter a never ending sequence: messages to close windows will never be handled (in case, use TaskManager and stop thinBasic.exe process).
    Module is not tested much, interaction is very very minimal but I feel confident I will get something usefull from this job.
    Of course obfuscated scripts cannot be traced. For the moment if you try you will get a GPF but in next version you will get a runtime error.

    Let me know what you think, any evident bugs or just ideas.
    I will keep into consideration during development.

    Ciao
    Eros

    Updates:
    • 2008.04.06: removed messagebox. Added F8 (execute line) and CTRL+F8 (execute up to cursor position). Much more usable
    • 2008.04.13: big improvements in Trace module user interface and possibilities: single line steps, execute, break points, variable inspection
    • 2008.04.14: traced script is now shown with its original comments and indentations
    Attached Images Attached Images
    Attached Files Attached Files
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  2. #2
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: Experimental TRACE module

    Working direction:
    • remove messagebox stop Done
    • F5 full execution Done
    • F8 for line execution Done
    • CTRL+F2 set/remove break point Done
    • add rebar buttons with interaction functionalities: line execute, block execute, stop, ...
    • manage source script in native mode (with full comments and indentations). Currently TRACE module loads script already optimized by thinCore
    • manage scripts with included files. Now if script has included files they are inline expanded
    • ability to trace scripts working with UI module messages
    • manage variables inspection Done
    • manage variables interactions
    • store Trace user configuration options


    This list will be updated and integrated with the help of feedbacks.

    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  3. #3
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: Experimental TRACE module

    Thanks Eros,

    I would like to see some Trace_AddWatch(VariableName), Trace_RemoveWatch(VariableName), which could somehow integrate to the debugger editor window (and eliminate MSGBOXing).

    And maybe some TRON ... Trace_On, Trace_Off would be also nice.

    I like it very much so far, the editor with yellow line looks nice, I think I have seen it before in some other sample you posted?


    Really promising!,
    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  4. #4

    Re: Experimental TRACE module

    Hey, that is really cool and for sure become very very helpfull. Thank you!

  5. #5
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: Experimental TRACE module

    Version updated.
    Removed message box.
    Added F8 for line execution
    Added CTRL + F8 execution till cursor (place cursor in some line after current line)

    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  6. #6
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: Experimental TRACE module

    Hey Eros,

    this is gona be really powerful, the manual control + run to cursor is really very usable!
    I like the speed, and everything. I got idea the watch variables could be in listview below under the richedit.

    Only problem now are some artifacts, but when I move the window "under the screen" and back they get properly repainted,
    see the picture.


    Petr

    Attached Images Attached Images
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  7. #7
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: Experimental TRACE module

    Yes, I know about screen repaint but do not worry about screen or whatever related to the edit window.
    I'm currently using CodeSense edit control but only because it gives me fast integration without the need to concentrate on the edit control. Maybe I will change it to something else like Scintilla or even to something home made like we did in thinAir. Or maybe we will use thinAir.

    Currently I'm more target on the "way" to do the whole thing, on the way to interact between script execution engine and tracer/debugger.
    Using an external module open the way to also other to develop other debuggers. For example what about a remote tracer via IP where you execute the script on one computer but trace it on another?

    Just thinking and experimenting.

    Next thing I will work on:
    • break points
    • variable inspections


    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  8. #8

    Re: Experimental TRACE module

    Thanks for the update!

  9. #9

    Re: Experimental TRACE module

    Works perfect!

  10. #10
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404

    Re: Experimental TRACE module

    Thanks Eros. Fantastic idea and I like what is yet to be added too. Thanks a lot, really inspiring to see the coolness that is being added to thinBasic by you, Roberto and all the great module makers!
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

Page 1 of 2 12 LastLast

Similar Threads

  1. New experimental module: GDIP
    By ErosOlmi in forum thinBasic vaporware
    Replies: 2
    Last Post: 06-12-2007, 08:06

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •