home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ARM Club 3
/
TheARMClub_PDCD3.iso
/
hensa
/
internet
/
newsbase
/
support
/
!DBAssist2
/
!Help
< prev
next >
Wrap
Text File
|
1994-08-21
|
4KB
|
134 lines
DBAssist2 - a programmers' desktop debugging assistant
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Copyright notice
================
This 100%, hand-crafted, ARM code application is Copyright, 1994, the author
Richard Sargeant. You may NOT include this program or any part thereof in
any commercial software without my prior written permission.
Introduction
============
Conceptual details from !DBAssist
---------------------------------
DBAssist is a small utility program to aid debugging desktop programs.
Instead of having to use Wimp_ReportError to display variables etc. whilst
debugging, or writing them to a file which possibly could be corrupted if the
software crashes the machine, it should send a wimp message to DBAssist,
which will then display the line in a window and optionally write it to a
file also.
Note from Author of !DBAssist2
------------------------------
DBAssist2 is a even *smaller* utility program to aid debugging desktop
programs. Uses 32K versus 96K on my Acorn A5000, or 12K versus 76K when in
use on a Risc PC. :-)
Arc-Binkley compatible
----------------------
Versions 2.19 (and later..?) of this program support redirection of the
low-level debugging output to !DBAssist (V1.02). Not surprisingly both these
programs are maintained by Keith Hall.
!DBAssist2, by Richard Sargeant also supports the same protocol. The display
window records the 64 most recent lines of the debugging output. The window
automatically scrolls, just as !DBAssist and !Binkley do.
It can also record the output to a file, the name of which defaults to
<DBAssist2$Dir>.LogFile, but this can be by-passed by specifying a different
filename as parameters to the last command in the !Run file which invokes
!DBAssist2. Depending on whether the word -log is on this line, the writing
of the debugging data to file may commence as soon as the application is
started. Still only needs 12K, when last checked.
Style of log output
-------------------
The program shows today's date on start-up, and shutdown (if you watch
carefully). The log output includes the time down the left hand side. When
the application receives debugging information from a different application
task, then it's name is recorded. If for some reason the name can not be
found for some reason, like:
a) The Task Manager module has died or has been re-initialised, and
therefore is unaware of the names of tasks already running, or...
b) This program is being run on a RISC OS 2 machine, then...
The task's handle is shown, in hexadecimal, as an compromise.
Multiple copies of applications running and sending debugging messages are
detected, even if the task-names are identical.
Automatic dbassist logging info from !DBAssist V1.02
-----------------------------------------------------
The message is #&82782 (as above, but the first word of the data in the
message being the 'action' code). Codes are:
&827820 - enquire and force DBAssist to respond if present
&827821 - sent by DBAssist when starting and after receiving &827820
&827822 - sent by DBAssist when shutting down.
How to make use of it!
======================
Use from a WIMP application, written in BASIC
---------------------------------------------
DIM mb% 256:REM block to hold debugging information temporaily
:
PROCtrace("Information!")
:
REM tracing procedure
DEF PROCtrace(A$)
!mb%=(25+LEN(A$)) AND-4:mb%!12=0
mb%!16=&82782:$(mb%+20)=A$+CHR$0
SYS"Wimp_SendMessage",17,mb%,0
ENDPROC
Use from a WIMP application, written with DeskLib
-------------------------------------------------
extern void trace(char *);
extern void tracef(char *, ...);
/*
* these functions have been pre-compiled, and are to be found
* in the file dba-object - just copy over as o.dba and add this
* to the list of files you include at link time
*/
perform_test(void)
{
trace ("This is a test of tracing");
tracef("Testing, %s, %d, %d, %d", "testing", 1, 2, 3);
}
---------------------------------------------------------------------------
Richard Sargeant - e-mail Sargeant@arcade.demon.co.uk
netmail Fidonet #2:257/609.8
Or "Ricky Sarge" at Arcade BBS, user number 879,
Digital Databank, user number 402.
---------------------------------------------------------------------------