home *** CD-ROM | disk | FTP | other *** search
/ APDL Public Domain 1 / APDL_PD1A.iso / program / debug / wimpdebug / !WimpDebug / Docs / Guide next >
Encoding:
Text File  |  1991-08-27  |  17.8 KB  |  426 lines

  1. |> <WimpDebug$Dir>.Docs.Guide
  2.  
  3. *** WimpDebug Reference Guide ***
  4. Last revision: 26. Aug 1991
  5. Documents WimpDebug v1.21
  6.  
  7. Contents:
  8.  -CLI commands
  9.  -SWI interface for high-level languages
  10.  -ARM code SWI interface
  11.  -The Aasm and BASIC Assembler macros
  12.  -General display characteristics
  13.  -Wimp interface
  14.  -Display errors
  15.  -CLI errors
  16.  
  17.  
  18.  
  19. ______________________________ CLI commands ________________________________
  20.  
  21. -- Boot --
  22.  
  23.    The very first 'CLI command' you enter in connection with this module, in
  24. one way or another, is the one which loads (and starts up) the module,
  25. whether the actual command is "!WimpDebug" or "RMLoad WimpDebug" etc. In all
  26. cases, you may append to the 'boot' command the same set of options as to the
  27. *WDStartTask command.
  28.  
  29.  
  30.  
  31. *WDStartTask [-WindowBg|-WBg <col>]  [-WindowFg|-WFg <col>]
  32.              [-IconBg|-IBg <col>]  [-IconFg|-IFg <col>]
  33.              [-NonvalueBg|-NBg <col>]  [-NonvalueFg|-NFg <col>]
  34.              [-ErrorBg|-EBg <col>]  [-ErrorFg|-EFg <col>]
  35.              [-WindowWidth <width>]  [-LeftWidth <lefticonwidth>]
  36.              [-OpenWindow <0|1>]  [-IconNumbers <0|1>]
  37.  
  38.    This command (re)starts the WimpDebug task, which provides the display
  39. window in the desktop.
  40.    The following options may be specified:
  41.    -Colours: You may specify exactly what colours WimpDebug uses in the
  42. Display window: the window background and foreground colours, the normal
  43. icon colours used, and the icon colours used for indicating non-values and
  44. errors. The colours may be specified either with or without qualifiers. If
  45. qualifiers are not used, the number(s) given are read and assigned in strict
  46. left-to-right order, according to the colour list given in the syntax
  47. description. The colour numbers refer to the standard Wimp colours, and may
  48. thus be in the range 0-15.
  49.    -WindowWidth (width> allows you to specify the width of the work area of
  50. the display window (in OS units) on the desktop. Note that this may be much
  51. wider than what can be seen at once on the screen.
  52.    -LeftWidth <lefticonwidth> sets the width of the icons in the left column
  53. of the Display window. The right column then fills the space left in the
  54. window's work area.
  55.    -OpenWindow <0|1>. This option specifies whether WimpDebug is to open its
  56. Display window immediately when it starts up as a task (e.g. upon entering
  57. the desktop). The number given is treated as a logical flag, i.e as a zero
  58. or non-zero.
  59.    -IconNumbers <0|1>. If you set this option, the icons in the Display
  60. window will be numbered. The number given is treated as a logical flag, i.e
  61. as a zero or non-zero.
  62.  
  63.    All unspecified parameters retain their previous value. The option
  64. settings survive many things, like *RMTidy, but are reset to their default
  65. values by "*RMReInit WimpDebug".
  66.  
  67.    Examples:
  68.  "*RMLoad %.WimpDebug -o 1 8 -efg 0" loads the WimpDebug module from the
  69. current library and sets these options: the OpenWindow option is enabled,
  70. window background colour is set to 8 (dark blue), and the error foreground
  71. colour is set to 0 (white).
  72.  "*WDStart -i 0 -wfg 15 8 2" (re)starts the WimpDebug task after setting
  73. these options: icon numbering is disabled, the window background and
  74. foreground colours are set to 8 (dark blue) and 15 (cyan) respectively, and
  75. the icon background colour is set to 2 (grey).
  76.  
  77.  
  78. *WDShow <icon> <text>
  79.  
  80.    The given text string is displayed in the specified icon as a text
  81. constant. The <icon> number is treated as an expression which is evaluated,
  82. and the text string is GS_Trans'ed before use.
  83.  
  84.  
  85. *WDShowEval <icon> <expression> [<base>]
  86.  
  87.    The given expression is evaluated, and the result (a 32-bit signed
  88. integer) is displayed in the specified icon as a decimal number. Optionally,
  89. the number base may be specified explicitly - it may be either 2, 10 or 16.
  90.  
  91.  
  92. *WDListIcons
  93.  
  94.    Lists the contents of the Display window icons. The data are displayed in
  95. the same way as in the Display window icons.
  96.  
  97.  
  98. *WDClear
  99.  
  100.    Clears all Display window icons.
  101.  
  102.  
  103.  
  104. ________________ SWI interface for high-level languages ____________________
  105.  
  106.    For use of WimpDebug with high-level languages, a set of 'ordinary' SWIs
  107. are provided, which are easier to use and almost as comprehensive as the ARM
  108. code SWI interface
  109.    The general form of these calls are:
  110.  
  111. SWI WD_<disptype>   (&CFF00-&CFF13)
  112.    Entry: R0=icon# to use, range 0-31
  113.           R1=the value to show or use
  114.           R2=offset
  115.    Exit:  Unspecified
  116.  
  117.    R1 and R2 are added before they are displayed or used otherwise (see the
  118. list of examples for how to use this facility).
  119.  
  120.    The display types you may choose between are (codes in decimal):
  121.  
  122. Numbers:     0: Hex          1: HexB         }  Displays the value in the
  123.              2: DecS         3: DecSB        }  specified base. Uses either
  124.              4: DecU         5: DecUB        }  word or byte (LSB) value
  125.              6: Bin          7: BinB
  126.  
  127. (Also, if you append an "I" to these codes (or add 8 to the code), they will
  128. show the data pointed at by the given value instead of the value itself
  129. (i.e. indirected data).)
  130.  
  131. Strings:    16: StringZ       (zero terminated)
  132.             17: StringCR      (zero, CR or LF terminated)
  133.             18: StringSP      (terminated by SPACE or any ctrl.char)
  134.  
  135. These codes display the string pointed at by the given value. The post-fixes
  136. to the SWI names specify how the string is terminated.
  137.  
  138. Others:     19: PC            ('display R15', i.e. PC and PSR separately)
  139.  
  140.  
  141.  
  142. ______________________ ARM code SWI interface ______________________________
  143.  
  144.    For use with ARM programs, a completely different set of SWIs is avaliable
  145. instead of those mentioned above. These SWIs use the SWI number to pass on
  146. information such as the icon to use, the register to show etc. - you don't
  147. need to use specific registers for holding this information. Thus, these SWIs
  148. are completely transparent to the program they are called from.
  149.    ARM SWIs (as I will call them from now on) are identified by b16-b23 of
  150. the SWI number being set, while b0-b15 hold the 'reason code' for the
  151. operation to be performed, as well as other information that may be required.
  152.  
  153.    Bit 15 of the reason code is used to distinguish between two major
  154. classes of operations: 0=display a register, 1=perform housekeeping/special
  155. operations.
  156.  
  157.                                    ----
  158.  
  159. b15=0: (Show register)
  160. Reason code composition: 0ooooooiiiiirrrr, where
  161.       o=display op-code (6-bit value)
  162.       i=icon# to use (0-31)
  163.       r=register# to display (0-15)
  164.  
  165.    Reason codes (hex):
  166.  
  167.      00: hexadecimal word              01: hexadecimal byte
  168.      02: signed decimal word           03: signed decimal byte
  169.      04: unsigned decimal word         05: unsigned decimal byte
  170.      06: binary word                   07: binary byte
  171.  
  172.   08-0F: indirected versions of codes 00-07: the register given is used as a
  173.          pointer to data in memory, which is fetched and shown.
  174.  
  175.      10: string, zero-terminated
  176.      11: string, control-char terminated (i.e. 0, 10 or 13 terminate)
  177.      12: string, space or ctrl terminated (i.e. codes<=32 terminate)
  178.   13-17: unused
  179.  
  180.      18: Display register as PC+PSR
  181.   19-1F: unused
  182.  
  183.      20: Show the register without type specification
  184.   21-27: unused
  185.   28-37: The same as codes 08-17, except that the word following the debug
  186.          SWI instruction is treated as an offset literal and added to the
  187.          value of the specified register before fetching the data to be
  188.          shown. The offset is a two's complement number.
  189.   38-3F: unused
  190.  
  191.                                    ----
  192.  
  193. b15=1: (perform special operations)
  194. Reason code composition: 1oooooxxxxxxxxxx
  195.       o=reason code (5-bit value)
  196.       x=reason code parameters/unused (10-bit value)
  197.  
  198.      00: Set display type for icon without modifying the data shown
  199.          b0-b4=icon# (0-31), b5-b9=display type (00-1F)
  200.      01: Set icon to show string constant following SWI, zero-term.
  201.          b0-b4=icon# (0-31)
  202.   02-1F: unused
  203.  
  204.  
  205.    All op-codes in the above list labelled 'unused' are ignored if called.
  206. They will be used for future expansion.
  207.  
  208.  
  209.  
  210. ______________ The Aasm and BASIC Assembler macro libraries ________________
  211.  
  212.    Hand-calculating the SWI numbers every time you want to use a debug SWI
  213. soon becomes tiresome. To aid you in this respect, a couple of macros are
  214. supplied which do the hard work of assembling the correct SWI instruction,
  215. based on parameters supplied by you.
  216.  
  217.  
  218.                      *** The Aasm/ObjAsm library ***
  219.  
  220.    The supplied library source is ready for inclusion in your program, using
  221. the GET directive. It provides two macros:
  222.  
  223.  Show <reg>,<icon>,<disptype>,<offset>
  224.  ShowStr <icon>,<string>
  225.  
  226.    The 'ShowStr' macro assembles an SWI which in effect resembles the
  227. *WDShow command in action. It simply displays the given string in the
  228. specified icon as a non-value.
  229.  
  230.    The 'Show' macro on the other hand is the core macro, which computes SWI
  231. numbers for all other functions provided by the ARM debug SWI interface. To
  232. achieve the various effects, a number of variations of the basic syntax is
  233. used, which the macro definiton recognises and handles. Note though, that
  234. the fields specified above never change their meaning.
  235.    The display types available are similar to those used in the section 'SWI
  236. interface for high-level languages' above, i.e. 'Hex', 'DecS', 'DecU' etc.
  237. Refer to that section, and the comments at the beginning of the AAsm macro
  238. source file, for further information; also have a look at the examples in
  239. the Tutorial.
  240.  
  241.  
  242.   "Show <reg>,<icon>,<disptype>"
  243. Th is is the basic and most common use of the macro. It will assemble an SWI
  244. instruction which instructs WimpDebug to show the contents of the specified
  245. register in the specified icon using the display type given. The range of
  246. display types accessible by this version of the macro call is those whose
  247. op-code is in the range 00h-1Fh.
  248.  
  249.   "Show <reg>,<icon>,<disptype>,<offset>"
  250.    This variant assembles an SWI instruction with an op-code in the range
  251. 28h-37h. The given offset value is stored in the word following the debug
  252. SWI instruction. When executed, the value is fetched and added to the value
  253. in the specified register before being used for other purposes.
  254.  
  255.   "Show <reg>,<icon>"
  256.    This will assemble an SWI instruction with opcode 20h, i.e. it will
  257. instruct WimpDebug to show the value in the specified register using the
  258. display type already used in the destination icon.
  259.  
  260.   "Show ,<icon>,<disptype>"
  261.    This variant can be used if you want to alter the display type used in an
  262. icon without altering the value shown. It assembles an SWI with a 'special
  263. operation' op-code #0.
  264.  
  265.    The macros perform extensive parameter checking (using the ASSERT
  266. directive), to prevent you from using invalid or erroneous parameters, or
  267. bad combinations of parameters. Things that are trapped include register and
  268. icon values out of range, unknown display types, and invalid parameter
  269. combinations, e.g. "Show ,<icon>,<disptype>,<offset>".
  270.    Note also that if you specify a show operation which includes an <offset>
  271. value, indirection is always used, even if it is not explicitly stated in
  272. the display type.
  273.  
  274.  
  275.                    *** The BASIC Assembler library ***
  276.  
  277.    The WimpDebug macros for the BASIC assembler are supplied as a library to
  278. be included into the main program, using the LIBRARY command. They consist
  279. of user-defined functions which take the required parameters and generate
  280. the necessary code corresponding to the required debug action. 
  281.    These are the functions available:
  282.  
  283.                    FNshow(reg%,icon%,type$)
  284.                    FNshowo(reg%,icon%,type$,offset%)
  285.                    FNsetshowtype(icon%,type$)
  286.                    FNshowtext(icon%,text$)
  287.  
  288. The type specification strings are the same as for the Aasm macros, the only
  289. difference being that the BASIC macros have case insensitive type names. The
  290. individual macros will now be discussed:
  291.  
  292.  -FNshow(reg%,icon%,type$)
  293.    This is the basic macro for assembling an SWI instruction to show the
  294. contents of register reg% in icon icon%, using the display type specified by
  295. type$. If type$ is null/empty, the register value will be shown using the
  296. type already used in the icon.
  297.  
  298.  -FNshowo(reg%,icon%,type$,offset%)
  299.    A variation of FNshow, which allows you to specify an offset value which
  300. is added to the register before it is shown. Indirection is enforced, and
  301. you may not leave type$ empty.
  302.  
  303.  -FNsetshowtype(icon%,type$)
  304.    Assembles an instruction which does nothing but modify the show type used
  305. in an icon, without altering the value shown.
  306.  
  307.  -FNshowtext(icon%,text$)
  308.    Creates code to show text$ in an icon, i.e. it displays a text constant.
  309.  
  310. Note that all the macros assume that p% is used as the 'pass counter'
  311. variable in the assembler - the directive "OPT p%" is used every time the
  312. macros assemble something. Change the library file if this does not suit
  313. you.
  314.  
  315.  
  316.  
  317. _____________________ General display characteristics ______________________
  318.  
  319.    When a WimpDebug SWI is issued, the data shown reflect the state of the
  320. computer at the time of issuing the SWI, i.e. indirected data (including
  321. strings) are copied from the original memory location to a buffer within
  322. WimpDebug. This means that if the monitored value in memory changes later
  323. on, the value WimpDebug shows is not affected.
  324.    Note that when using indirection with number values, the optional 'B' (to
  325. indicate byte values) separates between using the equivalent to LDR and
  326. LDRB. Thus, without 'B', the operation may only access data at a word
  327. aligned address, while 'B' operations may fetch data at any address within
  328. the valid addressing range.
  329.    When displaying strings, WimpDebug will show no more than up to the first
  330. 250 characters of it.
  331.  
  332.    The format WimpDebug uses for showing the various types of data in the
  333. display window is as follows:
  334.   -Indirected data are always preceeded by the string "-> " to signify that
  335. the number shown does not represent the actual value given.
  336.   -Binary numbers: preceeded by the character "%" to indicate the binary
  337. base. In order to prevent unnecessarily long (and unreadable) strings of
  338. digits when displaying binary words, WimpDebug will (a) separate each byte
  339. in the word by a space, i.e. insert a space for every 8th bit, and (b) only
  340. show the significant (non-zero) bytes in the word. So 05A1h will be shown as
  341. "%00000101 10100001".
  342.   -Hexadecimal numbers will be preceeded by the "&" character to indicate
  343. the base of the number.
  344.   -Decimal numbers will be shown spaced, i.e. with a space character
  345. inserted for every 3 digits. So 87990 will be shown as "87 990".
  346.   -Strings will be shown embedded in quotation marks. If the string is
  347. longer than the allowed 250 characters, it will be truncated; this is
  348. indicated by the string having '...' appended to it after the closing
  349. quotemark. Control characters (codes<32) in the string are shown as a
  350. hexadecimal number enclosed in square brackets, eg. the char with ASCII code
  351. 17h is shown as "[17]".
  352.   -'R15'-like values will be shown like this: first the value of the PC on
  353. its own (b2-25 only), displayed as a hexadecimal word. Then the PSR flags and
  354. the interrupt disable bits; these are shown like this: "nZcv-IF" (for
  355. example). The PSR bits should be interpreted like this: lower case letters
  356. means that the bit/flag is reset, capital letters indicate the bit/flag is
  357. set. The interrupt letters are in capitals when the corresponding interrupts
  358. are DISABLED (so "iF" means IRQ enabled, FIQ disabled). Finally, the
  359. processor mode is shown using a three-letter code: USR, IRQ, FIQ, or SVC.
  360.   -Non-values are shown with a different icon background colour than
  361. ordinary items. The term non-value refers to the fact that WimpDebug is not
  362. aware of how the displayed string was obtained, i.e. it was passed the
  363. string directly - no binary number to be converted or to use as a string
  364. pointer was given. The point in this distinction will become more apparent
  365. in (possible) later versions...
  366.  
  367.  
  368.  
  369. ___________________________ The WIMP interface _____________________________
  370.  
  371.    Well, there's not much to be said about this, since it's still quite
  372. simple and straightforward.
  373.    WimpDebug puts an icon on the icon bar. The display window will be opened
  374. when you click on this icon. The icon bar menu has the usual 'Info' item,
  375. along with items for clearing all icons in the window and quitting the
  376. WimpDebug task (the module is not removed by this).
  377.    The current version does not feature a menu or other actions in the
  378. display window.
  379.  
  380.  
  381.  
  382. ____________________________ Display Errors ________________________________
  383.  
  384.    WimpDebug will return an error message if requested to show something
  385. which is in some way illegal or impossible. The message appears in the icon
  386. which was intended for the data, and it is marked as an error message by
  387. special colours (the default is a red background).
  388.    These are the errors WimpDebug can give:
  389.  
  390. #0: Address exception
  391.    You have tried to make WimpDebug show data in memory outside the
  392. allowable address range.
  393.  
  394. #1: Data abort exception
  395.    This error occurs if you try to make WimpDebug access a word in memory at
  396. an address which is not word aligned.
  397.  
  398. #2: Unterminated string at end of memory
  399.    This error occurs if you try to display a string which starts at a valid
  400. address but stretches into an invalid address area, without any terminating
  401. character to be found, i.e. it's sort of an address exception.
  402.  
  403. #3: Unknown show opcode
  404.    WimpDebug does not recognise the show operation code passed to it.
  405.  
  406. #4: Show with unspecified type failed
  407.    You have tried to show some data without specifying a type to use. This
  408. fails if the icon previously held a non-value
  409.  
  410. #5: Show type changes may not be applied to non-values
  411.    You have tried to apply a change of display style to an icon which held a
  412. non-value.
  413.  
  414.  
  415.  
  416. _________________________________ CLI errors _______________________________
  417.  
  418.    &1E6: Unknown WimpDebug operation.
  419.  &CFF00: WimpDebug may only be started manually from within the desktop.
  420.  &CFF01: WindowWidth too small.
  421.  &CFF02: Left column width out of range.
  422.  &CFF03: WimpDebug is unable to restore SWI hardware vector.
  423.  &CFF04: Illegal icon number.
  424.  &CFF05: Unknown window handle passed to WimpDebug for redraw.
  425.  &CFF06: Invalid base specification given to *WDShowEval.
  426.