home *** CD-ROM | disk | FTP | other *** search
/ The Developer Connection…ice Driver Kit for OS/2 3 / DEV3-D1.ISO / docs / kdebug.inf (.txt) < prev    next >
Encoding:
OS/2 Help File  |  1993-06-29  |  92.2 KB  |  2,876 lines

  1.  
  2. ΓòÉΓòÉΓòÉ <hidden> Debug Kernel Reference ΓòÉΓòÉΓòÉ
  3.  
  4. Select One: 
  5.  
  6. Introduction 
  7. Installing Debug Support 
  8. Entering the Debugger 
  9. Expressions 
  10. Operator Precedence 
  11. Binary Operators 
  12. Unary Operators 
  13. Numbers 
  14. Strings 
  15. Symbol Files 
  16. Breakpoints 
  17. Using Kernel Debugger Commands 
  18. Commands (Breakpoint) 
  19. Commands (External) 
  20. Using Default Commands 
  21. Setting Useful Breakpoints 
  22. Debugging Kernel Device Drivers 
  23. Debugging VM Start Sessions 
  24. Debugging the CMD.EXE 
  25. Debugging a Remote System 
  26.  
  27.  
  28. ΓòÉΓòÉΓòÉ 1. Introduction ΓòÉΓòÉΓòÉ
  29.  
  30. This section describes the use of the Kernel Debugger functions in the OS/2 
  31. system. 
  32.  
  33. This release of the OS/2 toolkit contains a copy of the OS/2 debugging kernel. 
  34. It is included to assist you in debugging your applications and drivers until 
  35. higher-level debuggers such as IPMD can provide adequate debugging functions in 
  36. complex situations. 
  37.  
  38. The Kernel Debugger is a low-level debugger oriented toward system and 
  39. device-driver debugging. 
  40.  
  41. The use of this kernel is supported as an aid in debugging your software.  We 
  42. offer support for the installation and use of the debugging kernel and its 
  43. commands and syntax. 
  44.  
  45. The Kernel Debugger is derived from the DEBUG and SYMDEB debuggers, with 
  46. enhancements to handle both real-mode and protected-mode operation. Most of the 
  47. commands and structure of this debugger are the same as for DEBUG and SYMDEB. 
  48. This document describes most of the Kernel Debugger 's commands and new 
  49. features. 
  50.  
  51. The Kernel Debugger is actually a version of the  OS/2 kernel that has a user 
  52. interface included in the kernel itself.  This interface always gets its input 
  53. from an asynchronous port, usually COM2 or COM1, and always prints its output 
  54. to the same asynchronous port. The kernel debugger is a compiled part of the 
  55. kernel. Connect a terminal to communications port 2 (COM2) to receive output 
  56. from the Kernel Debugger. To interrupt the Kernel Debugger at any time, press 
  57. Control and C (Ctrl+C) on the terminal. 
  58.  
  59. The debugger and user interface actually amount to about 80KB (where KB equals 
  60. 1024 bytes) of code and data. 
  61.  
  62. The debugger normally uses COM2 for its input and output, but if no COM2 
  63. exists, it looks for a COM1 port.  If neither COM1 or COM2 exists, it looks for 
  64. any other COM port in the ROM data area (40:0).  A three-wire null modem cable 
  65. is all that is needed, with pins 2 and 3 switched on one end of the cable. A 
  66. full null modem cable works as well. 
  67.  
  68. An asynchronous modem can be used to set up a remote debugging session. In a 
  69. remote debugging session, you call over a telephone line to the system that has 
  70. the problem. This allows you to solve problems at remote locations, using the 
  71. Kernel Debugger. 
  72.  
  73. See Setup for Remote Debugging for more information about remote debugging. 
  74.  
  75.  
  76. ΓòÉΓòÉΓòÉ 2. Installing Debug Support ΓòÉΓòÉΓòÉ
  77.  
  78. The menu-based debug installation program installs debug replacement files for 
  79. the kernel and the Presentation Manager interface. Once the program is 
  80. installed, you can install other debug files, or restore retail files, from the 
  81. OS/2 command prompt. 
  82.  
  83. During initial installation, two files are copied to the root directory of your 
  84. specified installation drive: 
  85.  
  86. DBINST.CMD 
  87.      A command file that can be executed separately.  This file calls 
  88.      DBUGINST.EXE with the requested installation drive as a command-line 
  89.      argument. 
  90.  
  91. DBUGINST.EXE 
  92.      This executable file is the user interface.  The user can choose which 
  93.      parts of the debug system to install, or which parts to restore to the 
  94.      retail version. 
  95.  
  96. INSTALLING FROM DISKETTE 
  97.  
  98. To install and start the debug installation program: 
  99.  
  100.  1. Insert Debug Diskette 1 in drive A. 
  101.  
  102.  2. At the OS/2 command prompt, type: 
  103.  
  104.     a:install c a 
  105.  
  106.      where: 
  107.  
  108.        c   is the drive where OS/2 resides. 
  109.  
  110.        a   is the diskette drive. 
  111.  
  112.     Note:  Do NOT type a colon after the drive letters. 
  113.  
  114.  3. Press Enter.  A screen appears that presents installation choices. 
  115.  
  116. INSTALLING FROM CD-ROM OR REMOTE DISK 
  117.  
  118. To install and start the debug installation program: 
  119.  
  120.  1. Insert the Toolkit installation CD-ROM into the CD-ROM drive. 
  121.  
  122.     Note:  If installation is from a remote disk, ensure you have access to it. 
  123.  
  124.  2. At the OS/2 command prompt, type : 
  125.  
  126.     d:\OS2TK21\CDINST d c 
  127.  
  128.      where: 
  129.  
  130.        d   is the drive of the CD-ROM or remote disk. 
  131.  
  132.        c   is the drive where OS/2 resides. 
  133.  
  134.     Note:  Do NOT type a colon after the drive letters. 
  135.  
  136.  3. Press Enter.  A screen appears that presents installation choices. 
  137.  
  138. The user interface consists of a menu that provides installation choices in 
  139. three optional parts.  It also provides the ability to restore two of those 
  140. parts to their corresponding retail versions. 
  141.  
  142. The menu choices are as follows: 
  143.  
  144. o Install utilities/symbols 
  145. o Install debug kernel 
  146. o Install debug PM 
  147. o Restore retail kernel 
  148. o Restore retail PM 
  149.  
  150. When prompted to enter a debug installation option, choose the options in the 
  151. order they appear on the screen. 
  152.  
  153. When you complete the debug installation procedure, you may need to edit your 
  154. CONFIG.SYS file. 
  155.  
  156.  
  157. ΓòÉΓòÉΓòÉ <hidden> Debug Support - Edit CONFIG.SYS ΓòÉΓòÉΓòÉ
  158.  
  159. EDIT CONFIG.SYS - DEBUG KERNEL 
  160.  
  161. If you installed only the debug kernel, shutdown and restart your system. 
  162.  
  163. Note:  If you have a second communication port, then the output of the debug 
  164. kernel will go to that port (COM2), otherwise output will go to COM1.  Be sure 
  165. to connect your cable to the active port. 
  166.  
  167. RESTORING THE KERNEL 
  168.  
  169. To restore the retail kernel, run the debug installation program and select the 
  170. "Restore Retail Kernel" option. 
  171.  
  172. DEBUG PRESENTATION MANAGER INTERFACE 
  173.  
  174. If you have installed the debug version of the Presentation Manager Interface, 
  175. modify the DEVICE statement with the PMDD.SYS line a follows: 
  176.  
  177. DEVICE=c:\OS2\DEBUG\DLL\PMDD.SYS /Cn 
  178.  
  179. where: 
  180.  
  181. c    is your installation drive 
  182. n    is the communication port for debug output 
  183.  
  184.      Allowed values for n are: 
  185.  
  186.    2 if COM2 is present or 
  187.    1 if COM2 is not present 
  188.  
  189. The DEVICE statement includes the C drive as the installation drive and allows 
  190. you to call the debug version of PMDD.SYS from the OS2\DEBUG\DLL subdirectory. 
  191. The /C switch is set with n as the communication port for the debug output. 
  192.  
  193. Modify the LIBPATH statement by adding the DEBUG\DLL subdirectory as follows: 
  194.  
  195. LIBPATH=C:\OS2\DEBUG\DLL; .... 
  196.  
  197. Shutdown and restart your system to have the changes take effect. 
  198.  
  199. RESTORING THE PRESENTATION MANAGER INTERFACE 
  200.  
  201. To restore the retail Presentation Manager, do the following: 
  202.  
  203.  1. Restore the device statement: 
  204.  
  205.     DEVICE=C:\OS2\PMDD.SYS 
  206.  
  207.  2. Modify the LIBPATH statement by removing the DEBUG\DLL subdirectory. 
  208.  
  209.  3. Shutdown and restart your system to have the changes take effect. 
  210.  
  211.  
  212. ΓòÉΓòÉΓòÉ <hidden> Debug Support - Install Utilities / Symbols ΓòÉΓòÉΓòÉ
  213.  
  214. The Install utilities / symbols option copies all the kernel and the 
  215. Presentation Manager symbol files (.SYM) to the installation partition.  The 
  216. subdirectory structure follows: 
  217.  
  218.   ΓöÇROOT
  219.        ΓööΓöÇΓöÇΓöÇΓöÇ OS2
  220.              Γö£ΓöÇΓöÇ DLL
  221.              ΓööΓöÇΓöÇ DEBUG
  222.                   ΓööΓöÇΓöÇΓöÇΓöÇ DLL
  223.  
  224.  
  225. ΓòÉΓòÉΓòÉ <hidden> Debug Support - Install Debug Kernel ΓòÉΓòÉΓòÉ
  226.  
  227. The Install debug kernel option: 
  228.  
  229. o Unhides OS2KRNL in the root directory 
  230. o Renames it with a .RTL file name extension 
  231. o Replaces it with the debug version from the "DB" diskette 
  232. o Adds a kernel symbol file to the root directory 
  233.  
  234.    ROOT
  235.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  236.   Γöé OS2KRNL      Γöé
  237.   Γöé OS2KRNL.SYM  Γöé
  238.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  239.   Γöé OS2KRNL.RTL  Γöé
  240.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  241.  
  242.  
  243. ΓòÉΓòÉΓòÉ <hidden> Debug Support - Install Debug PM ΓòÉΓòÉΓòÉ
  244.  
  245. The Install debug PM option: 
  246.  
  247. o Unpacks debug versions of the Presentation Manager and display DLLs and 
  248.   PMDD.SYS to the \OS2\DEBUG\DLL directory 
  249. o Replaces the PMWIN symbol file: 
  250.  
  251.   ΓöÇROOT
  252.        ΓööΓöÇΓöÇΓöÇΓöÇΓöÇ OS2
  253.               Γöé
  254.               ΓööΓöÇΓöÇΓöÇ DEBUG
  255.                     Γöé
  256.                     ΓööΓöÇΓöÇΓöÇΓöÇ DLL  ΓöÇΓöÇ  ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  257.                                     Γöé PMDD.SYS  Γöé
  258.                                     Γöé PMDD.SYM  Γöé
  259.                                     Γöé PMGRE.DLL Γöé
  260.                                     Γöé PMWIN.DLL Γöé
  261.                                     Γöé PMWIN.SYM Γöé
  262.                                     Γöé PMGRE.SYM Γöé
  263.                                     ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  264.  
  265.  
  266. ΓòÉΓòÉΓòÉ <hidden> Debug Support - Restore Retail Kernel ΓòÉΓòÉΓòÉ
  267.  
  268. The Restore retail kernel option copies the saved OS2KRNL.RTL file in the root 
  269. directory to the same name without extension, and deletes the .RTL file.  (The 
  270. kernel symbol file will be left in the root directory.) 
  271.  
  272.    ΓöÇROOT
  273.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  274.   Γöé OS2KRNL      Γöé
  275.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  276.  
  277.  
  278. ΓòÉΓòÉΓòÉ <hidden> Debug Support - Restore Retail PM ΓòÉΓòÉΓòÉ
  279.  
  280. The Restore retail PM option describes the config.sys changes required to 
  281. restore the retail version. The debug DLLs (which are currently active) are 
  282. left in the \OS2\DEBUG\DLL subdirectory. 
  283.  
  284.  
  285. ΓòÉΓòÉΓòÉ 3. Entering the Debugger ΓòÉΓòÉΓòÉ
  286.  
  287. There are various ways to enter the debugger. The first way is during 
  288. initialization. If the following keys are pressed at the debugger's console, 
  289. the debugger is entered: 
  290.  
  291. o "r" - (lowercase r) enters the debugger at the beginning of system kernel 
  292.   initialization in real mode. This is very early in system initialization. 
  293.  
  294. o "p" - enters the debugger after going into protected mode for the first time. 
  295.   Symbols have not been loaded yet. 
  296.  
  297. o "<space-bar>" - enters the debugger after most of the kernel has been 
  298.   initialized.  Symbols for the system kernel have been loaded. 
  299.  
  300. After initialization is complete, the debugger can be entered at any time by 
  301. pressing Ctrl+C at the debugger's console. The debugger is entered when and 
  302. where the next timer tick occurs after the keys were pressed. This is the most 
  303. commonly used method to enter the debugger. 
  304.  
  305. An NMI (non maskable interrupt) switch allows you to enter the debugger even if 
  306. interrupts are disabled. Pressing Ctrl+C does not allow this. 
  307.  
  308. An INT 3 in the kernel or in a program will also cause the debugger to stop. 
  309.  
  310. A kernel "panic" is an event where the  OS/2 kernel enters a state where it 
  311. cannot continue to run the system with pure integrity. 
  312.  
  313. When a kernel panic occurs, a message is sent to both the screen and the 
  314. debugger port.  Before sending the message to the screen, the screen is cleared 
  315. and set to text mode.  This can be a problem if you need to see how far a test 
  316. case got before stopping.  If you set the byte flag fDebugOnly to nonzero, the 
  317. message goes to the debug port only, and the screen is left unchanged. 
  318.  
  319. After symbols are loaded, an initialization file named KDB.INI is read and 
  320. executed. KDB.INI is a plain text file that, if used, resides in the root 
  321. directory of the startup drive. Any debugger command or list of debugger 
  322. commands can be in the KDB.INI file.  A "G" command should be at the end of the 
  323. commands unless you want the debugger to stop after the KDB.INI file is 
  324. executed. 
  325.  
  326.  
  327. ΓòÉΓòÉΓòÉ 4. Expressions ΓòÉΓòÉΓòÉ
  328.  
  329. The expression evaluator has been enhanced to provide support for four types of 
  330. addresses - 
  331.  
  332. real mode           (&segment:offset) 
  333. protected mode      (#selector:offset) 
  334. linear address      (%dword) 
  335. physical address    (%%dword) 
  336.  
  337. The symbols: 
  338.  
  339. "&" 
  340. "#" 
  341. "%" 
  342. "%%" 
  343.  
  344. override the current address type, allowing selectors to be used in real mode, 
  345. segments to be used in protected mode, and so on.  The "%" linear address and 
  346. the "%%" physical address operator actually convert other address types to a 
  347. linear or physical address. For example, %(#001F:0220) looks up selector 1F's 
  348. linear address in the current LDT, and adds hex 0220 to it. Linear and physical 
  349. addresses are the same, unless paging is enabled on an  80386 microprocessor. 
  350.  
  351. o ?  <expr> | "<string>" 
  352.  
  353. This command evaluates the expression and prints it in all the standard 
  354. numerical bases, along with the ASCII character for the value and the physical 
  355. address for the address. It also prints an indication of whether the expression 
  356. evaluated to TRUE (nonzero) or FALSE (zero). It prints a string if the string 
  357. is surrounded by single or double quotation marks. 
  358.  
  359. #1f:02C0       Protected-Mode address 
  360.  
  361. &3450:1234     Real-Mode address 
  362.  
  363. %310230        Linear address 
  364.  
  365. %%310230       Physical address 
  366.  
  367. Addresses can be used in any mode.  In real mode, you can use protected mode 
  368. addresses as long as there is an override. The default depends on the current 
  369. debugger mode. 
  370.  
  371. The following are keywords that return the value of registers, breakpoints, and 
  372. so on in expressions: 
  373.  
  374. o AX, BX, CX, DX, SI, DI, BP, DS, ES, SS, CS, SP, IP - register values 
  375.  
  376. o FLG - value of the flags 
  377.  
  378. o GDTB - value of the GDT base as a physical address 
  379.  
  380. o GDTL - value of the GDT limit 
  381.  
  382. o IDTB - value of the IDT base as a physical address 
  383.  
  384. o IDTL - value of the IDT limit 
  385.  
  386. o TR, LDTR, MSW - value of the TR, LDTR, and MSW registers 
  387.  
  388. o BR0, BR1,..., BR9 - the address at that breakpoint. 
  389.  
  390.   The 80386 keywords are (in addition to the above): 
  391.  
  392. o EAX, EBX, ECX, EDX, ESI, EDI, EBP, ESP, EIP - extended register values 
  393.  
  394. o FS, GS - segment registers 
  395.  
  396. o EFLG - value of extend flags 
  397.  
  398. o CR0, CR2, CR3 - control register values 
  399.  
  400. o DR0, DR1, DR2, DR3, DR6, DR7 - debug register values 
  401.  
  402. o TR6, TR7 - test register values. 
  403.  
  404. These register names are searched for first, before the symbol table is 
  405. searched. The "@" character can override the register name lookup, and cause a 
  406. search of the symbol table for the name. The term "@ax" causes a search for a 
  407. symbol called "ax", instead of evaluating to the register value. 
  408.  
  409.  
  410. ΓòÉΓòÉΓòÉ 5. Operator Precedence ΓòÉΓòÉΓòÉ
  411.  
  412. The precedence of the operators has been changed to be more like "C". 
  413.  
  414. If two or more operators have the same precedence, the expression is evaluated 
  415. from left to right. "C" evaluates unary operators from right to left, which is 
  416. more intuitive and easier to use. Expressions such as "poi #60:133" must be 
  417. written as "poi (#60:133)" because of the way the debugger handles unary 
  418. operators. 
  419.  
  420.  1. (  ) 
  421.  
  422.  2. |  : 
  423.  
  424.  3. &  #  %  %%  -  ! NOT  SEG  OFF  BY  WO  DW  POI  PORT  WPORT  (all unary 
  425.     operators) 
  426.  
  427.  4. *  /  MOD 
  428.  
  429.  5. +  - 
  430.  
  431.  6. >  <  >=  <= 
  432.  
  433.  7. ==  != 
  434.  
  435.  8. AND  XOR  OR 
  436.  
  437.  9. &&  || 
  438.  
  439.  
  440. ΓòÉΓòÉΓòÉ 6. Binary Operators ΓòÉΓòÉΓòÉ
  441.  
  442. The following operators evaluate the relationship of two arguments: 
  443.  
  444. ( )           Parentheses, used to change order of evaluation 
  445.  
  446. :             Address binder, binds segment/selector and offsets 
  447.  
  448. *             Multiplication 
  449.  
  450. /             Division 
  451.  
  452. MOD           Modulo (remainder) 
  453.  
  454. +             Addition 
  455.  
  456. -             Subtraction 
  457.  
  458. >             Greater than relational operator 
  459.  
  460. <             Less than relational operator 
  461.  
  462. >=            Greater than or equal to relational operator 
  463.  
  464. <=            Less than or equal to relational operator 
  465.  
  466. ==            Equal to operator 
  467.  
  468. !=            Not equal to relational operator 
  469.  
  470. AND           Bitwise AND 
  471.  
  472. XOR           Bitwise exclusive OR 
  473.  
  474. OR            Bitwise inclusive OR 
  475.  
  476. &&            Logical AND 
  477.  
  478. ||            Logical OR 
  479.  
  480.  
  481. ΓòÉΓòÉΓòÉ 7. Unary Operators ΓòÉΓòÉΓòÉ
  482.  
  483. The following operators expect a single argument. 
  484.  
  485. Ranges are an address and either a length or an end.  "4544:0 L5" is address 
  486. (4544:0) and a length of 5 objects.  If you are dumping words, 5 words are 
  487. dumped.  "#8:32 50" is a range of bytes from address "8:32" to and including 
  488. "8:50". 
  489.  
  490. Note:  For <ranges>, if the second address has a unary operator such as "&" or 
  491. "#", then it must be separated by a comma from the first. Parentheses work as 
  492. well, for example: 
  493.  
  494. >db ds:40,%40000        Correct 
  495.  
  496. >db ds:40 (%40000)      Correct 
  497.  
  498. >db ds:40 %40000        Incorrect 
  499.  
  500. These results are caused by the way in which the expression evaluator parses 
  501. the input. 
  502.  
  503. |             Task number/address operator 
  504.  
  505. &             Address type is segment:offset 
  506.  
  507. #             Address type is selector:offset 
  508.  
  509. %             Address type is linear 
  510.  
  511. %%            Address type is physical 
  512.  
  513. -             Two's complement 
  514.  
  515. !             Logical NOT operator 
  516.  
  517. NOT           Bitwise one's complement 
  518.  
  519. SEG           Returns the segment portion 
  520.  
  521. OFF           Returns the offset portion 
  522.  
  523. BY            1-byte value from the address 
  524.  
  525. WO            2-byte value from the address 
  526.  
  527. DW            4-byte value from the address 
  528.  
  529. POI           4-byte address from the address 
  530.  
  531. PORT          1-byte value from an 8-bit I/O port 
  532.  
  533. WPORT         2-byte value from a 16-bit I/O port 
  534.  
  535.  
  536. ΓòÉΓòÉΓòÉ 8. Numbers ΓòÉΓòÉΓòÉ
  537.  
  538. The default base for numbers in the Kernel Debugger is 16 (hexadecimal). You 
  539. can add a one-letter suffix to the digits of a number to indicate the base of 
  540. the number, as shown in the following table. The term "nnnnnn" represents a 
  541. number that consists of a variable number of digits. 
  542.  
  543. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  544. Γöé Number       Γöé Base          Γöé Valid digits                   Γöé
  545. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  546. Γöé nnnnnnY      Γöé Binary        Γöé 0 1                            Γöé
  547. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  548. Γöé nnnnnnO      Γöé Octal         Γöé 0 1 2 3 4 5 6 7                Γöé
  549. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  550. Γöé nnnnnnQ      Γöé Octal         Γöé 0 1 2 3 4 5 6 7                Γöé
  551. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  552. Γöé nnnnnnT      Γöé Decimal       Γöé 0 1 2 3 4 5 6 7 8 9            Γöé
  553. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  554. Γöé nnnnnnH      Γöé Hexadecimal   Γöé 0 1 2 3 4 5 6 7 8 9 A B C D E FΓöé
  555. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  556.  
  557.  
  558. ΓòÉΓòÉΓòÉ 9. Strings ΓòÉΓòÉΓòÉ
  559.  
  560. A string can be represented as follows: 
  561.  
  562. o 'characters' 
  563.  
  564. o "characters" 
  565.  
  566. A string represents a list of ASCII values.  It can be any number and 
  567. combination of characters enclosed in single (') or double (") quotation marks. 
  568. The starting and ending quotation marks must be the same type.  If a matching 
  569. quotation mark appears inside the string, it must be given twice to prevent the 
  570. debugger from ending the string too soon. 
  571.  
  572. Examples: 
  573.  
  574. o 'This is a string' 
  575.  
  576. o "This is a string" 
  577.  
  578. o 'This ''string'' is okay' 
  579.  
  580. o "This ""string"" is okay" 
  581.  
  582.  
  583. ΓòÉΓòÉΓòÉ 10. Symbol Files ΓòÉΓòÉΓòÉ
  584.  
  585. The Kernel Debugger supports symbolic debugging. The MAPSYM utility program 
  586. converts a .MAP file to a .SYM file. When a symbol file (generated with MAPSYM) 
  587. is loaded by the operating system, the debugger can use public symbols in the 
  588. operating system, executable programs, dynamic link libraries, or any device 
  589. driver as part of an expression. The disassembler and the BL command also 
  590. display addresses symbolically if the symbol exists for the address. 
  591.  
  592. The debugger uses the MAPSYM format for the symbol file. The statement MAPSYM 
  593. MAPFILE.MAP generates the .SYM file MAPFILE.SYM. The kernel's symbols must be 
  594. on the system startup drive in the root directory, in a file named OS2KRNL.SYM. 
  595. For device drivers, the .SYM file must be in the same directory as the device 
  596. driver file with the .SYM extension. 
  597.  
  598. To load symbols for a program or module, the .SYM file must be in the same 
  599. directory as the .EXE or .DLL file, and the symbols will be loaded 
  600. automatically. 
  601.  
  602. The file name of the .SYM file must match that of the executable (program, 
  603. device driver or DLL) it corresponds to. 
  604.  
  605. There can be more than one symbol file loaded at one time, and more than one 
  606. currently active. The WA, WR and LM commands control and list the currently 
  607. active map files.  The term map file refers to the .SYM file generated by 
  608. MAPSYM.  Each newly-loaded map file starts in the active state. 
  609.  
  610. The message Symbols Linked (xxxxxxxx) is printed when a symbol file loads 
  611. successfully.  The "xxxxxxx" is the map name listed in the LM command.  The 
  612. message Symbols Unlinked (xxxxxxxxx) is printed when a program that has loaded 
  613. symbols stops and the symbol file is removed. 
  614.  
  615. Symbols are case insensitive. 
  616.  
  617.  
  618. ΓòÉΓòÉΓòÉ 11. Using Kernel Debugger Commands ΓòÉΓòÉΓòÉ
  619.  
  620. There are many Kernel Debugger commands that allow you to control execution of 
  621. the system under test. 
  622.  
  623. Most commands are one or two characters, with one-character options.  The 
  624. semicolon character (;) is the command separator, and the comma (,) or a blank 
  625. is the operand separator. 
  626.  
  627. When the syntax of the command is shown, the following conventions are used: 
  628.  
  629. o Arguments between square brackets ([ ]) are optional. 
  630.  
  631. o A vertical bar (|) indicates that either argument is acceptable. 
  632.  
  633. The definitions of some of the arguments used in the commands are as follows: 
  634.  
  635.  <range>  = <addr> [<word>] | [<addr>] [L <word>] 
  636.  
  637.  <addr>  = [& | #][<word>:]<word> | %<dword> 
  638.  
  639.  <list>  = <byte>, <byte>, ... | "string" 
  640.  
  641.  <string> = "char" | 'char' 
  642.  
  643.  <dword>, 
  644.  
  645.  <word> , 
  646.  
  647.  <byte>  = evaluate to the size indicated in the symbols <>. 
  648.  
  649. Some examples of how to use the debugger follow: 
  650.  
  651.  ##? 
  652.  
  653. This command gets you a help screen, and '.?' gets you a help screen for the 
  654. extended commands. 
  655.  
  656.  ##.P 
  657.  
  658. This command displays all of the processes running in the system.  The 
  659. left-hand column of this display shows the 'slot number', which is important 
  660. for the '.ss' command. 
  661.  
  662. When you set a breakpoint in an application, the current debugger 'context' 
  663. must be changed to that process.  For example, if you press Ctrl+C and you 
  664. interrupt while 'BAR.EXE' is executing, but you want to set a breakpoint in 
  665. 'FOO.EXE', you must change the debugger context to 'FOO.EXE'. 
  666.  
  667.  ##SS [slot number] 
  668.  
  669. Type '.p', find out the slot number of 'FOO.EXE', and type '.ss [slot number]'. 
  670. Now you can set breakpoints in 'FOO.EXE'. Because .DLLs have no 'process' 
  671. associated with them, in order to set a breakpoint in a .DLL you need to be in 
  672. the context of an application that is dynamically linked to that .DLL. 
  673.  
  674.  ##BP [addr] 
  675.  
  676. This sets a break point at the address [addr].  [addr] can be symbolic or 
  677. numerical. For 32-bit applications, this is a 32-bit address. For 16-bit 
  678. applications, this is a 16-bit address. 
  679.  
  680. ##BC [bp number] 
  681.  
  682. ##BD [bp number] 
  683.  
  684. ##BC * 
  685.  
  686. ##BD * 
  687.  
  688. 'BC [bp number]' clears a breakpoint, while 'BD' disables it. 'BC *' clears all 
  689. breakpoints, while 'BD *' disables all breakpoints. 
  690.  
  691. ##DA [addr] 
  692.  
  693. ##DB [addr] 
  694.  
  695. ##DW [addr] 
  696.  
  697. ##DD [addr] 
  698.  
  699. The above commands stand for 'dump ASCII', 'dump byte', 'dump word' and 'dump 
  700. doubleword' respectively, and display memory starting at address [addr].  DW 
  701. [addr] L 20 would display hex 20 words starting at [addr]. 
  702.  
  703.  ##E [addr] 
  704.  
  705. This allows you to edit memory (change memory contents) at [addr]. 
  706.  
  707.  ##K 
  708.  
  709. This gives a stack-frame backtrace of the current application (even at ring 0). 
  710.  
  711.  ##.K [slot number] 
  712.  
  713. This gives a stack-frame backtrace of the thread in this slot. If you are in 
  714. ring 0, this causes a ring-3 backtrace. 
  715.  
  716.  ##DD SS:ESP 
  717.  
  718. This dumps the stack data at the current top of the stack. 'ESP' always points 
  719. to the last value pushed onto the stack. 
  720.  
  721.  ##DD SS:EBP 
  722.  
  723. This is what links 'C' stack-frames together at any time.  The 'EBP' register 
  724. points to the location on the stack where the old 'EBP' is saved. After 'EBP' 
  725. is located on the stack, you get the return address and then the parameters 
  726. passed to the function that is currently executing. References to [EBP+n] refer 
  727. to passed parameters, while references to [EBP-n] refer to local variables. 
  728.  
  729.  ##G 
  730.  
  731. This means 'go' or execute. 
  732.  
  733.  ##R 
  734.  
  735. This dumps the register set. To set a register, type 'r [reg] = value'. For 
  736. example, 'r EAX = 6' puts 6 into register EAX. To re-execute some code or to 
  737. jump ahead in the code, reset the instruction pointer by typing 'r EIP=[addr]'. 
  738.  
  739.  ##P 
  740.  
  741. This steps through the code using the INT 3 type of stepping to step over 
  742. function calls. 
  743.  
  744. Note:  If a function exits to an address other than the return address (where 
  745. the INT 3 is waiting), you might get unexpected results. Keep track of what 
  746. happens within the conditional jump and looping constructs of your program. 
  747.  
  748.  ##T 
  749.  
  750. This single-steps through the code. This does not use the INT 3 type of 
  751. stepping as 'p' does, but actually steps into any call to a function. 
  752.  
  753.  
  754. ΓòÉΓòÉΓòÉ 12. The Breakpoint (BP) Command ΓòÉΓòÉΓòÉ
  755.  
  756. A breakpoint command is a string of any debugger commands that are executed 
  757. when that breakpoint is hit. Semicolons (;) separate commands from one another. 
  758. All command text is forced to uppercase unless surrounded by single quotation 
  759. marks. Two single or double quotation marks remove their special meaning. 
  760.  
  761. There are two kinds of breakpoints in the Kernel Debugger: temporary (sometimes 
  762. called GO breakpoints) and sticky.  Temporary breakpoints are set when the GO 
  763. command is executed, and are removed when the debugger is entered again for any 
  764. reason (hitting a GO or sticky breakpoint, a trap or fault, and so on). Sticky 
  765. breakpoints are created, removed, and disabled with the commands defined below. 
  766.  
  767. If a passcount greater than 0 is used, the breakpoint must be executed that 
  768. many times before the debugger actually breaks. The default for passcount is 0. 
  769.  
  770. If you set a breakpoint in an LDT segment when a thread other than thread 1 is 
  771. running, that breakpoint will be moved to thread 1 when the current thread ends 
  772. (so that it can still be addressed).  When thread 1 ends, the breakpoint will 
  773. be disabled, and its address will be marked as invalid.  When that task slot is 
  774. reused, the breakpoint can be enabled again. 
  775.  
  776. On an 80386 processor, the debug registers can be used in a sticky breakpoint. 
  777. See the BR command. 
  778.  
  779.  ##BP[n] [<address>] [<passcount>] [<breakpoint commands>] 
  780.  
  781. This command sets a new breakpoint, or changes an old sticky breakpoint. The 
  782. "n" is an optional breakpoint number to select an old breakpoint for changing 
  783. or forcing a new breakpoint to a certain number. If the breakpoint number is 
  784. omitted, the first available breakpoint number is used. The number must be just 
  785. after the "BP", with no intervening space. It must be a digit from '0' to '9'. 
  786. There must be a space after the number. Up to 10 breakpoints can be set. The 
  787. address is required for all new breakpoints. Either an address or a breakpoint 
  788. number can be used to change an existing breakpoint. A breakpoint command or 
  789. passcount can be added or changed with commands such as BP0 "DB DS:ESI;R" or 
  790. BP2 5. 
  791.  
  792.  ##BR[<bp>] E|W|R|1|2|4 [<addr>] [<passcnt>] ["<bp cmds>"] 
  793.  
  794. This command sets an 80386 debug register.  Debug registers can be used to 
  795. break on data reads and writes, and instruction execution.  This is the same 
  796. action used by a regular breakpoint).  Up to 4 debug registers can be set and 
  797. enabled at one time.  Disabled BR breakpoints no longer occupy a debug 
  798. register.  The flag definitions are: 
  799.  
  800. Flag      Description 
  801.  
  802. 1         One-byte length (default) 
  803.  
  804. 2         Word length on a word boundary 
  805.  
  806. 4         Doubleword length on a doubleword boundary 
  807.  
  808. E         Break on instruction execution only (one-byte length only) 
  809.  
  810. W         Break on writes only 
  811.  
  812. R         Break on reads and writes 
  813.  
  814. For one-byte breakpoints, the linear address alignment can be anywhere; 
  815. however, for word-length breakpoints the linear address must be on a word 
  816. boundary.  For a doubleword-length breakpoint, the linear address must be on a 
  817. doubleword boundary.  The debugger converts the address to linear, and prints 
  818. an error message if the alignment is incorrect. 
  819.  
  820. Only addresses that can be converted to linear (segment, selector, and linear, 
  821. but not physical) can be used in the BR command address. The rest of the 
  822. arguments are exactly like a BP command. 
  823.  
  824. ##BT[<n>] [<address>] 
  825.  
  826. Sets a time-stamping breakpoint. 
  827.  
  828. ##BS 
  829.  
  830. Shows the time-stamp entries. 
  831.  
  832. ##BL 
  833.  
  834. This command lists the currently set breakpoints along with the current and 
  835. original passcount and the breakpoint command, if any.  An "e" after the 
  836. breakpoint number means that the breakpoint is enabled; a "d" means that it is 
  837. disabled.  After either one of those, there may be an "i" which indicates that 
  838. the address was invalid the last time the debugger tried to set or clear the 
  839. breakpoint. 
  840.  
  841. ##BC[n],[n],... 
  842.  
  843. Removes (clears) the list of breakpoint numbers from the debugger's breakpoint 
  844. table. 
  845.  
  846. ##BE[n],[n],... 
  847.  
  848. Enables the list of breakpoint numbers. 
  849.  
  850. ##BD[n],[n],... 
  851.  
  852. Disables the list of breakpoint numbers, so the breakpoint is not actually put 
  853. into the code but is saved until it is enabled. 
  854.  
  855.  
  856. ΓòÉΓòÉΓòÉ 13. Breakpoint Commands ΓòÉΓòÉΓòÉ
  857.  
  858. The following is a list of breakpoint commands: 
  859.  
  860. ?    Help (?) 
  861. BC   Break Clear 
  862. BD   Break Disable 
  863. BE   Break Enable 
  864. BL   Break List 
  865. BP   Breakpoint 
  866. BR   Break Register 
  867. BS   Break Show time stamps 
  868. BT   Break Time stamp 
  869. C    Compare 
  870. D    Dump memory 
  871. DB   Dump memory in Bytes 
  872. DD   Dump memory in Dwords 
  873. DG   Dump GDT entries 
  874. DI   Dump IDT entries 
  875. DL   Dump LDT entries 
  876. DW   Dump memory in Words 
  877. E    Enter 
  878. F    Fill 
  879. GO   Go 
  880. H    Hex 
  881. I    Input 
  882. J    Conditional Execution 
  883. K    Stack trace 
  884. LA   List Absolute symbols 
  885. LG   List active Groups 
  886. LM   List Maps 
  887. LN   List Near symbols 
  888. LS   List all Symbols 
  889. M    Move 
  890. O    Output 
  891. P    Ptrace 
  892. R    Register 
  893. S    Search 
  894. T    Trace Point 
  895. U    Unassemble 
  896. VC   Clear Interrupt and trap Vector 
  897. VL   List Interrupt and trap Vector 
  898. VT   Add Interrupt and trap Vector 
  899. VS   Add Interrupt and trap Vector 
  900. WA   Add active map 
  901. WR   Remove active map 
  902. Y    Debugger option 
  903.  
  904.  
  905. ΓòÉΓòÉΓòÉ 14. External Commands ΓòÉΓòÉΓòÉ
  906.  
  907. The debug external (dot) commands include the following: 
  908.  
  909. .?             Help for external commands 
  910. .B             COM port Baud rate 
  911. .C             Dump ABIOS Common data area 
  912. .D             Dump DOS data structures 
  913. .I             Swap In page 
  914. .IT            Swap In TSD 
  915. .K             User stack trace 
  916. .LM            Print MTE segment table 
  917. .MA            Memory Arena record dump 
  918. .MC            Memory Context record dump 
  919. .ML            Memory ALias record dump 
  920. .MO            Memory Object record dump 
  921. .MP            Memory Page frame dump 
  922. .MV            Memory Virtual page structure dump 
  923. .P             Print Process information 
  924. .R             User Register 
  925. .REBOOT        Restart the system 
  926. .S             Task context change 
  927. .T             RAS Trace buffer print 
  928.  
  929.  
  930. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The COMPARE (C) Command ΓòÉΓòÉΓòÉ
  931.  
  932. ##C <range> <addr> 
  933.  
  934. This command compares the bytes in the memory location specified by <range> 
  935. with the corresponding bytes in the memory locations beginning at <addr>.  If 
  936. all corresponding bytes match, the Kernel Debugger displays its prompt and 
  937. waits for the next command. If one or more corresponding bytes do not match, 
  938. each pair of mismatched bytes is displayed. 
  939.  
  940.  
  941. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The DUMP (D) Command ΓòÉΓòÉΓòÉ
  942.  
  943. ##D [<range>] 
  944.  
  945. Dumps memory in the last format used. 
  946.  
  947. ##DA [<range>] 
  948.  
  949. Dumps memory in ASCII format only. 
  950.  
  951. ##DB [<range>] 
  952.  
  953. Dumps memory in bytes and ASCII. 
  954.  
  955. ##DW [<range>] 
  956.  
  957. Dumps memory in words. 
  958.  
  959. ##DD [<range>] 
  960.  
  961. Dumps memory in doublewords. 
  962.  
  963. ##DG[A] [<range>] 
  964.  
  965. This command dumps the global descriptor table (GDT). The "A" option causes all 
  966. the entries to be dumped (not just the valid entries).  The default is to 
  967. display only the valid GDT entries.  A range of entries or just one GDT entry 
  968. can be displayed.  If the command is passed an LDT selector, it displays "LDT" 
  969. and the appropriate LDT entry. 
  970.  
  971. ##DI[A] [<range>] 
  972.  
  973. This command dumps the interrupt descriptor table.  The A option causes all the 
  974. entries to be dumped (not just the valid entries).  The default is to display 
  975. just the valid IDT entries.  A range of entries or just one IDT entry can be 
  976. displayed. 
  977.  
  978. ##DL[A|P|S|H] [<range>] 
  979.  
  980. This command dumps the local descriptor table.  The A option causes all the 
  981. entries to be dumped (not just the valid entries).  The default is to display 
  982. just the valid LDT entries.  A range of entries or just one LDT entry can be 
  983. displayed.  If the command is passed a GDT selector, it displays "GDT" and the 
  984. appropriate GDT entry. 
  985.  
  986. The options P, S, and H are used to dump private, shared, or huge segment 
  987. selectors respectively.  To dump the huge segment selectors, give the shadow 
  988. selector, followed by the maximum number of selectors reserved for that 
  989. segment, plus 1. 
  990.  
  991. ##DP[A|D] [<range>] 
  992.  
  993. This command dumps the page directory and page tables.  Page tables are always 
  994. skipped if the corresponding page directory entry is not present.  Page 
  995. directory entries appear with an asterisk next to the page frame, and are 
  996. dumped once preceding a 4-megabyte region. As a general rule, you can ignore 
  997. any lines beginning with an asterisk. 
  998.  
  999. The A option dumps all present page directory and page table entries; the 
  1000. default is to skip page directory and page table entries that are zero.  A zero 
  1001. page table entry means that the page is uncommitted. 
  1002.  
  1003. The D option dumps only page directory entries.  If a count is given as part of 
  1004. the optional range, it is interpreted as a page directory entry count.  For 
  1005. example: 
  1006.  
  1007.   ##dp ff000 l4
  1008.    linaddr   frame   pteframe  state res Dc Au CD WT Us rW Pn state
  1009.   %000ff000* 00343  frame=00343  2    0  D  A        U  W  P  resident
  1010.   %000ff000  000ff  frame=000ff  1    0  c  A        U  W  P  uvirt
  1011.   %00100000  002ae  frame=002ae  0    0  c  A        U  W  P  pageable
  1012.   %00101000  00215  vp id=0083c  0    0  c  u        U  W  n  pageable
  1013.   %00102000         vp id=0083d  0    0  c  u        U  W  n  pageable
  1014.  
  1015.                         bit   bit
  1016.                         set  clear
  1017.                         ---  -----
  1018.                  key:    D    c    Dirty / clean
  1019.                          A    u    Accessed / unaccessed
  1020.                          U    s    User / supervisor
  1021.                          W    r    Writable / read-only
  1022.                          P    n    Present / not-present
  1023.  
  1024. The pteframe field contains the contents of the high-order 20 bits in the PTE. 
  1025. If the page is present, that value is the high-order 20 bits of the physical 
  1026. address that the page maps. To find out information about that physical 
  1027. address, you can issue the .MP command. If the page is not present, the 
  1028. pteframe field contains an index into the Virtual Page (VP) structure. The .MV 
  1029. command can dump information from that structure. A non present page might 
  1030. still be cross-linked to a page of physical memory via the VP, and if it is, 
  1031. that physical address is in the frame column. 
  1032.  
  1033. An exception is that uvirt pages (noted in the state column) are direct 
  1034. mappings of physical memory, without any other page manager structures 
  1035. associated with them. 
  1036.  
  1037. ##DT [<addr>] 
  1038.  
  1039. This command dumps the TSS.  If no address is given, it dumps the current TSS 
  1040. pointed to by the TR register, extracting the type (16-bit or 32-bit) from the 
  1041. descriptor access byte. If an address is given, the type is extracted from the 
  1042. 386env flag. 
  1043.  
  1044. ##DX 
  1045.  
  1046. This command dumps the 80286 loadall buffer. 
  1047.  
  1048.  
  1049. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The ENTER (E) Command ΓòÉΓòÉΓòÉ
  1050.  
  1051. ##E <addr> [<list>] 
  1052.  
  1053. This command enters one or more byte values into memory at the specified 
  1054. <addr>.  If the optional <list> is given, the command replaces the byte at the 
  1055. given address and the bytes at each subsequent address until all values in the 
  1056. list have been used. If no <list> is given, the command prompts for a 
  1057. replacement value. 
  1058.  
  1059. If an error occurs, all byte values remain unchanged. 
  1060.  
  1061. If you do not supply a <list>, the Kernel Debugger prompts for a new value at 
  1062. <addr> by displaying this address and its current value followed by a dot (.). 
  1063. You can then replace the value, skip to the next value, return to a previous 
  1064. value, or exit the command by following these steps: 
  1065.  
  1066. o To replace the byte value, simply type the new value after the current value. 
  1067.   Make sure you type a 1-digit or 2-digit hexadecimal number.  The command 
  1068.   ignores extra trailing digits or other characters. 
  1069.  
  1070. o To skip to the next byte, press the Spacebar.  Once you have skipped to the 
  1071.   next byte, you can change its value or skip to the next byte.  If you skip 
  1072.   beyond an 8-byte boundary, the Kernel Debugger starts a new display line by 
  1073.   displaying the new address and value. 
  1074.  
  1075. o To return to the preceding byte, type a hyphen (-). When you return to the 
  1076.   preceding byte, the Kernel Debugger starts a new display line with the 
  1077.   address and value of that byte. 
  1078.  
  1079. o To exit the E command, press Return. You can exit the command at any time. 
  1080.  
  1081.  
  1082. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The FILL (F) Command ΓòÉΓòÉΓòÉ
  1083.  
  1084. ##F <range> <list> 
  1085.  
  1086. This command fills the addresses in the given <range> with the values in the 
  1087. <list>.  If the range specifies more bytes than the number of values in the 
  1088. list, the list is repeated until all bytes in the range are filled.  If <list> 
  1089. has more values than the number of bytes in the range, the command ignores any 
  1090. extra values. 
  1091.  
  1092.  
  1093. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The GO (G) Command ΓòÉΓòÉΓòÉ
  1094.  
  1095.  ##G[S][T][=<start-address>][<break-address>],,, 
  1096.  
  1097. This command passes execution control to the program at the given 
  1098. <start-address>.  Execution continues to the end of the code or until a 
  1099. <break-address> is encountered.  The debug code also stops at any breakpoints 
  1100. set using the Breakpoint Set command. 
  1101.  
  1102. If no <start-address> is given, the command passes execution to the address 
  1103. specified by the current values of the CS and IP registers. The equal sign (=) 
  1104. can be used only when a <start-address> is given. 
  1105.  
  1106. If a <break-address> is given, it must specify an instruction address (that is, 
  1107. the address must contain the first byte of an instruction opcode).  Up to ten 
  1108. addresses can be given at one time. The addresses can be given in any order. 
  1109. Only the first address encountered during execution causes a break.  All others 
  1110. are ignored.  If you attempt to set more than ten breakpoints, an error message 
  1111. is displayed. 
  1112.  
  1113. The S option prints the time (in PERFVIEW timer ticks) from when the system is 
  1114. started with GS until the next entry is made in the debugger. No attempt is 
  1115. made to calculate and remove debugger overhead from the measurement. 
  1116.  
  1117. The T option allows trapped exceptions to resume at the original trap handler 
  1118. address without having to unhook the exception. Instead of issuing the vcp d; 
  1119. t; and vsp d commands, you can use the T option of the GO command. 
  1120.  
  1121. When execution of the debug code reaches a breakpoint, the kernel debugger 
  1122. normally displays the current values of the registers and flags.  It also 
  1123. displays the next instruction to be executed. If the default command (Z) has 
  1124. been changed to something other than the REGISTER (R) command, the debugger 
  1125. executes the command list set by the last ZS command. 
  1126.  
  1127.  
  1128. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The HELP/PRINT (?) Command ΓòÉΓòÉΓòÉ
  1129.  
  1130. ##?[<expr>]|'string' 
  1131.  
  1132. This command prints help if no arguments are given. If an expression is given, 
  1133. it prints the value of the evaluated expression in all bases. If a string is 
  1134. given, it prints the string on the console. 
  1135.  
  1136.  
  1137. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The Hex (H) Command ΓòÉΓòÉΓòÉ
  1138.  
  1139. ##H <value1> <value2> 
  1140.  
  1141. This command displays the sum and difference of two hexadecimal numbers. The 
  1142. debugger adds <value1> to <value2> and displays the result. It then subtracts 
  1143. <value2> from <value1> and displays that result. The results are displayed on 
  1144. one line and are always hexadecimal. See the "Help/Print Expression" command 
  1145. for a more general expression display. 
  1146.  
  1147.  
  1148. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The INPUT (I) Command ΓòÉΓòÉΓòÉ
  1149.  
  1150. ##I <port> 
  1151.  
  1152. This command reads and displays 1 byte from the given input <port>. The <port> 
  1153. can be any 16-bit port address. 
  1154.  
  1155.  
  1156. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The List Near Symbol Command (LN) Command ΓòÉΓòÉΓòÉ
  1157.  
  1158. ##LN [<addr>] 
  1159.  
  1160. This command lists the nearest symbol both forward from and backward to the 
  1161. address passed.  The default is the current disassembly address. All the active 
  1162. maps are searched. 
  1163.  
  1164. There is the possibility that there will be duplicates when <addr> is specified 
  1165. as a selector:offset. Make sure that you have selected the correct slot (with 
  1166. the .S command) before you issue the LN command with a selector:offset. 
  1167.  
  1168.  
  1169. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The List Groups (LG) Command ΓòÉΓòÉΓòÉ
  1170.  
  1171. ##LG [<mapname>] 
  1172.  
  1173. This command lists the selector or segment and the name for each group in the 
  1174. active maps or the specified map. 
  1175.  
  1176.  
  1177. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The List Maps (LM) Command ΓòÉΓòÉΓòÉ
  1178.  
  1179. ##LM 
  1180.  
  1181. This command lists all the current symbol files that are loaded and shows which 
  1182. ones are active. 
  1183.  
  1184.  
  1185. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The List Absolute Symbols (LA) Command ΓòÉΓòÉΓòÉ
  1186.  
  1187. ##LA [<mapname>] 
  1188.  
  1189. This command lists all the absolute symbols in the active maps or the specified 
  1190. map. 
  1191.  
  1192.  
  1193. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The List Symbols (LS) Command ΓòÉΓòÉΓòÉ
  1194.  
  1195. ##LS <addr> 
  1196.  
  1197. This command lists all the symbols in the group that the address is in. 
  1198.  
  1199.  
  1200. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The Add/Remove Active Map (WA/WR) Commands ΓòÉΓòÉΓòÉ
  1201.  
  1202. ##WA <mapname> | * 
  1203.  
  1204. ##WR <mapname> | * 
  1205.  
  1206. "WA" adds a map to the active list.  "WR" removes it. 
  1207.  
  1208.  
  1209. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The Conditional Execution (J) Command ΓòÉΓòÉΓòÉ
  1210.  
  1211. ##J <expr> [<command list>] 
  1212.  
  1213. This command executes the command list if the expression evaluates to TRUE 
  1214. (nonzero).  Otherwise, it continues to the next command in the command line 
  1215. (not including the ones in the "command list"). The command list must be in 
  1216. single or double quotation marks if there is more than more command (separated 
  1217. by ";"). A single command, or no command, can also be used without quotation 
  1218. marks. This command can be used in breakpoint commands to conditionally break 
  1219. when an expression becomes true, or even in the default command (Z). 
  1220.  
  1221. The command BP 167:1454 "J AX == 0; G" breaks when AX equals 0 when this 
  1222. breakpoint is hit. 
  1223.  
  1224. The command BP 167:1452 "J BY (DS:SI+3) == 40 'R; G';DG DS" prints the 
  1225. registers and continues execution, if when this breakpoint is hit the byte 
  1226. pointed to by "DS:SI+3" is equal to 40.  Otherwise, it prints the descriptor 
  1227. table entry in DS. 
  1228.  
  1229. The command BP 156:1455 "J (MSW AND 1) == 1 'G'" breaks when the breakpoint is 
  1230. reached in real mode.  BP 156:1455 "J (MSW AND 1)" is a shortcut that does the 
  1231. same thing (like "C" Boolean expressions). 
  1232.  
  1233. See the default command (Z) for more examples. 
  1234.  
  1235.  
  1236. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The Stack Trace (K) Command ΓòÉΓòÉΓòÉ
  1237.  
  1238. ##K[S|B] [<SS:EBP>] [<CS:EIP>] 
  1239.  
  1240. This command threads through the BP chain on the stack and prints the address, 
  1241. 4 words or doublewords of parameters, and any symbol found for the address. 
  1242. The starting stack frame address (SS:EBP) and the initial code segment (CS:EIP) 
  1243. can be specified.  Defaults are SS:EBP and CS:EIP.  The "S" (Small) option 
  1244. indicates that the frame is 16 bits wide, and the "B" (Big) option indicates 
  1245. that the frame is 32 bits wide.  The default depends on the D bit in the CS 
  1246. selector. 
  1247.  
  1248.  
  1249. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The Move (M) Command ΓòÉΓòÉΓòÉ
  1250.  
  1251. ##M <range> <addr> 
  1252.  
  1253. This command moves the block of memory specified by <range> to the location 
  1254. starting at <addr>. 
  1255.  
  1256. All moves are guaranteed to be performed without data loss, even when the 
  1257. source and destination blocks overlap.  This means the destination block is 
  1258. always an exact duplicate of the original source block.  If the destination 
  1259. block overlaps some portion of the source block, the original source is 
  1260. changed. 
  1261.  
  1262. To prevent data loss, this command copies data from the source block's lowest 
  1263. address first whenever the source is at a higher address than the destination. 
  1264. If the source is at a lower address, this command copies data from the source's 
  1265. highest address first. 
  1266.  
  1267.  
  1268. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The Output (O) Command ΓòÉΓòÉΓòÉ
  1269.  
  1270. ##O <port> <byte> 
  1271.  
  1272. This command sends the given <byte> to the specified output <port>.  The <port> 
  1273. can be any 16-bit port address. 
  1274.  
  1275.  
  1276. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The Ptrace (P) Command ΓòÉΓòÉΓòÉ
  1277.  
  1278. ##P[N|T] [=<start-address>] [<count>] 
  1279.  
  1280. This command executes the instruction at the given <start-address>, and then 
  1281. displays the current values of the all the registers and flags (or whatever the 
  1282. Z command has been set to). 
  1283.  
  1284. The difference between PTRACE and TRACE commands is that PTRACE stops after 
  1285. instructions such as CALL, REP MOVSB, and so on, instead of tracing into the 
  1286. call or each rep string operation. 
  1287.  
  1288. If the optional <start-address> is given, the command starts execution at the 
  1289. given address.  Otherwise, it starts execution at the instruction pointed to by 
  1290. the current CS and IP registers.  The equal sign (=) may be used only if a 
  1291. <start-address> is given. 
  1292.  
  1293. If the optional <count> is given, the command continues to execute <count> 
  1294. instructions before stopping.  The command displays the current values of the 
  1295. registers and flags for each instruction before executing the next. 
  1296.  
  1297. The "N" option suppresses the register display, so that only the assembly line 
  1298. is displayed.  This only works if the "default command" (see the Z command) is 
  1299. an "R" (the normal setting). 
  1300.  
  1301. The "T" option allows the original trap handler address to be traced into 
  1302. without having to unhook the exception. Instead of issuing the "vcp d; t; vsp 
  1303. d" commands, you can use the "T" option of the PTRACE command. 
  1304.  
  1305.  
  1306. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The Register (R) Command ΓòÉΓòÉΓòÉ
  1307.  
  1308. ##R[T][<register-name> [<value>]] 
  1309.  
  1310. This command displays the contents of a CPU register and allows the contents to 
  1311. be changed to a new value. 
  1312.  
  1313. The T option toggles the "regterse" flag (see the Y command). 
  1314.  
  1315. If no <register-name> is given, the command displays all the registers, flags, 
  1316. and the instruction at the address pointed to by the current CS and IP register 
  1317. values. 
  1318.  
  1319. If a <register-name> is given, the command displays the current value of the 
  1320. given register, and prompts for a new value.  If both a <register-name> and 
  1321. <value> are given, the command changes the register to the given value. 
  1322.  
  1323. The <register-name> can be any one of the following names: 
  1324.  
  1325. o AX, BX, CX, DX, SI, DI, BP, SP, IP, PC - general registers. 
  1326.  
  1327. o DS, ES, SS, CS - segment registers. 
  1328.  
  1329. o GDTB - GDT base as a linear address. 
  1330.  
  1331. o GDTL - GDT limit. 
  1332.  
  1333. o IDTB - IDT base as a linear address. 
  1334.  
  1335. o IDTL - IDT limit. 
  1336.  
  1337. o TR, LDTR - TR, LDTR registers. 
  1338.  
  1339. o IOPL - input/output privilege level portion of flag registers. 
  1340.  
  1341. o F - flag register. 
  1342.  
  1343. o MSW - Machine status word. 
  1344.  
  1345. The 80386 <register-names> are the following (in addition to the above): 
  1346.  
  1347. o EAX, EBX, ECX, EDX, ESI, EDI, EBP, ESP, EIP - extended general registers. 
  1348.  
  1349. o FS, GS - segment registers. 
  1350.  
  1351. o EF - extended flag register. 
  1352.  
  1353. o CR0, CR2, CR3 - control registers. 
  1354.  
  1355. o DR0, DR1, DR2, DR3, DR6, DR7 - debug registers. 
  1356.  
  1357. o TR6, TR7 - test registers. 
  1358.  
  1359. IP and PC name the same register - the Instruction Pointer. F is a special name 
  1360. for the Flags register. 
  1361.  
  1362. To change a register value, supply name of the register when you enter the 
  1363. REGISTER command.  If you do not also supply a value, the command displays the 
  1364. name of the register, its current value, and a colon prompt.  Type the new 
  1365. value, and press Return.  If you do not want to change the value, just press 
  1366. Return.  If you enter a name that is not allowed, the command displays an error 
  1367. message. 
  1368.  
  1369. To change a flag value, supply the register name F when you enter the REGISTER 
  1370. command.  The command displays the current value of each flag as a two-letter 
  1371. name.  The following is a table of flag values: 
  1372.  
  1373. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  1374. Γöé          Values for the Flag Register                          Γöé
  1375. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1376. Γöé FLAG             Γöé SET                  Γöé CLEAR                Γöé
  1377. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1378. Γöé Overflow         Γöé OV                   Γöé NV                   Γöé
  1379. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1380. Γöé Direction        Γöé DN (Decrement)       Γöé UP (Increment)       Γöé
  1381. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1382. Γöé Interrupt        Γöé EI (Enabled)         Γöé DI (Disabled)        Γöé
  1383. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1384. Γöé Sign             Γöé NG (Negative)        Γöé PL (Plus)            Γöé
  1385. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1386. Γöé Zero             Γöé ZR                   Γöé NZ                   Γöé
  1387. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1388. Γöé Aux Carry        Γöé AC                   Γöé NA                   Γöé
  1389. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1390. Γöé Parity           Γöé PE (Even)            Γöé PO (Odd)             Γöé
  1391. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1392. Γöé Carry            Γöé CY                   Γöé NC                   Γöé
  1393. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1394. Γöé Nested Task      Γöé NT                   Γöé (toggles)            Γöé
  1395. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  1396.  
  1397. At the end of the list of values, the command displays a hyphen (-). When you 
  1398. see the hyphen, enter new values for the flags you want to change, and then 
  1399. press Return.  You can enter flag values in any order.  Spaces between values 
  1400. are not required.  Flags for which new values are not entered remain unchanged. 
  1401. If you do not want to change any flags, just press Return. 
  1402.  
  1403. If you enter a name other than those shown above, the command prints an error 
  1404. message.  The flags up to the error are changed; flags at and after the error 
  1405. are not changed. 
  1406.  
  1407. Changing the MSW (Machine Status Word) is the same as changing the flag 
  1408. registers, but with the following flag names: 
  1409.  
  1410. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  1411. Γöé          Values for the Machine Status Word                Γöé
  1412. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1413. Γöé FLAG                             Γöé SET    Γöé CLEAR          Γöé
  1414. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1415. Γöé Protected Mode                   Γöé PM     Γöé (toggles)      Γöé
  1416. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1417. Γöé Monitor Processor Extension      Γöé MP     Γöé (toggles)      Γöé
  1418. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1419. Γöé Emulate Processor Extension      Γöé EM     Γöé (toggles)      Γöé
  1420. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1421. Γöé Task Switched                    Γöé TS     Γöé (toggles)      Γöé
  1422. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  1423.  
  1424. "Toggles" means that if the flag is set, using the flag name in the REGISTER 
  1425. command clears it.  If the flag is clear, using the flag name in the REGISTER 
  1426. command sets it. 
  1427.  
  1428.  
  1429. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The Search (S) Command ΓòÉΓòÉΓòÉ
  1430.  
  1431. ##S <range> <list> 
  1432.  
  1433. This command searches the given <range> of memory locations for the byte values 
  1434. given in <list>.  If the bytes in the list are found, the command displays the 
  1435. address of each occurrence of the list.  Otherwise, it displays nothing. 
  1436.  
  1437. The <list> can have any number of bytes.  Each must be separated by a space or 
  1438. comma.  If the list contains more than one byte, this command does not display 
  1439. an address unless the bytes beginning at that address exactly match the value 
  1440. and order of the bytes in the list. 
  1441.  
  1442.  
  1443. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The Trace (T) Command ΓòÉΓòÉΓòÉ
  1444.  
  1445. ##T[A|C|N|S|T|X][=<start-address>][<count>][<addr>] 
  1446.  
  1447. This command executes the instruction at the given <start-address>, and then 
  1448. displays the current values of all the registers and flags. 
  1449.  
  1450. If the optional <start-address> is given, the command starts execution at the 
  1451. given address.  Otherwise, it starts execution at the instruction pointed to by 
  1452. the current CS and IP registers.  The equal sign (=) may be used only if a 
  1453. <start-address> is given. 
  1454.  
  1455. If the optional <count> is given, the command continues to execute a number of 
  1456. instructions equal to <count> before stopping. The command displays the current 
  1457. values of the registers and flags for each instruction before executing the 
  1458. next instruction. 
  1459.  
  1460. The A option allows the user to specify an ending address for the trace. 
  1461. Instructions are traced until [<addr>] is reached. 
  1462.  
  1463. The C option suppresses all output, and counts instructions traced.  An end 
  1464. address is required for this command. 
  1465.  
  1466. The N option suppresses the register display, so that only the assembly line is 
  1467. displayed.  This only works if the "default command" (see the Z command) is an 
  1468. R (the normal setting). 
  1469.  
  1470. The S (special trace) option is identical to the C option, except that the 
  1471. instruction and count are displayed for every call and the return from that 
  1472. call. 
  1473.  
  1474. The T option allows the original trap handler address to be traced into without 
  1475. having to unhook the exception. Instead of issuing the vcp d; t; and  vsp d 
  1476. commands, you can use the T option of the TRACE command. 
  1477.  
  1478. The X option forces the debugger to trace regions of code known to be 
  1479. untraceable (such as, _PGSwitchContext). 
  1480.  
  1481.  
  1482. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The Unassemble (U) Command ΓòÉΓòÉΓòÉ
  1483.  
  1484.  ##U [<range>] 
  1485.  
  1486. This command displays the instructions in a mnemonic format. All the  80386 and 
  1487. 80387 opcodes can be displayed. 
  1488.  
  1489. If given a <range>, the specified address is displayed for the number of bytes 
  1490. specified.  If the <range> contains the L option (for example, u 90:234 l3), 
  1491. this specifies the number of lines to display. 
  1492.  
  1493.  
  1494. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The Interrupt and Trap Vector (VL) Command ΓòÉΓòÉΓòÉ
  1495.  
  1496.  ##VL[N | P | V | R | F] 
  1497.  
  1498. This command lists the real- and protected-mode vectors that the debugger 
  1499. intercepts. Vectors that have been set with VT (rather than with VS) are 
  1500. printed with an asterisk following the vector number. VLR lists only the real 
  1501. mode vectors, and VLP lists only the protected mode vectors.  VL lists both, as 
  1502. follows: 
  1503.  
  1504.     R 0 1 2 3 4 5 6
  1505.     V 0 1 2
  1506.     P 0 1 2 3 4 5 6 7 8* 9 A B
  1507.  
  1508. The N (Noisy) option lists the traps that beep when hit. 
  1509.  
  1510. The F (Fatal) option causes the kernel to route the faults that are fatal to a 
  1511. process to the debugger instead of displaying the popup message.  For GP 
  1512. faults, "VSF D" is the same a "VSP D".  For page faults, "VSP E" traps all ring 
  1513. 3 and ring 2 page faults, and "VSF E" traps only the invalid page faults. 
  1514.  
  1515. ##VT[N | P | V | R | F] n[,n,..] 
  1516.  
  1517. This command adds a new vector that the debugger intercepts. VTR installs a 
  1518. debugger handler in the real mode IDT. VTP installs a debugger handler in the 
  1519. protected mode IDT. VSV or VTV intercepts V86 mode exceptions or traps. 
  1520.  
  1521. The "N" option causes the intercepted traps to beep when hit. 
  1522.  
  1523. The "F" (Fatal) option causes the kernel to route the faults that are fatal to 
  1524. a process to the debugger instead of displaying the popup message.  For GP 
  1525. faults, "VSF D" is the same a "VSP D".  For page faults, "VSP E" traps all ring 
  1526. 3 and ring 2 page faults, and "VSF E" traps only the invalid page faults. 
  1527.  
  1528. ##VS[N | P | V | R | F] n[,n,..] 
  1529.  
  1530. This command is the same as VT, except that VS does not intercept ring 0 
  1531. interrupts. The VSV and VTV commands intercept V86 mode exceptions or traps. 
  1532.  
  1533. The "N" option causes the intercepted traps to beep when hit. 
  1534.  
  1535. The "F" (Fatal) option causes the kernel to route the faults that are fatal to 
  1536. a process to the debugger instead of displaying the popup message.  For GP 
  1537. faults, "VSF D" is the same a "VSP D".  For page faults, "VSP E" traps all ring 
  1538. 3 and ring 2 page faults, and "VSF E" traps only the invalid page faults. 
  1539.  
  1540. ##VC[N | P | V | R | F] n,[n],.. 
  1541.  
  1542. This command clears the vectors indicated, reinstalling whatever address was in 
  1543. the vector before the debugger obtained the vector. 
  1544.  
  1545. The "N" option causes the affected traps to not beep when hit. It does not 
  1546. clear the trap itself. 
  1547.  
  1548. The "F" (Fatal) option causes the kernel to route the faults that are fatal to 
  1549. a process to the debugger instead of displaying the popup message.  For GP 
  1550. faults, "VSF D" is the same a "VSP D".  For page faults, "VSP E" traps all ring 
  1551. 3 and ring 2 page faults, and "VSF E" traps only the invalid page faults. 
  1552.  
  1553. Note:  If you want to intercept general protection faults before the operating 
  1554. system does, then you can issue "VTP D" before the fault is hit, examine the 
  1555. information about the fault, and issue "VCP D" and "G" to let the system GP 
  1556. handler get control and end the process. Alternatively, you can issue the "VCP 
  1557. D" command after hitting the fault, and trace into the exception handler.  The 
  1558. "TT" and "GT" commands do this automatically. 
  1559.  
  1560.  
  1561. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The Debugger Option (Y) Command ΓòÉΓòÉΓòÉ
  1562.  
  1563. ##Y[?] [386env|dislwr|regterse] 
  1564.  
  1565. This command allows the debugger configuration to be changed. The "?" prints 
  1566. the current options supported.  The "Y" command by itself prints the current 
  1567. state of the options.  The "Y" command and a flag name sets or toggles an 
  1568. options flag. The flags are as follows: 
  1569.  
  1570. 386env      32-bit environment (toggles) 
  1571.  
  1572. dislwr      lowercase disassembly (toggles) 
  1573.  
  1574. regterse    terse register set (toggles) 
  1575.  
  1576. All these flags toggle their state when set, and are printed only when the 
  1577. option is on. 
  1578.  
  1579. The "386env" flag controls the size of addresses, registers, and so on when 
  1580. displayed.  When this option is on, addresses, registers, and so on are printed 
  1581. in 32-bit formats; otherwise they are printed in 16-bit formats.  This flag has 
  1582. nothing to do with the processor in which the debugger is executing. It only 
  1583. concerns the display sizes. 
  1584.  
  1585. The "dislwr" flag controls the disassembler's lowercase option. When the flag 
  1586. is on, disassembly is in lowercase. 
  1587.  
  1588. The "regterse" flag controls the number of registers displayed in the register 
  1589. dump command.  In the 32-bit format, when the "regterse" flag is on, only the 
  1590. first three lines are displayed (instead of the normal six-line plus 
  1591. disassembly-line display).  In the 16-bit format (386env off), only the first 
  1592. two lines of the normal three-line display (plus the disassembly line) are 
  1593. printed. 
  1594.  
  1595.  
  1596. ΓòÉΓòÉΓòÉ 15. Using Default Commands ΓòÉΓòÉΓòÉ
  1597.  
  1598. ##Z 
  1599.  
  1600. This command executes the default command. The default command is a string of 
  1601. debugger commands that are executed any time the debugger is entered and there 
  1602. is no breakpoint command attached to the entry.  It starts as only the "R" 
  1603. command, but any string of commands can be used. 
  1604.  
  1605. ##ZL 
  1606.  
  1607. This command lists the default command. 
  1608.  
  1609. ##ZS <string> 
  1610.  
  1611. This command changes the default command.  If there are any errors (too long), 
  1612. it returns to the R command. 
  1613.  
  1614. If you want to process through all the INT 3s in your application or test 
  1615. program, you can use the following command: 
  1616.  
  1617.     ZS "J (BY CS:EIP) == CC 'G';R."
  1618.  
  1619. This restarts execution every time you enter the debugger on an INT 3. 
  1620.  
  1621. A watchpoint can be set up as follows: 
  1622.  
  1623.     ZS "J (WO 40:1234) == 0EED 'r'; T"
  1624.  
  1625. This command traces until the word at 40:1234 is equal to hex 0EED. This will 
  1626. not work if you are tracing through the mode-switching code in the operating 
  1627. system or other sections of code that cannot be traced. 
  1628.  
  1629.  
  1630. ΓòÉΓòÉΓòÉ 16. External Debugger Commands ΓòÉΓòÉΓòÉ
  1631.  
  1632. These commands are part of the debugger but are specific to the environment in 
  1633. which the debugger is running.  The following commands are for the OS/2 
  1634. environment. 
  1635.  
  1636.  
  1637. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The Help (.?) Command ΓòÉΓòÉΓòÉ
  1638.  
  1639.  ##.? 
  1640.  
  1641. This command prints the help menu for the external debugger commands. 
  1642.  
  1643.  
  1644. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The COM Port BAUD Rate (.B) Command ΓòÉΓòÉΓòÉ
  1645.  
  1646.  ##.B <baud rate> [<port addr>] 
  1647.  
  1648. This command sets the baud rate of the debugging port. Valid values for the 
  1649. baud rate are 150, 300, 600, 1200, 2400, 4800, 9600 and 19200.  Because the 
  1650. default base of numbers for the debugger is 16, you must add the suffix "T" to 
  1651. a decimal (base 10) number to indicate a decimal value.  For example, if you 
  1652. want to debug over a 1200-baud line, the correct command is: 
  1653.  
  1654.     .B 1200T
  1655.  
  1656. The port address option can be "1" for COM1, or "2" for COM2. Anything else is 
  1657. taken as a base port address.  During initialization, if there is no COM2, the 
  1658. debugger checks for COM1 and then any other COM port address in the ROM data 
  1659. area, and uses it as the console. 
  1660.  
  1661.  
  1662. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The Dump ABIOS Common Data Area (.C) Command ΓòÉΓòÉΓòÉ
  1663.  
  1664.  ##.C 
  1665.  
  1666. This command dumps the ABIOS common data area. 
  1667.  
  1668.  
  1669. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The Dump OS/2 Data Structures (.D) Command ΓòÉΓòÉΓòÉ
  1670.  
  1671.  ##.D <data structure name> [<addr>] 
  1672.  
  1673. This command displays a few common OS/2 data structures. The data structures 
  1674. supported are: 
  1675.  
  1676. Name        Description 
  1677.  
  1678. SFT         System file table entry 
  1679.  
  1680. VPB         Volume parameter block 
  1681.  
  1682. DPB         Disk parameter block 
  1683.  
  1684. CDS         Current Directory Structure 
  1685.  
  1686. KSEM        Internal Kernel Semaphore 
  1687.  
  1688. DT          Disk Trace 
  1689.  
  1690. DEV         Device driver header 
  1691.  
  1692. REQ         Device driver request packet 
  1693.  
  1694. MFT         Master file table entry 
  1695.  
  1696. BUF         File system buffer 
  1697.  
  1698. BPB         BIOS parameter block 
  1699.  
  1700. SEM32       32-bit Semaphore structure 
  1701.  
  1702. MUXQ        32-bit Semaphore MuxQ chain 
  1703.  
  1704. OPENQ       32-bit Semaphore OpenQ chain 
  1705.  
  1706.  
  1707. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The Swap in TSD or Page (.I/.IT) Commands ΓòÉΓòÉΓòÉ
  1708.  
  1709.  ##.I[D|B] [<addr>] 
  1710.  
  1711. If only ".I" is given, the page enclosing that address is swapped in.  The 
  1712. address may include an optional task slot number override, as in %3|20000. 
  1713.  
  1714.  ##.IT[D|B] [<slot>] 
  1715.  
  1716. The ".IT" command swaps in the corresponding task's TSD.  The "D" option queues 
  1717. a single swap-in request to be acted upon at task time by the KDB daemon 
  1718. thread. If the "D" option is not given, this command is restricted to being 
  1719. executed in user mode (ring 3 or ring 2) or in kernel mode if it is not 
  1720. interrupt time, and if the thread is not blocked when swapping or leaving the 
  1721. kernel (InDos is 0).  The ".I[T]" command checks for all these conditions, and 
  1722. prints an error. 
  1723.  
  1724.  
  1725. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The User Stack Trace (.K) Command ΓòÉΓòÉΓòÉ
  1726.  
  1727.  ##.K[<slot> | # | *] 
  1728.  
  1729. This command threads through the BP chain on the user stack of the slot 
  1730. specified, and prints the address, 4 words or doublewords of parameters, and 
  1731. any symbol found for the address.  The default starting point is taken from the 
  1732. user SS:EBP and CS:EIP of the debugger's default slot (the one selected with 
  1733. .S).  The S (Small) option indicates that the frame is 16 bits wide, and the B 
  1734. (Big) option indicates that the frame is 32 bits wide. The default depends on 
  1735. the D bit in the user's CS. 
  1736.  
  1737.  
  1738. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The Print Module Table Entry Segment Table (.LM) Command ΓòÉΓòÉΓòÉ
  1739.  
  1740.  ##.LM[O][L|P|V|X] [<hobmte|laddr|"modulename">] 
  1741.  
  1742. This command prints module table entries (MTEs) and their associated object and 
  1743. segment table entries. 
  1744.  
  1745. The "O" option suppresses the object or segment table display. 
  1746.  
  1747. The "L" option displays only library (.DLL) MTEs. 
  1748.  
  1749. The "P" option displays only Physical Device Driver (PDD) MTEs. 
  1750.  
  1751. The "V" option displays only Virtual Device Driver (VDD) MTEs. 
  1752.  
  1753. The "X" option displays only executable (.EXE) MTEs. 
  1754.  
  1755. If a nonzero HOBMTE is given, only those MTEs with a matching HOBMTE are 
  1756. printed.  If a nonzero linear address is given, only the MTE pointed to by the 
  1757. linear address is printed.  If a quoted string is given, only those MTEs with a 
  1758. matching module name are printed. The module names for A:\BAR.DLL and 
  1759. C:\FOO\BAR.EXE are both "BAR".  No drive, path, or extension information should 
  1760. be given. 
  1761.  
  1762.  
  1763. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The Memory Arena Record Dump (.MA) Command ΓòÉΓòÉΓòÉ
  1764.  
  1765.  ##.MA[A|B|C|F|H|L|M|R] [<har|laddr>] | [<har|laddr> L<number of entries>] 
  1766.  
  1767. This command displays the virtual memory manager's arena records. If no handle 
  1768. or linear address is given, the entire table is displayed.  If a linear address 
  1769. is given, it is considered a pointer to an arena record.  One record or a range 
  1770. of records can be displayed. 
  1771.  
  1772. The "A" option displays all contexts (the default is the current context only). 
  1773.  
  1774. The "B" option displays only busy (allocated) entries. This is the default. 
  1775.  
  1776. The "F" option displays only free (unallocated) entries. 
  1777.  
  1778. The "C" option finds the corresponding object record, and displays the arena, 
  1779. object, alias and context record chains. 
  1780.  
  1781. The "H" option follows hash links, displaying entries. 
  1782.  
  1783. The "L" option follows forward links, displaying entries. 
  1784.  
  1785. The "R" option follows reverse links, displaying entries. 
  1786.  
  1787. The "M" option causes all arena records whose linear address range encloses the 
  1788. given linear address to be displayed.  A linear address must also be given, and 
  1789. no count is allowed.  Context information is ignored, so if the linear address 
  1790. is valid in multiple contexts, multiple arena records are displayed.  A 
  1791. physical address may be given instead of a linear address to allow non present 
  1792. linear addresses to get past the debugger's expression analyzer.  If a selector 
  1793. address type is used, it must be converted to a linear address on the command 
  1794. line. 
  1795.  
  1796. If you ever need to find out what option owns a selector because of a GP fault 
  1797. in some unknown LDT or GDT segment or memory object, one of the following 
  1798. commands is useful: 
  1799.  
  1800.  
  1801.       .M
  1802.     or
  1803.       .MAMC CS:EIP
  1804.  
  1805. The .MAMC CS:EIP, command displays the arena record and memory object record 
  1806. (and the owner) of the code segment. It also follows the context record chains 
  1807. and displays them.  The "CS" can be substituted with any selector, and the 
  1808. "EIP" with any offset.  This command converts the selector:offset into a linear 
  1809. address automatically, so the resulting address can be used to find and 
  1810. interpret the arena records and memory object records. 
  1811.  
  1812. Since ".M" defaults to ".MAMC" when no options are given, and since specifying 
  1813. the "M" option to any ".M" command uses "CS:EIP" for the default, ".M" is the 
  1814. same as ".MAMC CS:EIP". 
  1815.  
  1816.  
  1817. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The Memory Contect Record Dump (.MC) Command ΓòÉΓòÉΓòÉ
  1818.  
  1819.  ##.MC[B|C|F] [<hco|laddr>] | [<hco|laddr> L<number of entries>] 
  1820.  
  1821. This command displays the virtual memory manager's context records.  If no 
  1822. handle or linear address is given, the entire table is displayed.  If a linear 
  1823. address is given, it is considered to be a pointer to a context record.  One 
  1824. record or a range of records can be displayed. 
  1825.  
  1826. The "B" option displays only busy (allocated) entries. This is the default. 
  1827.  
  1828. The "F" option displays only free (unallocated) entries. 
  1829.  
  1830. The "C" option also follows context record chains and displays them. 
  1831.  
  1832.  
  1833. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The Memory Alias Record Dump (.ML) Command ΓòÉΓòÉΓòÉ
  1834.  
  1835.  ##.ML[C] [<hal|laddr>] | [<hal|laddr> L<number of entries>] 
  1836.  
  1837. This command displays the virtual memory manager's alias records. If no handle 
  1838. or linear address is given, the entire table is displayed.  If a linear address 
  1839. is given, it is considered to be a pointer to an alias record.  One record or a 
  1840. range of records can be displayed. 
  1841.  
  1842. The "B" option displays only busy (allocated) entries. This is the default. 
  1843.  
  1844. The "F" option displays only free (unallocated) entries. 
  1845.  
  1846. The "C" option finds the corresponding object record, and displays the arena, 
  1847. object, alias and context record chains. 
  1848.  
  1849.  
  1850. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The Memory Object Record Dump (.MO) Command ΓòÉΓòÉΓòÉ
  1851.  
  1852.  ##.MO[B|C|F|M|N|P|S|V] [<hob|laddr>] | [<hob|laddr> L<number of entries>] 
  1853.  
  1854. This command displays the virtual memory manager's memory object records.  If 
  1855. no handle or linear address is given, the entire table is displayed.  If a 
  1856. linear address is given, it is considered a pointer to an object record.  One 
  1857. record or a range of records can be displayed. 
  1858.  
  1859. This command attempts to display which process, MTE or PTDA owns the segment. 
  1860. It displays the owner as a short ASCII string when appropriate.  It displays 
  1861. the PID of the process and, if possible, the name of the module that owns this 
  1862. segment.  Code segments normally have only the module name and no process ID. 
  1863. If the segment is an MTE, PTDA or LDT, this command displays the object name, 
  1864. the process ID (if the segment is a PTDA) and the module name, if possible. 
  1865.  
  1866. Here are a few examples of the owners that this command can display: 
  1867.  
  1868. Owner       Description 
  1869.  
  1870. free        Free memory. 
  1871.  
  1872. devhlp      Allocated by the AllocPhys devhlp. 
  1873.  
  1874. idevice     Installable device driver memory. 
  1875.  
  1876. system      System-owned memory. 
  1877.  
  1878. dosexe      The initial memory arena when the operating system started. This 
  1879.             includes all of the system code and data segments. 
  1880.  
  1881. mte         A module table entry. 
  1882.  
  1883. ptda        A per task data arena. 
  1884.  
  1885. ldt         A local descriptor table. 
  1886.  
  1887. If it only has a PID or a module name, then this piece of memory is owned by 
  1888. the process or module. 
  1889.  
  1890. The "B" option causes in-use (busy) object records to be displayed. 
  1891.  
  1892. The "F" option causes free object records to be displayed. 
  1893.  
  1894. The "C" option displays the arena, object, alias and context record chains. 
  1895.  
  1896. The "M" option causes all pseudo object records with an exactly matching linear 
  1897. address to be displayed.  A linear address must also be given, and no count is 
  1898. allowed.  If a selector address type is used, it must be converted to a linear 
  1899. address on the command line.  A physical address may be given instead of a 
  1900. linear address to allow non present linear addresses to get past the debugger's 
  1901. expression analyzer. 
  1902.  
  1903. The "N" option causes non pseudo object records to be displayed. 
  1904.  
  1905. The "P" option causes pseudo object records to be displayed. 
  1906.  
  1907. The "S" option causes object records with the semaphore busy or wanted to be 
  1908. displayed. 
  1909.  
  1910. The "V" option causes object record linear addresses to be displayed.  It also 
  1911. disables the owner interpretation. 
  1912.  
  1913.  
  1914. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The Memory Page Frame Dump (.MP) Command ΓòÉΓòÉΓòÉ
  1915.  
  1916.  ##.MP[B|F|H|L|R|S] [<frame|laddr>] | [<frame|laddr> L<number of entries>] 
  1917.  
  1918. This command displays the page manager's page frame structures. If no handle or 
  1919. linear address is given, the entire table is displayed.  If a linear address is 
  1920. given, it is considered to be a pointer to a page frame structure.  One record 
  1921. or a range of records can be displayed. 
  1922.  
  1923. The "B" option displays only busy (allocated) entries. This is the default. 
  1924.  
  1925. The "F" option displays only free (unallocated) entries. 
  1926.  
  1927. The "H" option follows hash links, displaying entries. 
  1928.  
  1929. The "L" option follows forward links, displaying entries. 
  1930.  
  1931. The "R" option follows reverse links, displaying entries. 
  1932.  
  1933. This data structure contains per-physical-page information.  To find out the 
  1934. owner of a particular physical page, issue .MP FrameNumber, where FrameNumber 
  1935. is the physical address shifted right by 12 bits (take off 3 hex zeros).  If 
  1936. the page is not free, the pVP field contains a flat pointer to the virtual page 
  1937. structure.  Issue .MV %pVP, where pVP is the value from the .MP dump, to get 
  1938. the contents of the VP.  The Hob field of the VP is a handle to the Object 
  1939. Record.  Issue .MO Hob to dump it.  This displays a readable string for the 
  1940. owner on the right of the display (see the .MO command). Issuing the .MA 
  1941. command for the Har field in the object record gives the base virtual address 
  1942. of the object containing the page (under "va").  Use the HobPg field of the VP 
  1943. to get the page offset within the object. 
  1944.  
  1945.  
  1946. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The Memory Virtual Page Frame Dump (.MV) Command ΓòÉΓòÉΓòÉ
  1947.  
  1948.  ##.MV[B|F|L|R] [<vpid|laddr>] | [<swapid|laddr> L<number of entries>] 
  1949.  
  1950. This command displays the swap manager's swap frame structures. If no handle or 
  1951. linear address is given, the entire table is displayed.  If a linear address is 
  1952. given, it is considered to be a pointer to a swap frame structure.  One record 
  1953. or a range of records can be displayed. 
  1954.  
  1955. See the .MP command for an example. 
  1956.  
  1957. The "B" option displays only busy (allocated) entries. This is the default. 
  1958.  
  1959. The "F" option displays only free (unallocated) entries. 
  1960.  
  1961. The "L" option follows forward links, displaying entries. 
  1962.  
  1963. The "R" option follows reverse links, displaying entries. 
  1964.  
  1965.  
  1966. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The Print Process Status (.P) Command ΓòÉΓòÉΓòÉ
  1967.  
  1968.  ##.P[B|U] [<slot> | # | *] 
  1969.  
  1970. This command displays the current status of the process and thread. The 
  1971. asterisk (*) by the slot number denotes the currently executing task or the 
  1972. last task to have blocked. The number sign (#) marks what the debugger 
  1973. recognizes as the current task is (set by the .S command). If "#", "*", or a 
  1974. slot number is used on the command line, only the corresponding slot's 
  1975. information is displayed. 
  1976.  
  1977. Without the "B" or "U" option, this command prints the PID, parent PID, command 
  1978. subtree number, thread number, state, priority, block ID, PTDA address, TCB 
  1979. offset, dispatch ESP, screen group and name of the process or thread. 
  1980.  
  1981. The "B" option displays the detailed blocked information. The handlesem entry 
  1982. is for the current virtual memory manager handle semaphores owned by this 
  1983. process. The child entry is for a child process that is being executed. It is 
  1984. printed after all the threads in the executing task (and their handlesem 
  1985. entries) have been printed. 
  1986.  
  1987. The "U" option displays user state information, which includes the CS:EIP and 
  1988. SS:ESP at the time the kernel was entered, along with the number of arguments 
  1989. that were passed, their PTDA offset, and the offset of the register stack 
  1990. frame. 
  1991.  
  1992.  
  1993. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The User Register (.R) Command ΓòÉΓòÉΓòÉ
  1994.  
  1995.  ##.R [<slot> | # | *] 
  1996.  
  1997. The .R command displays the contents of the user's CPU registers, flags, and 
  1998. the next instruction to be executed for a specified slot. This command is 
  1999. available to the user at the time of entry to the kernel. 
  2000.  
  2001. If no parameter is given, or if (#) is on the command line, the debugger's 
  2002. current slot (selected by the .S command) is used. If (*) is on the command 
  2003. line, the currently scheduled slot (or the last one to block) is used. 
  2004. Alternatively, if there is a number on the command line, it is taken as the 
  2005. slot to use. 
  2006.  
  2007.  
  2008. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The REBOOT (.REBOOT) Command ΓòÉΓòÉΓòÉ
  2009.  
  2010.  ##.REBOOT 
  2011.  
  2012. This command warm-starts the machine. The whole string .REBOOT must be typed. 
  2013.  
  2014.  
  2015. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The Task Context Change (.S) Command ΓòÉΓòÉΓòÉ
  2016.  
  2017.  ##.S[S] [<slot> | *] 
  2018.  
  2019. This command changes what the debugger thinks the current task context is.  If 
  2020. no slot number is passed, it prints the current task number.  This allows 
  2021. dumping of some process-specific data (the LDT or stack) for a task other than 
  2022. the current task.  The "S" option also changes the SS and ESP to the new task's 
  2023. PTDA selector and dispatch ESP value.  The original SS and ESP are 
  2024. automatically restored when the debugger stops, or when the ".SS" command is 
  2025. used to switch back to the current task.  The (*) slot number changes the 
  2026. debugger's current task number to the real system task number. 
  2027.  
  2028.  
  2029. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The RAS Trace Buffer Print (.T) Command ΓòÉΓòÉΓòÉ
  2030.  
  2031.  ##.T [<count>] [maj=<xx> [min=<yy>]] 
  2032.  
  2033. This command dumps the RAS trace buffer, optionally dumping only events with 
  2034. the specified major and minor event codes. 
  2035.  
  2036.  
  2037. ΓòÉΓòÉΓòÉ 17. Setting Useful Breakpoints ΓòÉΓòÉΓòÉ
  2038.  
  2039. There are many actions that can be invoked when you use a combination of 
  2040. breakpoint commands.  You can easily set up the debugger to stop at a certain 
  2041. label, print information about the current system millisecond, current process, 
  2042. and executing file, and then continue. For example, this would be very useful 
  2043. in analyzing the performance of a subsystem .DLL. Another use would be to set a 
  2044. breakpoint on a file-read label in the file system, and dump information about 
  2045. which file is being read, where it is being read from, how much of the file is 
  2046. being read, and what is reading it. 
  2047.  
  2048. In order to do this, you must know some internal information about the kernel 
  2049. and other system components, such as labels of various application programming 
  2050. interface (API) functions or worker routines. 
  2051.  
  2052. One way to keep some release independence is to base breakpoints from function 
  2053. labels with an offset.  These change much less often than the linear addresses 
  2054. of the functions. An example is as follows: 
  2055.  
  2056.  
  2057.     BP _LDRGetMte +63 "DA %EDX L EAX +1; G"
  2058.  
  2059. This command places a breakpoint at the symbol _LDRGetMte, offset by hex 63. 
  2060. Whenever that breakpoint is hit, the debugger dumps (in ASCII) the memory at 
  2061. the linear address stored in register EDX, for a length contained in register 
  2062. EAX plus one byte. The program then continues executing. 
  2063.  
  2064. Of course this offset within the function may change, but it is easier to find 
  2065. the new offset if it does than to use linear addresses for your breakpoints. 
  2066.  
  2067. The effect of this breakpoint is to display the name of any executable file 
  2068. (such as one with a file type of .EXE, .DLL, or .SYS) that is started with 
  2069. DosExecPgm, DosStartSession, or DosLoadModule, or imported from any other 
  2070. executable file. This is very useful when debugging problems in applications. 
  2071.  
  2072. A series of actions that can help you profile your code to see how often you 
  2073. are taking page faults on pieces of code follows: 
  2074.  
  2075.  1. Unassemble at the label _ldrgetpage for approximately 30 instructions 
  2076.  
  2077.  2. Look for a call to _ldrvalidatemtehandle 
  2078.  
  2079.  3. Set a breakpoint on the instruction immediately following that call (where 
  2080.     execution would go upon return from the call) as follows: 
  2081.  
  2082.  
  2083.  BP% address" . lm% eax ;G "
  2084.  
  2085. This breakpoint will cause the loader to display the name of the code module 
  2086. (DLL or EXE) that code is being read from. For example, all code that is ever 
  2087. executed is referenced at least once (the first time it is loaded). However, if 
  2088. you are seeing excessively long code load times and a large amount of what 
  2089. looks to be thrashing, you may want to use this breakpoint. Also, if you have 
  2090. code residing on remote drives, you may want to use this breakpoint to see how 
  2091. much you are hitting the code on the remote drive to possibly reconfigure it. 
  2092.  
  2093. A breakpoint you can use to profile your code is: 
  2094.  
  2095.  
  2096.   BP xxxxxx "DD SISData+4 L1; G"
  2097.  
  2098.   where xxxxxx is the address or label you wish to profile.
  2099.  
  2100. This breakpoint will give you a running millisecond counter in hexadecimal. If 
  2101. you want to tell the time it takes between two points in the code, add this to 
  2102. the breakpoints and the time will be displayed when it hits the points. This 
  2103. will help in narrowing down the slow area of code. Be careful when analyzing 
  2104. the results, however, as although the timer is reported in milliseconds, it is 
  2105. only updated every 16 milliseconds. 
  2106.  
  2107. When the Presentation Manager Interface sets error information, you can query 
  2108. for it through the debugger by executing the following breakpoint: 
  2109.  
  2110.  
  2111.   BP _winseterrorinfo
  2112.  
  2113. When this breakpoint is hit, the first parameter after the return address on 
  2114. the stack is the error code being set. 
  2115.  
  2116. If you happen to press Ctrl+C while the speaker is sounding a tone, that tone 
  2117. will continue until the speaker is shut off. The command: 
  2118.  
  2119.  
  2120.  0  61 41
  2121.  
  2122. will output the instruction to turn the speaker port off. 
  2123.  
  2124. Using the debugger, you can also see which keystrokes are being input to the 
  2125. Presentation Manager single input queue. The breakpoint: 
  2126.  
  2127.  
  2128.  BP putinsqp "dw si 17; G"
  2129.  
  2130. will show you the keyboard scan codes before PMWIN gets them. This is helpful 
  2131. when tracking the direction of keystrokes. 
  2132.  
  2133. You can also look at the processor's registers before they are affected by the 
  2134. OS/2 trap handler. By executing: 
  2135.  
  2136.  
  2137.  BP trap$systemfatalfault
  2138.  
  2139. you can stop the system before the trap handler is invoked. 
  2140.  
  2141. To look at the device driver header chain, you can use the following 2 
  2142. commands: 
  2143.  
  2144.  
  2145.  .D dev devhead
  2146.  
  2147. This command will display the device driver information starting at the first 
  2148. device driver in the chain. 
  2149.  
  2150.  
  2151.  .D dev 'devnext'
  2152.  
  2153. This will query the device driver chain, showing the installed device drivers. 
  2154.  
  2155. If you ever need to break in just before the system reboots, use this: 
  2156.  
  2157.  
  2158.  BP w_shutdown
  2159.  
  2160. To see which slots (threads) are being dispatched, you can look inside the 
  2161. scheduler by: 
  2162.  
  2163.  
  2164.  BP _schgetnextrunner "dw tasknumber l1; G"
  2165.  
  2166. This will give you the slot number of each thread being dispatched. This is 
  2167. valuable to track performance issues to see if any one process is getting a 
  2168. disproportionately large share of the processor. 
  2169.  
  2170. To interrupt a device driver just before it initializes, you can use: 
  2171.  
  2172.  
  2173.  BP syiInitializeDeviceDriver
  2174.  
  2175. This will stop just before the driver initializes so you can trace through the 
  2176. initialization routine. 
  2177.  
  2178. Another useful breakpoint is one that tells you what kernel calls you are 
  2179. executing. There is a routine called "sci" that is used in all OS/2 kernel 
  2180. calls. By setting the following breakpoint you can have it report what kernel 
  2181. calls you are making. 
  2182.  
  2183.  
  2184.  BP sci "ln wo(ss:esp)"
  2185.  
  2186. This breakpoint says to break on sci (system call interface) and list the near 
  2187. symbol representing the name of the kernel call. The kernel call is determined 
  2188. by looking at the return value on the stack. This is more effective than just 
  2189. stopping and listing near symbols because this method displays just the name of 
  2190. the routine and makes tracing a series of kernel calls much easier. 
  2191.  
  2192. If you need to look into the functions dealing with the graphics engine 
  2193. (especially if you are writing a presentation driver such as a printer or 
  2194. display driver) you can set the following breakpoint: 
  2195.  
  2196.  
  2197.   BP dispatch32
  2198.  
  2199. This breakpoint is in PMGRE.DLL, and when it is encountered you should look at 
  2200. the return address. Next, unassemble at that address less approximately 20 
  2201. bytes.  You are looking for the first doubleword pushed onto the stack before 
  2202. the call. This should be the doubleword representing the command flags and the 
  2203. engine function number. The command flags are the high order word and the 
  2204. function number is the low order word of the doubleword. You could look at the 
  2205. stack frame to get this, but because this is the first dword pushed, it is the 
  2206. last dword in the frame due to the 32-bit calling conventions. Because the DDI 
  2207. stack frames are variable-sized, you may have to do some searching to find the 
  2208. end of the frame. You can do this too, but unassembling before the call works 
  2209. just as well and may be easier. 
  2210.  
  2211. For 16-bit presentation drivers, you would want to set the breakpoint as 
  2212. follows: 
  2213.  
  2214.  
  2215.   BP dispatch16
  2216.  
  2217. Since the 16-bit calling conventions put the function number first, you can 
  2218. simply look at the stack frame on this one. 
  2219.  
  2220. Another useful breakpoint is as follows: 
  2221.  
  2222.  
  2223.   BP _LDRNewExe "G %(DW(SS:ESP)); DD _pgSwappablePages L 3; G"
  2224.  
  2225. This command places a breakpoint at the symbol _LDRNewExe. When that breakpoint 
  2226. is reached, the program continues executing until the caller is returned to. 
  2227. The debugger then displays the number of pages of swappable memory in the 
  2228. system, followed by the number of fixed (resident) pages, followed by the 
  2229. number of pages of discardable memory (read-only or execute-only pages). The 
  2230. program then continues executing. 
  2231.  
  2232. The effect of this breakpoint is to display the hex number of pages that are in 
  2233. use by the whole system after every executable program is started. 
  2234.  
  2235. The term "G %(DW(SS:ESP))" means "Go (G) to the linear address (%) that is the 
  2236. doubleword (DW) at the top of the stack (SS:ESP) and stop". The operators "WO" 
  2237. and "BY" are similar to "DW". "WO" means "word," and "BY" means "byte." This 
  2238. type of setup can be useful when displaying parameters for a function call as 
  2239. well, for example: 
  2240.  
  2241.  
  2242.     BP _LdrOpenNewExe "DA %(DW(SS:ESP+4)); G"
  2243.  
  2244. When this breakpoint is executed, the debugger dumps ASCII (DA) starting at the 
  2245. linear address (%) given in the doubleword (DW) at SS:ESP plus 4 bytes (the 
  2246. doubleword at the top of the stack is the address for _LdrOpenNewExe to return 
  2247. to). The program then continues executing. 
  2248.  
  2249. The effect of this breakpoint is to display (in ASCII) the name of every 
  2250. executable loaded module that actually opens a file. The difference between 
  2251. this breakpoint and the one given earlier is that the earlier one displays the 
  2252. names even if the module was attached to instead of newly opened and loaded. 
  2253. This breakpoint only gives the names of the newly opened modules.  By setting 
  2254. both breakpoints and subtracting the names, you can determine the imported 
  2255. modules. 
  2256.  
  2257. A series of commands that can be useful in determining the amount of memory an 
  2258. application requires is as follows: 
  2259.  
  2260.  
  2261.  .PU  (pick a thread that is in the process you wish to examine)
  2262.  .SS n (where 'n' is the thread or slot number you picked)
  2263.  DL   (list all valid LDT selectors (all 16-bit segments))
  2264.  
  2265. If the DL command listing stops with an address not present or invalid, issue 
  2266. the ".ID x" command (where 'x' is the address) and then the G (Go) command. 
  2267. When the system stops again, the LDT page will be present.  Reissue the ".SS n" 
  2268. and DL commands, and you will get a more complete listing of the LDT selectors. 
  2269. An example of the output follows: 
  2270.  
  2271.       # .PU
  2272.         ... (generates a lot of information like...)
  2273.  Slot Pid  Ord  pPTDA    Name    pstkframe  CS:EIP        SS:ESP     cbargs
  2274.  0012 0006 0012 7d31ccb0 FOO.EXE 7d102f50 d02f:00002501 0b3f:00007eee 0008
  2275.  ...  ...  ...  ...      ...     ...      ...           ...           ...
  2276.  
  2277.       # .SS 12
  2278.       # DL
  2279.         ... (try it and stop at %7b176000...)
  2280.       # .ID %7b176000
  2281.         task|addr 0012|7b176000 queued, g to continue
  2282.       # G
  2283.         ... (stops at INT3 in tasking...)
  2284.         0170:fff629f4 cc             int     3
  2285.       # .SS 12
  2286.       # DL
  2287.         0007  Data    Bas=7b175000 Lim=0000ffff DPL=3 P  RO
  2288.         000f  Data    Bas=00010000 Lim=00001677 DPL=3 P  RW    A
  2289.         0017  Code    Bas=00020000 Lim=00003197 DPL=3 P  RE    A
  2290.         001f  Data    Bas=00030000 Lim=00001fff DPL=3 P  RW    A
  2291.         ...   ...     ...          ...          ...   .  ..    .
  2292.  
  2293. The first entry (0007 Data ...) points to the process' LDT itself, and should 
  2294. not be counted when adding up the amount of memory the application itself is 
  2295. using.  However, it is part of the system overhead that is used for the 
  2296. process, and should be attributed as such. 
  2297.  
  2298. The following breakpoints give you a great deal of information about the 
  2299. startup of an application: 
  2300.  
  2301. BP g_tkExecPgm              "? 'ExecPgm'; G" 
  2302.  
  2303. BP g_w_loadmodule           "? 'LoadModule'; G" 
  2304.  
  2305. BP h_w_QAppType             "? 'QryApplType'; DA DS:DX; G" 
  2306.  
  2307. BP _ldrGetMte +63           "DA %EDX ; G" 
  2308.  
  2309. BP _ldrOpenNewExe           "DA %(DW(SS:ESP+4)); G" 
  2310.  
  2311. BP _load_error              "DD SS:ESP L 3; G" 
  2312.  
  2313. BP h_w_getprocaddr          "? 'GetProcAddr'; G" 
  2314.  
  2315. BP h_w_getprocaddr +23      "? 'by ordinal'; ? DI; G" 
  2316.  
  2317. BP h_w_getprocaddr +25      "? 'by name'; DA AX:DI; G" 
  2318.  
  2319. These nine breakpoints give you a great deal of information about how a program 
  2320. loads and starts executing. These breakpoints can be placed into a KDB.INI file 
  2321. on the system being tested to allow you to determine which binary files are 
  2322. loaded and executed. Please again note that these offsets may change in 
  2323. subsequent releases of the OS/2 kernel and loader. Some of the possible types 
  2324. of files are the following: 
  2325.  
  2326. File Type            File 
  2327. .DLL        Dynamic link library 
  2328. .EXE        Executable program 
  2329. .FON        Static font file 
  2330. .PSF        Dynamic font file 
  2331. .QPR        Queue printer driver 
  2332. .PDR        Printer driver 
  2333. .SYS        Physical device driver 
  2334. .VDD        Virtual device driver 
  2335.  
  2336. The next two breakpoints inform the debugger that the specified label was 
  2337. passed. This allows you to interpret the successive breakpoints accurately. 
  2338.  
  2339.   1. BP g_tkExecPgm     "? 'DosExecPgm'; G"
  2340.  2. BP g_w_loadmodule  "? 'DosLoadModule'; G"
  2341.  
  2342. The next breakpoint prints the name of the routine being executed, and prints 
  2343. the name of the file being queried. 
  2344.  
  2345.  
  2346.  3. BP h_w_QAppType    "? 'DosQueryAppType'; DA DS:DX; G"
  2347.  
  2348. A program issues DosQueryAppType (QAT) when it has to determine the application 
  2349. type of an executable file. For example, when you type 'FREDDY' at a command 
  2350. prompt and press Enter, the system program CMD.EXE has to find out whether the 
  2351. file 'FREDDY' is a .EXE file, a .CMD file, a .COM file, or some other type of 
  2352. file. 
  2353.  
  2354. Some information can be derived from the file's extension. The DOS command 
  2355. processor works this way. However, you may still need to determine whether a 
  2356. .EXE file is a DOS application, a 16-bit OS/2 Version 1.3 application, a 32-bit 
  2357. OS/2 application, or a  Windows application. DosQueryAppType (QAT) attempts to 
  2358. determine this in a way that is very similar to what happens when the program 
  2359. is actually loaded and executed. 
  2360.  
  2361. Sometimes, DosQueryAppType (QAT) is issued to verify that the file exists. For 
  2362. example, SysInit (the thread that loads all the device drivers) has to 
  2363. determine whether a device driver exists, and whether the file contains a valid 
  2364. device driver. SysInit issues DosQueryAppType (QAT) for all of the BASEDEV= and 
  2365. DEVICE= statements in the CONFIG.SYS file. 
  2366.  
  2367. Sometimes, the QAT type does not need to open the file. If the Shell queries 
  2368. the type of a file several times in quick succession, the first QAT call 
  2369. determines the type of the file, and then saves it for a few cycles. If another 
  2370. QAT call is made immediately for the same file, the previously-determined type 
  2371. is returned. This value is cleared when any other file-system access is made, 
  2372. such as when a file is deleted. 
  2373.  
  2374. To see whether a file was actually opened for a loader or tasking call, see 
  2375. breakpoint number 5. 
  2376.  
  2377. Breakpoint number 4 prints the name of any file being loaded, read, attached 
  2378. to, or otherwise referred to (for example, imported) in the loader. 
  2379.  
  2380.  
  2381.  4. BP _ldrGetMte +63  "DA %EDX ; G"
  2382.  
  2383. If breakpoint number 1, 2, or 3 immediately precedes breakpoint number 4, then 
  2384. breakpoint number 4 indicates the name of the primary module being executed by 
  2385. DosExecPgm, or loaded by DosLoadModule (DLM), or queried by DosQueryAppType 
  2386. (QAT). 
  2387.  
  2388. Breakpoint number 5 displays the name of any file being opened for execution by 
  2389. the loader. This breakpoint, along with breakpoint number 6, allows the 
  2390. debugger to find a large number of observed problems. 
  2391.  
  2392.  
  2393.  5. BP _ldrOpenNewExe   "DA %(DW(SS:ESP+4)) ; G"
  2394.  6. BP _load_error      "DD SS:ESP L 3; G"
  2395.  
  2396. Breakpoint number 6 is the error handler for this area. Many error codes are 
  2397. not returned through a base-pointer chained stack frame through several levels 
  2398. of function calls. Instead, a special stack frame is created when the loader is 
  2399. entered, and the stack offset to this frame is preserved. When an error occurs, 
  2400. _load_error() is called with two parameters,an error code and an optional MTE 
  2401. handle. In breakpoint number 6, the debugger displays the return address from 
  2402. the location the error was detected, the error code for what happened, and 
  2403. either a 0 or a module table entry (MTE) handle for where the error was found. 
  2404. File BSEERR.H contains the Control Program error codes. Common error codes are 
  2405. 2 (ERROR_FILE_NOT_FOUND) and 193 (ERROR_BAD_EXE_FORMAT). If an MTE handle is 
  2406. supplied, issue the '.lm[o] handle' command to obtain more information. 
  2407.  
  2408. After _load_error() finishes processing, it clears the stack of everything 
  2409. above the special stack frame. It then returns directly to the original caller, 
  2410. without executing any intervening code. This is efficient, and it avoids a 
  2411. large amount of error-handling code in each function. 
  2412.  
  2413. The next three breakpoints are used to determine what is being retrieved from a 
  2414. .DLL after a successful call to DosLoadModule (DLM). Breakpoint number 7 
  2415. displays the label 'DosGetProcAddr', followed by information about the .DLL 
  2416. being queried, including its name. 
  2417.  
  2418. Breakpoint number 8 displays the ordinal number of the code or data being 
  2419. sought in the .DLL. Breakpoint number 9 displays the name of the code or data 
  2420. being sought in the .DLL. Breakpoints number 8 and 9 are mutually exclusive. 
  2421.  
  2422.  
  2423.  7. BP h_w_getprocaddr  "? 'DosGetProcAddr'; .LM EAX; G"
  2424.  8. BP h_w_getprocaddr +23 "? 'by ordinal'; ? DI; G"
  2425.  9. BP h_w_getprocaddr +25 "? 'by name'; DA AX:DI; G"
  2426.  
  2427. Breakpoints number 7, 8, and 9 do not provide information that is being 
  2428. imported from a .DLL. To do this, more information about the internal operation 
  2429. of the loader is required. 
  2430.  
  2431. The following is an example that uses these breakpoints: 
  2432.  
  2433.  
  2434. LoadModule
  2435.  
  2436. C:\OS2\DLL\TIMESNRM.PSF
  2437. 43 3a 5c 4f 53 32 5c 44-4c 4c 5c 54 49 4d 45 53 C:\OS2\DLL\TIMESNRM.PSF.
  2438. QryApplType
  2439.  
  2440. C:\OS2\PMSHELL.EXE
  2441. 43 3a 5c 4f 53 32 5c 50-4d 53 48 45 4c 4c 2e 45 C:\OS2\PMSHELL.EXE
  2442. QryApplType
  2443.  
  2444. 04a8:00000002 C:\OS2\PMSHELL.EXE
  2445. QryApplType
  2446.  
  2447. 04a8:00000002 C:\OS2\PMSHELL.EXE
  2448. ExecPgm
  2449.  
  2450. C:\OS2\PMSHELL.EXE
  2451. LoadModule
  2452.  
  2453. BVSCALLS
  2454. GetProcAddr
  2455.  
  2456. by ordinal
  2457.  
  2458. 0003H 3T 3Q 0000000000000011Y '.' TRUE
  2459. LoadModule
  2460.  
  2461. PMSDMRI
  2462. LoadModule
  2463.  
  2464. C:\OS2\DLL\PMATM.DLL
  2465. GetProcAddr
  2466.  
  2467. by name
  2468.  
  2469. 04a8:00000002 FONT_DRIVER_DISPATCH_TABLE
  2470. LoadModule
  2471.  
  2472. DISPLAY
  2473. LoadModule
  2474.  
  2475. C:\OS2\DLL\DISPLAY.DLL
  2476. LoadModule
  2477.  
  2478. PMCTLS
  2479.  
  2480. LoadModule
  2481.  
  2482. SPL1B
  2483. LoadModule
  2484.  
  2485. SPL1D
  2486. 53 50 4c 31 44                  SPL1D
  2487. 0030:00006724  fff8b6c3 00000002 00000000 (this is what _load_error() displays)
  2488.  
  2489.  
  2490. ΓòÉΓòÉΓòÉ 18. Debugging Kernel Device Drivers ΓòÉΓòÉΓòÉ
  2491.  
  2492. There are some structures in the Kernel Debugger that are useful when you are 
  2493. debugging a kernel device driver. You can issue the following commands to refer 
  2494. to these structures. 
  2495.  
  2496. ##.D DEV DS:0 
  2497.  
  2498. This command displays the header of the device driver. It helps you determine 
  2499. which device driver you are debugging. 
  2500.  
  2501. ##.D REQ ES:BX 
  2502.  
  2503. This command displays the kernel request packet. This packet is passed between 
  2504. the file system and a kernel device driver. Issue this command at the strategy 
  2505. entry point or exit point of the device driver. This command helps you 
  2506. determine which request the device driver has just finished processing, or is 
  2507. about to process. 
  2508.  
  2509. ##.MAMC 
  2510.  
  2511. This command displays the module name of the program that is currently 
  2512. executing. This helps you determine the owner of the process that trapped. 
  2513.  
  2514. ##VSF* 
  2515.  
  2516. This command sets the trap vectors. This causes the Kernel Debugger to stop at 
  2517. the instruction that is about to cause a trap. 
  2518.  
  2519.  
  2520. ΓòÉΓòÉΓòÉ 19. Debugging VM Start Sessions ΓòÉΓòÉΓòÉ
  2521.  
  2522. Before you begin kernel debugging in a VM Start session, you must establish 
  2523. interrupt vectors 1 and 3. Issue the command DD %%0 to see what the vectors 
  2524. should be, and then issue the following commands to set them to their correct 
  2525. values: 
  2526.  
  2527.  
  2528.       E &0:4 12 67 00 1d
  2529.       E &0:c 57 67 00 1d
  2530.  
  2531. To debug a trap 6 or an incorrect-output problem, set a breakpoint at the 
  2532. VMINT21 entry point. 
  2533.  
  2534. You can find the segment of FSFILTER by looking at the INT 20h or INT 21h 
  2535. vectors (0:80 and 0:84, respectively). The offset of VMINT21 is hex 330. Trace 
  2536. through all of the INT 21 calls until the error is observed. Run the test again 
  2537. to the last successful INT 21, then begin stepping through the code until the 
  2538. error is found. 
  2539.  
  2540. A method of eliminating FSFILTER as the component with the problem is to set up 
  2541. a test case that is executed from the diskette. This way, you can execute a VM 
  2542. Start session without installing FSFILTER. If the problem still occurs, then 
  2543. FSFILTER is not the cause of the problem. 
  2544.  
  2545.  
  2546. ΓòÉΓòÉΓòÉ <hidden> Debug Support - Debugging the CMD.EXE ΓòÉΓòÉΓòÉ
  2547.  
  2548. A problem that appears to be in CMD.EXE is usually located in a different 
  2549. program. Due to the way in which the Kernel Debugger works, CMD.EXE symbols are 
  2550. often shown when they should not be. This can happen when a trap occurs in an 
  2551. application that was started from the command prompt. 
  2552.  
  2553. You can issue a List Near Symbol (LN) command at the debug console. However, 
  2554. there are probably no symbols for the application, so the Kernel Debugger 
  2555. displays the closest symbols. These symbols are usually from CMD.EXE (the 
  2556. parent process). 
  2557.  
  2558. Therefore, you should first issue the Print Process Status (.P #) command. This 
  2559. command shows which process actually trapped. If the line does not show "CMD" 
  2560. on the right-hand side, the program that trapped is not CMD.EXE. 
  2561.  
  2562.  
  2563. ΓòÉΓòÉΓòÉ 20. Debugging a Remote System ΓòÉΓòÉΓòÉ
  2564.  
  2565. The OS/2 Kernel Debugger allows OS/2 developers to diagnose problems quickly, 
  2566. but only if they have access to the system that demonstrates the problem. 
  2567. Installing a modem on the target debug system allows the developers to call the 
  2568. target system by telephone to interact with it. 
  2569.  
  2570. Although the Kernel Debugger will work with nearly any modem, configuration 
  2571. details are unique to each modem.  This section will describe the setup of 
  2572. several modems, and give general guidelines for setting up other modems. 
  2573.  
  2574. In addition to installing the Kernel Debugger on your own system you will need 
  2575. the following items: 
  2576.  
  2577. o Target system with both RETAIL and DEBUG Kernels 
  2578. o Modem 
  2579. o Modem data cable 
  2580. o Analog dial-in telephone line 
  2581. o Communications software 
  2582.  
  2583. Analog Dial-In Lines 
  2584. Communication Software 
  2585. Configuring for Remote Debug 
  2586. Modems 
  2587. Modem Data Cables 
  2588. Limitations 
  2589. The Target System 
  2590. Trouble-Shooting 
  2591.  
  2592.  
  2593. ΓòÉΓòÉΓòÉ <hidden> Debug Support - The Target System ΓòÉΓòÉΓòÉ
  2594.  
  2595. The target system is the computer you wish to debug. This computer should have 
  2596. the Kernel Debugger and symbols installed on it. However, if you want to use 
  2597. the target system to configure the modem you must configure the modem before 
  2598. you install the Kernel Debugger.  The debugger interferes with communications 
  2599. programs running on the same serial port.  If you have another computer 
  2600. available, you can configure the modem on that computer, and then move the 
  2601. modem to the target system. 
  2602.  
  2603.  
  2604. ΓòÉΓòÉΓòÉ <hidden> Debug Support - Modems ΓòÉΓòÉΓòÉ
  2605.  
  2606. Most asynchronous modems are suitable for use as a remote-debug modem.  For 
  2607. best performance, the modem should: 
  2608.  
  2609. o Support auto-answer operation 
  2610.  
  2611. o Support locked DTE speed at 9600 bps 
  2612.  
  2613. o Allow connections at CCITT V.32 (9600 bps) and V.22bis (2400 bps) 
  2614.  
  2615. o Support error-correction (MNP or V.42) 
  2616.  
  2617. o Save configuration in case of a power-outage. 
  2618.  
  2619.  
  2620. ΓòÉΓòÉΓòÉ <hidden> Debug Support - Modem Data Cables ΓòÉΓòÉΓòÉ
  2621.  
  2622. The configuration of the cable used to connect the modem to the target system 
  2623. is not important.  Any serial data cable should have the connections required 
  2624. by the Kernel Debugger.  Ensure that you do not use a null-modem cable.  A 
  2625. null-modem cable is made to connect a DTE to a DTE (a computer is DTE, and a 
  2626. modem is DCE).  A normal cable connects a DTE to a DCE.  Use either a 25-to-25 
  2627. pin cable (for connection to the built-in serial port on a PS/2) or a 25-to-9 
  2628. pin cable (for connection to a 9-pin serial port). 
  2629.  
  2630. Required connections for remote debug cable: 
  2631.  
  2632.  
  2633. 25-to-25 Pin Cable
  2634.  
  2635.  
  2636.          MODEM        COMPUTER
  2637.          DB25P         DB25J
  2638.  
  2639.           ΓöîΓöÇΓöÉ           ΓöîΓöÇΓöÉ
  2640.           Γöé2Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ2Γöé
  2641.           Γöé3Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ3Γöé
  2642.           Γöé7Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ7Γöé
  2643.           ΓööΓöÇΓöÿ           ΓööΓöÇΓöÿ
  2644.  
  2645.  
  2646. 25-to-9 Pin Cable
  2647.  
  2648.  
  2649.          MODEM        COMPUTER
  2650.          DB25P         DB9J
  2651.  
  2652.           ΓöîΓöÇΓöÉ           ΓöîΓöÇΓöÉ
  2653.           Γöé2Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ3Γöé
  2654.           Γöé3Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ2Γöé
  2655.           Γöé7Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ5Γöé
  2656.           ΓööΓöÇΓöÿ           ΓööΓöÇΓöÿ
  2657.  
  2658. Note:  The 25-to-9 pin cable reverses pins 2 and 3.  Do not confuse this with a 
  2659. null-modem cable. The signals on a 25-to-9 pin cable are normally reversed. 
  2660.  
  2661.  
  2662. ΓòÉΓòÉΓòÉ <hidden> Debug Support - Analog Dial-In Lines ΓòÉΓòÉΓòÉ
  2663.  
  2664. In order to call the modem and connect to the target system, you will need a 
  2665. standard voice-grade telephone line that can be direct-dialed. A connection can 
  2666. be made if the line must go through a switchboard, but it makes it more 
  2667. difficult for the person doing the debugging.  Digital telephone lines will not 
  2668. work with the modem. 
  2669.  
  2670.  
  2671. ΓòÉΓòÉΓòÉ <hidden> Debug Support - Communications Software ΓòÉΓòÉΓòÉ
  2672.  
  2673. Use any terminal software that can communicate at 9600 bps, such as the Softerm 
  2674. Custom software that comes with the OS/2 operating system. 
  2675.  
  2676.  
  2677. ΓòÉΓòÉΓòÉ <hidden> Debug Support - Configuring Remote Debug ΓòÉΓòÉΓòÉ
  2678.  
  2679. After you have assembled the required items, follow these steps to prepare the 
  2680. target system for remote debugging: 
  2681.  
  2682.  1. Connect the modem to the target system. 
  2683.  
  2684.     Connect one end of the serial cable to the modem, and the other end to the 
  2685.     serial port on the target system.  If the target system has more than one 
  2686.     serial port, connect the cable to the port configured as COM2 (the Kernel 
  2687.     Debugger uses COM2 by default).  With PS/2 systems, the Reference Diskette 
  2688.     can tell you which port is configured as COM2.  Connect the telephone line 
  2689.     to the modem, and turn on the modem. 
  2690.  
  2691.  2. Program the modem for DEBUG operation: 
  2692.  
  2693.     Programming the modem may be a complex process, depending on the type of 
  2694.     modem and the intended use. There are two ways to program the modem: 
  2695.  
  2696.    o Quick programming for single debug use 
  2697.  
  2698.    o Full programming for "permanent" debug use 
  2699.  
  2700.     The "quick" method is simple, but the modem will not be programmed to 
  2701.     recover from loss of power or repeated calls.  The "full" method allows the 
  2702.     modem to be programmed once, and then used whenever debugging is needed. 
  2703.  
  2704.     The "quick" programming is performed by the Kernel Debugger itself.  When 
  2705.     the Kernel Debugger boots, it will find and process the file "KDB.INI" in 
  2706.     the root directory of the startup drive.  This file can contain startup 
  2707.     commands for the debugger, one of which can be a modem initialization 
  2708.     string. For this reason, the modem must be connected and turned on when the 
  2709.     target machine is started, and cannot be turned off until debugging is 
  2710.     complete. To use "quick" programming, create a KDB.INI file in the root 
  2711.     directory of the startup drive (using the OS/2 System Editor).  The first 
  2712.     line of the file should be: 
  2713.  
  2714.    .B 9600t 2 (Set debugger for 9600 bps, comm port 2) 
  2715.  
  2716.     The second line is the modem initialization string, which is unique to each 
  2717.     type of modem.  The commands in the initialization string must: 
  2718.  
  2719.    o Activate auto-answer 
  2720.  
  2721.    o Lock the DTE at 9600 bps 
  2722.  
  2723.    o Activate XON/XOFF flow control 
  2724.  
  2725.    o Ignore the DTR signal (not supplied by the Kernel Debugger) 
  2726.  
  2727.    o Suppress result codes 
  2728.  
  2729.     The last line of the KDB.INI file can contain other debugging commands. 
  2730.     The last command should be G, which tells the debugger to continue running 
  2731.     after processing the KDB.INI file. Without the G, the debugger will stop 
  2732.     after processing the KDB.INI file, and you will have to manually enter the 
  2733.     G to continue. 
  2734.  
  2735.     The "quick" programming strings for several popular modems are as follows. 
  2736.     The string is in the form: ? "modem string", which instructs the Kernel 
  2737.     Debugger to send the quoted string to the modem during initialization. 
  2738.  
  2739.    ? "AT&F E0 Q1 &B1 &H2 &I2 &D0 S0=1" 
  2740.         US Robotics HST and Dual Standard 
  2741.  
  2742.    ? "AT&F2 E0 Q2 &D0 &K4 S0=1" 
  2743.         Supra FAX/Modem V.32bis 
  2744.  
  2745.    ? "AT&F E0 Q1 &D0 \Q1 S0=1" 
  2746.         Intel 14.4EX 
  2747.  
  2748.     To use "Full" programming, you will configure the modem with the same 
  2749.     features as in "quick" programming, but the settings will be stored in the 
  2750.     modem's firmware (or set in modem switches). However, determining how to 
  2751.     store these settings can be difficult. A thorough study of the modem manual 
  2752.     may be required.  To program the modem, use a terminal emulation program 
  2753.     (for example, the SOFTERM program that is supplied with OS/2). When 
  2754.     programming the modem, set the terminal program for 9600 bps operation, and 
  2755.     type the appropriate modem string.  Since the initialization string 
  2756.     instructs the modem to suppress result codes, the modem will not return a 
  2757.     response. The "FULL" programming strings for several modems are: 
  2758.  
  2759.    AT&F &B1 &H2 &I2 &W 
  2760.         US Robotics HST and Dual Standard 
  2761.  
  2762.    AT&F2 E0 Q2 &D0 &K4 S0=1 &W 
  2763.         Supra FAX/Modem V.32bis 
  2764.  
  2765.    AT&F E0 Q1 &D0 \Q1 S0=1 &W 
  2766.         Intel 14.4EX 
  2767.  
  2768.     Note:  The US Robotics and HST Dual Standard do not store all settings, but 
  2769.     have external switches instead.  After programming the modem, set the 
  2770.     switches as follows: 
  2771.  
  2772.     1=ON               (DTR forced ON) 
  2773.     2=don't care       (result code type) 
  2774.     3=OFF              (result code suppressed) 
  2775.     4=ON               (command echo suppressed) 
  2776.     5=OFF              (auto-answer enabled) 
  2777.     6=don't care       (carrier detect function) 
  2778.     7=ON               (result code in originate mode only) 
  2779.     8=ON               (AT commands enabled) 
  2780.     9=ON               (don't disconnect for +++) 
  2781.    10=OFF              (load NVRAM at power-on) 
  2782.    QUAD=OFF            (normal connect - ON if null modem cable used) 
  2783.  
  2784. When the modem is connected and programmed, the system will be ready for remote 
  2785. debugging.  Re-start the system with the Kernel Debugger installed. When the 
  2786. telephone rings, the debug modem will answer the phone and establish connection 
  2787. with the caller.  The modem-to-kernel speed should remain at 9600 bps (the 
  2788. default speed used by the Kernel Debugger), but the modem-to-modem speed can be 
  2789. whatever is used by the remote modem. If both modems support error correction, 
  2790. correction will be used. 
  2791.  
  2792.  
  2793. ΓòÉΓòÉΓòÉ <hidden> Debug Support - Limitations ΓòÉΓòÉΓòÉ
  2794.  
  2795. Since the modem communicates with the target system at 9600 bps, but can 
  2796. communicate with the remote modem at any speed, the modem must use flow control 
  2797. to avoid data overruns.  The only flow control supported by the Kernel Debugger 
  2798. is XON/XOFF. The only problem this causes is when the remote user wants to 
  2799. pause a continuous data display by pressing Ctrl+S.  If the modem has also sent 
  2800. a Ctrl+S, the one from the user will be ignored.  You may have to press Ctrl+S 
  2801. several times before the display pauses.  This is not a problem if the remote 
  2802. user's communications program supports a "scroll-back buffer," in which case 
  2803. there is no reason to pause the display with Ctrl+S. 
  2804.  
  2805.  
  2806. ΓòÉΓòÉΓòÉ <hidden> Debug Support - Trouble-Shooting ΓòÉΓòÉΓòÉ
  2807.  
  2808. If, after following these directions, you cannot establish a remote debug 
  2809. connection, this guide may help: 
  2810.  
  2811. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  2812. ΓöéSymptom             ΓöéProblem             ΓöéSolution            Γöé
  2813. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2814. ΓöéModem rings but     ΓöéModem is not set forΓöécheck modem         Γöé
  2815. Γöédoesn't answer      Γöéauto-answer         Γöéprogramming (look   Γöé
  2816. Γöé                    Γöé                    Γöéfor AA light on     Γöé
  2817. Γöé                    Γöé                    Γöémodem).             Γöé
  2818. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2819. Γöé                    ΓöéPhone line not      ΓöéPlug in telephone   Γöé
  2820. Γöé                    Γöéconnected to modem  Γöéline to modem.      Γöé
  2821. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2822. ΓöéModem answers, but  ΓöéRETAIL kernel       ΓöéRemove RETAIL kernelΓöé
  2823. ΓöéKernel Debugger doesΓöéinstalled           Γöéand install DEBUG   Γöé
  2824. Γöénot respond         Γöé                    Γöékernel.             Γöé
  2825. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2826. Γöé                    ΓöéData cable not      ΓöéConnect data cable  Γöé
  2827. Γöé                    Γöéconnected properly  Γöéfrom modem to targetΓöé
  2828. Γöé                    Γöé                    Γöémachine.  plug into Γöé
  2829. Γöé                    Γöé                    ΓöéCOM2 if target      Γöé
  2830. Γöé                    Γöé                    Γöémachine has more    Γöé
  2831. Γöé                    Γöé                    Γöéthan one serial     Γöé
  2832. Γöé                    Γöé                    Γöéport.               Γöé
  2833. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2834. Γöéremote modem sees   ΓöéModem not locked at Γöécheck modem         Γöé
  2835. Γöémeaningless data on Γöé9600 bps            Γöéconfiguration.      Γöé
  2836. Γöéscreen, unable to   Γöé                    Γöé                    Γöé
  2837. Γöécontrol debug       Γöé                    Γöé                    Γöé
  2838. Γöésession             Γöé                    Γöé                    Γöé
  2839. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2840. Γöé                    ΓöéKernel Debugger not ΓöéAdd .B 9600T to     Γöé
  2841. Γöé                    Γöéoperating at 9600   ΓöéKDB.INI file (createΓöé
  2842. Γöé                    Γöébps                 Γöéfile if needed, in  Γöé
  2843. Γöé                    Γöé                    Γöéroot directory of   Γöé
  2844. Γöé                    Γöé                    Γöéboot drive). Re-bootΓöé
  2845. Γöé                    Γöé                    Γöétarget machine.     Γöé
  2846. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  2847.  
  2848.  
  2849. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  2850.  
  2851. Trademark of the IBM Corporation. 
  2852.  
  2853.  
  2854. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  2855.  
  2856. See the section Debugging a Remote System. 
  2857.  
  2858.  
  2859. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  2860.  
  2861. Trademark of the Intel Corporation. 
  2862.  
  2863.  
  2864. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  2865.  
  2866. Trademark of the Intel Corporation. 
  2867.  
  2868.  
  2869. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  2870.  
  2871. Trademark of the Intel Corporation. 
  2872.  
  2873.  
  2874. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  2875.  
  2876. Trademark of the Microsoft Corporation.