PDA

View Full Version : single step execution for debugging



chliu
07-03-2012, 11:02
The thinAir is a very good tool for running the whole program (F5 key), and for single-step (single-line) debugging (F8 key).

But when we have to run a xxxx.tbasic program outside the thinAir, is there a way to do single-step
debugging job ??

For example: (just my assumed idea)
Under dos console prompt, we may just type
"thinBasicc xxxx.tbasic -single" then it will run line by line according to each time the enter-key
is pressed.

ErosOlmi
07-03-2012, 22:24
First of all welcome to thinBasic community forum. I hope you will find thinBasic suitable for your needs.

Back to your question, yes there are other ways to invoke thinBasic debugger outside thinAir:
add
USES "TRACE"
to your script. This will load Trace module and invoke debugger (that is the Trace module) every time the script will be executed
run your script in debug mode adding a @D command parametr like the following:
thinBasic.exe @D <Script file name> [Optional parameters]

Full optional thinBasic syntax is the following:

thinBasic.exe [execution flags] <Script file name> [Optional parameters]

where [execution flags] can be one of the following

@D
Debug mode: the script will be executed in debug mode showing thinbasic debug window. Execution is retained by the debug engine until runtime error or user exiting from debugger.
@O
Obfuscation mode. The script will not be executed but an obfuscated version of the original script will be created in the same directory of the original script. Obfuscated scripts have .tbasicx extension. Execution will immediately return to calling program.
@B
Dependency mode. The script will be partially executed in order to analyse dependant module and include files. A file with the same file name of the original script but with extension .sdep will be created in the same directory or the original script. Execution will immediately return to calling program.

Ciao
Eros

chliu
08-03-2012, 03:45
Thank you for the answer. I'll try it.

chliu
09-03-2012, 00:18
Hi,Eros:
The trace module will evoke the debug window, and it is a very goog tool indeed.
But, there may be an application which needs to automatically monitor the debugging process.

So, one question:
Under single step debugging mode, is there any way to get the exact line number
and the filename of the xxxx.tbasic being executed, and the result flag (the line is ok or notOk)?

The main program and the included programs are merged together inside the thinDegbug window.
If there are many included files, then we don't know what the exact file is runing.

I found no documentation about thinBasic_Trace.dll.
My best regards.

ErosOlmi
09-03-2012, 17:21
Hi chliu,

I'm outside and I cannot completely reply now. I will reply when home or during the week-end.
There are some other few undocumented features maybe you can be interested.
Even if debugged code is the build of main code plus all included code, thinBasic keep track of every line from which file it comes so thinDebug is able to rebuilt the information and pass outside it.
But I will be more precise in a next post

Also I'm really open to listen about suggestions and possible enhancements.

Ciao
Eros

chliu
10-03-2012, 08:24
Hi Eros, what a responsible and kind person you are!
I am not in that rush,take your time please.
Two opinions:
1. Both thinAre and thinDebug need some plug-in mechanism for the some automation purposes.
2. The trace.dll may be ducomented for programers to have a better control.
Could you consider if I am running a program under a totally black screen console, I mean I can't
depend both thinAir and thinDebug, then how could I do single step debugging job?