Jump to content

KernelDebugRef - Using Default Commands

From EDM2

Reprint Courtesy of International Business Machines Corporation, © International Business Machines Corporation

Kernel Debugger Reference
  1. Introduction
  2. Installing the Kernel Debugger
  3. The T Terminal Emulator
  4. Entering the Debugger
  5. Expressions
  6. Operator Precedence
  7. Binary Operators
  8. Unary Operators
  9. Numbers
  10. Strings
  11. Symbol Files
  12. Using Kernel Debugger Commands
  13. The Breakpoint (BP) Command
  14. Breakpoint Commands
  15. External Commands
  16. Using Default Commands
  17. External Debugger Commands
  18. Setting Useful Breakpoints
  19. Debugging Kernel Device Drivers
  20. Debugging VM Start Sessions
  21. Debugging a Remote System
  22. Notices

Using Default Commands

  • ##Z

This command executes the default command. The default command is a string of debugger commands that are executed any time the debugger is entered and there is no breakpoint command attached to the entry. It starts as only the R command, but any string of commands can be used.

  • ##ZL

This command lists the default command.

  • ##ZS <string>

This command changes the default command. If there are any errors (too long), it returns to the R command.

If you want to process through all the INT 3s in your application or test program, you can use the following command:

ZS "J (BY CS:EIP) == CC 'G';R"


This restarts execution every time you enter the debugger on an INT 3.

A watchpoint can be set up as follows:

ZS "J (WO 40:1234) == 0EED 'r'; T"

This command traces until the word at 40:1234 is equal to hex 0EED. This will not work if you are tracing through the mode-switching code in the operating system or other sections of code that cannot be traced.