OS/2 Debugging Handbook - Volume II Using The Debug Kernel and Dump Formatter
OS/2 Debugging Handbook - Volume II Using The Debug Kernel and Dump Formatter
February 1996
IBML
SG24-4641-00
International Technical Support Organization
February 1996
Take Note!
Before using this information and the product it supports, be sure to read the general information under
“Special Notices” on page xv.
Order publications through your IBM representative or the IBM branch office serving your locality. Publications
are not stocked at the address given below.
An ITSO Technical Bulletin Evaluation Form for reader′s feedback appears facing Chapter 1. If the form has been
removed, comments may be addressed to:
When you send information to IBM, you grant IBM a non-exclusive right to use or distribute the information in any
way it believes appropriate without incurring any obligation to you.
The following information describes the four volumes that comprise the OS/2
Debugging Handbook library. The graphic of the opened book denotes the
volume that you are currently reading.
This volume introduces the concepts of debugging with practical examples. Also
contained in this book is a CDROM version of the entire library, which is
viewable via the OS/2 INF View utility.
Volume II, Using the Debug Kernel and Dump Formatter, SG24-4641.
This volume provides necessary information to set up and use the Kernel Debug
and Dump Formatter tools. Also this guide serves as a command reference for
these products.
This publication is volume two, which is one of four volumes that together
provide information and reference materials intended to help perform OS/2
debugging.
This volume provides details on how to set up and use the OS/2 Kernel Debug
and Dump Formatter utilities. A Kernel Debug and Dump Formatter command
reference is a major part of this book.
(299 pages)
Abstract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
Special Notices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
How This Document is Organized . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Related Publications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
International Technical Support Organization Publications . . . . . . . . . . xviii
ITSO Redbooks on the World Wide Web (WWW) . . . . . . . . . . . . . . . . . xix
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xx
Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
Contents ix
x OS/2 Debugging
Figures
Information in this book was developed in conjunction with use of the equipment
specified, and is limited in application to those specific hardware and software
products and levels.
IBM may have patents or pending patent applications covering subject matter in
this document. The furnishing of this document does not give you any license to
these patents. You can send license inquiries, in writing, to the IBM Director of
Licensing, IBM Corporation, 500 Columbus Avenue, Thornwood, NY 10594 USA.
The information contained in this document has not been submitted to any
formal IBM test and is distributed AS IS. The information about non-IBM
(VENDOR) products in this manual has been supplied by the vendor and IBM
assumes no responsibility for its accuracy or completeness. The use of this
information or the implementation of any of these techniques is a customer
responsibility and depends on the customer′s ability to evaluate and integrate
them into the customer′s operational environment. While each item may have
been reviewed by IBM for accuracy in a specific situation, there is no guarantee
that the same or similar results will be obtained elsewhere. Customers
attempting to adapt these techniques to their own environments do so at their
own risk.
Reference to PTF numbers that have not been released through the normal
distribution process does not imply general availability. The purpose of
including these reference numbers is to alert IBM customers to specific
information relative to the implementation of the PTF when it becomes available
to each customer according to the normal IBM PTF distribution process.
IBM OS/2
Presentation Manager Workplace Shell
This volume of the OS/2 Debugging Handbook Library details the setting up of
the OS/2 Kernel Debug and Dump Formatter utilities. Details of commands used
by both utilities are presented and explained in this book. Aided with the other
volumes in this series, the trained user will be able to perform debug operations
on OS/2 systems.
Related Publications
Throughout this book we assume the availability and familiarity with two
co-requisite publications:
• The INTEL486 Microprocessor Programmer ′ s Reference Manual , ISBN
1-55512-159-4
• The Intel Pentium Family User ′ s Manual, Volume 3: Architecture and
Programming Manual , ISBN 1-55512-227-2
• The Design of OS/2 by H.M. Deitel and M.S. Kogan , ISBN 0-201-54889-5
The publications listed in this section are considered particularly suitable for a
more detailed discussion of the topics covered in this document.
• The OS/2 Technical Library Control Program Programming Reference Version
2.00, S10G-6263-00
• OS/2 2.0 Proc Lang 2/REXX Ref , S10G-6268-00
• OS/2 2.0 Proc Lang 2/REXX User Guide , S10G-6269-00
• OS/2 WARP Control Program Programming Guide , G25H-7101-00
• OS/2 WARP Control Program Programming Ref , G25H-7102-00
• OS/2 WARP PM Basic Programming Guide , G25H-7103-00
• OS/2 WARP PM Advanced Programming Guide , G25H-7104-00
• OS/2 WARP GPI Programming Guide , G25H-7106-00
• OS/2 WARP GPI Programming Ref , G25H-7107-00
IBM employees in the USA may order ITSO books and CD-ROMs using
PUBORDER. Customers in the USA may order by calling 1-800-879-2755 or by
faxing 1-800-445-9269. Most major credit cards are accepted. Outside the
USA, customers should contact their local IBM office. Guidance may be
obtained by sending a PROFS note to BOOKSHOP at DKIBMVM1 or E-mail to
[email protected].
IBM employees may access LIST3820s of redbooks as well. Point your web
browser to the IBM Redbooks home page:
http://w3.itsc.pok.ibm.com/redbooks/redbooks.html
Preface xix
Acknowledgments
The authors of this book are:
Pete Guy
IBM SDO, Austin
Richard Moore
IBM PSP EMEA
Tim Sennitt
ITSO Boca Raton, Center
This book could not have reached publication without the encouragement, help
and support from a number of colleagues and friends. In particular we would
like to thank the following:
Tim Sennitt for his help in preparing the printed material and doing much of
the donkey-work to bring this to publication.
Joanne Rearnkham, Barry Bryan and David Jaramillo for their support in
enabling access to the materials necessary to produce this book.
Chris Perritt and Glen Brew for making available the original Design
Workbook and Functional Specifications for OS/2 2.0.
Charlie Schmitt for his original work on converting the kernel debugger code
into a dump formatter.
Jeff Mielke and David Jaramillo for their work on PMDF, the structure
compiler and continued work on the dump formatter.
Allen Gilbert for making available documentation on System Trace, which
has been reproduced in an edited form in this book. Also, for making
available an early version of the dump formatter without which it would not
have been possible to develop the original Dump Formatter class.
Doug Azzarito for supplying the material on Kernel Debugger Remote Debug
Setup.
James Taylor for providing the basis of the lab exercises relating to PM
hangs.
Marie Jazynka, one of the first OS/2 debuggers, for patient encouragement of
a great many OS/2 debugging people.
Our management teams, without whose foresight and support none of this
work would ever have started. These include:
• Hermann Lamberti General Manager for PSM EMEA; Gordon Bell -
director PSM EMEA Technical Marketing; Chris Brown - manager PSM
OEM and Enterprise Technical Marketing and Brian Rose - manager PSM
Project Office; Roy Aho - Director of the Solution Developer Technical
Support Center, for encouraging the beginnings of this several years ago;
Terry Gray, manager of Platform Competency and Operation, within
Solution Developer Technical Support, Austin.
Finally to Sarah-Jane and Shelly, for supporting many very extended working
days and weeks.
xx OS/2 Debugging
Chapter 1. Kernel Debugger User Guide
ALLSTRICT
This version of the kernel contains all optional self-diagnostic (otherwise
known as strict or assertion checking) code. Besides this functional
difference many of the system control blocks have extra accounting and
signature fields. This has a number of consequences that may affect
problem diagnosis:
HSTRICT
This version of the kernel is essentially the RETAIL kernel with the debugger
component. It contains only a limited set of strict checking code. The system
control blocks are of the same form as those used by in the RETAIL kernel.
The performance characteristics of the HSTRICT kernel are closer to those of
the RETAIL kernel than the ALLSTRICT kernel. For this reason the HSTRICT
kernel is recommended as a first choice when diagnosing application and
non-system problems.
The base version of the ALLSTRICT kernel is distributed with the OS/2
Developer ′ s Tool kit . Versions of the HSTRICT and ALLSTRICT kernels for fix
packs may be obtained from the following sources:
• The OS/2 Base product CDROM for Warp is distributed with the ALLSTRICT
kernel and Dump Formatter. (For the initial release of Warp this was only
available on the US version of Warp).
• The Developer Connection CDROM - this may be ordered through the
Developer Assistance Program (DAP) or the System Library Subscription
Service (SLSS).
• From your local IBM Marketing Representative.
Throughout this chapter the term debugger is used loosely to mean any of
the following where ambiguity is not a problem:
Debug Kernel (HSTRICT or ALLSTRICT).
The debugger component within the debug kernel.
The debugging console.
2 OS/2 Debugging
allows the UNPACK command to be used to copy all symbols files in one
operation (per diskette).
3. Unhide the RETAIL kernel module using the following command:
ATTRIB -r -s -h OS2KRNL
4. Rename the RETAIL kernel to something unique, for example, OS2KRNLR.
5. Rename the ALLSTRICT or HSTRICT kernel to OS2KRNL. There is no need
to hide or make the replaced kernel read-only, unless you wish to protect
yourself against accidents!
The MUT is now ready to use in debug mode as soon as it is re-booted. Before
that happens the debug console needs to be set up.
Note: It is possible to run the MUT with the debug kernel installed without
setting up the debug console. This particularly useful when diagnosing
pervasive problems. If the COM port settings are correct when the
problem reoccurs then the debug console may be connected at that time.
A null modem cable is required to connect the MUT to the debug console. This
is essentially a 3-wire circuit that connects the two COM connectors together.
Some PCs are equipped with a 25-pin sockets, other 9-pin. A null modem cable
is a symmetric circuit so we do not distinguish which is the MUT and which the
console.
MUT/CONSOLE CONSOLE/MUT
DB25J DB25J
┌─┐ ┌─┐
│2├───────────┤3│
│3├───────────┤2│
│7├───────────┤7│
└─┘ └─┘
MUT/CONSOLE CONSOLE/MUT
DB25J DB9J
┌─┐ ┌─┐
│2├───────────┤2│
│3├───────────┤3│
│7├───────────┤5│
└─┘ └─┘
┌─┐ ┌─┐
│2├───────────┤3│
│3├───────────┤2│
│5├───────────┤5│
└─┘ └─┘
The null modem cable essentially connects RX-TX and SG-SG. The pin
conventions for RX and TX on a 25-pin connector reverse those of a 9-pin
connect. Thus the 25-9 connection looks like a non-null circuit.
With these items you should be able to cater for most variations and remote
connection as well.
The next thing to consider is the COM port settings. By default the debug kernel
will first select COM2. It that is in use then COM1. If you require the debugger
to use another COM port, or a non-standard I/O port address then you might
need to set this explicitly by using the .B command, which should be entered in
the KDB.INI initialization file.
By default the kernel debugger initializes the selected COM port to run at 9600
bits per second. If your debugging console requires a different speed setting
then you should convey this to the debug kernel using the .B command, again
entered in the KDB.INI file.
The default communications protocol uses 8 data bits, 1 stop bit and no parity. If
this needs to be different, then it may be set using the O command also enterd in
the KDB.INI file.
Finally some COM ports require the DTR signal to be held high before allowing
communication. If this is necessary then it can be set using the debug kernel to
write to the I/O port that controls the COM port setup register. This may be
done using the the O command entered in the KDB.INI file.
4 OS/2 Debugging
Having set up the COM port requirements on the MUT, the debug console must
be setup to match. Precisely how this is done will depend on whether a dumb
terminal or terminal emulator software is used. If you use emulator software
under OS/2 you may need to use the OS/2 MODE command to select compatible
COM port settings for the debugging console′s COM port.
The KDB.INI file is read after the kernel has loaded and the kernel symbols are
loaded and the system is running in protect mode.
Attention
The content of the KDB.INI file is somewhat sensitive. If you make a syntax
or format error then you may hang the system and have to re-boot from
installation diskettes to recover.
On most systems the use of a KDB.INI file is not required to establish correct
operation of the COM port and should be avoided.
Each command must be terminated with a <CR><LF> pair except the last in
the file.
Enter the commands you require, using the <RETURN> key after each
command except the last. For the final command, terminate it using the
sequence: Ctrl-Z <RETURN>.
Note: Use of an editor for creating KDB.INI may not be suitable if the
<CR><LF> sequence cannot be suppressed from the last line.
The following example hows how to select COM3 at 1200 bps, with DTR held high
and to prepare the debugger to intercept any ring 2 or 3 traps.
.b 1200t 3e8
O 3ec 1
vsf *
g
Notes:
The VSF command causes the debugger to intercept all ring2 and ring3
traps and give control to the debug console.
The first step is to install the debug kernel and symbols files on the MUT as
described preceding section, (see 1.1, “Kernel Debugger Local Setup” on page 2
for more information.)
Although the Debug Kernel will work with nearly any modem; the configuration
details are unique to each modem. This topic describes the setup of several
modems, and gives general guidelines for setting up others.
1.2.1.1 Modem
Most asynchronous modems currently available will be suitable for use as a
remote-debug modem. For best performance, the modem should:
• Support auto-answer operation
• Support locked DTE speed at 9600 bps
• Allow connections at CCITT V.32 (9600 bps), and V.22bis (2400 bps)
• Support error-correction (MNP or V.42)
• Save configuration so a power-outage does not lose settings
6 OS/2 Debugging
MODEM COMPUTER
DB25P DB25J
┌─┐ ┌─┐
│2├───────────┤2│
│3├───────────┤3│
│7├───────────┤7│
└─┘ └─┘
MODEM COMPUTER
DB25P DB9J
┌─┐ ┌─┐
│2├───────────┤3│
│3├───────────┤2│
│7├───────────┤5│
└─┘ └─┘
Notice the 25-to-9 pin cable reverses pins 2 and 3. Do not confuse this with a
null-modem cable - the signals on a 25-to-9 pin cable are normally reversed.
.B 1200t 1
(Set debugger for 1200 bps, COM port 1)
Following this are the modem initialization strings, which are unique to each
type of modem. The commands in the initialization string must:
• Activate auto-answer
• Lock the DTE at 9600 bps
• Activate XON/XOFF flow control
• Ignore the DTR signal (not supplied by the debug kernel)
• Suppress result codes
The remaining lines of the KDB.INI file may contain other debugging
commands. The last of these is normally G.
The quick programming strings for several popular modems are as follows.
8 OS/2 Debugging
AT&K4&D0S0=1&W
To use Full programming, you will configure the modem with the same
features as in quick programming, but the settings will be stored in the
modem′s firmware (or set in modem switches). Determining how to store
these settings can be difficult. A thorough study of the modem manual may
be required. To program the modem, use a terminal emulation program (for
example, the Softerm program that is supplied with OS/2). When
programming the modem, set the terminal program for 9600 BPS operation,
and type the appropriate modem string. Since the initialization string
instructs the modem to suppress result codes, the modem will not return a
response. The FULL programming strings for several modems are:
Note: The US Robotics HST Dual Standard does not store all settings, but
has external switches instead. After programming the modem, set
the switches as follows:
1=ON
(DTR forced ON)
2=don′t care
(result code type)
3=OFF
(result code suppressed)
4=ON
(command echo suppressed)
5=OFF
(auto-answer enabled)
7=ON
(result code in originate mode only)
8=ON
(AT commands enabled)
9=ON
(do not disconnect for +++)
10=OFF
(load NVRAM at power-on)
QUAD=OFF
(normal connect - ON if null modem cable used)
Once the modem is connected, and programmed, the system should be ready for
remote debugging. Re-boot the system with the debug kernel installed. When
1.2.2.3 Troubleshooting
If, after following these directions, you cannot establish a remote debug
connection, this guide may help:
Modem answers, but no response Retail kernel installed. Remove RETAIL kernel and
from debug kernel. install DEBUG kernel.
... ″ ... ″ ... Data cable not connected Connect data cable from modem
properly. to MUT. Plug into COM2 if MUT
has more than one serial port.
User at the remote modem sees Modem not locked at 9600 bps. Check modem configuration.
garbage on screen, unable to
control debug session.
... ″ ... ″ ... Debug Kernel not operating at Add .B 9600T to KDB.INI file
9600 bps. (create file if needed, in root
directory of boot drive). Re-boot
MUT.
10 OS/2 Debugging
1.3 Controlling the System from the Debugging Console
Having setup the Kernel Debugger for a Local or Remote debug session the
system is ready to be controlled from the debugging console. The console is
used in two modes, which for convenience we refer to as:
Monitor mode
Command mode
In Monitor mode the console acts merely as an output device for displaying
diagnostic messages from the debug kernel and debug versions any other of
system modules that write messages to the debugger′s COM port. In this mode
it is not possible to enter Kernel Debugger commands without having first
switched to command mode. In monitor mode the system runs more or less as
a retail system except for the performance overheads imparted by the additional
diagnostic code.
In addition to these prompts the Kernel Debugger also uses a data prompt when
a command require additional input. This is signified by a single colon prompt
′:′. Commands such as R and E may use a data prompt.
Channel check
This occurs when an I/O card activates the channel check signal.
Unless the NMI is masked off by setting the mask bit 0x80 in I/O port to 0x70,
the NMI channel check provides a means of breaking into the system even
when it is disabled for (maskable) interrupts, that is, when the CLI instruction
has been used to clear the interrupt flag in the EFLAGS register. An an
ISA-bus system a prototype card may be used to implement the following
circuit, which provides an NMI push button switch:
12 OS/2 Debugging
(-IOCHK)
A1 ────────────┐
│
├─ (NMI Push switch)
│
B1 ────────────┘
(Ground)
Note: OS/2 normally only disables NMIs during system initialization and
when the Kernel Debugger is running in command mode. However,
the Kernel Debugger will allow only one attempt to break in using a
channel check NMI, after which NMIs are disabled until the system is
re-booted.
The user holds down the r-key from the debugging console at system
initialization time.
If the r-key is held down at system initialization time the debugging console
will switch to command mode shortly after the OS2KRNL has entered
real-mode for the first time. At this time no symbols have been loaded,
paging has never been enabled and the KDB.INI file has not been processed.
Note: In real-mode many of the Kernel Debugger external commands are
not available (because they rely on Virtual Memory Management to
be initialized). Attempts to use them may cause unpredictable results
or even total system failure.
The user holds down the p-key at the debugging console at system initialization
time.
If the p-key is held down at system initialization time the debugging console
will switch to command mode shortly after the OS2KRNL has entered
protect-mode for the first time. At this time no symbols have been loaded,
paging is disabled and the KDB.INI file has not been processed.
The user holds down the Space-bar from the debugging console at system
initialization time.
If the space-bar is held down at system initialization time the debugging
console will switch to command mode shortly after the OS2KRNL has
entered protect-mode and fully initialized. At this time OS2KRNL symbols
have been loaded and paging is enabled but the KDB.INI file has not been
processed.
Ctrl-C
Will cancel the currently running command and return the console to
command mode.
Ctrl-S
Will temporarily suspend output to the debugging console and suspend
system execution.
Ctrl-Q
Will resume system execution and output to the debugging console.
14 OS/2 Debugging
Storage overlays, may not be noticed until the valid owner of the storage
traps at some later time.
A program terminates apparently normally, but unexpectedly.
A deadlock or hang occurs because a resource owner. forgets to release
ownership of a shared resource.
If the problem is such the there are readily identifiable criteria that allow it to be
intercepted closer to its cause, for example by using breakpoints under the
Kernel Debugger, then being able to take a dump at such a point can be
advantageous.
The simplest technique for initiating a system dump is to type the dump key
sequence ( Ctrl-Alt-NumLock-NumLock ) from the keyboard of the system
undertest while the debugger is in console mode. Then type the G command
from the debug console. The keyboard interrupt will be serviced and the
stand-alone dump procedure initiated.
The system dump is initiated when the kernel routine RASRST (RAS restart) is
called. Normally this occurs from ring 0 when exception management intercepts
a trap and TRAPDUMP is coded in the CONFIG.SYS file or when the keyboard
device driver ( KDB.SYS ) intercepts a Ctrl-Alt-NumLock-NumLock or
Ctrl-Alt-F10-F10 sequence. From ring 3 RASRST is called indirectly via the
Dos32ForceSystemDump API since RASRST is not addressable from any user
code selectors. The Kernel Debugger G command allows an address to be
specified where execution is to continue from, which provides a means calling
the system dump routine from the debugging console. Before using this
technique, the following points must be understood:
RASRST is not addressable from user code selectors since they have an
upper address boundary of at most 512MB.
RASRST requires to be executed using a 16-bit code selector.
RASRST requires a ring 0 stack selector to be active
Dos32ForceSystemDump requires a 32-bit code selector, such as 5b .
On some early versions of OS/2 2.1 Dos32ForceSystemDump is unreliable.
The symbol Dos32ForceSystemDump occurs in both DOSCALL1.DLL and the
callgate entry point in OS2KRNL.
From ring 2 or ring 3, 32-bit code the following commands will be successful
providing Dos32ForceSystemDump is working correctly. The address of
DOSCALL1:DOS32FORCESYSTEMDUMP is determined first, then a call to
Dos32ForceSystemDump is made:
g =1a027c78
For 16-bit application code the CS register must be to to a value that will address
DOSCALL1.DOS32FORCESYSTEMDUMP. A suitable selector would be 5b for
ring-3 code and 5a for ring-2. So, for 16-bit code this procedure becomes:
ln dos32forcesystemdump
%1a027c78 doscall1:FLAT32:DOS32FORCESYSTEMDUMP
r cs 5b (or r cs 5a)
g =1a027c78
If you wish to trap an application the very next time it runs in user mode then
use .R to determine the user registers and set a breakpoint on CS:EIP in the
context of the application′s thread slot and specify that SS be set to zero when
the breakpoint fires. For example:
.p 2d
Slot Pid Ppid Csid Ord Sta Pri pTSD pPTDA pTCB Disp SG Name
002d 000b 0002 000b 0001 blk 0200 7b700000 7b8c68fc 7b8acb60 1eb8 14 mrfilepm
##.r 2d
eax=00000000 ebx=00000000 ecx=0000aa37 edx=0000a9ef esi=00090bff edi=00090000
eip=0000272d esp=0000b228 ebp=0009b230 iopl=2 -- -- -- nv up ei ng nz na pe nc
cs=d02f ss=004f ds=a9ef es=be47 fs=150b gs=0000 cr2=1704b000 cr3=001d9000
doscall1:CONFORM16:postDOSSEMWAIT:
002d|d02f:0000272d c9 leave ;br0
16 OS/2 Debugging
SS:ESP=0000:0000b230 SSACC=**** SSLIM=********
EBP=0009b230 FLG=00002386
DOSCALL1.DLL 0005:0000272d
The VM lock trace is activated by setting bit 0 of the VM log flag doubleword to 1.
The flag doubleword is located at symbol: _VMLogFlags . Since no function is
currently assigned to the other bit positions so the lock log may be effectively
turned on by setting the byte a _VMLogFlags to 0xff as in the following example:
e _vmlogflags
%fff0127c 00.
ff
##g
L base fff32 size 2 flags 1 hob 16 hptda 3b9 ret fff3e551
L base 15e0 size 1 flags 4 hob 4a4 hptda 91 ret fff5a93c
L base 3f size 1 flags 4 hob 188 hptda 91 ret fff5a93c
18 OS/2 Debugging
U base 15e0 size 1 flags 4 hob 4a4 hptda 91 ret fff5a983
U base 3f size 1 flags 4 hob 188 hptda 91 ret fff5a983
L base 15e0 size 1 flags 4 hob 4a4 hptda 91 ret fff5a93c
L base 3f size 1 flags 4 hob 188 hptda 91 ret fff5a93c
U base 15e0 size 1 flags 4 hob 4a4 hptda 91 ret fff5a983
U base 3f size 1 flags 4 hob 188 hptda 91 ret fff5a983
L base fff35 size 3 flags 1 hob 16 hptda 4a4 ret fff3e551
L base fe79c size 4 flags 0 hob 3 hptda 380 ret fff49ec6
U base fe79c size 4 flags 0 hob 3 hptda 380 ret fff3d173
The fields displayed in each lock trace entry are formatted from the constituent
parts of the corresponding lock handle. They are defined as follows:
base
The virtual page number (that is the high order 5 digits of the address) of the
page(s) to be locked or unlocked
size
The number of pages being locked or unlocked
flags
The following bit settings are defined:
hob
The hob of the memory object whose pages are being locked or unlocked
hptda
The hptda of the process that requested the memory lock or unlock
ret The return address from VMLockMem, that is, the address of the caller
Note:
The return address is unfortunately of limited use since most calls to
VMLockMem are made via a limited number of interface routines. In
particular, DevHlp lock requests are made via dhw _VMLock and
SegLockDM . Unless one can trace in addition the SS:ESP on entry to
VMLock , the lock trace alone will be insufficient to solve memory
locking problem. One possible way of providing more information is
to supplement the lock trace with following breakpoint commands:
##bp _vmunlock+1,″k ss:sp;g″
##bp _vmlockmem+1,″k ss:sp;g″
##g
0170:fff3e551 fff32d68 00001281 10000000 ffe0068f CodeLockProc + 7c
L base fff32 size 2 flags 1 hob 16 hptda 3b9 ret fff3e551
0170:fff5a93c 015f0000 0000000e 40000000 fe7958c6 _dhw_VMLock + dc
0170:fff3db40 40000000 015f0000 0000000e fe7958c6
0170:00000155 01550000 62d61a84 00000003 5ab40000
L base 15f0 size 1 flags 4 hob 5de hptda 91 ret fff5a93c
The latest versions of OS/2 2.11 and OS/2 3.0 have implemented a new Kernel
Debugger command that facilitates an alternative method for analyzing memory
locking problems. See the Kernel Debugger .MK command for details.
20 OS/2 Debugging
1.4.3 Virtual Memory Management System Heap Validation
The system will perform additional validation of the kernel heap structures under
the debug kernel if the byte at label _vmkhGflags is set to a non-zero value.
The system will validate the linkages between various heap structures. If an
error is detected, then an IPE is generated with one of the following messages:
VMKSH: Invalid hint pointers
VMKSH: Invalid number of ksh descriptors
VMKSH: Invalid number of ksh blocks
Invalid heap block header at address: ssss:oooooooo
Preceding block at address: ssss:oooooooo
No preceding block
0x00000001
This will cause the loader to break into the debugger using an INT 3
instruction if any of the following error conditions are detected:
OS2LDR This is the OS2KRNL loader. One of its functions is to load the OS2KRNL module at boot time.
After the system has booted OS2LDR provides the CBIOS layer for the kernel.
System Loader This is a component of the kernel. It is responsible for loading program modules, DLLs, Device
Drivers and File System Drivers.
The logging facility discussed in this section applies to the System Loader.
0x00000004
This generates log entries when LDRGetPage is called to demand load a
page within a object of a load module. The message logged is of the form:
ldrGP cr2=nnnnnnnn hMTE=hhhh bno=oo
name=pppppppppppppppp
c r 2 = Is the page fault address.
h M T E = Is the module′s hmte.
b n o = Is page number within the module.
n a m e = is the module′s full name taken from the SMTE.
0x00000018
This switch causes log information to be generated when DLL modules are
loaded and initialized. The following messages are logged:
ldrDLM entry - slot ssss ptda pppppppp
tk SD has-init slot=ssss
tk SD no-init slot=ssss
22 OS/2 Debugging
tk IN and tk LIn Mark events in TKLiniInitNextDLL
0x00000080
This switch requests that import initialization be recorded. Messages of the
following format are generated:
lpi, Recording init hMTE=hhhh, flags1=ffffffff, name=nnnnnnnnn
0x00000100
Logs when the loader cannot load an object at the compiler/linker
designated base address. The message logged appears as follows:
Cannot load nnnnnnnn at the requested base address
where nnnnnnnn is the module name.
0x00000800
Logs the processing of the DLL import tree. The following messages appear:
24 OS/2 Debugging
ldr walking tree going up
ldr walking tree hMTE=05e1, name=H:\FAXWORKS\FAXWORKS.EXE
ldr walking tree going down
ldr walking tree hMTE=0419, name=H:\OS2\DLL\HELPMGR.DLL
ldr walking tree going up
ldr walking tree hMTE=05e1, name=H:\FAXWORKS\FAXWORKS.EXE
ldr walking tree going down
ldr walking tree hMTE=02ac, name=H:\OS2\DLL\PMDRAG.DLL
ldr walking tree going down
ldr walking tree hMTE=02a3, name=H:\OS2\DLL\PMCTLS.DLL
ldr walking tree going up
ldr walking tree hMTE=02ac, name=H:\OS2\DLL\PMDRAG.DLL
ldr walking tree going up
ldr walking tree hMTE=05e1, name=H:\FAXWORKS\FAXWORKS.EXE
ldr walking tree going down
ldr walking tree hMTE=0279, name=H:\OS2\DLL\PMWP.DLL
ldr walking tree going down
ldr walking tree hMTE=029d, name=H:\OS2\DLL\IMP.DLL
ldr walking tree going up
ldr walking tree hMTE=0279, name=H:\OS2\DLL\PMWP.DLL
ldr walking tree going down
ldr walking tree hMTE=02a8, name=H:\OS2\DLL\SEAMLESS.DLL
ldr walking tree going down
ldr walking tree hMTE=02b1, name=H:\OS2\DLL\PMVIOP.DLL
ldr walking tree going up
ldr walking tree hMTE=02a8, name=H:\OS2\DLL\SEAMLESS.DLL
ldr walking tree going up
ldr walking tree hMTE=0279, name=H:\OS2\DLL\PMWP.DLL
ldr walking tree going down
ldr walking tree hMTE=02ad, name=H:\OS2\DLL\SOM.DLL
ldr walking tree going up
ldr walking tree hMTE=0279, name=H:\OS2\DLL\PMWP.DLL
ldr walking tree going up
ldr walking tree hMTE=05e1, name=H:\FAXWORKS\FAXWORKS.EXE
ldr walking tree going up
lrm, Skipping init hMTE=05e1, flags1=20903150, name=H:\FAXWORKS\FAXWORKS.EXE
lrm, Skipping init hMTE=0279, flags1=e498b394, name=H:\OS2\DLL\PMWP.DLL
lrm, Skipping init hMTE=02ad, flags1=e498b396, name=H:\OS2\DLL\SOM.DLL
lrm, Recording init hMTE=02a8, flags1=e098b395, name=H:\OS2\DLL\SEAMLESS.DLL
lrm, Skipping init hMTE=02b1, flags1=a498b395, name=H:\OS2\DLL\PMVIOP.DLL
lrm, Skipping init hMTE=029d, flags1=2098b398, name=H:\OS2\DLL\IMP.DLL
lrm, Skipping init hMTE=02ac, flags1=a498b388, name=H:\OS2\DLL\PMDRAG.DLL
lrm, Skipping init hMTE=02a3, flags1=e498b394, name=H:\OS2\DLL\PMCTLS.DLL
lrm, Skipping init hMTE=0419, flags1=a098b39a, name=H:\OS2\DLL\HELPMGR.DLL
lrm, Skipping init hMTE=02b8, flags1=e498b394, name=H:\OS2\DLL\PMSPL.DLL
lrm, Skipping init hMTE=02be, flags1=a098b398, name=H:\OS2\DLL\SPL1B.DLL
lrm, Skipping init hMTE=0104, flags1=2098b388, name=H:\OS2\DLL\MSG.DLL
lrm, Skipping init hMTE=029a, flags1=2098b388, name=H:\OS2\DLL\PMWIN.DLL
lrm, Skipping init hMTE=0281, flags1=e498b394, name=H:\OS2\DLL\PMMERGE.DLL
lrm, Skipping init hMTE=0111, flags1=2098b388, name=H:\OS2\DLL\SESMGR.DLL
lrm, Skipping init hMTE=029c, flags1=2098b388, name=H:\OS2\DLL\PMSHAPI.DLL
lrm, Skipping init hMTE=0262, flags1=2098b388, name=H:\OS2\DLL\NLS.DLL
lrm, Skipping init hMTE=01e5, flags1=2098b388, name=H:\OS2\DLL\VIOCALLS.DLL
lrm, Skipping init hMTE=029b, flags1=2098b388, name=H:\OS2\DLL\MOUCALLS.DLL
lrm, Recording init hMTE=0293, flags1=e498b394, name=H:\OS2\DLL\PMGPI.DLL
lpi, Recording init hMTE=0279, flags1=e498b394, name=H:\OS2\DLL\PMWP.DLL
lpi, Recording init hMTE=02ad, flags1=e498b396, name=H:\OS2\DLL\SOM.DLL
lpi, Recording init hMTE=02b1, flags1=a498b395, name=H:\OS2\DLL\PMVIOP.DLL
lpi, Recording init hMTE=02a3, flags1=e498b394, name=H:\OS2\DLL\PMCTLS.DLL
26 OS/2 Debugging
ldrDLM entry - slot 36 ptda ab99a000
ldrDLM name - slot 36 name DISPLAY
lpi Processing imports slot=0036, module=H:\OS2\DLL\DISPLAY.DLL
ldr walking tree hMTE=034b, name=H:\OS2\DLL\DISPLAY.DLL
ldr walking tree going down
ldr walking tree hMTE=0281, name=H:\OS2\DLL\PMMERGE.DLL
ldr walking tree going down
ldr walking tree hMTE=0293, name=H:\OS2\DLL\PMGPI.DLL
ldr walking tree going up
ldr walking tree hMTE=0281, name=H:\OS2\DLL\PMMERGE.DLL
ldr walking tree going down
ldr walking tree hMTE=029a, name=H:\OS2\DLL\PMWIN.DLL
ldr walking tree going up
ldr walking tree hMTE=0281, name=H:\OS2\DLL\PMMERGE.DLL
ldr walking tree going down
ldr walking tree hMTE=029b, name=H:\OS2\DLL\MOUCALLS.DLL
ldr walking tree going up
ldr walking tree hMTE=0281, name=H:\OS2\DLL\PMMERGE.DLL
ldr walking tree going down
ldr walking tree hMTE=01e5, name=H:\OS2\DLL\VIOCALLS.DLL
ldr walking tree going up
ldr walking tree hMTE=0281, name=H:\OS2\DLL\PMMERGE.DLL
ldr walking tree going down
ldr walking tree hMTE=0262, name=H:\OS2\DLL\NLS.DLL
ldr walking tree going up
ldr walking tree hMTE=0281, name=H:\OS2\DLL\PMMERGE.DLL
ldr walking tree going down
ldr walking tree hMTE=029c, name=H:\OS2\DLL\PMSHAPI.DLL
ldr walking tree going up
ldr walking tree hMTE=0281, name=H:\OS2\DLL\PMMERGE.DLL
ldr walking tree going down
ldr walking tree hMTE=0111, name=H:\OS2\DLL\SESMGR.DLL
ldr walking tree going up
ldr walking tree hMTE=0281, name=H:\OS2\DLL\PMMERGE.DLL
ldr walking tree going up
ldr walking tree hMTE=034b, name=H:\OS2\DLL\DISPLAY.DLL
ldr walking tree going up
lrm, Recording init hMTE=034b, flags1=2498b394, name=H:\OS2\DLL\DISPLAY.DLL
tk SD has-init slot=36
tk SD pre-inc slot=36 cnest=1
ldrDLM free - slot 36
ldrDLM exit - slot 36
ldrGP cr2=13ef0000 hMTE=34b bno=6
name = H:\OS2\DLL\DISPLAY.DLL
tk LIn slot=36 cnest=1
ldrDLM entry - slot 36 ptda ab99a000
ldrDLM name - slot 36 name IBMS332
lpi Processing imports slot=0036, module=H:\OS2\DLL\IBMS332.DLL
ldr walking tree hMTE=0362, name=H:\OS2\DLL\IBMS332.DLL
ldr walking tree going down
ldr walking tree hMTE=0368, name=H:\OS2\DLL\PMGRE.DLL
ldr walking tree going down
ldr walking tree hMTE=0281, name=H:\OS2\DLL\PMMERGE.DLL
ldr walking tree going down
ldr walking tree hMTE=0293, name=H:\OS2\DLL\PMGPI.DLL
ldr walking tree going up
ldr walking tree hMTE=0281, name=H:\OS2\DLL\PMMERGE.DLL
ldr walking tree going down
ldr walking tree hMTE=029a, name=H:\OS2\DLL\PMWIN.DLL
28 OS/2 Debugging
ldr walking tree hMTE=029a, name=H:\OS2\DLL\PMWIN.DLL
ldr walking tree going up
ldr walking tree hMTE=0281, name=H:\OS2\DLL\PMMERGE.DLL
ldr walking tree going down
ldr walking tree hMTE=029b, name=H:\OS2\DLL\MOUCALLS.DLL
ldr walking tree going up
ldr walking tree hMTE=0281, name=H:\OS2\DLL\PMMERGE.DLL
ldr walking tree going down
ldr walking tree hMTE=01e5, name=H:\OS2\DLL\VIOCALLS.DLL
ldr walking tree going up
ldr walking tree hMTE=0281, name=H:\OS2\DLL\PMMERGE.DLL
ldr walking tree going down
ldr walking tree hMTE=0262, name=H:\OS2\DLL\NLS.DLL
ldr walking tree going up
ldr walking tree hMTE=0281, name=H:\OS2\DLL\PMMERGE.DLL
ldr walking tree going down
ldr walking tree hMTE=029c, name=H:\OS2\DLL\PMSHAPI.DLL
ldr walking tree going up
ldr walking tree hMTE=0281, name=H:\OS2\DLL\PMMERGE.DLL
ldr walking tree going down
ldr walking tree hMTE=0111, name=H:\OS2\DLL\SESMGR.DLL
ldr walking tree going up
ldr walking tree hMTE=0281, name=H:\OS2\DLL\PMMERGE.DLL
ldr walking tree going up
ldr walking tree hMTE=0368, name=H:\OS2\DLL\PMGRE.DLL
ldr walking tree going up
ldr walking tree hMTE=037e, name=H:\OS2\DLL\COMETDLL.DLL
ldr walking tree going down
ldr walking tree hMTE=0104, name=H:\OS2\DLL\MSG.DLL
ldr walking tree going up
ldr walking tree hMTE=037e, name=H:\OS2\DLL\COMETDLL.DLL
ldr walking tree going up
lrm, Recording init hMTE=037e, flags1=e098b396, name=H:\OS2\DLL\COMETDLL.DLL
lrm, Skipping init hMTE=0104, flags1=2098b388, name=H:\OS2\DLL\MSG.DLL
lrm, Skipping init hMTE=0368, flags1=2098b388, name=H:\OS2\DLL\PMGRE.DLL
lrm, Skipping init hMTE=029a, flags1=2098b388, name=H:\OS2\DLL\PMWIN.DLL
tk SD has-init slot=36
tk SD pre-inc slot=36 cnest=1
ldrDLM free - slot 36
ldrDLM exit - slot 36
ldrGP cr2=13b30000 hMTE=37e bno=7
name = H:\OS2\DLL\COMETDLL.DLL
tk LIn slot=36 cnest=1
ldrDLM entry - slot 36 ptda ab99a000
ldrDLM name - slot 36 name PMSPL
tk SD no-init slot=36
ldrDLM free - slot 36
ldrDLM exit - slot 36
ldrGP cr2=13d90000 hMTE=2b8 bno=31
name = H:\OS2\DLL\PMSPL.DLL
ldrGP cr2=13940000 hMTE=2a3 bno=7b
name = H:\OS2\DLL\PMCTLS.DLL
ldrDLM entry - slot 36 ptda ab99a000
ldrDLM name - slot 36 name PMSDMRI
lpi Processing imports slot=0036, module=H:\OS2\DLL\PMSDMRI.DLL
ldr walking tree hMTE=02c6, name=H:\OS2\DLL\PMSDMRI.DLL
ldr walking tree going up
lrm, Skipping init hMTE=02c6, flags1=2098b388, name=H:\OS2\DLL\PMSDMRI.DLL
tk SD no-init slot=36
30 OS/2 Debugging
ldr walking tree going up
lrm, Skipping init hMTE=060b, flags1=2098b1c8, name=H:\FAXWORKS\FX044.LOL
ldrDLM free - slot 36
ldrDLM exit - slot 36
ldrDLM entry - slot 36 ptda ab99a000
ldrDLM name - slot 36 name SND
lpi Processing imports slot=0036, module=H:\MMOS2\DLL\SND.DLL
ldr walking tree hMTE=00fe, name=H:\MMOS2\DLL\SND.DLL
ldr walking tree going down
ldr walking tree hMTE=029a, name=H:\OS2\DLL\PMWIN.DLL
ldr walking tree going down
ldr walking tree hMTE=0281, name=H:\OS2\DLL\PMMERGE.DLL
ldr walking tree going down
ldr walking tree hMTE=0293, name=H:\OS2\DLL\PMGPI.DLL
ldr walking tree going up
ldr walking tree hMTE=0281, name=H:\OS2\DLL\PMMERGE.DLL
ldr walking tree going down
ldr walking tree hMTE=029b, name=H:\OS2\DLL\MOUCALLS.DLL
ldr walking tree going up
ldr walking tree hMTE=0281, name=H:\OS2\DLL\PMMERGE.DLL
ldr walking tree going down
ldr walking tree hMTE=01e5, name=H:\OS2\DLL\VIOCALLS.DLL
ldr walking tree going up
ldr walking tree hMTE=0281, name=H:\OS2\DLL\PMMERGE.DLL
ldr walking tree going down
ldr walking tree hMTE=0262, name=H:\OS2\DLL\NLS.DLL
ldr walking tree going up
ldr walking tree hMTE=0281, name=H:\OS2\DLL\PMMERGE.DLL
ldr walking tree going down
ldr walking tree hMTE=029c, name=H:\OS2\DLL\PMSHAPI.DLL
ldr walking tree going up
ldr walking tree hMTE=0281, name=H:\OS2\DLL\PMMERGE.DLL
ldr walking tree going down
ldr walking tree hMTE=0111, name=H:\OS2\DLL\SESMGR.DLL
ldr walking tree going up
ldr walking tree hMTE=0281, name=H:\OS2\DLL\PMMERGE.DLL
ldr walking tree going up
ldr walking tree hMTE=029a, name=H:\OS2\DLL\PMWIN.DLL
ldr walking tree going up
ldr walking tree hMTE=00fe, name=H:\MMOS2\DLL\SND.DLL
ldr walking tree going down
ldr walking tree hMTE=0104, name=H:\OS2\DLL\MSG.DLL
ldr walking tree going up
ldr walking tree hMTE=00fe, name=H:\MMOS2\DLL\SND.DLL
ldr walking tree going up
lrm, Recording init hMTE=00fe, flags1=6098b396, name=H:\MMOS2\DLL\SND.DLL
lrm, Skipping init hMTE=0104, flags1=2098b388, name=H:\OS2\DLL\MSG.DLL
lrm, Skipping init hMTE=029a, flags1=2098b388, name=H:\OS2\DLL\PMWIN.DLL
lrm, Skipping init hMTE=029c, flags1=2098b388, name=H:\OS2\DLL\PMSHAPI.DLL
lrm, Skipping init hMTE=0262, flags1=2098b388, name=H:\OS2\DLL\NLS.DLL
tk SD has-init slot=36
tk SD pre-inc slot=36 cnest=1
ldrDLM free - slot 36
ldrDLM exit - slot 36
ldrGP cr2=13310000 hMTE=fe bno=12
name = H:\MMOS2\DLL\SND.DLL
ldrGP cr2=13311000 hMTE=fe bno=13
name = H:\MMOS2\DLL\SND.DLL
tk LIn slot=36 cnest=1
32 OS/2 Debugging
name = H:\FAXWORKS\FAXWORKS.EXE
ldrDLM entry - slot 36 ptda ab99a000
ldrDLM name - slot 36 name H:\FAXWORKS\Fax.adp
lpi Processing imports slot=0036, module=H:\FAXWORKS\FAX.ADP
ldr walking tree hMTE=0618, name=H:\FAXWORKS\FAX.ADP
ldr walking tree going down
ldr walking tree hMTE=029a, name=H:\OS2\DLL\PMWIN.DLL
ldr walking tree going down
ldr walking tree hMTE=0281, name=H:\OS2\DLL\PMMERGE.DLL
ldr walking tree going down
ldr walking tree hMTE=0293, name=H:\OS2\DLL\PMGPI.DLL
ldr walking tree going up
ldr walking tree hMTE=0281, name=H:\OS2\DLL\PMMERGE.DLL
ldr walking tree going down
ldr walking tree hMTE=029b, name=H:\OS2\DLL\MOUCALLS.DLL
ldr walking tree going up
ldr walking tree hMTE=0281, name=H:\OS2\DLL\PMMERGE.DLL
ldr walking tree going down
ldr walking tree hMTE=01e5, name=H:\OS2\DLL\VIOCALLS.DLL
ldr walking tree going up
ldr walking tree hMTE=0281, name=H:\OS2\DLL\PMMERGE.DLL
ldr walking tree going down
ldr walking tree hMTE=0262, name=H:\OS2\DLL\NLS.DLL
ldr walking tree going up
ldr walking tree hMTE=0281, name=H:\OS2\DLL\PMMERGE.DLL
ldr walking tree going down
ldr walking tree hMTE=029c, name=H:\OS2\DLL\PMSHAPI.DLL
ldr walking tree going up
ldr walking tree hMTE=0281, name=H:\OS2\DLL\PMMERGE.DLL
ldr walking tree going down
ldr walking tree hMTE=0111, name=H:\OS2\DLL\SESMGR.DLL
ldr walking tree going up
ldr walking tree hMTE=0281, name=H:\OS2\DLL\PMMERGE.DLL
ldr walking tree going up
ldr walking tree hMTE=029a, name=H:\OS2\DLL\PMWIN.DLL
ldr walking tree going up
ldr walking tree hMTE=0618, name=H:\FAXWORKS\FAX.ADP
ldr walking tree going down
ldr walking tree hMTE=0104, name=H:\OS2\DLL\MSG.DLL
ldr walking tree going up
ldr walking tree hMTE=0618, name=H:\FAXWORKS\FAX.ADP
ldr walking tree going up
lrm, Recording init hMTE=0618, flags1=6090b1c6, name=H:\FAXWORKS\FAX.ADP
lrm, Skipping init hMTE=0104, flags1=2098b388, name=H:\OS2\DLL\MSG.DLL
lrm, Skipping init hMTE=029a, flags1=2098b388, name=H:\OS2\DLL\PMWIN.DLL
lrm, Skipping init hMTE=029c, flags1=2098b388, name=H:\OS2\DLL\PMSHAPI.DLL
lrm, Skipping init hMTE=0262, flags1=2098b388, name=H:\OS2\DLL\NLS.DLL
tk SD has-init slot=36
tk SD pre-inc slot=36 cnest=1
ldrDLM free - slot 36
ldrDLM exit - slot 36
ldrGP cr2=178de000 hMTE=618 bno=f
name = H:\FAXWORKS\FAX.ADP
ldrGP cr2=178df000 hMTE=618 bno=10
name = H:\FAXWORKS\FAX.ADP
ldrGP cr2=10e72000 hMTE=618 bno=1c
name = H:\FAXWORKS\FAX.ADP
ldrGP cr2=178e6000 hMTE=618 bno=17
34 OS/2 Debugging
name = H:\FAXWORKS\FAXWORKS.EXE
ldrGP cr2=178c1000 hMTE=5e1 bno=87
name = H:\FAXWORKS\FAXWORKS.EXE
ldrGP cr2=178c1000 hMTE=5e1 bno=87
name = H:\FAXWORKS\FAXWORKS.EXE
ldrGP cr2=178c2000 hMTE=5e1 bno=88
name = H:\FAXWORKS\FAXWORKS.EXE
ldrGP cr2=178c6000 hMTE=60b bno=7
name = H:\FAXWORKS\FX044.LOL
ldrGP cr2=178c7000 hMTE=60b bno=8
name = H:\FAXWORKS\FX044.LOL
ldrGP cr2=13c80000 hMTE=419 bno=34
name = H:\OS2\DLL\HELPMGR.DLL
ldrDLM entry - slot 36 ptda ab99a000
ldrDLM name - slot 36 name HPMGRMRI
lpi Processing imports slot=0036, module=H:\OS2\DLL\HPMGRMRI.DLL
ldr walking tree hMTE=062a, name=H:\OS2\DLL\HPMGRMRI.DLL
ldr walking tree going up
lrm, Skipping init hMTE=062a, flags1=2098b18a, name=H:\OS2\DLL\HPMGRMRI.DLL
ldrDLM free - slot 36
ldrDLM exit - slot 36
ldrGP cr2=178c7000 hMTE=62a bno=8
name = H:\OS2\DLL\HPMGRMRI.DLL
ldrGP cr2=10000 hMTE=5e1 bno=1
name = H:\FAXWORKS\FAXWORKS.EXE
ldrGP cr2=113000 hMTE=5e1 bno=82
name = H:\FAXWORKS\FAXWORKS.EXE
ldrGP cr2=21000 hMTE=5e1 bno=12
name = H:\FAXWORKS\FAXWORKS.EXE
ldrDLM entry - slot 36 ptda ab99a000
ldrDLM name - slot 36 name H:\OS2\DLL\HELV.FON
lpi Processing imports slot=0036, module=H:\OS2\DLL\HELV.FON
ldr walking tree hMTE=035e, name=H:\OS2\DLL\HELV.FON
ldr walking tree going up
lrm, Skipping init hMTE=035e, flags1=2098b3c8, name=H:\OS2\DLL\HELV.FON
ldrDLM free - slot 36
ldrDLM exit - slot 36
ldrGP cr2=28000 hMTE=5e1 bno=19
name = H:\FAXWORKS\FAXWORKS.EXE
ldrGP cr2=178c2000 hMTE=60b bno=3
name = H:\FAXWORKS\FX044.LOL
ldrGP cr2=42000 hMTE=5e1 bno=33
name = H:\FAXWORKS\FAXWORKS.EXE
ldrGP cr2=44000 hMTE=5e1 bno=35
name = H:\FAXWORKS\FAXWORKS.EXE
ldrGP cr2=41000 hMTE=5e1 bno=32
name = H:\FAXWORKS\FAXWORKS.EXE
ldrGP cr2=178c0000 hMTE=60b bno=1
name = H:\FAXWORKS\FX044.LOL
ldrGP cr2=178c6000 hMTE=60b bno=7
name = H:\FAXWORKS\FX044.LOL
ldrGP cr2=178c7000 hMTE=60b bno=8
name = H:\FAXWORKS\FX044.LOL
ldrGP cr2=43000 hMTE=5e1 bno=34
name = H:\FAXWORKS\FAXWORKS.EXE
ldrGP cr2=40000 hMTE=5e1 bno=31
name = H:\FAXWORKS\FAXWORKS.EXE
ldrGP cr2=29000 hMTE=5e1 bno=1a
36 OS/2 Debugging
name = H:\FAXWORKS\FAXWORKS.EXE
ldrGP cr2=37000 hMTE=5e1 bno=28
name = H:\FAXWORKS\FAXWORKS.EXE
ldrGP cr2=23000 hMTE=5e1 bno=14
name = H:\FAXWORKS\FAXWORKS.EXE
ldrGP cr2=13e52000 hMTE=281 bno=119
name = H:\OS2\DLL\PMMERGE.DLL
ldrGP cr2=13e53000 hMTE=281 bno=11a
name = H:\OS2\DLL\PMMERGE.DLL
ldrGP cr2=13e54000 hMTE=281 bno=11b
name = H:\OS2\DLL\PMMERGE.DLL
0x01000000
Display input to DosDebug
0x02000000
Display output from DosDebug
0x00000010
Display exceptions in DosDebug processing
0x10000000
Display execution flow in debugger processing
0x20000000
Display execution flow in debugger processing
0x40000000
Display execution flow in watchpoint and debug register processing
0x01000000
Display output buffer setup passed to user
0x02000000
Display input buffer setup passed from user
0x04000000
Display conversion routine flow
0x08000000
Display alias conversion routine flow
0x10000000
Display input and output return codes only
0x20000000
Display processing of notifications from DosDebug
0x00000001
Display floating point information
Each system API results either in a call to a system DLL or to the Kernel through
a Call Gate. The name of a system interface that is called when an application
uses an API is either identical to the API name or may be determined from one
of the following conventions:
DosI name Kernel Call Gate name corresponding to API Dos name .
Dos32name DOSCALL1 32-bit entry point corresponding to API Dos name .
Dos16name DOSCALL1 16-bit entry point corresponding to API Dosname.
In nearly all cases the system entry points have corresponding system trace
points with the entry point name prefixed with either pre or post. So the System
Tracepoints Reference (Volume 4) provides a comprehensive source for for
deriving API related breakpoints.
38 OS/2 Debugging
Physical Device Driver helper routines pass through a common router, then to
specific worker routines. Worker entry point names generally adhere to the
following convention:
DosHlp_name worker routine dh _name .
Virtual Device Driver helper routines have entry points in the kernel with
identical names (folded to uppercase) to the helper name.
File system driver and mini-file system driver helper routines have entry points
in the kernel with identical names to the helper name.
In addition to API and driver helper related breakpoints, the following system
labels may also prove useful when intercepting errors or program initiation:
_tkSchedNext
This routine is called when a new thread is selected for scheduling. The
out-going thread slot number is recorded in variable Tasknumber .
_tkSchedNext exits from one of two points:
SchedNextRet A new thread slot is selected.
SchedNextRet2 The same thread slot is selected.
##bp doslibDisp
##g
eax=00000000 ebx=000029f4 ecx=00000010 edx=00000014 esi=00000bc8 edi=00000c0a
eip=00000294 esp=0000773c ebp=00007752 iopl=2 -- -- -- nv up ei pl nz na po nc
cs=ffd7 ss=001f ds=ffa7 es=ffaf fs=150b gs=0000 cr2=1fc70490 cr3=001d0000
doscall1:CODE16_GROUP:DOSLIBIDISP:
ffd7:00000294 b80100 mov ax,0001 ;br0
##.p#
Slot Pid Ppid Csid Ord Sta Pri pTSD pPTDA pTCB Disp SG Name
*0044# 002c 0006 002c 0001 run 0400 7b9ae000 7bb4fc14 7bb2f088 1f48 19 cmd
>> The hmte for the current process is found in the PTDA at
>> ptda_module
##dw ptda_module l1
0030:0000ffaa 03a1
##.lmo 3a1
hmte=03a1 pmte=%fe97ebe4 mflags=84903152 c:\os2\cmd.exe
obj vsize vbase flags ipagemap cpagemap hob sel
0001 0000c6a8 00010000 80001025 00000001 0000000d 03a0 000f r-x shr alias
0002 00007efa 00020000 80001025 0000000e 00000008 03a2 0017 r-x shr alias
0003 00009730 00030000 80001043 00000016 00000002 0000 001f rw- prel alias
>> Now dump the MTE and SMTE, whose address is at MTE+0x4
##dd %fe97ebe4 l8
%fe97ebe4 03a10002 fd4341d0 fe97ec1c fe9a143c
%fe97ebf4 84903152 00000007 00060050 fe908e74
##dd %fd4341d0
%fd4341d0 00000017 00000002 000044fa 00000003
%fd4341e0 00007790 00000009 000005d9 fd434261
%fd4341f0 00000003 fd4342a9 00000a00 00000000
%fd434200 00000000 fd434361 fd434368 fd434369
%fd434210 fd4343c9 fd4348f1 fd434924 00000a00
%fd434220 00000000 00000000 00000003 00000000
%fd434230 00000000 00001fa0 fd434252 00000000
%fd434240 00000000 00003f40 00000000 0000000e
40 OS/2 Debugging
>> SMTE+0x4 is the entry point object number
>> SMTE+0x8 is the entry point offset offset
>> For CMD.EXE this is 2:44fa
>> Since object 2 starts at %20000, we can define a breakpoint on
>> entry to CMD.EXE at %20000+44fa
##bl
0 e ffd7:00000294 [DOSLIBIDISP]
1 e %000244fa [__astart]
>> Disable BP 0 since DosLibIDisp is called for every DLL that will be
>> initialised in the new process.
##bd 0
##g
eax=00000027 ebx=00000491 ecx=00009730 edx=0000f834 esi=00001fa0 edi=000003a1
eip=000044fa esp=00007790 ebp=00000000 iopl=2 -- -- -- nv up ei pl nz na po nc
cs=0017 ss=001f ds=001f es=0000 fs=150b gs=0000 cr2=00063ffe cr3=001d0000
cmd:_TEXT3:__astart:
0017:000044fa fc cld ;br2
VMLockMem
This breakpoint is on entry to the memory locking subroutine of Virtual
Memory Management. It may be used in conjunction with the VM Lock
Trace.
_XCPTBuildR3DispatcherStack
This routine is called whenever a process fatal exception is generated,
regardless of whether exception handlers are registered. It therefore makes
a stronger method than VSF * for intercepting fatal user exceptions.
Exception management and how to intercept exceptions is discussed in more
detail in the Trap and Exception Processing section.
_xcptR3ExceptionDispatcher
Whenever an exception (that is not fatal to the system), the Ring 3 Exception
Dispatcher is called to dispatch registered exceptions. It does this by
locating exception registration records from the TIB at +0x0. :1i.Thread
Information Block
On entry to the Ring 3 Exception Dispatcher, ESP+0x4 and E X P + 0 x 8 point
to the exception report record and exception context record, respectively.
The exception report record contains the exception number, and exception
address.
The exception context record contains all register values at the time of
exception.
The layout for both these records is given in the BSEXCPT.H header file of
the OS/2 Programmer′s Toolkit.
Most exceptions are generated from a hardware detected exception such as
a trap. These are readily intercepted by using the Kernel Debugger VSF
command. Exceptions may also be generated by the DosRaiseException
API. Whatever the source all exceptions will eventually result in a call to
_xcptrR3ExceptionDispatcher . This makes this label an excellent breakpoint
##gt
eax=00022d18 ebx=00000000 ecx=0002059c edx=000a0000 esi=00000000 edi=00000000
eip=1ff9c8d8 esp=00022bf0 ebp=00022d04 iopl=2 -- -- -- nv up ei pl zr na pe nc
cs=005b ss=0053 ds=0053 es=0053 fs=150b gs=0000 cr2=00000000 cr3=001d0000
doscall1:FLAT32:_xcptR3ExceptionDispatcher:
005b:1ff9c8d8 55 push ebp ;br0
##dd %esp
%00022bf0 1ff9c7e9 00022d18 00022d3c 00000000
%00022c00 00000000 2c1a0002 154b0000 00100000
%00022c10 00010002 00000000 032b0000 ffa72212
%00022c20 0058ffaf 2c520066 154b0000 033e0002
%00022c30 52110000 ff9f3130 00000000 00172c52
%00022c40 e91f0000 e9270116 ffa70066 3029ffa7
%00022c50 0008ffa7 e9170000 00570000 00000019
%00022c60 00008000 00000000 00f80000 80000000
##dd %00022d18
%00022d18 c0000005 00000000 00000000 0001011c
%00022d28 00000002 00000001 00000000 7bb4fc94
%00022d38 ffdf9264 00000007 0000699c fff5416b
%00022d48 00000433 ffdf9264 7b9afe0c ffdf6378
%00022d58 00000433 000069bc fff54ef2 ffdf9264
%00022d68 ff1f5a50 fe86106c 00000000 fed022d0
%00022d78 00000000 00006a04 fff6d8d9 00000053
%00022d88 00000000 7b9afe3c ff1f5a50 7cf8014c
42 OS/2 Debugging
>> The context record contains the registers at time of exception.
>> Note the cs:eip at +0xa0 and +0x9c. Also the ss:esp at +0xbc abd
>> +0xb8 and ebp at +0x98.
##dd %00022d3c
%00022d3c 00000007 0000699c fff5416b 00000433
%00022d4c ffdf9264 7b9afe0c ffdf6378 00000433
%00022d5c 000069bc fff54ef2 ffdf9264 ff1f5a50
%00022d6c fe86106c 00000000 fed022d0 00000000
%00022d7c 00006a04 fff6d8d9 00000053 00000000
%00022d8c 7b9afe3c ff1f5a50 7cf8014c 7cf80088
%00022d9c 00000001 7cf80088 00000001 7bb2fdb2
%00022dac 00000000 0000150b 00000053 00000053
##d
%00022dbc 00000000 00000000 00000000 00000000
%00022dcc 0002059c 000a0000 00022e74 0001011c
%00022ddc 0000005b 00012216 00022e6c 00000053
%00022dec 00060210 00000000 00000000 000205fc
%00022dfc 000205fc 00020a40 00000000 00000000
%00022e0c 00000000 00000000 00000000 000a0000
%00022e1c 00002000 00000000 00090000 00022e50
%00022e2c 00011fa8 000205fc 00090000 00000000
Win32SetErrorInfo
This API is called by PM whenever it needs to record a PM error. When this
is used as a breakpoint, the doubleword at % e s p + 0 x 4 contains the PM error
code about to be recorded.
NWDHandler
This symbol is the entry point to the Trap 2 interrupt handler. The IDT entry
for Trap 2 contains a Task Gate that points to NWDHandler. When
NWDHandler receives control the Task Register will contain the selector for
the current TSS. The link field of the current TSS will contain the previous
value of the TR, where the processor saved the current registers when the
interrupt occurred.
Frequently NMI interrupts are associated with disabled code and obscure
hardware or software problems. If can be useful on these occasions to set
up a KDB.INI file with the following commands to display information when
the trap 2 occurs. This is particularly advantageous when dealing with NMI
interrupts caused by the NMI Watch Dog timer firing.
bp nwdhandler,″? ′curr tss′ ; dt tr:0;? ′ prev tss′ ; dt #(wo(tr:0)):0″
Note: When the first NMI occurs, the following would be displayed:
The register values when the NMI occurred are displayed under the label
prev tss .
After NWDHandler has processed the NMI, the NMI TSS is edited and the
entry point on subsequent NMI is approximately NWDHandler+25. This
may be used as an indication that an NMI has previously occurred.
Exception Definition
44 OS/2 Debugging
Trap 1 and 3 for system trace
387 co-processor emulation
VDM privileged instruction emulation
In the abnormal case, an error condition has been detected. If the error
cannot be corrected then either a process or the system dies depending on
whether the error can be isolated to a particular process. Usually traps and
faults in ring 0 code result in system termination. Bad parameters passed in
system APIs may cause the kernel to trap. The system recovers by directing
an exception 0xc0000005 to a process. Unless the process can handle this
exception, it dies.
• Full details of OS/2 defined exceptions are given in OS/2 System Exception
Codes.
Exception Logic
46 OS/2 Debugging
1.6.1 Exception Registration Records
48 OS/2 Debugging
1.6.3 Exception Handler Stack Frames
Note: User exception handlers can be disabled under the Kernel Debugger by
locating the TIB, then storing 0xffffffff at offset 0x0, which is the pointer to
the exception registration record chain. The chain is terminated by
0xffffffff and can be re-worked manually for debugging purposes - provided
that the system is not already processing an exception for this thread.
2 Throughout this chapter the term debugger. is used loosely to mean any of the following where ambiguity is not a problem:
50 OS/2 Debugging
Chapter 2. Dump Formatter User Guide
Each of the two Dump Formatters is generated for each build of the OS/2 kernel.
Thus the Dump Formatter is system level and FixPak level dependent, in a
similar way to the debug kernels. Several base versions of the Dump Formatters
are distributed with the OS2PDP package. For versions that correspond to a
particular FixPak, contact your local IBM Service Representative.
The Dump Formatter has a named pipe interface that allow it to be controlled
from another program. This is exploited by the PMDF program, which is also
distributed with the OS2PDP package.
PMDF provides:
• A PM interface to the Dump Formatter
• Automatic Dump Formatter version management
• The ability to log output to a file
• Use of Drag and Drop on Dump Formatter output to the PMDF commands
line
• A REXX interface that allows REXX EXECs to issue Dump Formatter
commands and capture their output
• Process Dump Formatting
The command set supported by Dump Formatter is very similar to that of the
Kernel Debugger. In many cases they share common commands. These are
documented in Chapter 3, “Kernel Debugger and Dump Formatter Command
Reference” on page 71.
dumpfile
The file name of the (decompressed) dump to be analyzed. If a path is not
prepended to the file name then the Dump Formatter assumes the current
path. See 2.2, “Dump Decompression” on page 53.
-P pipename
The name of a named pipe through which Dump Formatter output and
commands are channeled.
Note: This parameter is intended for use when DF&US.RET.EXE or
DF&US.DEB.EXE is started from another program using the
DosExecPgm API.
Note:
When the Dump Formatter is started it displays the build level of the system from
which the dump was taken and then the build level of the formatter. If these do
not match unpredictable, results may occur. However, if the levels are close
then it is probably safe to use the Dump Formatter, though not guaranteed.
If the incorrect type of Dump Formatter is used, for example, RETAIL Dump
Formatter with a ALLSTRICT dump, then the Dump Formatter will probably trap.
If it does not, then an error message will appear.
The latter problem usually occurs when the .P is used. This is sometimes
circumventable by using the EXEDHR utility to increase the stack size of the
Dump Formatter. Another approach is to use the %PS REXX to display each
thread slot individually.
52 OS/2 Debugging
Formatter provided that at least one location of a module or its data
can be determined absolutely.
Symbol files not present in the current directory may be manually
loaded using the WA command. The syntax and function of this
command differs subtly from the Kernel Debugger equivalent:
• Under Dump Formatter names are symbol file names unlike
Kernel Debugger where they are symbol map names. This allows
relative path names to be used.
• Under Dump Formatter WA reads the symbol file, whereas under
Kernel Debugger it is just marked active provided it was loaded
when the module was loaded.
The Dump Formatter prompts for command input with a single # sign. Unlike the
Kernel Debugger this is not used to signify the processor mode or whether
paging is enabled. Consequently the Dump Formatter always assumes that the
current processor mode is Protect Mode with Paging Enabled. The user must
therefore explicitly prefix segment:offset addresses in Virtual 8089 mode with an
ampersand (&).
Dumps taken to a hard disk partition may be used directly by Dump Formatter or
PMDF.
NDCOMP has a better tolerance for missing dump data or corrupted dumps. The
syntax for NDCOMP is as follows:
──── NDCOMP ───┬──────┬─ source drive ─── file name ─────────────
└─ /f ─┘
/f
source drive
Specifies the drive where the DUMPDATA.nnn file will be found. This may
specify either a hard disk drive or a diskette drive. The DUMPDATA.nnn files
from a diskette dump may be copied to a hard drive root directory before
using the NDCOMP utility.
file name
The target dump file name including path information.
The home directory contains the PMDF executables and help files, the version
control file PMDFVERS.LST, and any REXX EXECs to be installed in their default
directory.
PMDFVERS.LST
The build level is the internal system build level and may be determined
either by browsing the OS2KRNL load module and searching for the text
@#IBM:n.nnn#@
near the end of the module, or by using the BLDLEVEL utility in the OS2
directory. The VER /R command is not reliable since it only reports the
base version level, not the fix-pack version level, in some releases.
54 OS/2 Debugging
2.4 PMDF Menus and Options
PMDF offers a number of facilities from its pull-down menus and also from the
mouse buttons.
From the Keyboard Ctrl-C and Esc serve to interrupt the Dump Formatter.
Warning
Do not use the Dump Formatter Q command. Under PMDF this will cause
PMDF to hang. To terminate the Dump Formatter either quit PMDF from the
system menu or select another dump for processing.
New Dump
Select this option to decompress a new dump.
Notes:: For diskette dumps the DUMPDATA.nnn files may be copied for a
directory on the hard drive and decompressed from there.
PMDF has the ability to decompress diskette images created by
OS2IMAGE without re-creating the original diskettes. To use this
facility each of the image file must be named image.nnn where nnn is
a numeric sequence number that corresponds to the disk number.
Open Dump
This option prompts the user for the dump file name and then invokes Dump
Formatter.
Log Output
This option prompts the user to start or stop logging output to a file. Data
may be appended to an existing log file.
Connect
Connect allows PMDF to be used as a terminal emulator to drive a Kernel
Debugger session. See Chapter 1, “Kernel Debugger User Guide” on
page 1 for more information.
Disconnect
Disconnect terminated the communications session with the Kernel
Debugger.
Search String
Locates text within the scrollable window.
Undo
Reverse the previous Edit Cut action.
Copy
Copy marked text to the clipboard.
Cut
Move marked text to the clipboard.
Clear Screen
Clears the scrollable window of all text. This is not a reversible action.
56 OS/2 Debugging
Figure 9. PMDF Edit Pull-down M e n u
Font Settings
This allows font selection for displayed output.
Function Keys
This provides a menu to predefine function keys as strings of Dump
Formatter command strings. Commands may be separated by a semicolon.
Terminal Settings
Allows the communications parameters to be specified for when the Connect
option of the File pull-down is selected.
Save Settings
This will save the current options in the PMDF.INI file for use the next time
PMDF is started.
Caution
The output from the Analyze options needs to interpreted with care. Some
options are precise in that the follow control block chains anchored from the
SAS such as the Physical Device Driver Chain and Kernel Heap. Others
depend on correct symbols being loaded for correct results. Some options,
for example those that display stacks, are more speculative in what they
display.
Before these facilities are relied on, the user should thoroughly acquaint
themselves with the manual techniques that belie their function. This
information is available in the course materials that comprise the first few
chapters of this handbook.
System
The System menu displays the following options:
58 OS/2 Debugging
Figure 11. PMDF System M e n u
Process
The Process menu displays the following options:
Threads
The Threads menu dumps stacks related to a given thread. The following
menu is displayed:
Synopsis
This offers a miscellaneous collection of options, the most important of which
is the Trap Screen display. The following menu is displayed:
60 OS/2 Debugging
Figure 15. PMDF Help Pull-down M e n u
A single click with mouse button 2 will display a pop-up menu whose items take
the highlighted text in the scrollable output window as input.
The following diagram shows an example of the mouse pop-up menu. In this
example the Structures option is displayed. This particular option acts as a
supplement to the Dump Formatter .D command. For it to work correctly, the
Structure Definition Files (*.SDF) are required to be present in the same directory
as the Dump Formatter. These files are build level dependent and will only
display correct information if matched to the dump level. There is no validation
performed by these displays. The user must ensure that an appropriate input
address is highlighted.
EXECs are invoked by entering the REXX execname, with optional directory
information, prefixed with a ′ % ′ character from the PMDF command window. If
the EXEC is not installed in a directory in the PATH or in the same directory as
PMDF, then it must be prefixed with the fully qualified path name. For example:
%SEGTAB 123
The syntax and parameters for this implementation of the address instruction
are:
address df ′ CMD′ <output> <df_cmd>
Where:
62 OS/2 Debugging
<output>
is the name of a stem to a REXX compound variable that will be assigned to
capture output from the Dump Formatter command.
″output.0″ will be set to the number of lines. ″output.n″ will contain the nth
line of output.
< d f _c m d >
is the dump formatter command and parameters.
Parameters following the EXEC name will be passed to the EXEC as a one
parameter string.
A number of general purpose EXECs are provided in the OS2PDP package on the
CD-ROM accompanying this book. These are:
RUNCHANIN Generalized Control Chain Running EXEC
PS Generalized EXEC for executing Dump Formatter commands per
thread slot
TEMPLATE A Template EXEC containing a collection of subroutines useful
for writing other EXECs
There are also a number of example EXECs that format control blocks and
illustrate how to use the REXX interface and the subroutines contained in
TEMPLATE.
This exec provides a generalized control block chaining facility, where at each
hop of the chain a command or exec may be executed. The starting address
and link offset are required. Other parameters are optional. The parameters to
RUNCHAIN are:
<addr> Is an address expression of the start of the chain
< o f f s e t > Specifies the decimal or hexadecimal offset of the linking address.
Default is 0
<s> Specifies the length of the linking field as: D (double) or W (word) -
Default is D
<stop> Specifies a termination value for the linking field. This take
precedence over <chain> and may be specified as a hexadecimal
or decimal value.
<nnn> Specifies the maximum number of chain hops to traverse. Default is
10
<cmd> Specified a command to be executed at each hop. If the command is
prefixed with a % then an exec is executed. @L will cause the linear
address of the current block to be substituted. Default is DD @L L4.
<file> Specifies a print file to which the output will be copied.
Note: Hexadecimal values are specified as ′nn′ x
Block 2 at %fe0a1dac
Block 3 at %fe083e40
Block 4 at %fe0adef8
Block 5 at %fdf61cc8
64 OS/2 Debugging
< p a r m s > Are any valid parms where @TCB, @PTDA and @TSD are substituted
with their corresponding linear addresses. @disp is the scheduler′ s
ESP relative to the TSD. N.B @disp is only defined when page table
entries are present for the TSD.
Example 1:
Display priority information (on a 2.11 system) for slots 30 to 33 where priority
class is at TCB+e4, priority delta is at TCB+e5 and dispatching priority is a
word at TCB+e8.
Enter:
%PS 30 33 DB @TCB+e4 L2; DW @TCB+e8 L1
Slot 30
Warning: not all addresses are present
DB %7BA8FE78+E4 L2; DW %7BA8FE78+E8 L1
%7ba8ff5c 02 0f ..
%7ba8ff60 020f
Slot 31
DB %7BA9002C+E4 L2; DW %7BA9002C+E8 L1
%7ba90110 02 00 ..
%7ba90114 0200
Slot 32
Warning: not all addresses are present
DB %7BA9002C+E4 L2; DW %7BA9002C+E8 L1
%7ba90110 02 00 ..
%7ba90114 0200
Slot 33
DB %7BA90394+E4 L2; DW %7BA90394+E8 L1
%7ba90478 03 00 ..
%7ba9047c 0800
ps ended rc: 0
Note: For slot 30 a warning message is issued because in this instance .s30
gave an error because slot 30 page tables were swapped out.
linaddr <address>
Converts an address expression to a linear address (without the % prefix). If
storage cannot be referenced then a null string is returned.
gethxstr <h>,<a>,<l>
Retrieve a string of hex bytes from storage. If storage can′t be retrieved
then a null string is returned. The string is returned as a concatenated
string of bytes.
getbytes <h>,<a>,<l>
Retrieve a one or more bytes from storage. If storage can′t be retrieved
then a null string is returned. The string is returned as a string of bytes
separated by blanks.
getwords <h>,<a>,<l>
Retrieve a one or more words from storage. If storage can′t be retrieved
then a null string is returned.
getdwords <h>,<a>,<l>
Retrieve a one or more double words from storage. If storage can′t be
retrieved then a null string is returned.
getqwords <h>,<a>,<l>
Retrieve a one or more quadruple words from storage. If storage can′t be
retrieved then a null string is returned.
66 OS/2 Debugging
format < n a m e > , < o f f s e t > , < b a s e > , < t y p e > , < d e s c >
Format a field from a control block and returns the value of the field.
fmtblock <name>,<offset>,<base>,<type>,<number>,<desc>
Formats a table of bytes, words or double words imbedded in a control
block.
The Process Dump Formatter offers a limited subset of the full Dump Formatter
command set. These are:
.D Display storage in Bytes, Words or Double-Words.
DL Display LDT entries.
L List, Symbols, Maps and Symbol Groups
.LM and .LMO Display Module Table Entries and Object Tables
.MA Display Arena Records for storage dumped.
.MO Display Object Records for storage dumped.
.ML Display Information on Dumped Memory.
Note: This command does not perform the same function as the
similarly named Kernel Debugger .ML command, which formats
VM Alias Records.
.P Display threads.
Note: Unlike the Dump Formatter and Kernel Debugger version of
this command, .P is used to select the thread ordinal within
the dumped process. Thus for single thread processes .P 1 is
the only valid combination.
.PB Display thread Block IDs.
Note: Unlike the Dump Formatter and Kernel Debugger version of
this command, .PB is used to select the thread ordinal within
If the dump was created because of a trap then the trap number is
displayed otherwise the trap number is shown as ffffffff.
The Analyze pull-down menu differs from the standard PMDF Analyze facility.
This offers the following choices:
Registers
This performs the R command for each thread dumped.
68 OS/2 Debugging
Task Summary
This performs a .P command followed by an R command for each thread
dumped.
Local Descriptors
This performs a DL command.
Module Table
This is a much more extensive version of the .LMO command. The entire
MTE and SMTE for each module dumped is formatted.
Process Synopsis
This formats the entire Process Dump, including dumping all memory in byte
format.
For information on taking and controlling Process Dumps see the following:
The CONFIG.SYS DUMPPROCESS command
The DosProcessDump API
Dump Formatter
Kernel Debugger
References to some system control offsets blocks are made in the descriptions
of the commands. For the sake of brevity, the ALLSTRICT version of the OS/2
WARP 3.0 kernel is assumed and in some cases the equivalent RETAIL and
HSTRICT kernel offsets are given in parentheses. For example:
JFN_pTable (PTDA +0x5b8 (H/R: +0x5b0))
The reader should refer to the System Reference Manual, Volume 4 of the OS/2
Debugging Library for control block layouts of the ALLSTRICT, HSTRICT and
RETAIL kernels for OS/2 WARP 3.0 and OS/2 2.11 kernels.
For a description of the conventions used in the syntax diagrams, see 3.1,
“Syntax Diagrams - Notation.”
Complex expressions may be used where substituted values are required. The
rules governing expressions are described in 3.2, “The Expression Evaluator” on
page 73.
72 OS/2 Debugging
┌── , ──┐ ┌── , ──┐
│ │
────┬─────┬┴─── ───┬─ D ─┬┴────
├─ A ─┤ ├─ E ─┤
├─ B ─┤ └─ F ─┘
└─ C ─┘
For the Dump Formatter and Kernel Debugger spaces between parameters
options are optional.
Ordered non-exclusive selection lists and parameters are shown in the order
they must be specified.
┌── , ──┐ ┌── , ──┐
│ │
── X ────┬─────┬┴─────────┬─ D ─┬┴──────┬─────┬─── = value ───
├─ A ─┤ ├─ E ─┤ ├─ H ─┤
├─ B ─┤ └─ F ─┘ └─ I ─┘
└─ C ─┘
Where complex diagrams require splitting into multiple sections, the sections are
identified by a lowercase italic name. For example:
──────────┬───────────────────┬─────────────
│ │
├──┤ section 1 ├────┤
│ │
└──┤ section 2 ├────┘
section 1:
├─────────────┬─────┬────┬─────┬───────────┤
└─ A ─┘ ├─ B ─┤
└──C ─┘
In this example the syntax for section 1 is exclusive with section 2. The options
for section 1 are shown at the label section 1 :
Symbols defined by symbol files may also be used to represent either their
equivalent address operator and address arithmetic value combination or
constant arithmetic value in command line expressions.
nnnnnnY
Binary number nnnnnn
nnnnnnO
Octal number nnnnnn
nnnnnnQ
Alternative notation for octal number nnnnnn
nnnnnnT
Decimal number nnnnnn
nnnnnnH
Hexadecimal number nnnnnn
The following represents the same number, expressed in each of the permissible
forms:
31
31t
1fh
37o
37q
10001111y
74 OS/2 Debugging
Boolean Boolean expressions are ones that resolve to either a TRUE or FALSE
value.
Boolean expression may be formed from arithmetic expressions using
boolean binary and unary operators together with parentheses (), to
influence evaluation order.
Boolean expressions may be used as absolute values in arithmetic
expressions, where TRUE assumes the value 1 and FALSE 0.
Address An arithmetic expression that resolves to one or two numeric values
that represent a linear, physical, segment:offset or selector:offset
address.
Address expressions are formed from absolute expressions using
addressing separators.
Note: The expression evaluator allows arithmetic values to be expressed in
hexadecimal. A potential conflict may occur where symbol names exist
that begin with letters a - f. For example, a linear address expressed as
%fe1234 may be rejected with the message:
Invalid expression
If the same error message persists, then the address refers to either
paged out or unallocated virtual memory.
* Multiplication
/ Integer division
MOD
Modulo or remainder operator
+ Addition
- Subtraction
AND
Bitwise AND
XOR
Bitwise exclusive OR
OR
Bitwise OR
Boolean operators:
> =
Greater than or equal to
= =
Logical equality
! = Logical inequality
&&
Logical AND
|| Logical OR
NOT
Bitwise ones complement
Boolean operators:
! Logical negation
SEG
Returns the segment or selector portion of an address that resolves to either
a &segment:offset or #selector:offset form.
OFF
Returns the offset of an address the resolves to either a &segment:offset or
#selector:offset form.
BY
Returns one byte from an address location.
WO
Returns one word from an address location.
DW
Returns one doubleword from an address location.
POI
Returns one doubleword far pointer (selector:offset or segment:offset
address) from an address location. The low order word returned is treated
as the offset. The high order word returned is treated as a selector or
segment based, depending on the default addressing mode. See the D
command for more information.
76 OS/2 Debugging
PORT
Returns one byte from an 8-bit I/O port address.
WPROT
Returns one word from a 16-bit I/O port address.
Example:
DD %(dw(%7abcde0+10))
# Selector prefix
%%
Physical address prefix
Examples:
%ebp
The built-in register mnemonics supported by the Kernel Debugger and Dump
Formatter are:
• 16-bit registers:
ax, bx, cx, dx, si, di, bp, ip, pc
• 32-bit registers:
eax, ebx, ecx, edx, esi, edi, ebp, eip
• Segment registers:
cs, ds, es, fs, gs, ss
• Flag registers:
flg, eflg
• Control registers:
cr0, cr2, cr3
• GDTR register:
gdtb, gdtl
• IDTR register:
idtb, idtl
• Task control registers:
tr, ldtr, msw
• Debug registers:
dr0, dr1, dr2, dr3, dr4, dr5, dr6
• Test registers:
tr6, tr7
These may be used as absolute expressions for the current register value. See
the R command for information on displaying and setting current register values
and for the definition of the register mnemonics.
78 OS/2 Debugging
Similar conflicts may also arise between hexadecimal values and symbols.
These may be avoided by prefixing the hexadecimal numeric value with a zero.
80 OS/2 Debugging
S Search
T Trace
U Unassemble
V Trap Vectors Command family
W Withmap Add or Remove
Y Set Kernel Debugger options
Z Set/list/execute the default command
Display help for internal Kernel Debugger and Dump Formatter commands and
evaluate complex expressions.
Syntax:
───── ? ──┬─────────────────┬──────────────────────────────────
├─── expr ───┤
└─── string ───┘
Parameters:
(default) Displays a help summary for most of the Dump Formatter and Kernel
Debugger internal commands.
Note: Some of the information displayed is out-of-date.
Two pages of information are displayed with an intervening --More--
prompt.
expr An expression that resolves to either a simple numeric value or an
address using any of the expression evaluation operators. Symbols
of addresses and symbols of absolute values may be specified.
string A string enclosed in single or double quotes.
Where:
sel:offset Specifies the selector and offset form of the address if the expression
resolves to a sel:offset form.
%linaddr Specifies the linear address equivalent of the expression if it resolves
to either a sel:offset or %linaddr form.
%physaddr Specifies the physical address equivalent of the expression. If the
expression resolves to a virtual address then the page tables must be
present to perform the address translation.
See the DP command for information on displaying page table entries
and the .I command for information on paging in memory.
82 OS/2 Debugging
##? 5
05H 5T 5Q 00000101Y ′ . ′ TRUE
? bmp_segsize
12H 18T 22Q 00010010Y ′ . ′ TRUE
Notes
Each arithmetic value is suffixed with a modifier that indicates the base used:
H Signifies hexadecimal
T Signifies decimal (Tens)
Q Signifies octal (Qctal?)
Y Signifies binary (Yes/no?)
##? ″This is a way of annotating the debug log from this session′ s analysis″
This is a way of annotating the debug log from this session′ s analysis
##
Syntax:
──── B ───────────────────────┬── C ──┬───┬─────────────┬───
├── D ──┤ └── options ──┘
├── E ──┤
├── L ──┤
├── P ──┤
├── R ──┤
├── S ──┤
└── T ──┘
Parameters:
C Clear breakpoints.
See the BC command for options.
D Disable breakpoints.
See the BD command for options.
E Enable breakpoints.
See the BE command for options.
L List breakpoints.
See the BL command for options.
P Set or change breakpoints.
See the BP command for options.
R Set a debug register breakpoint.
See the BR command for options.
S Set a timestamped breakpoint trace.
See the BS command for options.
T Display a timestamped breakpoint trace.
See the BT command for options.
options See the associated command for details.
Syntax:
84 OS/2 Debugging
┌─── , ───┐
│
──── BC ───────────────────┬───── n ──┴──┬──────────────────
└───── * ─────┘
Parameters:
n Breakpoint number to be cleared.
* may be specified to clear all breakpoints.
See the breakpoint commands for information on listing and setting
breakpoints.
Syntax:
┌─── , ───┐
│
──── BD ───────────────────┬───── n ──┴──┬──────────────────
└───── * ─────┘
Parameters:
n Breakpoint number to be disabled.
* may be specified to disable all breakpoints.
See the breakpoint commands for information on listing and setting
breakpoints.
Syntax:
┌─── , ───┐
│
──── BE ───────────────────┬───── n ──┴──┬──────────────────
└───── * ─────┘
Parameters:
Syntax:
──── BL ──────────────────────────────────────────────────────
Parameters: none.
bl
0 e 0158:00005874 [DOSOPEN] 5 (5) ″ . P*;G″
1 d 0158:00007384 [DOSHOLDSIGNAL]
2 e %fff461a4 [_tkSchedNext] 12 (15) ″ . P*″
3 dT %fff474e4 [_PGSwitchContext]
4 d %1a022298 [DOS32WRITE] 10 (10)
5 e W2 0030:0000ffcc [Ppid]
6 dI E1 0000:00000000 5 (5) ″DW TASKNUMBER L1″
##
86 OS/2 Debugging
d Disabled breakpoint. See the BD command.
e Enabled breakpoint. See the BE command.
The suffix T signifies that the breakpoint is a timestamp
breakpoint created using the BT command
The suffix I indicates that the address has become invalid.
addr The address at which the breakpoint is defined.
[ symbol ] The breakpoint offset to the nearest symbolic address, if it exits. See
the LN and WA commands for information on listing and loading
symbol definitions.
pc The remaining passcount for this breakpoint. If a passcount is not
defined then this value is not displayed. See the BP and BR
commands for more information on passcounts.
(mc) The initial passcount defined for this breakpoint. If no passcount was
defined then this value is not displayed. See BP and BR commands
for more information on passcounts.
″cmd, cmd, ....″ A list of commands to be executed when the breakpoint fires.
Each command is separated by commas and the entire string is
enclosed in quotes. If no command string is defined then this field is
not displayed. See the BP, BR and Z commands for more information
on breakpoint command lists.
Syntax:
Parameters:
n Explicitly specifies a breakpoint number to be assigned to this
breakpoint. A value from 0 to 9 may be specified. If specified there
must be no space between the number and the BP command.
The default is to assign the lowest available number. If all 10
breakpoint numbers have been assigned then the following message
appears:
Too many breakpoints
addr The address of the breakpoint.
The Kernel Debugger saves the byte of storage at the location
specified by addr and inserts an INT 3 instruction in its place.
Notes: Whenever the Kernel Debugger is entered the storage
overlayed by any breakpoints is temporarily restored. When
BP 31 | %10032
Is equivalent to:
.S 31
BP 31 | %10032
.S 8
passcount Specifies the number of times the breakpoint may be passed before
the Kernel Debugger is entered. Each time the breakpoint is passed
the count is decremented by 1 until 1 is reached. When the
breakpoint is encountered with a count of 1 then it will fire and the
Kernel Debugger will be entered. Thus if passcount is 5 then the
breakpoint will fire on the 5th encounter.
The default passcount is 1, that is, the breakpoint will fire on first
encounter.
cmd Specifies a command to be executed when the breakpoint fires. More
than one command may be specified by using a semicolon separator
and enclosing the entire command list in single or double quotes.
If no command string is specified then the default command string, as
specified by the Z command will be executed.
If the breakpoint is successfully defined then the built-in mnemonic BRn , where n
corresponds to the breakpoint number, takes the value of the breakpoint
address. This may be used in any address expression or any command.
Note: Since BP breakpoints are implemented by the insertion of INT 3
instructions, it is possible for such breakpoints to become discarded if the
page of code is discarded and subsequently paged back into memory.
88 OS/2 Debugging
This complexity may be avoided by setting register breakpoints with the
BR command.
Syntax:
Parameters:
n Explicitly specifies a breakpoint number to be assigned to this
breakpoint. A value from 0 to 9 may be specified but from this range
only a total of 4 may specify enabled debug register breakpoints.
If a value n is specified there must be no space between the number
and the BR command.
The default is to assign the lowest available number. If all 10
breakpoint numbers have been assigned then the following message
appears:
Too many breakpoints
If all four debug registers are in use, then the following message:
Out of debug registers
is displayed.
Note: A disabled debug register breakpoint does not commit the use
of a debug register. Thus more that 4 debug register
breakpoints may be defined, but only a maximum of 4 enabled
at any one time.
See the BE and BD commands for information on enabling and
disabling breakpoints.
E Specifies that the breakpoint is to fire when an instruction at the
breakpoint address is fetched for execution.
This is mutually exclusive with the W and R parameters.
Rb Specifies that the breakpoint is to fire when storage at the breakpoint
address, for length b is referenced. b may specify 1, 2 or 4 bytes and
defaults to 1 byte if left blank.
This is mutually exclusive with the W and E parameters.
Wb Specifies that the breakpoint is to fire when storage at the breakpoint
address, for length b is stored. b may specify 1, 2 or 4 bytes and
defaults to 1 byte if left blank.
This is mutually exclusive with the R and E parameters.
If the specified address is valid then the breakpoint definition is accepted and
enabled. Otherwise it is accepted but disabled and one of the following
messages is generated:
Invalid selector: selector:offset
Past end of segment selector:offset
If the breakpoint is successfully defined then the built-in mnemonic BRn, where n
corresponds to the breakpoint number, takes the value of the breakpoint
address. This may be used in any address expression or any command.
Syntax:
──── BS ──────────────────────────────────────────────────────
Parameters:
None.
90 OS/2 Debugging
The timestamp trace buffer is formatted in LIFO order. The following is an
example of the formatted trace:
Number of entries = 4284
BP0 381e6ae1a (hex)
BP4 381e68292 (hex)
BP0 381e658d1 (hex)
BP4 381e40559 (hex)
BP0 381e3da7d (hex)
Notes: The number of entries is the total accumulated number of timestamp
trace events regardless of wrapping of the (4096 entry) timestamp trace
buffer.
Syntax:
Parameters:
n Explicitly specifies a breakpoint number to be assigned to this
breakpoint. A value from 0 to 9 may be specified. If specified, there
must be no space between the number and the BT command.
The default is to assign the lowest available number. If all 10
breakpoint numbers have been assigned then the following message
appears:
Too many breakpoints
addr The address of the breakpoint.
The Kernel Debugger saves the byte of storage at the location
specified by addr and inserts an INT 3 instruction in its place.
Notes: Whenever the Kernel Debugger is entered the storage
overlayed by any breakpoints is temporarily restored. When
the Kernel Debugger gives control back to the system, enabled
breakpoints are re-instated.
If addr specifies the address of an existing breakpoint then the
existing breakpoint is updated with the new parameters.
If the address is valid then the breakpoint definition is accepted and enabled.
When enabled, the timestamp breakpoint causes the current high resolution
Unlike the BP and BR commands, BT does not return control to user when the
breakpoint is encountered.
92 OS/2 Debugging
3.3.11 C - Compare Memory
Syntax:
Parameters:
addr1 The address of the beginning of the first location to compare with the
second. This address is assumed to be in # selector:offset format. If
the selector is omitted then the current DS selector is assumed.
n The offset from addr1 of the last byte to compare (that is, the length of
the range less 1).
addr2 The address of the beginning of the second location to compare with
the first. An address expression may be specified. This address is
assumed to be in # selector:offset format. If the selector is omitted
then the current DS selector is assumed.
Where differences are found in the address range, they are displayed in the
following way:
001f:00000000 57 4f 001f:00000003
001f:00000001 50 32 001f:00000004
001f:00000003 57 4f 001f:00000006
The addresses of the two differing locations are displayed outermost and the
bytes at those locations are displayed in columns 2 and 3.
Syntax:
───┬─ D ──┬───┬──────────────────┬───────────────────────────
├─ DA ──┤ └── addr ──┬───────┤
├─ DB ──┤ └─ Ln ──┘
├─ DW ──┤
└─ DD ──┘
Parameters:
(default) Display memory using the current display format. When the user
breaks into the Kernel Debugger the current format is set to byte
display. If the user subsequently executes a DW, DA or DD command
then the current format is set to words, ASCII or doublewords,
respectively. Byte format default may be restored by using DB.
A Force memory to be displayed in ASCII format and set the current
display format to ASCII. The display is terminated as soon as the first
null byte (0x00) is reached or the length specification is reached.
Note: The current display address is not updated when in ASCII
format.
B Force memory to be displayed in byte format and set the current
display format to byte.
W Force memory to be displayed in word format and set the current
display format to word.
D Force memory to be displayed in doubleword format and set the
current display format to doubleword.
addr The address of the memory location to display. When the user
breaks into the Kernel Debugger this defaults the current DS selector,
offset 0. If a display command other than DA is executed then the
current display address is updated to the last displayed address + 1 .
An address expression may be specified.
Ln The number of bytes, words or doublewords to display, depending
upon the current display format. If not specified this defaults to 128
bytes, 64 words and 32 doublewords respectively.
94 OS/2 Debugging
##da 1f:0
001f:00000000 WP_OBJHANDLE=177110
Figure 19. ASCII Format
##db 1f:0
##dw 1F:0
Syntax:
───── DA ──────┬──────────────────┬───────────────────────────
└── addr ──┬───────┤
└─ Ln ──┘
Syntax:
───── DB ──────┬──────────────────┬───────────────────────────
└── addr ──┬───────┤
└─ Ln ──┘
Syntax:
96 OS/2 Debugging
───── DW ──────┬──────────────────┬───────────────────────────
└── addr ──┬───────┤
└─ Ln ──┘
Syntax:
───── DD ──────┬──────────────────┬───────────────────────────
└── addr ──┬───────┤
└─ Ln ──┘
Syntax:
───┬─ DG ──┬──┬─────────────────┬──────────────────────────
└─ DGA ──┘ └─ s ────┬──────┬─┘
└─ Ln ─┘
Parameters:
(Default) Display valid GDT entries only.
A Display all GDT entries including invalid descriptors.
s Display descriptor for selector number s.
Notes: Since bit 2 of the selector determines whether the descriptor
is local or global the correct table entry will be displayed
regardless of whether the DG or DL command is used. If an LDT
descriptor is specified then the following message is displayed:
LDT
The requestor priority level (RPL) bits (bits 0 and 1 of the
selector) are ignored by DG. Thus: DG 8 displays the same
information as DG 9, DG a and DG b.
If the s parameter is omitted then the entire GDT is displayed.
Ln The number of descriptor entries to display from and including
selector s. The default is to display one descriptor entry.
One or more descriptor table entries are displayed. An example display follows:
##dga
0000 Invalid Bas=00000000 Lim=00000000 DPL=0 NP
0008 Invalid Bas=00000000 Lim=00000000 DPL=0 NP
0010 TSS32 Bas=ffe05dfc Lim=00000067 DPL=0 P B
0018 Data Bas=ffe00150 Lim=000003ff DPL=0 P RW A UV
0020 Data Bas=ffe4a000 Lim=000003ff DPL=0 P RW A UV
0028 LDT Bas=7ab27000 Lim=0000ffff DPL=0 P
0030 Data Bas=ffde08a4 Lim=0000575b DPL=0 P RW ED A UV
003b Data Bas=7c38ba8c Lim=00000073 DPL=3 P RW
0040 Data Bas=ffe49400 Lim=000003bf DPL=0 P RW UV
004a Data Bas=00000000 Lim=1bffffff DPL=2 P RW A G4k BIG UV
0053 Data Bas=00000000 Lim=1bffffff DPL=3 P RW A G4k BIG UV
005a Code Bas=00000000 Lim=1bffffff DPL=2 P RE C A G4k C32 UV
0063 Data Bas=00000000 Lim=1fffffff DPL=3 P RW G4k BIG UV
006b Data Bas=00000000 Lim=1bffffff DPL=3 P RW A G4k BIG UV
For a detailed explanation of the descriptor table entry format see 3.3.17.1,
“Descriptor formats.”
98 OS/2 Debugging
Table 3 (Page 2 of 2). Descriptor Types
Type Type Numbers Description
TSS32 9 or 11 Available or Busy Intel486 CPU TSS
CallG32 12 Inter486 CPU Call Gate
IntG32 14 Intel486 CPU Interrupt Gate
TrapG32 15 Intel486 CPU Trap Gate
Notes: The bit offsets given above are relative to the second
doubleword of the descriptor viewed as 2 doublewords. The
INTEL programmer ′ s Reference shows the descriptor format as
a quad-word, but uses the same offsets specified above.
See the INTEL Pentium User ′ s Reference or the INTEL x86
Programmer ′ s References for further information.
Syntax:
───┬─ DI ──┬──┬─────────────────┬──────────────────────────
└─ DIA ──┘ └─ i ────┬──────┬─┘
└─ Ln ─┘
Parameters:
(Default) Display valid IDT entries only.
A Display all IDT entries including invalid descriptors.
i Display descriptor for interrupt vector i .
Ln The number of descriptor entries to display from and including
selector i . The default is to display one descriptor entry.
One or more descriptor table entries are displayed. An example display follows:
##dia
0000 TrapG32 Sel:Off=0170:fff47e64 DPL=0 P
0001 IntG32 Sel:Off=0170:fff47f10 DPL=3 P
0002 TaskG Sel:Off=1e38:00000000 DPL=0 P
0003 IntG32 Sel:Off=0170:fff480cc DPL=3 P
0004 TrapG32 Sel:Off=0170:fff48158 DPL=3 P
0005 TrapG32 Sel:Off=0170:fff48164 DPL=0 P
0006 TrapG32 Sel:Off=0170:fff48170 DPL=0 P
0007 TrapG32 Sel:Off=005a:1a090911 DPL=0 P
0008 TaskG Sel:Off=0088:00000000 DPL=0 P
0009 TrapG32 Sel:Off=0170:fff48258 DPL=0 P
000a TrapG32 Sel:Off=0170:fff48268 DPL=0 P
000b TrapG32 Sel:Off=0170:fff48270 DPL=0 P
000c TrapG32 Sel:Off=0170:fff48278 DPL=0 P
000d TrapG32 Sel:Off=0170:fff48280 DPL=0 P
000e TrapG32 Sel:Off=0170:fff4853c DPL=0 P
000f TrapG32 Sel:Off=0170:fff48544 DPL=0 P
0010 TrapG32 Sel:Off=0170:fff4854c DPL=0 P
For a detailed explanation of the descriptor table entry format see 3.3.17.1,
“Descriptor formats” on page 98.
Display entries from the Local Descriptor Table of the default thread slot. See
the .S command for information on changing the default thread slot.
Syntax:
───┬─ DL ──┬──┬─────────────────┬──────────────────────────
├─ DLA ──┤ └─ s ────┬──────┬─┘
├─ DLP ──┤ └─ Ln ─┘
├─ DLS ──┤
└─ DLH ──┘
Parameters:
(Default) Display valid LDT entries only.
A Display all LDT entries including invalid descriptors.
P Obsolete option. Was used to display only valid private arena LDT
descriptors where bits 3 and 4 of the selector number are 0.
S Obsolete option. Was used to display only valid shared arena LDT
descriptors where bits 3 and 4 of the selector number are non-zero.
H Obsolete option. Was used to display only huge segment LDT
descriptors.
s Display descriptor for selector number s.
Notes: Since bit 2 of the selector determines whether the descriptor
is local or global the correct table entry will be displayed
regardless of whether the DL or DG command is used. If an
GDT descriptor is specified then the following message is
displayed:
GDT
The requestor priority level bits (bits 0 and 1 of the selector)
are ignored by DL. Thus DL 7 displays the same information as
DL 6, DL 5 and DL 4.
If the s parameter is omitted then the entire LDT is displayed.
Ln The number of descriptor entries to display from and including
selector s. The default is to display one descriptor entry.
One or more descriptor table entries are displayed. An example display follows:
For a detailed explanation of the descriptor table entry format see 3.3.17.1,
“Descriptor formats” on page 98.
Display entries from the page tables of the default thread slot. See the :S
command for information on changing the default thread slot.
Syntax:
───┬─ DP ──┬──┬─────────────────┬──────────────────────────
└─ DPD ──┘ └─ addr ─┬──────┬─┘
DPA └─ Ln ─┘
Parameters:
A Display both page table and page directory entries. This is the
default.
D Display only page directory entries.
addr The linear or virtual address whose page directory and table entries
are to be displayed. If not specified DP displays the entire page
directory and its page tables.
An address expression may be specified.
Ln The number of page table entries to display starting with the entry for
addr . The default is to display the all page table entries from this
entry assigned to addr .
Note
Due to a bug in some versions of the Kernel Debugger an extra
zero is required for this parameter.
DP %90000 L50
Output from the DP command is presented in tabular form. Each of the columns
shown is described as follows:
linaddr Linear address of virtual memory whose page directory and table
entries are being formatted. Those lines corresponding to directory
entries have an * flag suffixed to the linear address. Page table
entries for a given directory entry are formatted following the
directory entry.
In the example above the linear address %90000 has its page table
located in physical frame 12f3, that is at physical %%12f3000. The
page table entry corresponding to virtual memory at %90000 is
described in the second line. Each of the following lines are
consecutive entries from page table 12f3.
frame The real storage frame number that contains either the page table (*
suffix to linaddr) or page frame corresponding to the linaddr. If this
field is blank then the frame has been discarded. If it contains a
frame number then the contents are still valid even though the page
table entry no longer points to a page frame. See pteframe field for
further discussion.
pteframe For table entries with the present bit set the this field shows the page
frame number pointed to by this table entry. This is shown as
f r a m e = fffff. Use the frame number with the .MP command to obtain
information on allocation and ownership of this this frame of real
storage.
For decommitted pages the table entry contains the Virtual Page ID.
This is shown as vp id= vvvvv. Use the .MV command with the virtual
page Id to obtain information on allocation and ownership of this
memory.
Notes: The vp id is not valid to use with .MV if the state of the table
entry is uvirt.
If the frame has been decommitted but the frame field still
shows a frame number then the frame contents are still valid
for reclaiming without a page-in operation from the swap file.
The corresponding virtual page will be queued from the idle
list. See .MV and .MP commands for more information on page
management.
Refer to the following for more information on page and memory management:
.M family of Kernel Debugger and Dump Formatter commands
Intel Pentium User ′ s Guide
Intel x86 Programmer ′ s Reference
Syntax:
────── DT ───────┬─────────┬──────────────────────────────────
└─ addr ──┘
Parameters:
addr The address of the task state segment to be formatted. If not
specified then the current TSS pointed to by the TR (task register) is
used.
The seltss (PTDA +0x2f0) field of the PTDA records the top-level task′ s
TSS selector used by a given process; thus it may be used to find the TSS
selector for Virtual DOS Machines.
Refer to Intel Pentium User ′ s Guide and Intel x86 Programmer ′ s Reference for
more information on the Task State Segment and Hardware architected
multitasking.
Formats the 286 LoadAll buffer from physical address %%800 in memory.
Syntax:
────── DX ────────────────────────────────────────────────────
Parameters:
None.
This command applies to the Intel 286 processor and is now obsolete. The
results are meaningless.
Syntax:
┌──────────────────┐
│ │
│
──── E ────┬────────────┬───────┬──────────────┬─┴────────────
└─── addr ───┘ ├── value ──┤
└── string ──┘
Parameters:
addr The address of the memory location to be changed. If not specified
this defaults to DS:00000000 where DS is established by the most
recent register display.
An address expression may be specified. See the R and .R
commands for information on establishing default addresses.
value A numerical byte value to be entered into memory. One or more
values may be specified separated commas or blanks. These may be
mixed with ″ string″ values.
string A character sting enclosed in quotes. Each character is treated as a
byte value and entered into memory separately, no terminating 0x00
value is stored. No folding of characters to upper or lower case
occurs. One or more strings may be specified separated by commas
or blanks. These may be mixed with numerical values .
Syntax:
┌──────────────────┐
│ │
│
──── F ──────── addr ──── Ln ────────┬── value ──┬─┴─────
└── string ──┘
Parameters:
addr The address of the memory location to be changed.
An address expression may be specified.
Ln The number ( n) of bytes to fill with data.
value A numerical byte value to be entered into memory. One or more
values may be specified separated commas or blanks. These may be
mixed with ″ string″ values.
string A character sting enclosed in quotes. Each character is treated as a
byte value and entered into memory separately, no terminating 0x00
value is stored. No folding of characters to upper or lower case
occurs. One or more strings may be specified separated by commas
or blanks. These may be mixed with numerical values .
The list of values and strings is repeated up to the length Ln and used to fill
memory at the specified address. If the fill data is shorter than the length then it
is repeated; if it is longer, it is truncated.
Cause execution to continue from a given point and optionally set 1 or more go
breakpoints.
Syntax:
───┬─ G ──┬──┬─────────────────────┬──┬─────────────────┬──
├─ GS ──┤ └─ = ─── start-addr ──┘ └─── break-addr ─┬┘
└─ GT ──┘ │
└───── , ──────┘
Parameters:
(Default) Continue execution from the current CS:EIP.
S The go-special command causes the high-resolution time interval to
be recorded from the point GS command is issued to the point that the
Kernel Debugger is re-entered as the result of a breakpoint firing.
Notes: No account is taken of the Kernel Debugger overhead when
calculating the time interval.
When the Kernel Debugger re-enters, for whatever reason, the
interval timer is cancelled until another GS command is
executed.
If the reason for entry is for reasons other than the firing of a
sticky or go breakpoint then in addition to cancelling the
interval timer no time message displayed.
T This option causes the Kernel Debugger′s trap vector handlers to be
removed temporarily from the IDT and the system′s re-instated until
after then next instruction has executed. After execution of the next
instruction the the Kernel Debugger′s V commands are re-instated.
This is a convenience option that saves manually unhooking a Kernel
Debugger trap vector handlers from the IDT, using a command
sequence similar to:
VC n
T
VS n
G
start-addr The address from which execution is to continue. This must be a
valid address for the current context. If start-addr is omitted then
execution continues from the current CS:EIP, as shown by the R
command.
Information
Be very careful to ensure that the start address is valid for the
privileged level and addressability of the code and data selectors
in use. If the Kernel Debugger attempts to load a segment
register that is invalid, the system may trap in the debugger code.
The system continues execution until the Kernel Debugger is re-entered. If the
reason for entry is other than a breakpoint firing then the R command is
automatically executed followed by one of the following command prompts:
> (signifies a command prompt in real mode)
# (signifies a command prompt in protect mode with paging disabled)
- (signifies a command prompt in V86 mode with paging disabled)
## (signifies a command prompt in protect mode with paging enabled)
-- (signifies a command prompt in V86 mode with paging enabled)
If entry was caused by a Kernel Debugger trap handler receiving control then a
message from the trap handler will be displayed. See the V command for
details.
This shows the time interval in both timer-ticks and equivalent number of
micro-seconds.
Display the sum, difference, product, quotient and remainder of two absolute
expressions.
Syntax:
Parameters:
abs-expr1 An expression that resolves to a simple numeric value using any of
the expression evaluator operators. Symbols of absolute values may
be specified in the expression, but symbols of relocatable addresses
may not.
abs-expr2 An expression that resolves to a simple numeric value using any of
the expression evaluator operators. Symbols of absolute values may
be specified in the expression, but symbols of relocatable addresses
may not.
Having resolved each of the expressions then the sum, difference, product and
quotient of the pair is displayed as in the following examples:
##h 2 3
+0005 -ffff *0006 0000 /0000 0002
#h 10t 5
+000f -0005 *0032 0000 /0002 0000
##h 7fff 5
+8004 -7ffa *7ffb 0002 /1999 0002
## 5*4 2*3
+001a -000e *0078 0000 /0003 0002
##h bmp_segsize 5
+0017 -000d *005a 0000 /0003 0003
##h
The product is shown as a two word value, the low word followed by the
high word.
Information
Syntax:
Parameters:
port A 16-bit I/O port address. This may be specified as a simple numeric
expression.
The byte of data is read from the requested I/O port and displayed in
hexadecimal at the console. For example:
##I 2f8
0d
See 3.3.32, “O - Output to an I/O Port” on page 123 for related information.
Syntax:
Parameters:
expression An expression that resolves to either a simple numeric value or an
address using any of the expression evaluation operators. Symbols
of addresses and symbols of absolute values may be specified.
cmd1 Specifies a command to be executed if the expression evaluates to
TRUE (non-zero). More than one command may be specified if each
is separated by a semi-colon and the entire command list is enclosed
in single or double quotes.
If cmd1 is omitted, control is returned to the debugging console when
the expression is TRUE.
cmd2 Specifies a command to be executed if the expression evaluates to
FALSE (non-zero). More than one command may be specified. Each
cmd2 must be prefixed by a semicolon, even if only one is specified.
Quotes are not required to encompass a list of
If cmd2 is omitted, control is returned to the debugging console when
the expression is FALSE.
BP #f:12d5 ″J ax==10t;g″
The first example shows a breakpoint set at address #f:12d5. When this
breakpoint fires the J command tests the condition of the AX register not equal
to decimal 10. If this is true, the G command is executed. Since no cmd2 is
specified the J command returns control to the debugging console when the
condition is FALSE (AX equal to decimal 10).
The second example is has the same effect as the first but is implemented by
testing the logically opposite condition.
The third example shows one method of stopping the system when a thread
switch to a particular thread slot has just occurred. In this case the debugging
console gains control when thread slot 8 is selected, whereupon .P* and .R
commands are automatically executed. The breakpoint SchedNextRet is one of
two exit points from the scheduler ( _tkSchedNext ). The other, SchedNextRet2 is
taken when the same thread slot is selected for re-dispatch. The global variable
Tasknumber contains the current and therefore out-going slot number on entry to
the scheduler; and in-coming slot number on exit from the dispatcher.
Note: The kernel calls one of the KMExitKmode routines before giving control to
user code. During this kernel exit processing the Resched and (TCB and
PTDA ) force flags are checked again and if set the scheduler/dispatcher
sequence is invoked. It is possible therefore, that even though a thread is
selected to run, and achieves run state, it is put back on the ready queue
before being given any user processing time.
The fourth example illustrates a method of tracing resources that are opened by
a specific thread slot (in this case slot 32) without giving control to the debugging
console. DOSOPEN is the kernel′s entry point for open processing. At this point
words 0x0f and 0x10 contain the offset and selector that points to the resource
name.
Syntax:
─┬── K ──┬──┬──────────────────┬─┬──────────────────────┬────
├── KS ──┤ └── stack-frame ──┘ └── selector:offset ──┘
└── KB ──┘
Parameters:
K Display stack frame trace assuming the default operation size from
the code descriptor specified by selector:offset
KS Display frame trace assuming an operation size of 16-bits
(small-model).
KB Display frame trace assuming an operation size of 32-bits (big-model).
stack-frame Address of the starting stack-frame. If not specified then this
defaults to the current SS:EBP or SS:BP as set by the last register
display.
See the R and .R commands for information on changing the default
register values.
An address expression may be specified.
selector:offset The selector:offset address of the code that is in effect when the
starting Stack-frame address was created. If not specified this
defaults to the current CS:EIP or CS:IP as displayed by the the R
command.
The code selector associated with this address is used for two
purposes:
1. To determine the default operand size in effect from the code
segment descriptor.
2. To attempt to distinguish between near and far calls at the
starting stack-frame address.
The K command displays the stack trace, threading through the BP or EBP chain
until either an invalid chain pointer is encountered or the command is
interrupted by the user. For each stack-frame, the return address and for
parameter words or doublewords are displayed. The symbol associated with the
return address is displayed after the parameter words. An example is given
below:
Notes:
1. The K command is insensitive to the unconventional use of the stack,
such as where subroutine returns are affected explicitly by setting the
stack pointer and jumping back to the calling code or in optimized
code where the EBP or BP registers are not used as stack-frame
pointers.
Such possibilities exist within the system when for example the kernel
returns to user code and also within some Presentation Manager
components.
2. No attempt is made to trace correctly through thunking layers where
the default operand size changes.
3. The stack trace is insensitive to any explicit segment operand
overrides that may be active.
4. No attempt is made to examine the descriptor of the SS register to
determine whether EBP or BP should be used. In a lot of 32-bit code
both the 16-bit and 32-bit data descriptors are created by the system
for calls to 16-bit subroutines.
In the example above the stack-frame address has been explicitly
overridden to use BP since the 16-bit stack selector (1f) is in effect
rather than the 32-bit 53 selector.
5. Unlike the default stack-frame address the default code selector:offset
is taken from the register values on entry to the Kernel Debugger.
Attention
Syntax:
Parameters:
A List absolute symbol definitions for the specified map-name or for all
active maps.
M List all active maps or the status of the specified map.
G List groups defined in all active maps of the specified map.
N When addr is specified this option lists the nearest symbols to the
address. If an exact match is found, symbols are listed; otherwise,
the nearest symbol before and after addr is listed.
When symbol is specified the address, map and group corresponding
to the symbol is listed.
If neither addr nor symbol is specified then the default disassembly
address is assumed. See the .R and U commands for related
information.
S List all symbols defined in the group that encompasses addr for all
active maps. If addr is not specified then the value of CS:EIP on entry
to the debugger is assumed, as displayed by the R command.
map-name Specifies the link edit map-name from which information is to be
displayed.
addr Specifies an explicit address expression.
symbol Specifies a publicly defined symbol name from a program source
code.
Symbol maps are obtained from symbol files (*.SYM), which are generated using
the linkage editor and the MAPSYM utility. Under the Kernel Debugger they are
loaded from the same directory as their corresponding load module when that is
Under the Dump Formatter symbol files are loaded for each MTE in the dump,
during initialization, from the current directory (usually the directory the Dump
Formatter is running from).
Under the Dump Formatter conforming segments are not checked. Thus a ring 2
selector:offset address may not be recognized, whereas the ring 3 selector is. If
LN does not find a symbol for a ring 2 selector, try specifying the same selector
with the ring 3 RPL specified. For example, specify d0fe:1234 as d0ff:1234.
Under the Dump Formatter LN does not check equivalences of the selector:offset
and linear forms of an address. Therefore it may be necessary to apply the
CRMA to an address if the LN command fails to find any near symbols.
Maps for WIN-OS2 and Windows components are supported under the Kernel
Debugger only. These are automatically activated and deactivated according to
whether the Kernel Debugger default thread slot is a Windows or WIN-OS2
environment.
##la
cmd:
9876 __acrtmsg
9876 __acrtused
d6d6 __aDBused
d6d6 __aDBdoswp
Figure 23. List Absolute Symbols Defined in CMD.EXE and their Associated Constants
Note: The Windows Kernel is not active, but loaded in thread slots 40 and 3f.
The additional active slot number information is only provided with
Windows and WIN-OS2 environment map files.
##lg cmd
cmd:
000f:00000000 _TEXT1
0017:00000000 _TEXT3
001f:00000000 DGROUP
Figure 25. List Segment Groups Defined in CMD.EXE and their Associated Addresses
##ln %20000
%00020000 cmd:_TEXT3:_eChcp
##ln _tkschednext
%fff4521c os2krnl:DOSHIGH32CODE:_tkSchedNext
##ln
0170:fff44695 os2krnl:DOSHIGH32CODE:HaltInst + 1
0170:fff44787 postSchedNext - f1
Figure 26. List Near Symbols and their Associated Addresses
Move a block of contiguous data from one memory location to another. This
command guarantees to duplicate the source data even when the source and
destination overlap.
Syntax:
Parameters:
source-addr The source address of the memory location to be moved (copied).
An address expression may be specified.
Ln The number (n) of bytes to move.
target-addr Target address of the memory move operation.
An address expression may be specified.
Memory content is copied from the source to the target address. If the source
and target overlap then the source will be updated; however, the move operation
is conducted from highest to lowest address or vice versa depending on whether
the target address is higher or lower than the source, thereby guaranteeing a
faithful copy of the original source.
Syntax:
Parameters:
port 16-bit I/O port address.
data A byte of data expressed numerically. This may be specified as a
simple numeric expression.
Set COM2 DTR line (assume standard port assignment for COM2 that is, 2f8):
##O 2fc 1
Set COM1 DTR line (assume standard port assignment for COM1 that is, 3f8):
##O 3fc 1
Syntax:
────── P ────┬───────┬──┬────────────────────┬───┬─────────┬──
├─ N ─┤ └─ = ── start-addr ──┘ └─ count ─┘
└─ T ─┘
Parameters:
(Default) Trace instruction execution by single-stepping, treating CALL, loop
and string repeat instructions as single events.
Note: Certain areas of the system are known to cause problems if
traced. Attempts to trace these areas are intercepted by the
Kernel Debugger. See below for further information.
N Trace instructions suppress the register display after each instruction
is executed.
T This option causes the Kernel Debugger′s trap vector handlers to be
removed temporarily from the IDT and the system′s re-instated until
after the next instruction has executed. After execution of the next
instruction the Kernel Debugger′s V commands are re-instated.
This is a convenience option that saves manually unhooking a Kernel
Debugger trap vector handlers from the IDT using a command
sequence similar to:
VC n
P
VS n
start-addr The address from which the execution is to continue. This must be a
valid address for the current context. If start-addr is omitted, then
execution continues from the current CS:EIP, as shown by the R
command.
count The number of instructions to trace before re-entering the Kernel
Debugger, unless one of the following conditions is encountered:
A fatal exception occurs.
An Internal Processing Error (IPE) occurs.
A sticky breakpoint fires.
A non-maskable interrupt occurs.
An INT 3 instruction is executed.
The user enters Ctrl-C from the debugging console.
If omitted then count defaults to one instruction.
PN suppresses the register display from the automatic R command, but still
displays an unassembled next instruction for each traced instruction. If the ZS
command has been used to specify a different default command then PN behaves
exactly as the P command.
##PN 5
0170:fff4521f 803d9e53e0ffff cmp byte ptr [InterruptLevel (ffe0539e)],ff
0170:fff45226 75b4 jnz fff451dc
0170:fff45228 803d9643e0ff00 cmp byte ptr [_cTKNoBlock (ffe04396)],00
0170:fff4522f 75be jnz fff451ef
0170:fff45231 0f01e1 smsw cx
##
Attention
Syntax:
─── Q ────────────────────────────────────────────────────────
Parameters:
None
Attention
Do not use this command when the Dump Formatter is invoked from PMDF.
This will cases PMDF to hang. To terminate the Dump Formatter either quit
PMDF from the system memu or select another dump for processing.
Display or set the current CPU registers saved on entry to the Kernel Debugger.
Set default addresses for the E, D, K and U commands.
Syntax:
──── R ───┬─────────────────────┬──────────────────────────────
│ │
├── T ──┤
│ │
├─┤ flag register ├─┤
│ │
├─┤ 2-bit register ├─┤
│ │
├─┤ 16-bit register ├─┤
│ │
├─┤ 24-bit register ├─┤
│ │
└─┤ 32-bit register ├─┘
flag register:
┌─────────────────────────┐
│
├─┬─ F ─┬─────┬────────────────────┬──┴──────────────────────────┤
├─ EF ─┘ └── flag mnemonics ──┘
│
│ ┌─────────────────────────────┐
│ │
├─ CR0 ──────┬────────────────────────┬──┴──────────────────────┤
│ └── cr0 flag mnemonics ──┘
│ ┌─────────────────────────────┐
│ │
└─ MSW ──────┬────────────────────────┬──┴──────────────────────┤
└── msw flag mnemonics ──┘
2-bit register:
24-bit register:
32-bit register:
Parameters:
(Default)
Displays the current CPU registers on entry to the Kernel Debugger and sets
default addresses for E, D and U commands.
T Toggle register display mode between terse and non-terse forms. The terse
form suppresses display of the test, debug, control, descriptor table and task
registers.
This option affects both the R and .R commands.
flag register
Specifies one of the flag registers to be modified. The following mnemonics
may be used:
Each of the flag bits is specified by a mnemonic. More than one flag may be
specified, with the order being unimportant. The Kernel Debugger processes
the flags from left to right; if an invalid flag is encountered processing stops,
but those flags already processed remain in effect.
Some flags are toggled by specifying a single mnemonic, others use a one
mnemonic; for the set condition and a another of the reset condition.
If replacements flags are omitted then the user is prompted for values.
flag mnemonics
Specifies one or more updated flag values for the FLAGS or EFLAGS
registers.
The following mnemonics are defined. The value of t implies the flag value is
toggled when the mnemonic is specified:
2-bit register
This option is used to specify that the IOPL field of the FLAGS or EFLAGS
register should be updated with the specified replacement 2-bit value . The
mnemonic IOPL is coded to specify this option.
If the replacement value is not specified then the user is prompted for a
value.
16-bit register
This option is used to set the value of a register where 16-bit register
specifies either one of the standard INTEL register mnemonics or:
24-bit register
This option is used to set the base address of either the GDT or IDT. using
GDTB and IDTB as mnemonics for these registers, respectively.
This option implies a request to update a register value. If the
corresponding new 16-bit value is not specified then the prompted for a
replacement value.
32-bit register
This option is used to set the value of a register where 16-bit register
specifies one of the standard INTEL register mnemonics.
This option implies a request to update a register value. If the
corresponding new 16-bit value is not specified then the prompted for a
replacement value.
2-bit value
Specifies the 2-bit replacement value for the IOPL.
16-bit value
Specifies the 16-bit replacement value for a given 16-bit register.
24-bit value
Specifies the 24-bit replacement value for a given 24-bit register.
32-bit value
Specifies the 32-bit replacement value for a given 32-bit register.
The register information is stored in a special save area which the Kernel
Debugger uses when entered and restores from this area when control returns
to the system.
Flag register value prompts have their current flag setting interpreted using the
mnemonics described above. For example:
##R EF
--(rf) --(vm) --(nt) nv(ov) up(dn) ei(di) pl(ng) nz(zr) na(ac) po(pe) nc(cy)
:
This example shows mnemonics for current settings followed by their negating
mnemonic in brackets. For example:
RF is not in effect, but since it is a toggle flag, the value RF specified at the
prompt would set RF.
NV is in effect. To negate it, specify OV at the prompt.
Syntax:
┌──────────────────┐
│ │
│
──── S ──────── addr ──── Ln ────────┬── value ──┬─┴─────
└── ″string″ ──┘
Parameters:
addr The address of the memory location to be searched.
Ln The number (n) of bytes to search.
value A numerical byte value to be searched into memory. One or more
values may be specified separated commas or blanks. These may be
mixed with ″ string″ values.
string A character string enclosed in single or double quotes. Each
character is treated as a list byte values to search memory, no
terminating 0x00 value is stored. No folding of characters to upper or
lower case occurs. One or more strings may be specified separated
by commas or blanks. These may be mixed with numerical values.
The list of values and strings is used as a combined search argument. Only
precise matches against the entire search argument are reported. The search is
repeated for every byte location in the range specified. If no matches are found
then nothing is displayed. Where matches are found the search command
displays a list of storage addresses. For example:
##s ptda_start l1000 ″TD″
0030:0000fffe
ln 30:fffe
0030:0000fffe os2krnl:TASKAREA:ptda_signature
Syntax:
───┬─ T ──┬──┬────────────────────┬───┬─────────┬──────────
├─ TX ──┤ └─ = ── start-addr ──┘ └─ count ─┘
├─ TN ──┤
├─ TT ──┘
│
│
├─ TA ──┬──┬────────────────────┬───── break-addr ───────
├─ TC ──┤ └─ = ── start-addr ──┘
└─ TS ──┘
Parameters:
(Default) Trace one or more instructions, excluding known bad areas (see X
subcommand below.)
A Trace all instructions to break-addr .
This option requires break-addr to be specified.
C Counts all instructions executed until break-addr is reached.
Note: Counting is suspended when the system switches out of the
current context in which the TC command was executed. It is
resumed when that context switches back.
This option requires break-addr to be specified.
N Trace instructions but suppress the register display after each
instruction is executed.
S The trace special option is similar to TC except that an intermediate
instruction count is displayed before execution of each CALL
instruction and after each return.
This option requires break-addr to be specified.
Notes: Counting is suspended when the system switches out of the
current context in which the TS command was executed. It is
resumed when that context switches back.
TS does not attempt to match CALL with RET instructions.
Instead it inserts a temporary breakpoint at the instruction
address following the CALL. In addition the TS command
maintains a stack of return addresses and always checks the
most recent two entries, as it single-instruction steps through
the traced code, for a matching return address. This technique
enables code that uses JMP instructions to return from a call
to be better detected.
This is not a foolproof technique, especially where mutually
recursive code is traced.
break-addr This is the address at which tracing will stop and the Kernel
Debugger will be re-entered unless one of the following conditions is
encountered:
A fatal exception occurs.
An Internal Processing Error (IPE) occurs.
A sticky breakpoint fires.
A non-maskable interrupt occurs.
An INT 3 instruction is executed.
The user enters Ctrl-C from the debugging console. The
break-addr only remains in effect until the Kernel Debugger is
next re-entered.
count This is the number of instructions to trace before re-entering the
Kernel Debugger, unless one of the following conditions is
encountered:
Except for TN, TC and TS the default command is executed when control returns to
the debugging console. This defaults to the R command unless respecified
through use of the ZS command.
TN suppresses the register display from the automatic R command, but still
displays an unassembled next instruction for each traced instruction. If the ZS
command has been used to specify a different default command then the TN
command behaves exactly as T.
##TN 5
0170:fff4521f 803d9e53e0ffff cmp byte ptr [InterruptLevel (ffe0539e)],ff
0170:fff45226 75b4 jnz fff451dc
0170:fff45228 803d9643e0ff00 cmp byte ptr [_cTKNoBlock (ffe04396)],00
0170:fff4522f 75be jnz fff451ef
0170:fff45231 0f01e1 smsw cx
##
Following this message the default command is executed. See the Z command
for details.
Attention
If any of the Trace commands is interrupted, the Kernel Debugger may leave
a temporary breakpoint active. This will result in a Trap 1 when the system
is next given control. If this occurs then either of the TT or GT commands will
clear this condition.
Syntax:
──── U ───────────────────┬──────────┬───────────────────────
└── addr ──┘
Parameters:
addr The address of the storage location to be unassembled.
Output from the U command is in two forms depending on whether the storage
address was set in the context of the default (Kernel Debugger′s or Dump
Formatter′s current) thread slot or another slot. In the former case output
appears as in the following example:
##u
0170:fff4521f 803d9e53e0ffff cmp byte ptr [InterruptLevel (ffe0539e)],ff
0170:fff45226 75b4 jnz fff451dc
0170:fff45228 803d9643e0ff00 cmp byte ptr [_cTKNoBlock (ffe04396)],00
0170:fff4522f 75be jnz fff451ef
0170:fff45231 0f01e1 smsw cx
0170:fff45234 66f7c10200 test cx,0002
0170:fff45239 0f8552050000 jnz fff45791
0170:fff4523f fa cli
In the latter case the context is shown by prefixing the thread slot to the address
as in the following example:
Slot Pid Ppid Csid Ord Sta Pri pTSD pPTDA pTCB Disp SG Name
*0022# 0013 0003 0013 0001 blk 0300 7b6ea000 7b8c7128 7b8ab820 1eb8 18 epm
##.r 34
doscall1:CONFORM16:postDOSSEMWAIT:
0034|d02f:0000272d c9 leave
0034|d02f:0000272e ca0800 retf 0008
0034|d02f:00002731 87db xchg bx,bx
0034|d02f:00002733 90 nop
doscall1:CONFORM16:DOSSEMSET:
0034|d02f:00002734 c8040000 enter 0004,00
0034|d02f:00002738 8b4608 mov ax,word ptr [bp+08]
0034|d02f:0000273b 3d0200 cmp ax,0002
0034|d02f:0000273e 7448 jz 2788
0034|d02f:00002740 250300 and a,0003
0034|d02f:00002743 3d0100 cmp ax,0001
0034|d02f:00002746 7415 jz 275d
0034|d02f:00002748 8b4608 mov ax,word ptr [bp+08]
##
Syntax:
Parameters:
L The List subcommand list active Kernel Debugger trap and interrupt
vectors.
Only a category specification (R, V, P, F or N) may be optionally
specified with the List subcommand.
S The Set subcommand activates a Kernel Debugger exception vector
according to criteria specified in the remaining parameters. Vectors
set using this option cause the Kernel Debugger to receive control
only when the corresponding exceptions are generated in ring 2 and 3
code.
T The Trap subcommand activates a Kernel Debugger exception vector
according to criteria specified in the remaining parameters. Vectors
set using this option cause the Kernel Debugger to receive control
whenever the corresponding exceptions are generated regardless of
the current privileged level.
C The Clear subcommand re-instates one or more system exception
handlers according to the criteria specified in the remaining
parameters.
R This option refines the exception criteria to real-mode exceptions
only.
If no refining category is specified then the vector subcommand being
executed applies to the R, V, P and F options simultaneously.
V This option refines the exception criteria to V86-mode exceptions only.
P This option refines the exception criteria to protect-mode exceptions
only.
F This option refines the exception criteria to those exceptions that
would be fatal to a process or the system. If a Local (system)
exception handler is registered then the exception is not intercepted.
Only the List subcommand gives immediate output, which is of the form in the
following example:
##VL
R 0 1 2 3 4 5 6
V
P d
F e d
As can be seen from this example, each category is shown with its one-letter
abbreviation followed by a list of interrupt vectors currently being intercepted by
the Kernel Debugger
Note: The N option must be specified explicitly to be listed.
The following figure shows the format of the trap messages issued by the Kernel
Debugger exception handlers:
Trap 0 - Divide Error Exception
Trap 1 - Unexpected trace interrupt
Trap 2 - NMI Interrupt
Trap 4 - INTO Detected Overflow Exception
Trap 5 - BOUND Range Exceeded Exception
Trap 6 - Invalid Opcode Exception
Trap 7 - Processor Extension Not Available Exception
Trap 8 - Double Exception Detected nnnn
Trap 9 - Processor Extension Segment Overrun
Trap 10 (0AH) - Invalid TSS nnnn, mmmmmmmm
Trap 11 (0BH) - Segment Not Present nnnn, mmmmmmmm
Trap 12 (0CH) - Stack Segment Overrun or Not Present nnnn, mmmmmmmm
Trap 13 (0DH) - General Protection Fault nnnn, mmmmmmmm
Trap 14 (0EH) - Page Fault nnnn, mmmmmmm
In the messages above nnnn is substituted with the Intel exception code and
mmmmmmmm is substituted with an interpretation of the Intel error code flags.
For Trap 10, Trap 11, Trap 12 and Trap 13 the error code flags are interpreted as:
External External event
IDT Gate IDT gate selector error
GDT GDT selector error
LDT LDT Selector error
For Trap 14 the error code flags are interpreted as a combination of:
Not Present Page not present
Read Access Read Access failure
Write Access Write Access Failure
User mode Fault occurred when executing in User mode
Supervisor Fault occurred when executing in Supervisor mode
If a trap occurs in the debugger component of the Kernel Debugger, the trap
message will be appended with:
- In Debugger
If this happens then the only hope of recovering the system is to set the
registers, using the R command, to a known consistent set of values.
See the INTEL x86 Programmer ′ s Reference or the INTEL Pentium User ′ s Guide
for further information on exceptions and error codes.
Notes: Trap 1 normally occurs as part of the operation of the Kernel Debugger.
Therefore, only unexpected Trap 1 exceptions are reported.
When a Trap 1 is generated through the use of the Debug Registers, then
the Kernel Debugger signals this with the message Debug register hit.
Add or remove a symbol map. Under the Kernel Debugger this merely activates
or deactivates a symbol map. Under the Dump Formatter a symbol file may be
re-loaded using the Withmap command.
Syntax:
──┬─ WA ──┬──┬─────────────────┬──────────────────────────────
└─ WR ──┘ ├── map-name ──┤
├── symbol-file │
└── * ──┘
Parameters:
A Activate 1 or all symbol maps.
Note: If the corresponding load module is not active then the map
will remain deactivated. See the L command for more
information on displaying map status.
R Remove 1 or all symbol maps.
L (not shown) This subcommand applied only to the Dump Formatter and has
been superseded by the .LM command.
map-name The symbol map name to be activated or deactivated
symbol-file The symbol file name, with optional path and extension, to be loaded
or removed.
Note: This operand applied only to the Dump Formatter.
* Specifies all the maps or symbol files should be loaded or removed.
Set or display Dump Formatter and Kernel Debugger disassembly and register
options.
Syntax:
─┬── Y? ──────────────────────────────────────────────────────
│
│ ┌──────────────────────┐
│ │ │
│ │
└── Y ──────┬─────────────────┬──┴───────────────────────────
├─── 386ENV ───┤
├─── REGTERSE ───┤
└─── DISLWR ───┘
Parameters:
(Default) Display current option settings.
? Display help for the Y command.
386ENV Force the Kernel Debugger and Dump Formatter to toggle the
environment setting between 286 and 386 modes.
This affects the way in which commands interpret the register set.
For example, in 286 mode, general registers are assumed, by default,
to be 16-bit registers. Under rare circumstances it is necessary to
force a particular mode to obtain a correct disassembly listing from
the U command. Mostly this occurs in system code that is
multi-modal and has juxtaposed sections of 32-bit and 16-bit code.
The initial setting is 386 mode under OS/2 V2.0 and above.
REGTERSE This has the same effect as the RT command.
The initial setting is for terse register display.
DISLWR This option toggles uppercase and lowercase display of assembler
mnemonics from the U command.
The initial setting is for lowercase mnemonics.
##y
386env dislwr regterse
Syntax:
───── Z ──┬─────┬──────────────────────────────────────────────
├─ L ─┘
│
│
│ ┌── ; ───┐
│ │
└─ S ──┬─────┬── cmd ─┴─┬─────┬────────────────────
└─ ″ ─┘ └─ ″ ─┘
Parameters:
(Default) Execute the default command string.
L Display the default command string
S Set the default command string.
cmd Specifies a Dump Formatter or Kernel Debugger commands to be
used in the default command string. If the command string comprises
more than one command, then each must be separated by commas
and the entire string enclosed in quotes.
When the Kernel Debugger and Dump Formatter are initialized the default
command string is set to ″R″.
Note: When the user breaks into the Kernel Debugger with Ctrl-C the R
command is executed regardless of the default command setting.
Display help for internal Kernel Debugger and Dump Formatter commands.
Syntax:
───── .? ──────────────────────────────────────────────────────
Parameters:
None.
Displays a help summary for most of the Dump Formatter and Kernel Debugger
external commands.
Note: Some of the information displayed is out-of-date.
Syntax:
────.A ───────────────────────────────────────────────────────
Parameters:
None
Syntax:
Parameters:
Speed The COMx port speed. Any of the following values are valid:
150t
300t
600t
1200t
2400t
4800t
9600t
19200t
Note: Since baud rates are usually expressed in decimal and the
default number base for the Kernel Debugger is hexadecimal,
a t subscript must be supplied when using decimal values.
Port Specifies which COM port is to be used. If 1 or 2 are specified then
COM1 or COM2 are implied. Any other numeric value is assumed to
be an I/O port address.
When the Kernel Debugger initializes a default baud rate of 9600t is set.
The COM port defaults to COM2 if there are two serial ports; otherwise the
default is COM1, unless no COM ports are defined in the ROM BIOS data area,
in which case the first port address in the ROM BIOS data area is assumed.
The parity, data and stop bit settings default to none, 8 and 1. These may be
altered either:
From the Kernel Debugger by writing directly to the COM port control
register using the .O command.
From the system under test by using the MODE command.
If synchronization is lost with the debugging console, for example because the
debugging communications port has been temporarily used by another
application then it may be reset using the MODE command, from the command
line of the system under test. For example, to re-specify the default parameters
use:
MODE COM2 9600,n,8,1
Syntax:
────.C ────────────────────────────────────────────────
Parameters: None
.C displays data for each logical device ID anchored from the Common ABIOS
Data Area (CDA). If the ABIOS is not present or initialized then the following
message is displayed:
ABIOS Not Present or Not Initialized
If the ABIOS is present and initialized, then data based on the Logical Device ID
(LID) table is displayed. The LID Table is located from a selector located at:
ABIOS _CDS_ANCHOR _p - in protect mode
ABIOS _CDS_ANCHOR _r - in real mode
Note: There is a formatting error that is illustrated in LID 12 and LID 14 lines.
See description below of T y p e = parameter for an explanation of this!
Type= This an interpretation of the device type (DevID) field taken from the
corresponding device block. The following Type values may appear:
Reserved Used only for the LID(0000) dummy entry.
Null signifies an unused entry (DB=0000:0000).
Internal Devid=0000 used for internal ABIOS calls.
Diskette Devid=0001 Diskette device.
Disk Devid=0002 Disk device.
Video Devid=0003 Video device.
Keyboard Devid=0004 Keyboard.
Printer Devid=0005 Printer.
Asynch Devid=0006 Asynchronous device.
SysTimer Devid=0007 System Timer.
RTCTimer Devid=0008 RTC Timer.
SysService Devid=0009 SysService.
NMInterrupt Devid=000a NMI Interrupt.
PointDevice Devid=000b Pointer Device.
LightPen Devid=000c Light Pen.
JoyStick Devid=000d JoyStick.
CMOSRam Devid=000e CMOS RAM.
FTT=sel:off sel:off address to the Function Transfer Table for this LID. The FTT
has the following standard header structure:
Syntax:
Parameters:
structure
The structure type may take one of the following values:
addr
Specifies the address of the structure to be formatted. If omitted then the
current DS selector value, offset 0 is assumed.
An address expression may be specified.
The following are examples of each of the 13 formatted structures. Refer to the
System Reference for a description of each formatted structure.
SFT System File Table Entry
VPB Volume Parameter Block
DPB Drive Parameter Block
CDS Current Directory Structure
KSEM Kernel Semaphore
DEV Device Driver Header
REQ Device Driver (Strategy 1) Request Packet
MFT Master File Table Entry
BUF File System Buffer
BPB BIOS Parameter Block
SEM32 32-Bit Semaphore
MUXQ Semaphore MUX Queue
OPENQ Semaphore Open Queue
.d sft d0:8
sf_ref_count: 0001 sfi_mode: 00a0
sf_usercnt: 0000 sfi_hVPB: 0012
reserved: 00 sfi_ctime: 0000
sf_flags(2): 0100:0000 sfi_cdate: 0000
sf_devptr: #0000:0000 sfi_atime: 0000
sf_FSC: #00c8:0008 sfi_adate: 0000
sf_chain: #0000:0000 sfi_mtime: 0000
sf_MFT: fe7fb788 sfi_mdate: 0000
sfdFAT_firFILEclus: 5ad6 sfi_size: 000bb135
sfdFAT_cluspos: 09c8 sfi_position: 00085d90
sfdFAT_lstclus: 0000 sfi_UID: 0000
sfdFAT_dirsec: 00000000 sfi_PID: 0000
sfdFAT_dirpos: 00 sfi_PDB: 0000
sfdFAT_name: sfi_selfsfn: 0000
sfdFAT_EAHandle: 0000 sfi_tstamp: 00
sf_plock: 0000 sfi_DOSattr: 20
sf_NmPipeSfn: 0000
sf_codepage: 0000
##
Figure 28. System File Table Entry
Notes:: The sfdFAT_name is only meaningful for SFTs that represent open FAT
file system files.
For a description of the SFT fields see the System File Table Entery (SFT) in the
System Reference.
##ln gdt_vpb
0138:00000098 os2krnl:DOSGDTDATA:GDT_VPB
##.d vpb 98:12
vpb_flink: 0000 vpdFAT_cluster_mask: 41
vpb_blink: 008d vpdFAT_cluster_shift: 00
vpb_ref_count: 007b vpdFAT_first_FAT: 00b2
vpb_search_count: 0000 vpdFAT_FAT_count: a8
vpb_first_access: 00 vpdFAT_root_entries: 0004
vpb_signature: 444a vpdFAT_first_sector: 885c0400
vpb_flags(2): 02:00 vpdFAT_max_cluster: 410e
vpb_FSC: #00c8:0008 vpdFAT_FAT_size: b200
vpi_ID: 26715015 vpdFAT_dir_sector: aa04a800
vpi_pDPB: #04b8:00c4 vpdFAT_media: 0d
vpi_cbSector: 0200 vpdFAT_next_free: 00b2
vpi_totsec: 0007cfe0 vpdFAT_free_cnt: 04a8
vpi_trksec: 0020 vpdFAT_FATentrysize: b2
vpi_nhead: 0040 vpdFAT_IDsector: 00000000
vpi_pDCS: #0000:0000 vpdFAT_access: 0000
vpi_pVCS: #0000:0000 vpdFAT_accwait: 0000
vpi_drive: 07 vpdFAT_pEASFT: #0000:0000
vpi_unit: 07
vpi_text: UNLABELED
vpi_flags: 0003
####.m 98:0
*har par cpg va flg next prev link hash hob hal
0003 %feaef04c 00000400 %fe6ef000 001 0002 0023 0000 0000 0003 0000 =0000
hob har hobnxt flgs own hmte sown,cnt lt st xf
0003 0003 fec5 0000 ffec 0000 0000 00 01 00 00 vmkrhrw
pvmli cs eip phlock cpg va flg hptda hob sig csig
%fe82e4c4 002d 0a6800a5 %ac22403c 0001 %fe83c000 0005 024b 0003 ea9f ea9f
##dd %(98:0)-10 l8
%fe6fd4dc 00000001 ff5905b8 5e02bd64 000009bd
%fe6fd4ec 05d6007b 000009ae 0000099c dac40000
##dd %(98:0)-10-4+9bc l8
%fe6fde94 6d6b6d62 00180000 ffa20098 00e800e8
%fe6fdea4 ffc2001c 00000008 00000000 00000000
##.mo ffa2
ffa2 vpb
##
Figure 29. Volume Parameter Block
Notes::
The selector for the VPB segment may be found by listing the symbol
GDT_VPB and using its offset.
The handle of a VPB (hVPB) is the offset within the VPB segment.
The VPB segment has a unique owner ID, which may be determined
using the .M command. In the case of the VPB segment it is allocated
from the kernel resident heap, so the true owner id is found in the
heap header (or its extension - the trailer).
.d dpb 4b8:c4
dpb_drive: 07
dpb_unit: 07
dpb_driver_addr: #0798:0000
dpb_next_dpb: #04b8:00e0
dpb_cbSector: 0200
dpb_first_FAT: 0001
dpb_toggle_time: 00000000
dpb_hVPB: 0012
dpb_media: f8
dpb_flags: 20
dpb_drive_lock: 0000
dpb_strategy2: #07a0:139c
##.m 04b8:0c4
*har par cpg va flg next prev link hash hob hal
0003 %feaef04c 00000400 %fe6ef000 001 0002 0023 0000 0000 0003 0000 =0000
hob har hobnxt flgs own hmte sown,cnt lt st xf
0003 0003 fec5 0000 ffec 0000 0000 00 01 00 00 vmkrhrw
pvmli cs eip phlock cpg va flg hptda hob sig csig
%fe82e4c4 002d 0a6800a5 %ac22403c 0001 %fe83c000 0005 024b 0003 ea9f ea9f
##dd %(4b8:0) - 10 l8
%fe6f1638 00000000 ff360498 2000fe6f 000001c5
%fe6f1648 00000000 001c0798 020004b8 00000001
##dd %(4b8:0) - 10-4+1c4 l8
%fe6f17f8 00000000 00000000 ff9604b8 0000000a
%fe6f1808 ff46000c 000014f8 00d020c8 ff46000c
##.mo ff96
ff96 dpb
Figure 30. Drive Parameter Block
Notes::
The DPB may be located from the VPB.
The DPB segment has a unique owner ID, which may be determined
using the .M command. In the case of the VPB segment it is allocated
from the kernel resident heap, so the true owner ID is found in the
heap header (or its extension - the trailer).
For a description of the DPB fields see the Driver Parameter Block (DPB) in the
System Reference.
>> locate the SAS file system section
##dw 70:12 l1
0070:00000012 0074
##dw 70:74
0070:00000074 0fa4 fe70 00c0 07f8 0828 00a8 0428 0000
0070:00000084 03c8 ffff ffff 0843 0000 0000 0000 0000
0070:00000094 0000 0000 0000 0000 0000 0000 0000 0000
0070:000000a4 0000 0000 0000 0000 0000 0000 0000 0000
0070:000000b4 0000 0000 0000 0000 0000 0000 0000 0000
0070:000000c4 0000 0000 0000 0000 0000 0000 0000 0000
0070:000000d4 0000 0000 0000 0000 0000 0000 0000 0000
0070:000000e4 0000 0000 0000 0000 0000 0000 0000 0000
>> +8 into the file system section is the CDS RMP selector.
>> Can verify this by checking out the memory object owner.
##.m 828:0
*har par cpg va flg next prev link hash hob hal
0003 %feaef04c 00000400 %fe6ef000 001 0002 0023 0000 0000 0003 0000 =0000
hob har hobnxt flgs own hmte sown,cnt lt st xf
0003 0003 fec5 0000 ffec 0000 0000 00 01 00 00 vmkrhrw
pvmli cs eip phlock cpg va flg hptda hob sig csig
%fe82e4c4 002d 0a6800a5 %ac22403c 0001 %fe83c000 0005 024b 0003 ea9f ea9f
##dd %(828:0)-10 l8
%fe7015b4 000007d0 ff5c07b0 0000bd64 0000060d
%fe7015c4 049d0600 01ae0014 00000001 00000400
##dd %(828:0)-10-4+60c l8
%fe701bbc 00000000 00000000 ff610828 0000fe70
%fe701bcc ff9e0054 4d45534b 00000201 00000000
##.mo ff61
ff61 cdsrmp
>> Now dump the CDS handle table for the process of interest
##.p#
Slot Pid Ppid Csid Ord Sta Pri pTSD pPTDA pTCB Disp SG Name
0048# 0029 0004 0029 0001 blk 0200 ab805000 ab99b820 ab97fc20 1ed4 11 cmd
>> The RMP has a 0x14 byte header. Each entry is prefixed with a word
>> length followed by the handle for that entry.
>> Starting with the first entry scan through until handle 0x0090 is
>> located.
##dw 828:14 l4
0828:00000014 8028 0000 00b2 0000
##dw 828:14 l2
0828:00000014 8028 0000
##dw 828:14+28 l2
0828:0000003c 0028 001c
##dw 828:14+28+28 l2
0828:00000064 0028 001d
##dw 828:14+28+28+28 l2
0828:0000008c 0026 001e
##dw 828:14+28+28+28+26 l2
0828:000000b2 8023 0014
##dw 828:14+28+28+28+26+23 l2
0828:000000d5 0028 0022
##dw 828:14+28+28+28+26+23+28 l2
0828:000000fd 002e 008f
##dw 828:14+28+28+28+26+23+28+2e l2
0828:0000012b 0025 0090
cdi_hVPB: 0012
cdi_end: 0002
cdi_flags: 80
cdi_text: H:\spool
##
Figure 32. (Part 2 of 2). Current Directory Structure
Notes::
For a description of the CDS fields see the Current Directory Structure (CDS) in
the System Reference .
>> Intra-Process serialisation mutex KSEM imbedded in the PTDA
.p#
Slot Pid Ppid Csid Ord Sta Pri pTSD pPTDA pTCB Disp SG Name
*000c# 0002 0000 0002 0004 blk 0804 ab78d000 ab997020 ab978420 1c9c 00 cntrl
##.d ksem %ab997020 +ptda_ptdasem-ptda_start
Signature : KSEM Nest: 0000
Type : MUTEX
Flags : 00
Owner : 0000 PendingWriters: 0000
##
##.pb 49
Slot Sta BlockID Name Type Addr Symbol
0049 blk fe83bdf4 warp_d
##.m %0fe83bdf4
*har par cpg va flg next prev link hash hob hal
072c %feaf8dd2 00000400 %00540000 149 072d 072b 0003 0000 0003 0025 hptda=0878
hal=0025 pal=%ffe5d140 har=072c hptda=0878 pgoff=00000 f=021
har par cpg va flg next prev link hash hob hal
0003 %feaef04c 00000400 %fe6ef000 001 0002 0023 0000 0000 0003 0000 =0000
hob har hobnxt flgs own hmte sown,cnt lt st xf
0003 072c fec5 1000 ffec 0000 0000 00 01 00 00 vmkrhrw
pvmli cs eip phlock cpg va flg hptda hob sig csig
%fe82e4c4 002d 0a6800a5 %ac22403c 0001 %fe83c000 0005 024b 0003 ea9f ea9f
Figure 33. (Part 1 of 2). K e r n e l Semaphore
##dd %0fe83bdf4-10 l8
%fe83bde4 00000000 bd100000 fe83fe83 ff7e0018
%fe83bdf4 4d45534b 000a0004 46380001 bd28a801
Notes::
KSEMs are usually found imbedded in system control blocks for
serialization and sharing purposes.
Dynamically allocated KSEMs are allocated out of one of the kernel
heaps.
Virtual Device Driver semaphore helper services result in KSEMs.
Under the ALLSTRICT kernel only, the KSEM has a signature field.
This is manufactured by the .D command for non-ALLSTRICT kernels.
Under the ALLSTRICT kernel the presence of a KSEM may be verified
by dumping the KSEM in bytes. Offset + 0 x 0 is where the signature is
located.
The owner field refers to the slot number of the semaphore owner.
For a description of the KSEM structure see the Kernel Semaphore Structure in
the System Reference .
>> Driver header address taken from the VBP with handle 12:
.d vpb 98:12
vpb_flink: 0000 vpdFAT_cluster_mask: 41
vpb_blink: 008d vpdFAT_cluster_shift: 00
vpb_ref_count: 007a vpdFAT_first_FAT: 00b2
vpb_search_count: 0000 vpdFAT_FAT_count: a8
vpb_first_access: 00 vpdFAT_root_entries: 0004
vpb_signature: 444a vpdFAT_first_sector: 885c0400
vpb_flags(2): 02:00 vpdFAT_max_cluster: 410e
vpb_FSC: #00c8:0008 vpdFAT_FAT_size: b200
vpi_ID: 26715015 vpdFAT_dir_sector: aa04a800
vpi_pDPB: #04b8:00c4 vpdFAT_media: 0d
vpi_cbSector: 0200 vpdFAT_next_free: 00b2
vpi_totsec: 0007cfe0 vpdFAT_free_cnt: 04a8
vpi_trksec: 0020 vpdFAT_FATentrysize: b2
vpi_nhead: 0040 vpdFAT_IDsector: 00000000
vpi_pDCS: #0000:0000 vpdFAT_access: 0000
vpi_pVCS: #0000:0000 vpdFAT_accwait: 0000
vpi_drive: 07 vpdFAT_pEASFT: #0000:0000
vpi_unit: 07
vpi_text: UNLABELED
vpi_flags: 0003
##.d dpb 4b8:c4
dpb_drive: 07
dpb_unit: 07
dpb_driver_addr: #0798:0000
dpb_next_dpb: #04b8:00e0
dpb_cbSector: 0200
dpb_first_FAT: 0001
dpb_toggle_time: 00000000
dpb_hVPB: 0012
dpb_media: f8
dpb_flags: 20
dpb_drive_lock: 0000
dpb_strategy2: #07a0:139c
##.lmo ′ ibmkbd
hmte=009b pmte=%fe6f1fb8 mflags=8008e1c9 h:\ibmkbd.sys
seg sect psiz vsiz hob sel flags
0001 0001 0194 01fa 0000 0540 8d49 data iter prel rel
0002 0002 11c2 11c4 0000 0548 8d60 code shr prel rel
##.d dev 540:0
DevNext: 0510:0000
DevAttr: 8980
DevStrat: 0680
DevInt: 0586
DevName: IBMKBD$
DevProtCS: 0548
DevProtDS: 0540
DevRealCS: 0000
DevRealDS: 0000
##
Figure 36. (Part 2 of 2). Physical Device Driver Header
Notes::
The Device Header appears in one of two formats, depending on
whether the device supports multiple units or not.
The interrupt routine address is not used by OS/2.
For a description of the DEV fields see the Physical Device Driver Header (DEV)
in the System Reference .
>> The two request packet pools for general device driver use:
##.moc 93
*har par cpg va flg next prev link hash hob hal
0091 %feaefc80 00000010 %ab546000 129 0090 0092 0000 0000 0093 0000 sel=04a8
hob har hobnxt flgs own hmte sown,cnt lt st xf
0093 0091 0000 0124 ff40 0000 0000 00 00 00 00 reqpkt1
##.moc 94
*har par cpg va flg next prev link hash hob hal
0092 %feaefc96 00000010 %ab536000 129 0091 0093 0000 0000 0094 0000 sel=04b0
hob har hobnxt flgs own hmte sown,cnt lt st xf
0094 0092 0000 0124 ff33 0000 0000 00 00 00 00 reqpkt2
##.p#
Slot Pid Ppid Csid Ord Sta Pri pTSD pPTDA pTCB Disp SG Name
*0043# 000d 0004 000d 0005 blk 081f ab7fb000 ab99ac20 ab97f220 1d24 17 faxworks
##.p2
Slot Pid Ppid Csid Ord Sta Pri pTSD pPTDA pTCB Disp SG Name
0002 0001 0000 0000 0002 blk 0200 ab779000 ffe3ca00 ab977020 1f3c 00 *tsd
##dd %ab977020 +1ac l1
%ab9771cc 04a80012
##.d req 4a8:12
PktLen: 32
PktUnit: 00
PktCmd: 00
PktStatus: 0000
PktDOSLink: 00000000
PktDevLink: 00000000
InitcUnit: 00
InitDevHlp: 0000:0000
InitParms: 0000:0000
InitDrv: 00
InitSysiData: 0000
##
Figure 38. (Part 2 of 2). Device Driver Request Packets
Notes::
Request Packets are allocated from one of three pools:
Strategy 1 request pool
Strategy 2 request pool
Swapper request pool
Each thread is preassigned a strategy 1 request packet. If this is in
use when a device driver tries to allocate another, then a packet is
allocated from the strategy 2 pool for strategy 1 use.
Asynchronous read and write requests are implemented in
DOSCALL1.DLL by creating multiple threads on which to run the
parallel I/O requests.
.D REQ does not format Strategy 2 format Request Packets.
For a description of the Request Packet fields see the Device Driver Request
Packer in the System Reference .
>> Display the SFT for SFN 20
.d mft %fe82ff7c
mft_ksem:
Signature : KSEM Nest: 0000
Type : SHARE Readers: 0000
Flags : 01 PendingReaders: 0000
Owner : 0000 PendingWriters: 0000
mft_lptr: 0000 mft_sptr: 00d0:08bb
mft_pCMap: 00000000 mft_serl: 013e mft_signature: 466d
mft_CMapKSem:
mft_hvpb: 0000 mft_opflags: 0000 mft_flags: 0000
mft_name: \DEV\MOUSE$
.d mft %fe6f190c
mft_ksem:
Signature : KSEM Nest: 0000
Type : SHARE Readers: 0000
Flags : 01 PendingReaders: 0000
Owner : 0000 PendingWriters: 0000
mft_lptr: 0000 mft_sptr: 00d0:2045
mft_pCMap: 00000000 mft_serl: 00a3 mft_signature: 466d
mft_CMapKSem:
mft_hvpb: 008d mft_opflags: 0000 mft_flags: 0001
mft_name: D:\SWAPPER.DAT
##
Figure 40. (Part 2 of 2). Master File Table Entries
Notes::
The MFT is entry may be located from each SFT that represents an
open instance of a file.
The MFT points to the most recent SFT open instance of the file.
For a description of the MFT field, see the Master File Table Entry (SFT) in the
System Reference .
>> Locate the file system buffer segment
##ln gdt_buffers
0138:000000a8 os2krnl:DOSGDTDATA:GDT_Buffers
##dw a8:0
00a8:00000000 ade4 94c4 0000 ff93 005a 0218 bc8b 0000
00a8:00000010 0664 0200 bc8c 000f 9000 00e5 0234 ade4
00a8:00000020 0000 0279 e05e 0000 0001 0400 0000 0000
00a8:00000030 0000 0000 46e5 4e49 3030 3630 4d54 2050
00a8:00000040 0000 0000 0000 0000 0000 b5cd 1f5e 3251
00a8:00000050 0400 0000 46e5 4e49 3030 3730 4d54 2050
00a8:00000060 0000 0000 0000 0000 0000 b5c8 1f5e 0000
00a8:00000070 0000 0000 4de5 3046 3030 2038 4d54 2050
##ln gdt_vpb
0138:00000098 os2krnl:DOSGDTDATA:GDT_VPB
Figure 41. (Part 1 of 2). File System Buffer (BUF)
>> The file system buffer segment is assigned a unique object owner
>> id.
##.m 0a8:0
*har par cpg va flg next prev link hash hob hal
0003 %feaef04c 00000400 %fe6ef000 001 0002 0023 0000 0000 0003 0000 =0000
hob har hobnxt flgs own hmte sown,cnt lt st xf
0003 0003 fec5 0000 ffec 0000 0000 00 01 00 00 vmkrhrw
pvmli cs eip phlock cpg va flg hptda hob sig csig
%fe82e4c4 002d 0a6800a5 %ac22403c 0001 %fe83c000 0005 024b 0003 ea9f ea9f
##dd %(a8:0)-10 l8
%fe702ff0 0b0c0001 4d5000a2 fe705854 0000cc99
%fe703000 94c4ade4 ff930000 0218005a 0000bc8b
##dd %(a8:0)-10-4+cc98 l8
%fe70fc84 00000000 00000000 ff9300a8 003ec010
%fe70fc94 ffa4000c fe80caac 00020100 ff9e0014
##.mo ff93
ff93 fsbuf
##
Figure 42. (Part 2 of 2). File System Buffer (BUF)
Notes::
File system buffers are allocated out of a buffer segment whose
selector may be located either from the SAS File System section,
offset + 0 x a or from symbol GDT_BUFFERS.
The buffer segment contains a header of length + 0 x 1 c .
Header Offset + 0 x 0 gives the offset to the head of the list of most
recently used buffers.
Header Offset + 0 x 4 gives the offset to the tail of the list of most
recently used buffers.
For a description of the Buffer Header fields, see the File System Buffers in the
System Reference.
##.d bpb bootbp
BytesPerSector: 0200
SectorsPerCluster: 08
ReservedSectors: 0001
NumberOfFATs: 00
RootEntries: 0200
TotalSectors: 0000
MediaDescriptor: f8
SectorsPerFAT: 00fa
SectorsPerTrack: 0020
Heads: 0040
HiddenSectors: 00000820
BigTotalSectors: 0007cfe0
Notes::
Two system BPBs are locatable at the symbols BootBPB and
minimumBPB.
Others are pointed to from the Device Driver Request Packet for
DosDevIOCtl command code 2 (build BPB).
See 3.4.5.7, “Device Driver (Strategy 1) Request Packet (REQ)” on
page 171 for information on formatting Device Driver Request
Packets.
For a description of the BPB fields, see the BIOS Parameter Block in the System
Reference .
##.pb 25
Slot Sta BlockID Name Type Addr Symbol
0025 blk fe81d2d0 pmshell Sem32 8001 004b hevLazyWrite
##.pb 2f
Slot Sta BlockID Name Type Addr Symbol
002f blk fe86ffdc pmshell
##.pb 30
Slot Sta BlockID Name Type Addr Symbol
0030 blk fe86fe58 pmshell Sem32 0001 00ce hevSleeper
Notes::
32-bit semaphores may be Event or Mutex in type, private or shared
in scope and if shared, named or anonymous.
The BlockID of a thread waiting on a 32-bit semaphore is the address
of the semaphore structure. The Type field in the .PB command
usually indicates a 32-bit semaphore when in use, however this is not
always the case. The next example shows how to determine
precisely whether the BlockID points to a 32-bit semaphore.
*har par cpg va flg next prev link hash hob hal
0003 %feaef04c 00000400 %fe6ef000 001 0002 0023 0000 0000 0003 0000 =0000
hob har hobnxt flgs own hmte sown,cnt lt st xf
0003 0003 fec5 0000 ffec 0000 0000 00 01 00 00 vmkrhrw
pvmli cs eip phlock cpg va flg hptda hob sig csig
%fe82e380 002d 0a6800a5 %ac22403c 0001 %fe83c000 0005 024b 0003 ea9f ea9f
##dd %0fe86fa1c-10 l8
%fe86fa0c 12d15b4c 54564553 ab97d220 ffc20018
%fe86fa1c 00000010 00000000 c4280001 455000a7
##.mo ffc2
ffc2 semstruc
##.d sem32 %0fe86fa1c
Type: Private Event
Flags: Reset
pMuxQ: 00000000
Post Count: 0000
Open Count: 0001
Create Addr: 00a7c428
##
Figure 45. How to Determine Whether a BlockID Points to a 32-Bit Semaphore
Notes::
Except for RAMSEM, MUXWAIT, ChildWait and private conventions the
BlockID is an address of a structure or routine that relates to the
resource or event being waited for.
The .M command is used to identifty the owner of the BlockID. In this
case it is the kernel resident heap.
Each resident heap block is prefixed with a 4-byte header. If the low
order bit is 0 then the high word of the header contains the owner of
the heap block.
32-bit Semaphore structures are allocated from regular resident heap
blocks. Thus the owner ID may be seen by displaying storage before
the BlockID address.
##da %fd084368
%fd084368 RJM\MUTEX0
pMux
--------
fe88aba4
##da %fd0843c8
%fd0843c8 RJM\MUXWAIT
##.d openq %fe571e94
Figure 46. (Part 1 of 2). Mux Wait Semaphores
##dd %fe88a8f4
%fe88a8f4 00000003 00000004 80000090 00000000
%fe88a904 80000091 00000001 80000094 00000001
%fe88a914 ffbe0014 fe88aba4 00000000 5158554d
%fe88a924 fe88a916 ffc70010 fe88a958 dd2f4580
%fe88a934 000001a2 ffc70010 fe88aa88 dd2f464d
%fe88a944 00000010 ffa4000c fe88a968 000102d5
%fe88a954 ffc70010 fe88a9d8 1bd49ce0 000101a5
%fe88a964 ffa4000c fe88aa7c 0001038d ffc70010
##
Figure 47. (Part 1 of 2). Mux Wait Semaphores
Notes::
pOpenQ points to an Open Queue Structure, that list all processes
that have access to the 32-bit semaphore. This is formatted using .D
OPENQ.
pName points to the semaphore name, when no anonymous.
pMuxQ points to a MUXQ structure, that lists any 32-bit MUX wait
semaphore address lists that have included this semaphore. In this
example we see one MUX list.
The MUX list may be formatted using .D SEM32.
Instead of a pMuxQ, the MUX semaphore contains a pointer to the
semaphore record (SR Pointer) and a count of the number of
semaphores in the list (SR Count).
There is no special formatting command for the SR Structure - it has
to be viewed by displaying storage directly. In this case we see then
length, flags and three semaphore handles each followed by the user
correlator.
For a description of the 32-bit Semaphore Structures, see the 32-Bit Semaphore
Structures in the System Reference .
Syntax:
Parameters:
T When specified it requests the Kernel Debugger page in the TSD for a
specified thread slot.
One TSD is assigned to each thread slot. If the registers for an
out-of-context thread need to be examined, then it may be necessary
to swap in the TSD for that slot, since the ring 3 stack frame is stored
in the TSD when a thread enters the kernel. The presence or
absence of the TSD for a given slot may be deduced by the presence
or absence of a value for the Disp field of the .P command.
If the T option is omitted it requests the Kernel Debugger page in the
page of virtual storage that encompasses the specified addr.
B When specified requests that all breakpoints be re-instated, including
those which the current CS:EIP may be addressing.
This parameter is effectively obsolete since breakpoints at the current
CS:EIP are correctly handled by the Breakpoint commands.
D Specifies that a page-in request be scheduled for the kernel debugger
daemon thread to execute. In most cases a page-in operation may
be performed synchronously, but under the following conditions it is
prohibited:
When an interrupt is being handled (that is, not at task time)
When a swapping operation is pending (TCBfswapping (TCB +
0x1a1) not 0)
When the current thread is blocked (TK_WF_SLEEPING (0x40) is
set in TCBWakeFlags (TCB + 0x162))
When in ring0 and InDos is 0
When one of these conditions occurs the page-in request may be
scheduled for execution asynchronously by the Debugger Daemon
thread by use of the D parameter. If the request is successfully
scheduled the user is invited to enter the G command. The system
will dispatch the Daemon thread, in time, which will attempt the
page-in request. The Daemon returns control to the debug console
using an INT 3 interrupt.
If .I is unable to complete the request the OS/2 system error code will be
displayed (in decimal) in the following message:
Display dump file header information saved by the stand-alone dump program in
the first sector (512 bytes) of the dump file.
Syntax:
──── .H ──────────────────────────────────────────────────────
Parameters:
None.
.h
Dump File Header Info:
Start Addr1: 0
End Addr1: 2623213
Total Disks: 9
Flag: 11
Ending addresses by disk:
2623213 6634079 9846551 12950323
14965147 17345751 19711393
22092095 25165823
#
Start Addr1:
The lowest physical address dumped.
End Addr1:
The highest physical address dumped.
Total Disks:
The number of disk volumes the dump data set spans. When the dump is
taken to hard disk then the number of volumes is one.
Flag:
Indicates whether the dump file required decompressing. 0 indicates a
compressed dump and 11 a decompressed dump.
Syntax:
──── .I ──────────────────────────────────────────────────────
Parameters:
None.
#.I
PROCESS slot:1c Pid:0003 Ord:0013
PTDA handle=0088 address=%7bcd5844
MTE handle=018a address=%fdfadf78 (PMSHL32)
SMTE address=%fc9a4c48
LDT handle=0187 address=%7a597000
CODE: user (cs:eip)#005b:17d679f2 cbargs=
STACKS: user (ss:esp)#0053:01382cbc(active)
ring2(ss:esp)#09be:00004000(bottom)
ring0 tcbframe=%7bbd4f54 bottom=%7bbd4f9c
Syntax:
─┬── .K ──┬──┬──────────┬────────────────────────────────────
├── .KS ──┤ ├── # ──┤
└── .KB ──┘ ├── * ──┤
└── slot ──┘
Parameters:
.K Display stack frame trace assuming the default operation size from
the descriptor associated with the code selector of the user registers
for the specified slot.
.KS Display frame trace assuming an operation size of 16-bits (small
model).
.KB Display frame trace assuming an operation size of 32-bits (big model).
slot Display stack trace for thread slot.
The following short hand may be used for the slot number:
* The current (last) thread the dispatcher gave control to.
This value is taken from the word a global label:
_TaskNumber
# The debugger default thread slot. This defaults to the
current slot unless overridden by the .S command.
If no slot number is given then all thread slots are displayed and
grouped by process.
The .K command operates as a K command, but with the starting stack frame
and code segment address implicitly determined from the user′s register as
displayed by the .R command.
The output from the ..K command display′s exactly as the K command but with
the slot-number prefixed to the return address when an out-of-context stack trace
is displayed. See the following example output.
Attention
Display selected information from the MTE and SMTE of one or more loaded
modules. Optionally format the associated STE or OTE as follows:
Syntax:
────.LM ────┬───────┬───┬───────┬────┬──────────┬─────────────
└── O ──┘ ├── L ──┤ ├── hmte ──┤
├── P ──┤ ├── addr ──┤
├── V ──┤ └── name ──┘
└── X ──┘
Parameters:
O Format information about each object of each load module.
For 32-bit modules selected fields from the Object Table Entry (OTE)
are displayed.
For 16-bit modules selected fields from the Segment Table Entry (STE)
are displayed.
L Select Dynamic Link Library modules only. (This includes .FON, .IFS
and .DLL modules).
P Select Physical Device Drivers modules only.
V Select Virtual Device Drivers modules only.
X Select Executable modules (.EXE) only.
hmte Specifies the handle of the memory object assigned to the MTE
structure to be formatted.
addr Specifies the address of the MTE to be formatted.
name Specifies the name (excluding the file extension and path). The MTE
matching this name will be formatted. The name must be specified
as a quoted string.
This option requires the SMTE to be present in storage. See below
for information on how to make the SMTE present.
The default specification is to scan the entire MTE chain without formatting
corresponding STEs or OTEs.
name The full path name for the module is displayed to the right of the
mflags field. The name is taken from the smte _path of the SMTE. If
the SMTE is swapped out then the the name is taken from
mte _modname (the .DEF file link edit name) and prefixed with an !
symbol.
Where no path information is given then the module is predefined by
the system and does not exist separately as a load module file.
The STE and OTE are displayed when the O option is specified. These tables
are accessed from the address at SMTE+0x1c. This requires that the SMTE be
present in storage. If it is not then the following is returned:
???
To page in the SMTE use .LM without parameters to obtain the MTE address from
the pmte field. The SMTE address is at MTE + 0x4. Use the .I command to
page in the SMTE storage.
#.lmo ′ hpfs′
#.lmo ′ doscall1′
If either the segment table or object is not in storage then the following message
is issued:
%nnnnnnnnx - swapped
Syntax:
────.M ─────┬───────┬───┬─────────────┬───────────────────────
├── A ──┤ └── options ──┘
├── O ──┤
├── C ──┤
├── L ──┤
├── V ──┤
└── P ──┘
Parameters:
A Format Memory Arena Records (VMARs). See the .MA command for
more information.
O Format Memory Object Records (VMOBs). See the .MO command for
more information.
C Format Memory Context Records (VMCOs). See the .MC command for
more information.
L Format Memory Alias Records (VMALs). See the .ML command for
more information.
V Format Virtual Page structures (VPs). See the .MV command for more
information.
P Format Page Frame structures (PFs). See the .MP command for more
information.
options See the corresponding .Mx command for details of applicable options.
The .M command defaults to:
.MAMC
.MAAMC
For further details see the M option of the .MA command.
Display memory arena records VMARs. Optionally format related object records
VMOBs, alias records VMALs and context records VMCOs.
Syntax:
────.MA ──┬─┬───────────────┬─┬───────┬─┬───────────┬─────────
│ ├── M ─┬───────┤ └── C ──┘ └── maddr ──┘
│ │ └── A ──┤
│ └────── A ──────┘
│
└─┬───────┬─┬─────────────────────┬──────────────────
└── B ──┘ ├────────── F ────────┤
└─┬───────┬─┬───────┬─┘
├── L ──┤ └── C ──┘
├── R ──┤
└── H ──┘
───────────────────────┬───────────────────────────┬───────────
├── har ────┬──┬─────────┬──┘
└── laddr ──┘ └── L n ──┘
Parameters:
A This option is used with (and implies) the M option. It causes a match
for private area addresses to be made across all contexts. See the M
option for further details.
Note:
Under Kernel Debugger the default is to match addresses in
the current context only.
Under Dump Formatter address matches are made across all
contexts, that is, the A option is in permanent effect.
B Display in-use (busy) arena records in sequential order.
C Display chained memory structures.
Chaining causes related memory structures to be displayed in
groups, the head of which is indicated by an * suffix. The related
structures are:
Aliases to the associated arena record (VMALs).
Arena records of all associated alias records (VMARs).
Shared instance data objects for all related arena records
Context records for shared objects of all associated arena records
(VMCOs). See the .MC command.
Object records of all associated arena records (VMOBs). See the
.MO command.
F Display free arena records.
Arena records are in contiguous storage, which is anchored from the address
given by global variable:
_parvmOne
Output from the .MA command is formatted using a common template with minor
variations.
Note: Because a common display template is used for all forms of arena record
certain fields will be irrelevant to the records being viewed and may
contain garbage information. Specific cases are noted in the examples
where this applies.
For a description of the fields formatted by .MA select .MA Output Field
Descriptions.
For more examples using of the .M family of commands see Volume I, of the
OS/2 Debugging Library ′ Exploring Memory Management ′ chapter.
har par cpg va flg next prev link hash hob hal
0263 %fef2948c 000294a2 %00320000 168 0233 0262 0000 0000 02df 0000 =029e
0264 %fef294a2 000294b8 %00000000 000 0000 0000 0000 0000 0000 0000 =0000
0265 %fef294b8 000294ce %00000000 000 0000 0000 0000 0000 0000 0000 =0000
Notes:
Flag bit 0x001 reset signifies a free record.
The only fields of relevance are har, par, and cpg.
Bit positions 0xffe of flg and remaining fields may contain garbage
from a previous use of the record.
For a description of the fields formatted by .MA select .MA Output Field
Descriptions.
har par cpg va flg next prev link hash hob hal
0004 %fef26062 00000000 %60000000 003 0239 0015 0000 0000 ffc0 0000 max=%fffc0000
0005 %fef26078 0000dfb0 %04000000 007 0259 006e 0000 0000 fff0 0000 max=%1fff0000
Notes:
Flag bit 0x002 set signifies a sentinel record.
hob is not relevant to sentinel records. (The value displayed
originates from the m a x = field).
For OS/2 2.1, arena record 4 is sentinel for the system arena.
For a description of the fields formatted by .MA select .MA Output Field
Descriptions.
har par cpg va flg next prev link hash hob hal
0005 %fef26078 0000dfb0 %04000000 007 0259 006e 0000 0000 fff0 0000 max=%1fff0000
Notes:
For a description of the fields formatted by .MA select .MA Output Field
Descriptions.
har par cpg va flg next prev link hash hob hal
0006 %fef2608e 00000003 %fff20000 009 000f 00b0 0000 0000 0007 0000 sel=0100
0007 %fef260a4 0000000b %ffe27000 009 0008 001a 0000 0000 0008 0000 sel=0400
0008 %fef260ba 0000000b %ffe32000 009 0009 0007 0000 0000 0009 0000 sel=0f00
0009 %fef260d0 00000010 %ffe3d000 009 000b 0008 0000 0000 000a 0000 sel=0120
Figure 51. System arena records - Address Space Mapped by a GDT Selector
Notes:
Flag bit 0x008 set signifies a selector mapping.
va value >= that specified in the System Arena Sentinel signifies
system area area record.
For a description of the fields formatted by .MA select .MA Output Field
Descriptions.
har par cpg va flg next prev link hash hob hal
000e %fef2613e 00000001 %fff16000 001 01d9 0083 0000 0000 000f 0000 =0000
000f %fef26154 00000001 %fff23000 001 0010 0006 0000 0000 0010 0000 =0000
0010 %fef2616a 00000002 %fff24000 001 0011 000f 0000 0000 0011 0000 =0000
selector
Figure 52. System Arena Records - Address Space not Mapped by a GDT
Notes:
Flag bit 0x008 set to 0 signifies a no selector mapping.
va value >= that specified in the System Arena Sentinel signifies
system area area record.
For a description of the fields formatted by .MA select .MA Output Field
Descriptions.
har par cpg va flg next prev link hash hob hal
00b2 %fef26f56 00000010 %1a0a0000 379 00b6 00b3 0000 0000 00be 0000 hco=001ed
00b3 %fef26f6c 00000010 %1a090000 3d9 00b2 00a9 0000 0000 00c0 0000 hco=001ee
00b4 %fef26f82 00000010 %1a0e0000 379 00bb 00b5 0000 0000 00c1 0000 hco=0022e
Notes:
Flag bit 0x200 set to 1 signifies shared arena, shared data.
Context records chained from hco value will list the processes that
currently share the memory object represented by this arena record.
For a description of the fields formatted by .MA select .MA Output Field
Descriptions.
har par cpg va flg next prev link hash hob hal
00e9 %fef27410 00000020 %1abb0000 179 0105 00ea 0000 0000 02b5 0000 =0000
00ea %fef27426 00000010 %1aba0000 179 00e9 00eb 0000 0000 02b6 0000 =0000
Notes:
Flag bit 0x200 set to 0 with a va value not in the system arena and 0
hptda indicates shared arena instance data.
Object records chained from hob value will list the objects and
processes that map to the common virtual address range represented
by this arena record.
For a description of the fields formatted by .MA select .MA Output Field
Descriptions.
har par cpg va flg next prev link hash hob hal
00e7 %fef273e4 00000010 %00020000 179 00e8 00db 0000 0000 011e 0000 hptda=0097
00e8 %fef273fa 00000010 %00030000 179 012f 00e7 0000 0000 011f 0000 hptda=0097
Notes:
Arena records not satisfying the criteria for any of the System,
Sentinel or Shared Arena records are assumed to be private arena
records.
If the private memory object is shared (for example, .EXE code
segments running in more than one process) then the associated
private arena records for the sharing processes are chained from the
link field as long as hal is zero.
har par cpg va flg next prev link hash hob hal
01e2 %fef28976 00000010 %00010000 1c9 01e3 01e0 00db 0000 011c 0000 hptda=0237
Notes:
Arena records not satisfying the above criteria are assumed to be
private arena records.
If the private memory object is shared (for example, .EXE code
segments running in more than one process) then the associated
private arena records for the sharing processes are chained from the
link field as long as hal is zero.
For a description of the fields formatted by .MA select .MA Output Field
Descriptions.
har par cpg va flg next prev link hash hob hal
0005 %fef26078 0000dfb0 %04000000 007 0259 006e 0000 0000 fff0 0000 max=%1fff0000
0009 %fef260d0 00000010 %ffe3d000 009 000b 0008 0000 0000 000a 0000 sel=0120
00b4 %fef26f82 00000010 %1a0e0000 379 00bb 00b5 0000 0000 00c1 0000 hco=0022e
00ea %fef27426 00000010 %1aba0000 179 00e9 00eb 0000 0000 02b6 0000 =0000
00e7 %fef273e4 00000010 %00020000 179 00e8 00db 0000 0000 011e 0000 hptda=0097
next Handle of next arena record within the same arena (private, shared or
system).
prev Handle of the previous record within the same arena (private, shared
or system).
link Handle of an associated arena record.
For private arena sentinel records this points to the boundary
sentinel.
For shared arena shared data this points to other private arenas
sharing the same object.
For alias objects this points to the arena record of the associated
(aliased) object.
hash Handle of the next arena record whose va hashes to the same hash
chain.
hob The handle of the associated memory object record. See .MO
command.
hal The handle of the associated memory alias record. See .ML
command. If this field is set to a value of 0xffff then this is not the
handle of an alias record, but signifies that this arena has been
privatized by the creation of an alias to it.
h p t d a = hhhh The handle of the pseudo-object that is the PTDA of the process
that has this arena record assigned to its private address space. Use
.MO hhhh to display the PTDA pseudo-object and hence obtain the
address of its virtual address.
m a x = %mmmmmmmm Maximum linear address of the area headed by this
sentinel record.
Syntax:
────.MC ────┬───────┬─┬───────┬─┬─────────────────────────┬───
└── B ──┘ ├── F ──┤ ├── hco─────┬───┬─────────┤
└── C ──┘ └── laddr ──┘ └── Ln ───┘
Parameters:
B Display in-use (busy) alias records in sequential order.
C Display chained context records.
Chaining causes related context records that are chained from
hconext of the current context to be formatted. The head of each
group indicated by an * suffix. Context records are chained to
represent each instance of an object being shared among several
processes. The head of the chain is pointed to by the hco field of the
corresponding arena record See the .MA command for information on
formatting arena records.
Notes: There is no pointer to the arena record from the context
record. Associated arena records have to be found by
scanning arena or object records.
The C option will not format context records from the head of
the chain. Do achieve this, locate the corresponding arena
record and use
.MAC har
F Display free alias records.
laddr Specifies the linear address of a specific context record to be
formatted.
Ln Specifies the number of context records to display.
hco Specifies the handle of a specific context record to be formatted.
Context records are in contiguous storage, which is anchored from the address
given by global variable:
_pcovmOne
For more examples using of the .M family of commands see: Exploring Memory
Management.
Notes:
pconext is used as a chain pointer to the next free context record.
For a description of the fields formatted by .MC see the .MC Output Field
Descriptions.
Notes:
Flag bit 0x20 set signifies a context handle > 64k. In effect this is a 1
bit extension of the 16 bit hco field of the VMCO. The .ML command
takes this into account when formatting VMCO records.
Flag bit 0x80 set signifies that the context has been privatized. This
implies that the object was originally shared but a private instance of
it has subsequently been created. Typically this occurs when
DosDebug is used to access a debugee′s shared data.
For a description of the fields formatted by .MC see the .MC Output Field
Descriptions.
Pid= This names the process Id and process executable that corresponds
to the hptda field.
Feature 82818
Syntax:
────.MK ────┬────────────────────┬────────────────────────────
└── hob ────┬────────┤
└── Ln ──┘
The VMLI is a copy of the constituents of the lock handle that resides in system
memory.In addition it includes:
The requestor′s return address
A pointer to the next VMLI
A pointer to the requestor′s lock handle
The .MK command formats the contents of the VMLI then re-calculates the
signature. The calculated and saved signatures should be identical.
Next the lock handle is accessed. If it differs from the corresponding VMLI then it
too is formatted and the signature is re-calculated and displayed. If either the
formatted lock handle and corresponding VMLI or the calculated and extracted
signatures disagree then a problem may be indicated. For example, an
overlayed or freed lock handle. However, there is no requirement for lock
requestors to retain their lock handles in their original locations.
Attention
The Kernel Debugger can trap when attempting to format lock handles from
freed memory.
##.mk
pvmli cs eip phlock cpg va flg hptda hob sig csig
%fe679f1c 0170 fffa015d %fd17d480 0001 %013f1000 0003 0091 0424 18aa 18aa
%fe68a1dc 0170 fffa015d %fd17d468 0001 %013f1000 0003 0091 0424 18aa 18aa
%fe74539c 0170 fff3e551 %ffe006ff 0002 %fff33000 0001 02f7 0016 0252 0252
%fe712c54 0170 fff3e551 %ffe00577 0003 %fff38000 0001 02f7 0016 0258 0258
%fe761e0c 0908 00000878 %7b6b7d0c 0001 %ffee9000 0005 0091 0190 011f 011f
0000 %4c800000 0ff0 0001 0000 0000 d7f5
%fe777e18 0908 00000841 %7b6b7d0c 0006 %ffeea000 0005 0091 0227 01bc 01bc
0000 %4c800000 0ff0 0001 0000 0000 d7f5
%fe777e3c 0908 00000809 %7b6b7d0c 0001 %ffef0000 0005 0091 022c 01c2 01c2
0000 %4c800000 0ff0 0001 0000 0000 d7f5
%fe777e60 0908 0000072b %7c224066 0002 %17c40000 0005 0091 0199 7e72 7e72
%fe777e84 0908 0000072b %7c224058 0001 %7a022000 0001 0091 0168 a224 a224
%fe777ef8 0908 000006ee %7c22403c 0001 %7a022000 0001 0091 0168 a224 a224
%fe777f28 0908 000006ee %7c22404a 0002 %17c80000 0005 0091 0196 7eaf 7eaf
%fe777f4c 0908 000000a5 %7c22402e 0001 %fe763000 0005 0091 0003 e80c e80c
For related information see refer also to the Virtual Memory Lock Trace.
Display memory alias records (VMALs). Optionally format related arena records
(VMARs), object records (VMOBs) and context records (VMCOs).
Syntax:
────.ML ────┬───────┬─┬───────┬─┬─────────────────────────┬───
└── B ──┘ ├── F ──┤ ├── hal─────┬───┬─────────┤
└── C ──┘ └── laddr ──┘ └── Ln ───┘
Parameters:
B Display in-use (busy) alias records in sequential order.
C Display chained memory structures.
Chaining causes related memory structures to be displayed in
groups, the head of which is indicated by an * suffix. The related
structures are:
The associated arena record (VMAR). See the .MA command.
Aliases to the associated arena record (VMALs).
Arena records of all associated alias records.
Shared instance data objects for all related arena records.
Context records for shared objects of all associated arena
records. (VMCOs). See the .MC command.
Object records of all associated arena records (VMOBs). See the
.MO command.
F Display free alias records.
maddr Specifies the matching address to be used with the M option.
laddr Specifies the linear address of a specific alias record to be formatted.
Ln Specifies the number of arena records to display.
Alias records are in contiguous storage, which is anchored from the address
given by global variable:
_palVMAliases
For a description of the fields formatted by .ML see the .ML Output Field
Descriptions.
For more examples using of the .M family of commands see Volume I, of the
OS/2 Debugging Library ′Exploring Memory Management′ chapter.
Notes:
Flag bit 0x001 reset signifies a free record.
The only fields of relevance are hal, pal, and palnext.
For a description of the fields formatted by .ML see the .ML Output Field
Descriptions.
Notes:
Flag bit 0x02 set signifies a CS alias record.
Flag bit 0x10 set signifies that DS is valid, i.e CS is an alias for the
same storage mapped by DS. For example after use of
DosCreateCSAlias. This flags distinguishes this form of the alias
record.
This alias applies to selectors within a specific (process) context.
For a description of the fields formatted by .ML see the .ML Output Field
Descriptions.
Notes:
Flag bit 0x10 reset distinguishes this form of the alias record.
hptda and har refer to the context and arena which has been aliases.
The context and arena of the creator of the alias may be shown using
.MLC hal
For a description of the fields formatted by .ML see the .ML Output Field
Descriptions.
Display memory object records (VMOBs). Optionally format related alias records
(VMALs), arena records (VMARs) and context records (VMCOs).
If feature 82818 is installed, then under the Kernel Debugger only, lock
information records will be formatted whenever a memory object with locked
pages is displayed. See the .MK command for more information.
Syntax:
────.MO ─┬───────┬─┬───────┬─┬───────────┬───────────────────────
└── V ──┘ ├── M ──┘ └── maddr ──┘
│
├───────┬─┬───────┬─┬───────────────────────┬─
└── B ──┘ ├── C ──┤ ├── hob ──┬─┬─────────┤
├── F ──┤ └── laddr ──┘ └── L n ──┘
├── N ──┤
├── P ──┤
└── S ──┘
Parameters:
B Display in-use (busy) object records in sequential order.
C Display chained memory structures.
Chaining causes related memory structures to be displayed in
groups, the head of which is indicated by an * suffix. The related
structures are:
The associated arena record (VMAR). See the .MA command.
Aliases to the associated arena record (VMALs).
Arena records of all associated alias records.
Shared instance data objects for all related arena records.
Context records for shared objects of all associated arena records
(VMCOs). See the .MC command.
Object records of all associated arena records (VMOBs).
Object records are located in contiguous storage, which is anchored from the
address given by global variable:
_pobvmOne
For more examples using of the .M family of commands see Volume I, of the
OS/2 Debugging Library ′Exploring Memory Management′ chapter.
Notes:
The verbose form is specified using the Voption. This causes the
suppression of owner and hmte interpretation.
For a description of the fields formatted by .MO see the .MO Output Field
Descriptions.
Notes:
The 0x8000 flag bit signifies as psuedo-object.
For a description of the fields formatted by .MO see the .MO Output Field
Descriptions.
Notes:
Flag bit 0x001 reset signifies a free record.
The only fields of relevance are va and pob when the V option is
specified.
The va field is used a link field to other free VMOBs.
For a description of the fields formatted by .MO see the .MO Output Field
Descriptions.
fff0 vmllock
fff1 vmob
fff2 vmsgs
fff3 vmbmp16
Notes:
System object IDs are not represented by VMOB structures. They are
pre-defined IDs for system components.
The Dump Formatter and Kernel Debugger display only object names
when displaying system objects.
Notes:
The lock wait flags indicate that a thread is waiting for locked
pages in the memory object to be unlocked, but not to resolve
a conflicting lock request: that is indicated with the
OB _LOCKWAIT flag.
If a thread blocks waiting for long-term locks to clear then the
address of the long-term lock count (VMOB + 0xd) is used as
the BlockID the thread blocks on. The thread blocks
indefinitely.
If a thread blocks waiting for short-term locks to clear then the
address of the short-term lock count (VMOB + 0xe) is used as
the BlockID the thread blocks on. The thread will block for up
to 10 seconds. If after that time the short-term lock has not
been cleared then an error is returned and under the debug
kernel the following message is sent to the debug console:
VMLOCK: Short term lock for > 10 secs: hob=hob
See the 3.4.21, “.PB - Display Blocked Thread Information” on
page 246 (.PB command) for information on thread slots
waiting on BlockIDs.
lt Count of active long-term lock holders. A non-zero value indicates
one or more pages of the memory object have been long-term locked,
that is prevented from being paged out from physical storage.
Long-term locks are expected to be held for a relatively long period of
time, in the order of seconds. See the .MP command for information
on displaying physical storage status. See also VM Lock Trace
Kernel Debugger facility.
st Count of active short-term lock holders. A non-zero value indicates
one or more pages of the memory object have been short-term
locked, that is prevented from being paged out from physical storage.
Short-term locks are expected to be held for a relatively short period
of time, in the order of milliseconds. See the .MP command for
information on displaying physical storage status. See also 1.4.2,
“Virtual Memory Management Lock Trace” on page 18 Kernel
Debugger facility.
description The object description appears to the right of the tabular display. It is
combines the interpretation of own and hmte fields. The following
forms are possible:
Process owned objects
System Object Owner IDs: System objects are a reserved range of hobs used to
attribute ownership of virtual memory objects to system components. System
object IDs have no corresponding VMOB.
The following table lists the system objects IDs are defined. The names shown
are those displayed by the Kernel Debugger and Dump Formatter when
formatting VMOB structures:
Syntax:
────.MP ──┬───────┬─┬───────┬─┬──────────────────────────┬─────
└── B ──┘ ├── F ──┤ ├── frame ──┬─┬─────────┬──┘
├── L ──┤ └── laddr ──┘ └── Ln ───┘
└── R ──┘
Parameters:
B Display in-use (busy) Page Frame Structures in sequential order.
Note: In-Use PFs are signified by the PF _FREE flag being reset and
not by the PF _BUSY flag being set.
F Display free Page Frame Structures.
L Follow left (forward) chain pointer. This is only of relevance to Free
and Idle Page Frame Structures since these are linked in a double
Page Frame Structures are allocated in contiguous storage from the address
given by global variable:
_pft
For a description of the fields formatted by .MP see the .MP Output Field
Descriptions.
For more examples using of the .M family of commands see Volume I, of the
OS/2 Debugging Library ′Exploring Memory Management′ chapter.
For a description of the fields formatted by .MP see the .MP Output Field
Descriptions.
Notes:
• Idle Page Frame Structures are chained in a double-linked list. The
head of this list may be located as follows:
1. Locate list structure whose address is given by _pgIdleList
2. The first doubleword of the list structure points to the
psuedo-page frame structure that heads the idle list.
3. The second double-word contains the pseudo-frame number of the
pseudo-PF. N.B. This marks the end of the linked list only.
4. The backward pointer to the first true idle PF is given by the 5 low
order digits of the second double-word of the pseudo-PF. This
value may be used with the .MP command.
For a description of the fields formatted by .MP see the .MP Output Field
Descriptions.
Notes: PF_FAST flag is set for some physical storage frames below
640K.
PF_BUSY signifies that access to the PF is being serialized by
the page frame manager. This is normally followed by setting
the VP_BUSY flag in the associated VP, if reset or setting the
VP_WANTED flag and waiting on the the BlockID of the VP
Syntax:
────.MV ──┬───────┬─┬───────┬─┬──────────────────────────┬─────
└── B ──┘ ├── F ──┤ ├── vpid ──┬─┬─────────┬──┘
├── L ──┤ └── laddr ──┘ └── Ln ───┘
└── R ──┘
Parameters:
B Display in-use (busy) Virtual Page Structures in sequential order.
Note: In-use VPs are signified by a zero reference count and not by
the VP_BUSY flag. See R e f = field in .MV Output Field
Description.
F Display free Page Frame Structures.
L Follow left (forward) chain pointer. This is only of relevance to free
Virtual Page Structures since these are linked in a double linked
chain.
Attention
Both the Dump Formatter and the Kernel Debugger may fail to
recognize the chain pointers correctly and under some
circumstances the debug kernel may hang. Use this option
advisedly!
Virtual Page Structures are allocated in contiguous storage from the address
given by global variable:
_pgpVPBase
For a description of the fields formatted by .MV see the .MV Output Field
Descriptions.
For more examples using of the .M family of commands see Volume I, of the
OS/2 Debugging Library ′Exploring Memory Management′ chapter.
Notes:
• Free Page Frame Structures are grouped in bundles that are chained
in a circular double link list. Each bundle comprises contiguous free
VPs in the VP array. The chain pointers are only used by the head
and tail of each bundle as follows:
− For bundles of greater than one VP:
1. Blink of the head points to the tail
2. Flink of the head points to the head of the next bundle
3. Blink of the tail points to the head of the previous bundle
4. Flink of the tail is set to zero
− For single VP bundles:
1. Blink points to the head of the previous bundle
2. Flink points to the head of the next bundle
The free VP chain is headed by a pseudo-VP whose Blink points to
the head of the first true free bundle and whose Flink points to the
last VP in the VP array. The pseudo-VP is located at global symbol:
_pgVPHead
• Unless a free VP is the head or tail of a bundle the Flink and Blink will
retain values from its previous use. In particular it may be possible to
glean information about a previous allocation at the Flink field
overlays the Flg and Block fields and the Blink field overlays the
HobPg and Hob fields of an in-use VP. In the example above VPI d41
For a description of the fields formatted by .MV see the .MV Output Field
Descriptions.
For more examples using of the .M family of commands see Volume I, of the
OS/2 Debugging Library ′Exploring Memory Management′ chapter.
For a description of the fields formatted by .MV see the .MV Output Field
Descriptions.
VPI=
The VP index into the array of VPs.
pVP=
The linear address of the VP.
status
The status of the VP interpreted from the Flg field. The following values may
appear:
B l o c k = nnnn
The cross-linked loader block number or swapper disk frame. This implies
the virtual page is not attached to a PF. If it is:
0 Allocate PF on demand
1 Allocate on demand zero-fill page
2 page is in a broken disk frame
F r a m e = nnn
The virtual page is linked to PF nnnn . Refer to the .MP command for
displaying information about the related page frame.
Flink=
Forward link of a free VP. This is only of relevance to the VP at the head of a
bundle of free VPs. See Free Virtual Page Structures for information on how
free VPs are linked.
Blink=
Backward link of a free VP. This is only of relevance to the VP at the head
and tail of a bundle of free VPs. See Free Virtual Page Structures for
information on how free VPs are linked.
Flg=
VP flags.
The following flags are defined:
Ref=
The number of memory objects sharing this page of data. A reference count
greater than 1 indicates shared memory, some instances of which will be
represented by VMCOs, (see the .MC command) and others by aliases (see
the .ML command).
The reference count is incremented and decremented according to usage.
When the count becomes zero the VP is no longer in use and any committed
physical storage or swapper storage my become eligible for freeing.
UVIRT storage is not represented by VPs thus reference accounting is not
performed.
Own=
The thread slot number of the current owner of the VP semaphore. This field
is only used in the debug kernel and will only have significance if the
VP_BUSY or WP_WANTED flags are set. See .PB command for information
on thread slots waiting on BlockIDs.
Display information saved by from the operating system when the stand-alone
dump procedure was initiated.
Syntax:
────.N ───────────────────────────────────────────────────────
Parameters:
None
gdtr_lim: 1FFF
gdtr_base: 7C3E5000
idtr_lim: 03FF
idtr_base: FFE00150
ldtr_reg: 0028
lo_data_sel: 0400
hi_data_sel: 0400
trace_buf_addr: 0B490400
sys_anchor_sel: 0070
arena_base: FEB1F020
max_threads: 0101
phys_page_dir: 001D6000
vm_object_ptr: FEC80020
StartInit_Data: 00000140
dcm_ote_start: FFF0A92F
CurProcPid: 000D
TaskData: 0B5C0400
FirstPacket: 158A
LastPacket: 04C0
SysSemDataTable: 53A60400
GDT_Buffers: 00A80138
PapTCBPtrs: 0B6B0400
callerSS: 00E8
callerESP: 00000FCC
savePage: 00241467
Display process and thread status information from the Per Task Data Area
(PTDA), Thread Control Block (TCB) and Thread Swappable Data (TSD).
Syntax:
────.P ───────────────────────┬──────────┬────────────────────
├── # ──┤
├── * ──┤
└── slot ──┘
Parameters:
slot
Display process status for thread slot slot.
The following shorthand may be used for the slot number:
* The current (last) thread the dispatcher gave control to. This
value is taken from the word a global label:
_TaskNumber
# The debugger default thread slot. This defaults to the current slot
unless overridden by the .S command.
If no slot number is given then all thread slots are displayed and grouped by
process.
The .P command locates a thread′s TCB from either the thread slot table, the
linear address of which is given by the following global variable:
_papTCBSlots
Slot Pid Ppid Csid Ord Sta Pri pTSD pPTDA pTCB Disp SG Name
0001 0001 0000 0000 0001 blk 0100 ffe3a000 ffe3c7d4 ffe3c61c 1eb4 00 *ager
0002 0001 0000 0000 0002 blk 0200 7b7ca000 ffe3c7d4 7b9c8020 1f3c 00 *tsd
0003 0001 0000 0000 0003 blk 0200 7b7cc000 ffe3c7d4 7b9c81d8 1f50 00 *ctxh
0004 0001 0000 0000 0004 blk 081f 7b7ce000 ffe3c7d4 7b9c8390 1f48 00 *kdb
0005 0001 0000 0000 0005 blk 0800 7b7d0000 ffe3c7d4 7b9c8548 1f20 00 *lazyw
0006 0001 0000 0000 0006 blk 0800 7b7d2000 ffe3c7d4 7b9c8700 1f3c 00 *asyncr
*0008 0002 0001 0002 0001 blk 0500 7b7d6000 7b9e4020 7b9c8a70 1eb8 01 pmshell
000a# 0002 0001 0002 0002 blk 0800 7b7da000 7b9e4020 7b9c8de0 1ed4 01 pmshell
Figure 72. Command .P Output
Slot may be found in the TCBNumber (TCB + 0x2) field of the TCB
Pid
The process id this thread slot is assigned to.
Ppid
The parent process id that created this thread. A value of zero signifies a
detached process.
Csid
The command subtree id.
This is normally the same value as the Pid. When the parent process dies
any orphaned children are adopted by their grandparent by making Ppid
equal to the grandparent′ s Pid. Each orphan inherits the Csid of its dying
parent. This mechanism ensures that orphaned PTDAs are not retained for
returning termination information to their parent (via DosWaitChild).
Csid is taken from the Csid (PTDA +0x4be (H/R: +0x4b6)) field of the PTDA.
Ord
The thread ordinal for this thread slot. This is the unique thread id assigned
to the thread within the process to which it belongs.
Ord is taken from the TCBOrdinal (TCB+ 0x0) field of the TCB
Sta
The thread′s ascending scheduler state taken from the TCBState (TCB
+0x161) field.
Except when a state transition is progress this is the same as the current
state of the thread (see the Qst field of the .PQ command.)
The following states are possible:
pTSD
Linear address of the TSD control block associated with this thread this
thread taken from the TCBpTSD (TCB +0x0c).
Note:
The TSD contains the ring 0 stack for the associated thread. For the
current thread this is addressable from selector 30 however the base
address of selector 30 is entirely different from TCBpTSD. This is
because the two addresses are aliased using two PTEs to pin the
same physical frame. This device allows the TSD for be accessed
out-of-context by the system, at the same time protecting system code
from erroneous stack references.
pPTDA
Linear address of the PTDA control block representing the process to which
this thread belongs. The address is taken from TCBpPTDA (TCB +0x08).
pTCB
Linear address of the TCB control block which represents the thread.
Note:
SG
Screen Group ID currently assigned to this process.
The Screen Groups ID is taken from the console locus structure (Cons_Loc
+ 0 x 2 ) embedded in the PTDA ((PTDA +0x526 (H/R: +0x51e))).
Name
The name of the primary executable running in this process.
Except for process 1 and DOS Virtual Machines the name is obtained from
the hmte stored in ptda_module (PTDA +0x5a6 (H/R: +0x59e)). If the SMTE
is paged in then the name is taken from the file name pointed to by
smte_path otherwise it it taken from mte _module and prefixed with an ! point.
See the .LM command for information on formatting loader control blocks.
Process 1 comprises internal threads, that is threads which run in the kernel
and are not separately loaded modules. ptda_module is zero for this process
so the Dump Formatter and Kernel Debugger translate the Tids for Pid 1 as
follows:
Virtual DOS Machines run the DEM component of OS/2 to provide DOS
emulation. DOS programs are loaded by the DEM and not known to the
(OS/2) loader. Thus ptda _module is zero and the Kernel Debugger and
Dump Formatter use the name *vdm to indicate a VDM. The PSP of the first
loaded DOS program in a process may be located from CurrentPDB (PTDA
Syntax:
────.PB ──────────────────────┬──────────┬────────────────────
├── # ──┤
├── * ──┤
└── slot ──┘
Parameters:
slot
Display user information for thread slot slot.
The following shorthand may be used for the slot number:
* The current (last) thread the dispatcher gave control to. This value
is taken from the word a global label:
_TaskNumber
# The debugger default thread slot. This defaults to the current slot
unless overridden by the .S command.
If no slot number is given then all thread slots are displayed in slot number
order.
The .PB command locates each thread′s TCB from the thread slot table, the
linear address of which is given by global variable:
_papTCBSlots
slot
The unique (hexadecimal) index in to the thread slot table of all threads.
This value may be flagged with:
Slot may be found in the TCBNumber (TCB + 0x2) field of the TCB
Sta
The ascending or desired state of the thread. This should always appear as
blk for the .PB command, however Dump Formatter does not check the
thread state so formats all threads. Those whose state is not blk should be
ignored. See 3.4.20.1, “Scheduler Finite State Machine” on page 245 and the
.PQ command for more information on thread states.
BlockID
The token used by TKSleep and TKWapeUp to sleep and wake a thread on
an event.
The BlockId is taken from TCBSleepID (TCB + 0x18c).
The BlockID is a conventional value. A number of conventions are used by
various system components. Usually the BlockID is constructed so to be
unique across all conventions. Frequently it will refer to the address of an
associated resource, such as a system control block, or a field within a
control block. See the discussion of the Type field below for more
information on interpreting BlockIDs.
Name
The name of the primary executable running in this process.
See name field description of the .P command for further information.
Type
Interpretation of the use of the BlockID in conjunction with double word
TCB_SemInfo (TCB + 0x14c) and double word TCB_SemDebugAddr (TCB +
0x150).
The following Types are recognized by the Dump Formatter and Kernel
Debugger:
RamSem
The thread is waiting on a RamSem or FastSafeRamSem.
The high word of the BlockID is 0xfffe; the low word is the RamSemID
taken from the RamSem structure.
The Addr field is taken from TCB_SemInfo. This is a selector:offset
address of the RAMSEM. The RamSem may be imbedded within a
FastSafeRamSem or a PMFastSafeRamSem.
MuxWait
The thread is waiting on multiple events.
The high word of the BlockID is 0xfffd, the low word is the slot of the
waiting thread.
TCB_SemInfo and TCB_SemDebugAddr are not used with a MuxWait
BlockID.
To locate the semaphores that comprise a given MuxWait proceed as
follows:
See Volume I of The OS/2 Debugging Library , example debugging log for
an explicit example of using this technique.
Addr and Symbol fields are blank.
ReqPkt
The thread is waiting for an I/O request packed to complete.
The BlockID is the Selector:Offset address of the request packet. The
Selector is the DOSGROUP kernel selector and should be selector 400.
The address should lie between addresses at global symbols:
FirstPacket and LastPacket.
See the Physical Device Driver Reference manual for information on
device driver request packets.
Addr and Symbol fields are blank.
See Volume I of The OS/2 Debugging Library , example debugging log for
an explicit example of using this technique.
The Addr and Symbol fields are blank.
DosSem
The thread is waiting on an internal RamSem.
The BlockID is the selector:offset of the DosSem. The Selector is the
DOSGROUP kernel selector and should be selector 400. The offset does
not lie in the System Semaphore Data Table of the I/O Request Packet
Table.
Addr is the BlockID formatted as selector:offset .
The Symbol displayed is either that of the TCB_SemDebugAddr or if -1,
the DosSem address. See the LN command for information on displaying
symbols.
Sem32
The thread is waiting on a 32-bit semaphore.
The BlockID is the address of the 32-bit Semaphore structure.
TCB_SemInfo contains the semaphore handle. This is of the form:
Buffer
The thread is waiting for a file system buffer.
The BlockId is the selector:offset address of the buffer. The high word is
the buffer selector and should be a8.
The Addr and Symbol fields are blank.
SFT
The thread is waiting for a SFT entry.
The BlockId is the selector:offset address of the SFT. The high word is
the buffer selector and should be one that is listed in the SFT table
pointed to by c0:0.
The Addr and Symbol fields are blank.
ChildWait
The thread is waiting in DosWaitChild for a child process to terminate.
The high word of the BlockID is the ptda_Pid offset from selector 30
(0xffca).
The low word of the BlockID is the Pid to which this thread belongs.
blank type
The thread is waiting on a BlockId that the Kernel Debugger and Dump
Formatter have not been able to identify.
Addr field is blank.
The Symbol displayed is either that of the TCB_SemDebugAddr or if -1,
the Sem32 address. See the LN command for information on displaying
symbols.
Notes::
The BlockID interpretation is not exact. A device driver, for example,
could call DevHlp_ProcBlock using a value for BlockID that conflicts
with another convention.
Under the Debug kernel only, TCB_SemDebugAddr is used to record
the creator′s address of kernel, system and RAM semaphores. If it is
not used it is set to 0xffffffff.
ChildWait semaphores might be missed by the Dump Formatter and
Kernel Debugger. Look out for BlockIDs of the form 0xffca????.
Some Sem32 BlockIDs are missed by the Dump Formatter. Check
TCB_SemInfo for a 32-bit semaphore handle and BlockIDs of the form
0xfe??????
Addr
The address of the semaphore associated with this BlockID
See Type field discussion above for more precise information.
Symbol
Either the symbolic address of the creator or of the associated semaphore.
See Type field discussion above for more precise information.
Syntax:
────.PQ ──────────────────────┬──────────┬────────────────────
├── # ──┤
├── * ──┤
└── slot ──┘
Parameters:
slot
Display queue status for thread slot slot.
The following shorthand may be used for the slot number:
* The current (last) thread the dispatcher gave control to. This value
is taken from the word a global label:
_TaskNumber
# The debugger default thread slot. This defaults to the current slot
unless overridden by the .S command.
The .PQ command locates each thread′s TCB from the thread slot table, the
linear address of which is given by global variable:
_papTCBSlots
Slot QSt Pri pTCB PriNextQ PriPrevQ PriHigh PriLow PriNext PriPrev
0001 blk 0100 ffe3c61c
0002 blk 0200 7b9c8020
0003 blk 0200 7b9c81d8
0004 blk 081f 7b9c8390
0005 blk 0800 7b9c8548
0006 blk 0800 7b9c8700 7b9cb3b0 7b9c9830
0008 blk 0500 7b9c8a70
000a blk 0800 7b9c8de0
*000b blk 0800 7b9c8f98 7b9ca960 7b9ca960
000c# blk 0800 7b9c9150 7b9cab18 7b9cab18
slot
The unique (hexadecimal) index in to the thread slot table of all threads.
This value may be flagged with:
Slot may be found in the TCBNumber (TCB + 0x2) field of the TCB.
QSt
The thread′s descending or current scheduler state taken from the
TCBQState (TCB +0x160) field.
Except when a state transition is progress this is the same as the desired
state of the thread (see the Sta field of the .P command.)
The following states are possible:
pTCB
Linear address of the TCB control block that represents the thread.
PriNextQ
The TCB address of the thread at the head of the next priority queue.
PriNextQ is taken from the TCBpTCBPriNextQ (TCB + 0x170) double-word
field.
If there are no other linked priority queues then TCBpTCBPriNextQ and
TCBpTCBPriPrevQ point to this thread and PriNextQ and PriPrevQ are shown
blank.
All TCBs not heading a priority queue have TCBpTCBPriNextQ and
TCBpTCBPriPrevQ pointing to themselves.
PriNext and PriPrev is only of relevance to blocked and delayed threads.
PriPrevQ
The TCB address of the thread at the head of the previous priority queue.
PriPrevQ is taken from the TCBpTCBPriPrevQ (TCB + 0x174) double-word
field.
PriHigh
The TCB address of the next higher priority thread within this priority queue.
PriHigh is taken from the TCBpTCBPriHigher (TCB + 0x178) double-word
field.
If there are no higher priority threads on this priority queue then
TCBpTCBPriHigher points to this thread and PriHigh is shown blank.
PriLow
The TCB address of the next lower priority thread within this priority queue.
PriLow is taken from the TCBpTCBPriLower (TCB + 0x17c) double-word
field.
If there are no lower priority threads on this priority queue then
TCBpTCBPriLower points to this thread and PriLow is shown blank.
PriNext
The TCB address of the next thread of the same priority within this priority
queue.
PriNext is taken from the TCBpTCBPriNext (TCB + 0x180) double-word field.
If there are no other threads of the same priority on this priority queue then
TCBpTCBPriNext and TCBpTCBPriPrev point to this thread and PriNext and
PriPrev are shown blank.
PriPrev
The TCB address of the previous thread of the same priority within this
priority queue.
Priprev is taken from the TCBpTCBPriPrev (TCB + 0x184) double-word field.
If there are no other threads of the same priority on this priority queue then
TCBpTCBPriNext and TCBpTCBPriPrev point to this thread and PriNext and
PriPrev are shown blank.
Priority queues are a double-linked list of thread priority groups. Each group is a
double-linked list of threads of the same priority.
By default these chain pointers are set to point to their own TCB.
TCBpTCBNext and TCBpTCBPrev link the TCBs within each priority group.
A number of PriQs are defined. Each is anchored from a global symbol pointer:
_ptcbPriQTSD
Anchor for all threads in tsd state.
_ptcbPriQRunner
Anchor for all threads in rdy state. At most this contains one TCB.
_ptcbPriQReady
Anchor for all threads in rdy state.
_ptcbPriQGetStack
Anchor for all threads in gsk state.
_ptcbPriQBadStack
Anchor for all threads in bad state.
ptda_pTCBPriQCritSec
Anchor per-process for all threads within a process in crt state.
Notes: For the current process ptda_pTCBPriQCritSec (PTDA +0x2e4) is a
also a global symbol. Out of current context it can be located relative
to the process′ PTDA address.
The TCB address of the thread that has entered critical section is
saved in ptda_pTCBCritSec (PTDA +0x2e0).
Each anchor points to a chain of PriQs of threads sleeping on the same BlockID.
The head TCB of each PriQ within a hashed chain is doubly linked from:
TCBpTCBPriNextQ (TCB + 0x170)
TCBpTCBPriPrevQ (TCB + 0x174)
When multi-wake-up threads wake their entire sleeping PriQ is moved to a chain
of PriQs for threads in dly state. The delayed thread PriQ is anchored from
global symbol:
_ptcbPriQDelayed
Display thread user space summary information for all (active) threads.
Syntax:
────.PU ──────────────────────┬──────────┬────────────────────
├── # ──┤
├── * ──┤
└── slot ──┘
Parameters:
slot
Display user information for thread slot slot.
The following shorthand may be used for the slot number:
* The current (last) thread the dispatcher gave control to. This
value is taken from the word a global label:
_TaskNumber
# The debugger default thread slot. This defaults to the current slot
unless overridden by the .S command.
If no slot number is given then all thread slots are displayed in slot number
order.
The .PU command locates each thread′s TCB from the thread slot table, the
linear address of which is given by global variable:
_papTCBSlots
Slot may be found in the TCBNumber (TCB + 0x2) field of the TCB.
Pid
The process id this thread slot is assigned to.
Ord
The thread ordinal for this thread slot. This is the unique thread id assigned
to the thread within the process to which it belongs.
Ord is taken from the TCBOrdinal (TCB+ 0x0) field of the current TCB.
pPTDA
Linear address of the PTDA control block representing the process to which
this thread belongs. The address is taken from TCBpPTDA (TCB +0x08).
Name
The name of the primary executable running in this process.
See name field description of the .P command for further information.
pstkframe
The address of the ring 0 stack frame that saved the user (ring 2 or ring 3)
registers at the last transition to ring 0. For internal threads that have never
run in ring 2 or ring 3 or for the currently running ring 3 thread this field will
appear blank.
The address for the user stack frame is taken from TCB_pFrameBase (TCB
+ 0x3c). See .R command for further information on displaying registers
saved in the user stack frame.
CS:EIP
The user (ring 2 or ring 3) CS:EIP saved in the ring 0 user stack frame the
last time the thread made a transition to ring 0. This field will appear blank
if the thread is an internal ring 0 thread, currently running in ring 3 or the
TSD for this thread is paged out. See the .I command for information on
paging in a TSD.
SS:ESP
The user (ring 2 or ring 3) SS:ESP saved in the ring 0 user stack frame the
last time the thread made a transition to ring 0. This field will appear blank
if the thread is an internal ring 0 thread, currently running in ring 3 or the
TSD for this thread is paged out. See the .I command for information on
paging in a TSD.
cbargs
The user (ring 2 or ring 3) cbargs saved in the ring 0 user stack frame the
last time the thread made a transition to ring 0. This field will appear blank
if the thread is an internal ring 0 thread, currently running in ring 3 or the
TSD for this thread is paged out. See the .I command for information on
paging in a TSD.
Display the user registers for a given thread slot. Set default addresses for the
E, D, K and U commands.
Syntax:
────.R ───────────────────────┬──────────┬────────────────────
├── # ──┤
├── * ──┤
└── slot ──┘
Parameters:
slot
Display user registers for thread slot slot. This option is valid only under the
Kernel Debugger.
The following shorthand may be used for the slot number:
* The current (last) thread the dispatcher gave control to. This
value is taken from the word a global label:
_TaskNumber
# The debugger default thread slot. This defaults to the current slot
unless current slot unless overridden by the .S command.
Registers are displayed and register mnemonics are assigned the values
displayed for use in address expressions and operands of other Kernel
Debugger and Dump Formatter commands.
If an invalid thread slot number is given the Kernel Debugger issues the
following message: prompted with the command prompt.
The format of the .R command output depends on whether the RT command has
been used to toggle register display to full or short form and also whether the Y
386ENV command has been used to toggle register interpretation into 286 or 386
mode. Examples of the various forms follow:
##rt
##.r
eax=00000000 ebx=00000014 ecx=0000abd7 edx=0000abd7 esi=00080bff edi=00080007
eip=0000272d esp=0000a668 ebp=0008a670 iopl=2 -- -- -- nv up ei ng nz na pe nc
cs=d02f ss=0047 ds=abd7 es=d137 fs=150b gs=0000 cr2=1581928c cr3=001d0000
doscall1:CONFORM16:postDOSSEMWAIT:
d02f:0000272d c9 leave
##y 386env
##.r 2c
ax=099f bx=0001 cx=fe4c dx=0007 sp=fe20 bp=fe88 si=ffec di=0000
ip=0626 cs=d02f ds=0053 es=0053 ss=099f -- nv up ei ng nz na pe nc
002c|d02f:0626 66ead77a021a5b00 jmp 005b:1a027ad7
##
##rt
##.r 2c
ax=099f bx=0001 cx=fe4c dx=0007 sp=fe20 bp=fe88 si=ffec di=0000
ip=0626 cs=d02f ds=0053 es=0053 ss=099f -- nv up ei ng nz na pe nc
gdtr=3e5000 1fff idtr=e00df0 03ff tr=0010 ldtr=0028 iopl=2 msw=ts em mp
002c|d02f:0626 66ead77a021a5b00 jmp 005b:1a027ad7
##
General Registers
These comprise the following registers:
Segment Registers
These comprise the following registers:
ip and eip
Each is displayed with its value in hexadecimal.
Flag registers
These comprise the following registers:
Bits 12 and 13 are the I/O Privilege Level bits. These are formatted as
i o p l = level .
Flags 14, 16 and 17 when reset are indicated by --.
g d t r = xxxxxxxx yyyy
Global Descriptor Table Register base address ( xxxxxxxx) and limit
( yyyy)
i d t r = xxxxxxxx yyyy
Interrupt Descriptor Table Register base address ( xxxxxxxx) and limit
( yyyy)
t r = xxxx
Task Register GDT selector ( xxxx).
Control Registers
cr0=
System control flags and Machine Status Word.
These have their bit setting interpreted as follows:
cr2=
Page fault linear address.
cr3=
Page Directory Base Register (PDBR).
Debug Registers
dr0 to dr3
These are formatted as follows:
dr0=llllllll glxnb
dr1=llllllll glxnb
dr2=llllllll glxnb
dr3=llllllll glxnb
where llllllll is the breakpoint linear address and glxnb are dr7 and dr6
related flags.
The flags have the following interpretations:
dr7=
The control bits 8 and 9 are interpreted as follows:
Test Registers
t r 6 = lllll v = v d = dd u = uu w = ww c = c
t r 7 = ppppp h t = h r e p = r
Syntax:
────.REBOOT ──────────────────────────────────────────────────
Parameters:
None
Attention
Set or display the Kernel Debugger′s and Dump Formatter′s default slot threads
slot.
Syntax:
────.S ─────┬───────┬─────────┬──────────┬────────────────────
└── S ──┘ ├── * ──┤
└── slot ──┘
Parameters:
slot
Set the default threads slot to slot.
The following shorthand may be used for the slot number:
* The current (last) thread the dispatcher gave control to. This value
is taken from the word a global label:
_TaskNumber
S Set current ESP, EBP, SS, CS and EIP registers to those of the Dispatcher.
This option sets these registers as if the thread context had just been
switched by the OS/2 Dispatcher. The R command will show the thread in
kernel mode, about to be run.
No actual updating of register values takes place. Only default values are
effected.
The new defaults are derived as follows:
The .S command sets certain default values such that the view of the user′ s
space in the new default slot is as if the thread context had switched. Linear
and LDT selector based addresses will be accessed correctly by the Dump
Formatter and Kernel Debugger. However, certain system data that are updated
by a context switch are not changed and continue to display in the system′ s
current thread context. These items include:
Task Register (TR)
GDT descriptor table entries for selectors 28, 30, 38 and 150b
Current TSS ring 0, and ring 2 stack selectors and pointers
Global and System copy of the Current Local Information Segments
The Thread Local Memory Area and Local Information Segment mapped by
LDT descriptor dfff
Note: Descriptor dfff maps a global shared memory object, but it′s data is
copied from the incoming PTDA and TCB when a context switch
occurs. This achieves the effect of thread local memory.
Syntax:
────.T ─────┬───────────┬─┬───────────────────────────┬───────
├── count ──┘ └── MAJ=mm ────┬────────────┤
│ └── MIN=nn ──┘
│
└──── S ────── filespec ──────────────────────────
Parameters:
count
The number of trace entries to print, starting with the most recent. If not
specified then the entire trace buffer will be dumped.
M A J = mm
Specifies that only trace events with major code mm should be displayed.
See System Trace Facility - Major Code Assignments for a information on the
deployment of trace major and minor codes in OS/2.
Attention
The Kernel Debugger may fail to process the M A J = parameter correctly.
Under some circumstances the debug kernel may hang. Use this option
advisedly!
M I N = nn
Specifies that only trace events with minor code nn should be displayed.
This option required the specification of a major code using the M A J =
parameter.
See System Trace Facility - Major Code Assignments for a information on the
deployment of trace major and minor codes in OS/2.
Attention
The Kernel Debugger may fail to process the M A J = parameter correctly.
Under some circumstances the debug kernel may hang. Use this option
advisedly!
S Specifies that the trace buffer should be saved to a file named in filespec .
This option is only available to the Dump Formatter.
The saved trace file may be subsequently formatted using the OS/2
TRACFMT command.
filespec
The file specification for the saved trace buffer.
The filespec may be fully qualified. The path defaults to the current
directory.
The trace buffer is allocated in a single segment (STDA) whose selector may be
located from global symbol ras_stda_addr. The STDA is a circular buffer whose
entries are recorded in reverse order. The header gives the offsets to the first,
last and current entires. The format of the trace buffer is described under
System Trace Data Area.
The major codes being traced are recorded in a bit string located at label
ras_mec _table. Each active major code has its corresponding bit set.
The minor codes being traced are recorded in a bit string whose selector is
located at label ras_min_table. The minor code table contains 32 byte entries,
each corresponding to a major code. Each bit of each entry corresponds to a
minor code within the major. If the bit is set, then the minor code is traced.
When tracing by Pid is active then the ptda_rasflag (PTDA +0x39a) is set to 0xff.
The .T command output appears as follows, (see note at the end of this section
for information on recent changes to the format of the trace output):
MAJ=
The traced event major code.
MIN=
The traced event minor code.
CONTEXT= system:processor
The system and processor context under which the event was traced.
system context may be:
PROTECT If the trace record was created when the system was running in
protect mode.
REAL If the trace record was created when the system was running in
real mode.
T S = hhss
The system time stamp where hh is 100th seconds and ss is seconds.
The time stamp is taken from the Global Information Segment (GISEG+0xa).
It is only recorded in the trace record if the time has changed since the
previous timed stamped record was recorded.
Note: TRACEFMT treats this value as a word length fixed number of two
decimal places.
trace data
Additional trace data.
A trace event may be accompanied with additional trace data, in which case
it is dumped in hexadecimal and ASCII format on the following line.
Attention
The use of the .T command after the new trace format was implemented, but
before the Kernel Debugger and Dump Formatter were updated, caused the
Kernel Debugger and Dump Formatter to trap.
The formatted trace is headed by a pair of timestamps that give the time tracing
was initiated and terminated. These are of the form:
YYYY,xxMM,xxDD,xxHH,xxmm,xxss,xxhh
Where:
YYYY is years,
MM is Months
DD is Days,
HH is hours,
mm is minutes,
ss is seconds.
hh is 1/100th seconds,
xx ignore.
The timestamp of each trace record is now shown as a pair of word values of the
form:
TS=MMHH,hhss
Where
MM is minutes,
HH hours,
The byte reversal occurs because the time values are originally byte
values which are displayed as words.
BlockIDs. BlockIDs are conventional tokens used to represent the reason for a thread
that blocks. This occurs as the result of the kernel entering TKSleep (either directly or
via ProcBlock). The address of the BlockID is passed to TKSleep and stored in
TCBSleepID. A thread wakes when the kernel calls TKWakeup (or ProcRun) with a
corresponding BlockID. All, zero or the highest priority thread blocked on the BlockID will
be woken depending on parameter flags. This mechanism is used by most functions and
APIs that cause thread execution to be suspended, either for an event or serialisation.
Examples are:
DosSleep
DosSemWait
DosWaitChild
DosRead
DevHlp _ProcBlock
Refer to 3.4.21, “.PB - Display Blocked Thread Information” on page 246 for more
detailed information.
BIOS Parameter Block. A BIOS Parameter Block is used for low level Disk I/O calls to
the BIOS.
For further information see:
The .D BPB Command in the Kernel Debugger and Dump Formatter Command
Reference.
The BPB Structure in the System Reference.
cbargs. cbargs is the argument count associated with the hardware defined call gate
mechanism. The count is the number of words or double-words (as defined by the gate
descriptor) that are inserted into a ring 0 stack when ring 2 or ring 3 code executes a call
gate instruction.
CBIOS. The Compatibility BIOS (CBIOS) is a layer of code in the OS2LDR that presents a
hardware independent interface to the BIOS for the OS2KRNL. The interface to the
OS2KRNL is provided through a set of entry points called Dos Helper Functions.
Client Register Information (CRI). The Client Register Information (CRI) is a table of
Register Information Packets (RIPs) that describe the offset and length of each register
that is stored in a ring 0 stack frame on entry to the kernel. This level of indirection
allows kernel routines to access entry registers regardless of the stack frame type, of
which there are a number, for example:
System Entry Frames from API calls
Trap Frames from traps and exceptions
Interrupt Frames from the interrupt manager
VDM Stack Frames
Kernel Stack Frames
Each TCB points to a CRI and the associated stack frame from TCB_pcriFrameType(TCB
+ 0x38) and TCB_pFrameBase(TCB + 0x3c) respectively.
Codepage Data Information Block (CDIB). The Codepage Data Information Block (CDIB)
contains country-specific constant information relating to screen, keyboard and printer
devices. The CDIB is built from information derived directly from CONFIG.SYS
statements.
The CDIB may be located from the SAS.
Common ABIOS Data Area (CDA). The CDA is the Common ABIOS Data Area.
Refer to the Kernel Debug and Dump formatter guide, external command .C - display
Common ABIOS data area.
Context. Context (or thread context) refers to the view of the system any given thread
has. Only one thread context may be current at any time.
Switching contexts refers to the process of preparing the system for another thread to
run. From an application program′s perspective this implies restoring its registers and
ring 2 and 3 stacks when it is given the opportunity to run again. From the system′ s
perspective, restoration of an application′s registers and stacks is done after the context
switch, by the dispatcher, on exiting kernel mode. Not every context switch is followed by
exiting kernel mode. For example, if another thread in the same process is in critical
section (but blocked) then the new thread enters crt state and the scheduler is called to
select yet another thread.
Context switching includes the following system actions:
• Updating GDT descriptor entries 28, 30, 38 and 150b, which point to
The current process′ LDT,
The current threads ring 0 stack,
The current thread′s floating point emulator work area,
The current thread′s TIB. (By default the FS selector is loaded with 150b).
Note: The LDT selector is only updated when the process changes with a context
switch, that is, for a process context switch.
• Updating page directory and tables for a process context switch.
• Updating the TR register if the process switch involves a task switch (normally only
VDMs).
• Updating the current TSS ring 0 and ring 2 stack addresses.
• Updating system copies of the Global and Information Segments.
• Copying the Local Information Segment from the incoming PTDA and the Thread
Local Memory Area from the incoming TCB to the segment mapped by LDT selector
dfff.
Besides addressing the current ring 0 stack, selector 30 also addresses the current
thread′s scheduling control blocks. In particular: the PTDA, TCB and TSD. This is done
by aliasing selected address ranges from selector 30 to those of the true PTDA, TCB and
TSD in the system arena global memory for the current context. The system defines a
dummy module containing a hard-coded PTDA. The symbols of this module have the
same name as those of the fields in the PTDA. The system arranges for this to map the
PTDA addressed by selector 30. This trick allows the system to refer to PTDA fields for
the current context without regard for which process is current, simply by using the field
names as public symbols. The user may use the same symbols for referencing the PTDA
but these are only valid for the current system context. To access PTDA fields in other
contexts the following technique can be used:
Glossary 275
Note that the current PTDA is located at PTDA_Start
##.p *
Slot Pid Ppid Csid Ord Sta Pri pTSD pPTDA pTCB Disp SG Name
*0025 0004 0002 0004 0001 blk 0300 7b7c8000 7bbc4080 7bbe8a90 1fc4 16 someprog
We wish to know the thread that has entered critical section in process of
thread slot 40. The address of the critical section TCB is
saved in ptda_pTCBCritSec and the thread ordinal and slot number
are the first two words of the TCB.
##.p 40
Slot Pid Ppid Csid Ord Sta Pri pTSD pPTDA pTCB Disp SG Name
0040 0012 0002 0012 0001 blk 0500 7b7d6000 7b9e4020 7b9c8a70 1eb8 10 userprog
##dw %(DW(%7b9e4020+ptda_ptcbcritsec-ptda_start)) l2
%7b9c8de0 0002 0041
Current Directory Structure (CDS). A Current Directory Structure (CDS) is used to store
file system information about the current directory per drive of each process.
Each CDS is managed in an RMP segment. The PTDA for each process contains an
imbedded array of 26 CDS handles, one for each drive. The CDS RMP segment may be
located from the SAS.
See also related structures:
MFT
SFT
DPB
FSC
VPB
Refer to the following for more detailed information
3.4.2, “.A - Format the System Anchor Segment (SAS)” on page 149.
3.4.5, “.D - Display an OS/2 System Structure” on page 160.
Driver Parameter Block (DPB). A Driver Parameter Block (DPB) contains vital
information about the state and format of a disk drive. The DPBs are chained together
and located in a single segment whose selector may be obtained from the SAS. See also
3.4.2, “.A - Format the System Anchor Segment (SAS)” on page 149.
See also related structures:
CDS
MFT
SFT
FSC
VPB
Refer to the following for more detailed information
3.4.2, “.A - Format the System Anchor Segment (SAS)” on page 149.
3.4.5, “.D - Display an OS/2 System Structure” on page 160.
File Allocation Table (FAT). The File Allocation Table file system is the default filing
system supported by OS/2. Support for FAT is always present, regardless of any
installed file systems.
File System Control Block (FSC). A File System Control Block (FSC) represents an
installed file system (IFS). The FSC contains a table of entry points implemented by the
file system driver (FSD). All FSCs are located in a single segment whose selector may
be obtained from the the SAS, see 3.4.2, “.A - Format the System Anchor Segment
(SAS)” on page 149.
See also related structures:
CDS
MFT
SFT
DPB
VPB
File System Driver (FSD). A File System Driver (FSD) is a special load module that
implements an installed file system (IFS). FSDs are loaded during system initialization
when the .IFS statement of CONFIG.SYS is encountered.
Examples of FSDs are:
HPFS.IFS
HPFS386.IFS
CDROM.IFS
Gate. A gate descriptor is one that defines to the hardware a means of entering code
that executes at a more privileged level of authority. Four types of gate are defined:
Call Gate The subject of a CALL instruction. Typically used to implement
operating system and device driver application programming
interfaces (APIs). Device drivers may create Call gates dynamically
using the DosDynamicAPI facility.
Task Gate The subject of a call or exception where a (hardware assisted) task
switch is required.
Interrupt Gate The subject of a hardware or software generated interrupt.
Typically an Interrupt gate will switch execution to an interrupt
handler when a device presents an interrupt.
Trap Gate The subject of a trap exception. Used to handle programming
errors.
Global Descriptor Table (GDT). The Global Descriptor Table (GDT) is a hardware
architected control block. The GDT is common to all protect mode processes. It contains
descriptors for memory segments common to all protect mode processes.
Refer to 3.3.17, “DG - Display Global Descriptor Table” on page 97 for more detailed
information.
Glossary 277
The selector for the GISEG may be located from the SAS. See the Dump Formatter and
Kernel Debugger .A command.
The GISEG is also mapped locally per-process by the LDT descriptor 0xdff4.
hal. The memory alias record handle (hal) is an index into the table of memory alias
records (VMALs) whose address is located at _parVMAliases.
Refer to 3.4.15, “.ML - Format Memory Alias Records (VMAL)” on page 209 for more
detailed information.
har. The memory arena record handle (har) is an index into the table of memory arena
records (VMARs) whose address is located at _parvmOne.
Refer to 3.4.12, “.MA - Format Memory Arena Records (VMAR)” on page 197 for more
detailed information.
hco. A hco is a handle for a memory context record. This is an index into the table of
memory arena records (VMCOs) whose address is located at _pcovmOne.
Refer to 3.4.13, “.MC - Format Memory Context Records (VMCO)” on page 204 for more
detailed information.
hmte. The MTE control block handle (hmte) is the hob of the memory object that
contains the MTE.
MTEs are allocated as pseudo-objects, so do not have Arena Records associated with
them.
Refer to the following for more detailed information:
3.4.16, “.MO - Format Memory Object Records (VMOB)” on page 212.
3.4.10, “.LM - Format Loader Structures (MTE, SMTE, OTE and STE)” on page 190.
hob. The memory object record handle (hob) is an index into the table of memory
objects records (VMOBs) whose address is located at _pobvmOne.
Refer to 3.4.16, “.MO - Format Memory Object Records (VMOB)” on page 212 for more
detailed information.
hptda. The PTDA control block handle hptda is the hob of the memory object that
contains the PTDA.
PTDAs are allocated as pseudo-objects, so do not have Arena Records associated with
them.
Refer to 3.4.16, “.MO - Format Memory Object Records (VMOB)” on page 212 for more
detailed information.
Interrupt Descriptor Table (IDT). The Interrupt descriptor table (IDT) is a hardware
architected structure that comprises a table of gate descriptors, one for each interrupt
vector. The low numbered entries are defined by the hardware architecture and
dedicated to exception management.
The Kernel Debugger′s V command may be used to intercept system exception handlers.
Internal Processing Errors (IPEs). Internal Processing Errors are unrecoveralble error
conditions detected by the system while running in ring 0. The may arise from
inconsistencies detected by the OS/2 Kernel or from traps occuring in any ring 0 code
(Kernel, Installable File System Drivers and Device Drivers).
When the system detects an IPE it enters a routine called panic where an error message
is formatted and displayed and the system is halted.
Job File Number (JFN). A Job File Number (JFN) is a handle for open file system
objects, unique within the process that opened the file system object. The JFN is
returned by DosOpen. It is used and an index into the JFN Table to locate the
corresponding SFT handle.
Job File Number Table (JFT). A Job File Number Table (JFT) entry is assigned to each
open file system object within a process. The JFT provides a cross-reference to the
handle for the corresponding SFT. The JFT is locatable from the PTDA field JFN_pTable
(PTDA +0x5b8 (H/R: +0x5b0)) for each process.
The JFT is initially allocated within the PTDA at label JFN_Table (PTDA +0x35e) with 20
entries. If this is expanded by use of the DosSetMaxFH then JFN _pTable is updated to
point to the new table.
See also related structures:
CDS
DPB
MFT
FSC
VPB
Loader Cache. The Loader Cache is used for saving discardable pages of instance data
segments from DLLs loaded from mountable media. The caches is allocated from the
kernel heap and has a system object owner ID of cache.
Local Descriptor Table (LDT). The Local Descriptor Table (LDT) is a hardware
architected table of memory descriptors.
Under OS/2 one LDT is allocated per process.
Refer to 3.3.19, “DL - Display the Current Local Descriptor Table” on page 101 for more
detailed information.
Master File Table (MFT). A Master File Table (MFT) entry is used to associate path
names with open files (SFTs) and lock records (RLRs). The MFTs are managed in a
PTREE structure, which is locatable from the SAS.
See also related structures:
CDS
DPB
SFT
FSC
VPB
Glossary 279
Refer to the following for more detailed information:
3.4.2, “.A - Format the System Anchor Segment (SAS)” on page 149
3.4.5, “.D - Display an OS/2 System Structure” on page 160
Message Queue Header (MQ). A PM Message Queue Header (MQ) is used as an anchor
for message processing for a given PM Application′s message thread. The MQ is created
when a threads calls WinCreateMsgQueue.
Module Table Entry (MTE) (non-swappable). The (non-swappable) Module Table Entry
(MTE) for a loaded module is use to record information about loaded modules. Since the
MTE is allocated in non-swappable only information that must be resident at all times is
recorded here. Related information that may be paged out is recorded in its sister
control, the Swappable Module Table Entry (SMTE).
The MTE contains the following information:
pointers to related control blocks such as, SMTE, resource and fix-up tables.
attributes of the load module.
Use count for .EXE modules.
Each MTE is identified by a unique handle referred to as the hmte.
Refer to 3.4.10, “.LM - Format Loader Structures (MTE, SMTE, OTE and STE)” on
page 190 for more detailed information.
Object Table Entry (OTE). An Object Table Entry (OTE) describes the address, size and
attributes an object within a loaded 32-bit load module.
The corresponding control block for a 16-bit load module is the STE.
Refer to 3.4.10, “.LM - Format Loader Structures (MTE, SMTE, OTE and STE)” on
page 190 for more detailed information.
Page Frame Structure (PF). A Page Frame Structure (PF) is used by page frame
management to track the status of a physical storage frame. The Page Frame Structures
are allocated in contiguous storage, anchored from the address specified in global
variable:
_pft
Each PF corresponds one to one with a frame of physical storage and provides links to
Virtual Page Structures VPs.
Zero or more PTEs may be pinned to a physical frame, this is reflected in a reference
count maintained in the associated PF.
UVIRT mappings have their corresponding PFs reserved unless aliased by non-UVIRT
storage.
Refer to the following for more detailed information
3.4.17, “.MP - Format Memory Page Frame Structures (PFs)” on page 225.
Patricia Tree (PTREE). A Patricia Tree (PTREE) is a form of tree structure designed to
offer a fast look-up facility for generically specified keys. In OS/2 a modified form of the
PTREE is use to manage MFTs for fast path-name look-up.
Page Table Entry (PTE). A Page Table Entry (PTE) is a hardware architected structure
that is used to map virtual addresses to physical storage addresses.
Refer to 3.3.20, “DP - Display Page Directory and Table Entries” on page 102 for more
detailed information.
Per-Task Data Area (PTDA). The Per-Task Data Area (PTDA) is the anchor point for all
process (task) related control information. One PTDA exists per process and from it is
located the LDT, TCB chain, Page tables and Arena Headers for a process.
Physical Arena Information block (PAI). The Physical Arena Information block (PAI)
describes ranges of physical memory to memory management.
Pageable physical memory is described by the PAI pointed to by the SAS.
Process Information Block (PIB). The Process Information Block (PIB) is a supplemental
process related control block made accessible to ring 3 programs. It contains process
status information obtained from the process′ PTDA.
The PIB may be located from ptda_avatib(PTDA + 0x28) using the Dump Formatter or
Kernel Debugger.
A program gains access to the PIB along with the TIB by calling the DosGetInfoBlocks
API.
Process Identifier (pid). The Process Identifier (pid) is a unique system wide value used
to identify a given process.
Note: It is not the same as the hptda which also uniquely identifies a process.
The Pid is used as a handle in process related APIs such as DosKillProcess and
DosWaitChild.
Refer to 3.4.20, “.P - Display Process Status” on page 238 for more detailed information.
Program Data Block. The Program Data Block is the name given to the DOS PSP by the
DEM component of OS/2.
Program Segment Prefix (PSP). The Program Segment Prefix (PSP) is a DOS control
block that forms the header of a loaded program. Under OS/2 the DEM component refers
to this as the PDB or Program Data Block.
Pseudo-Objects. Pseudo-Objects are small system objects that comprise control blocks
and other system areas, which for reasons of virtual memory conservation are not
represented by a corresponding Arena Records. They are allocated out of the kernel
resident heaps and comprise the following types of object:
MTE
VMAH
PTDA
Loader Cache
Refer to 3.4.16, “.MO - Format Memory Object Records (VMOB)” on page 212 for
more detailed information.
Glossary 281
Queue Message (QMSG). A PM Queue Message (QMSG) is used by WinPostMsg to
enqueue an asynchronously sent message to a thread′s message queue. QMSGs are
chained from the MQ of the receiver in a circular array.
Record Lock Record (RLR). A Record Lock Record (RLR) describes a locked region of a
file system record. RLRs are chained from the related MFT and point to the associated
SFT. They record the owner of the record lock.
See also related structures:
CDS
DPB
SFT
FSC
VPB
Register Information Packet (RIP). A Register Information Packet (RIP) is an entity used
to describe the size and offset of a register in a system stack frame. RIPs are located in
a CRI.
Screen Group. A Screen Group is a logical full screen buffer and keyboard. A number of
processes may be assigned to run in a given screen group. The workplace shell is one
such screen group. Each screen group is assigned an ID. The screen group assigned to
a process is recorded in its Local Information Segment. The currently active screen
group is recorded in the Global Information Segment.
Screen Groups are represented by SGCB structures.
Under version 2 of OS/2 the screen group concept has been extended to that of a
session.
Refer to 3.4.20, “.P - Display Process Status” on page 238 for information on displaying
screen group ids.
Screen Group Control Block (SGCB). The Screen Group Control Block (SGCB) is used by
the session manager component of the system to represent a Screen Group. It contains
status information for the screen group and acts as a cross reference between the Pid
currently associated with a given screen group and vice versa.
Segment Table Entry (STE). A Segment Table Entry (STE) describes the address, size
and attributes of a segment (object) within a loaded 16-bit load module.
Session. Sessions are groups of related processes initiated using DosStartSession API.
Each session is assigned a logical screen buffer or presentation space. Sessions are
identified by a unique ID that corresponds with their Screen Group Id (though the range
of numbers is extended to included PM sessions, which all share then same screen
group).
The following session ID/Screen Group ID ranges are defined:
SG Usage
32 First PM session
System Anchor Segment (SAS). The System Anchor Segment (SAS) is a central system
control block use to anchor control blocks for major system components such as:
File systems
Device Drivers
Scheduler
Memory management
The SAS is built at the beginning of the segment addressable from selector 70 and 78.
Refer to the following for more detailed information
3.4.2, “.A - Format the System Anchor Segment (SAS)” on page 149.
Swappable Module Table Entry (SMTE). The Swappable Module Table Entry (SMTE)
contains characteristics of a loaded module that may be page out of memory. The SMTE
is the sister control block to the MTE, which records those characteristics that must be
resident at all times.
The SMTE principally contains:
A pointer to OTE or STE.
A pointer to the fully qualified module name.
The entry point and initial stack pointers.
Refer to 3.4.10, “.LM - Format Loader Structures (MTE, SMTE, OTE and STE)” on
page 190 for more detailed information.
Glossary 283
System File Table (SFT). A System File Table (SFT) entry is used to describe the
attributes of each instance of an open file system object. SFTs are stored in a segment
directly locatable from the SAS. SFTs are indirectly locatable from the JFN Table
imbedded in the PTDA of each process that opens a file system object.
See also related structures:
CDS
DPB
MFT
FSC
VPB
Refer to the following for more detailed information
3.4.2, “.A - Format the System Anchor Segment (SAS)” on page 149
3.4.5, “.D - Display an OS/2 System Structure” on page 160
System Trace Data Area (SDTA). The System Trace Data Area (SDTA) is a circular
buffer used to record trace events. The SDTA may be located from the SAS.
Symbol. A symbol is the name given to a program code or data location that has been
made public by the programmer. Such symbolic definitions appear in the map file output
from the linkage editor. They may be referenced in the Dump Formatter and Kernel
Debugger using the L command when the map file is converted to a symbol file using the
MAPSYM utility.
Symbol Absolute. An Absolute symbol is a symbolized constant value that has been
made public by the programmer. Such symbolic definitions appear in the map file output
from the linkage editor and may be referenced in the Dump Formatter and Kernel
Debugger using the LA command when the map file is converted to a symbol file using
the MAPSYM utility.
Symbol Group. A symbol group is the set of symbols that are defined within a program
segment. Frequently a program segment is given its own selector at load time.
Symbol Map. A symbol map is created from symbolic name information generated by a
program compiler and converted for used by the Dump Formatter and Kernel Debugger
by the linkage editor and MAPSYM utilities. This allows program code and data locations
to be referred to by name as well as by address.
System File Number (SFN). A System File Number (SFN) is the system-wide unique
handle by which an open file system object is known. It is the offset into the SFT
segment that locates the corresponding SFT entry.
Refer to the following for more related information:
3.4.2, “.A - Format the System Anchor Segment (SAS)” on page 149.
3.4.5, “.D - Display an OS/2 System Structure” on page 160.
Task State Segment (TSS). The Task State Segment (TSS) is a hardware architected
control block that is used for two purposes:
Thrashing. Thrashing refers to the state of a system where most of the CPU time is
spent paging in and out memory from the swap file. This happens when real storage is
heavily over committed and storage references encompass a wide range of virtual pages
over a short processing time.
Such a condition can indicate a poorly tuned application where paging is caused by the
process of accessing data the application needs. A typical scenario is where work data is
chained in a single, very extended, queue and no mechanism exits to access the required
data without scanning the entire chain. Use of hashing techniques greatly reduce this
problem.
Thread Control Block (TCB). The Tread Control Block (TCB) contains per-thread control
and status information that must be resident at all times. The swappable counterpart to
the TCB is the TSD
Refer to the following for related information
3.4.20, “.P - Display Process Status” on page 238.
Thread Identifier (tid). The Thread Identifier (tid) is a value, unique within the owning
processes, used to identify the thread. It is not the same as the Thread Slot Number,
which uniquely identifies a thread, system-wide.
The Tid is used in thread related APIs such as DosKillThread and DosSetPriority.
Thread Information Block (TIB). The Thread Information Block (TIB) is a supplemental
thread related control block made accessible to ring 3 programs. It contains thread
information obtained from the thread′s TCB and acts as an anchor for exception-handlers
registered for the thread.
The TIB may be located from TCBptib(TCB + 0x10) using the Dump Formatter or Kernel
Debugger.
A program gains access to the TIB along with the PIB by calling the DosGetInfoBlocks
API.
Thread Local Memory Area (TLMA). The Thread Local Memory Area (TLMA) a an area of
private arena memory that is instanciated at a thread level. This is achieved by copying
the contents of the TLMA to dfff:0024 when a thread switch occurs. The TLMA contents
are saved in the TCB at TCBTLMA.
Glossary 285
Storage is allocated from the TLMA by using the DosAllocThreadLocalMemory API.
Thread Slot Number. The Thread Slot Number is a system wide unique identifier
assigned to each thread in the system.
Threads are located from the thread slot table whose linear address is at global symbol:
_papTCBSlots
Each slot is a double-word linear address of the corresponding thread′s TCB. The first
slot (slot=0) is reserved.
Under the Kernel Debugger and Dump Formatter the following symbols may be used to
represent particular threads in many of the commands that accept a slot number as a
parameter:
* The current or last dispatched thread as recorded in word global variable
_TaskNumber
# The default thread slot used by the Dump Formatter and Kernel Debugger.
Refer to 3.4.20, “.P - Display Process Status” on page 238 for more detailed information.
Thread Swappable Data (TSD). The Thread Swappable Data (TSD) control block contains
per-thread status and control information that resides in swappable memory and
therefore is not required for reference out of context of the related thread. The resident
memory counterpart to the TSD is the TCB (Thread Control Block).
The vast majority of the TSD is used as the ring 0 stack when a thread makes a privilege
level transition to ring 0 via a call gate descriptor. The base of the ring 0 stack will
therefore include the ring 3 call gate stack frame on entry to ring 0 (which is usually
kernel or device driver code).
In the debug kernel a dummy page prefixes the used part of the TSD in order to catch
ring 0 stack faults.
Other information contained in the TSD includes GTD instance data for the corresponding
thread′s context. This comprises descriptors for:
28: The LDT descriptor.
30: Base selector for ring 0 process instance data, which includes the ring 0 stack,
TCBs and PTDA.
38: Floating point emulator instance data
40: FS mapping to the TIB
When an an inter-process thread context switches, descriptors 30 - 40 are loaded into the
GDT from the TSD. When an intra-process thread context switches, descriptors 28 - 40
are loaded into the GDT from the TSD.
Refer to the following for related information
3.4.20, “.P - Display Process Status” on page 238.
Thunking. Thunking is the process of calling 16-bit code from 32-bit code and vice versa.
Thunking consists of applying the CRMA to convert from one form of address to the other
and making any stack parameter adjustments either by padding 16-bit operands to 32-bit
with leading zeros (16- to 31-bit conversion) or truncating the padded 32-bit value to 16
bits (32- to 16-bit conversion).
UVIRT. The UVIRT attribute signifies virtual storage mapping to a pages of physical
storage.
Virtual DOS Machine (VDM). A Virtual DOS Machine (VDM) is a type of process that runs
in an emulated DOS environment using the DOS EMulation (DEM) component of OS/2.
Virtual Page Structure (VP). A Virtual Page Structure (VP) is used by memory
management to track the status of a virtual storage frame, whether backed by physical
storage, cached by the loader or paged out to the swapper. The Virtual Page Structures
are allocated in contiguous storage, anchored from the address specified in global
variable:
_pgpVPBase
Refer to the following for more detailed information
3.4.18, “.MV - Format Memory Virtual Page Structures (VPs)” on page 230.
Virtual Memory Arena Header Record (VMAH). One Virtual Memory Arena Header
Record (VMAH) is allocated per arena to record information about the address range of
an arena. The VMAH points to its sentinel arena record (VMAR).
Each VMAH chained in a double linked list.
The system arena VMAH is located at global symbol:
_ahvmSys
The shared arena VMAH is located at global symbol: _ahvmShr
For each private arena the VMAH is imbedded in the PTDA at label &ptdaah..
Under OS/2 2.1 the system and shared arena VMAHs are assigned to objects 4 and 5
respectively.
Virtual Memory Alias Record (VMAL). The Virtual Memory Alias Record (VMAL) is used
to represent aliased regions of virtual memory. These are either:
regions of physical storage that may be addressed by more than one virtual or
linear address that are not associated with a memory object, such as VDM UVIRT
allocations.
When two memory objects are aliases of each other then they need not have co-incident
sizes or origins within the aliased arena record. Aliases are designed to provide
alternative attributes for accessing the same piece of data within or across processes.
Compare this with shared instance data within the shared arena, where multiple object
records share a common arena record. In this case each object is associated with a
unique process and is not considered an alias.
Each VMAL is identified by a unique handle referred to as the hal.
Refer to the following for more detailed information
3.4.15, “.ML - Format Memory Alias Records (VMAL)” on page 209.
Virtual Memory Kernel Heap (VMKH). The Virtual Memory Kernel Heap (VMKH)
structures are used to describe system heap memory. Many objects allocated out of the
kernel heap are assigned a System Object identifier.
Virtual Memory Arena Record (VMAR). The Virtual Memory Arena Record (VMAR) is
used to represent a contiguous region of virtual memory allocated in page quantities.
Such storage may or may not be committed or resident.
Glossary 287
Arena records are chained in a doubly linked lists, one for each arena type. That is, the
chain chain exists separately for each private arena, the shared arena and system arena.
Special arena records, known as Sentinels head each chain. They describe the entire
arena which they head.
All virtual memory is described by by at least one arena record.
Each VMAR is identified by a unique handle referred to as the har.
Arena also records point to the following related memory structures:
VMOB
VMAL
VMCO
Refer to the following for more detailed information
3.4.15, “.ML - Format Memory Alias Records (VMAL)” on page 209.
Virtual Memory Context Record (VMCO). A Virtual Memory Context Record (VMCO) is
used to record the association of shared arena, shared data objects with processes that
are using.
Each VMCO is identified by a unique handle referred to as the hco.
Refer to the following for more detailed information
3.4.13, “.MC - Format Memory Context Records (VMCO)” on page 204.
Virtual Memory Object Record (VMOB). The Virtual Memory Object Record (VMOB) are
used to represent memory objects, that is the instance data associated with a particular
virtual address. VMOBs contain pointers to the the owning and requesting objects as
well as the corresponding arena record (VMAH).
Each VMOB is identified by a unique handle referred to as the hob.
Refer to the following for more detailed information
3.4.16, “.MO - Format Memory Object Records (VMOB)” on page 212.
Volume Parameter Block (VPB). A Volume Parameter Block (VPB) is used to store
volume information associated with a file system object. All VPBs are contained within a
single segment locatable from the SAS. Most file system structures contain a VPB
handle for an associated volume. The handle is used as an offset into the VPB segment.
See also related structures:
CDS
MFT
SFT
DBP
FSC
Refer to the following for more detailed information
3.4.2, “.A - Format the System Anchor Segment (SAS)” on page 149
3.4.5, “.D - Display an OS/2 System Structure” on page 160
Zombie. The term Zombie is used to describe a.Z terminal condition of a thread or
process. There is a strict operating system definition and two colloquial uses:
•
• The strict system definition refers to a process that has terminated but whose PTDA
has been retained on the zombie queue ( _pPTDAFirstZombie) because the process
status byte (LISEG+0xa) indicates that its parent wishes to collect
termination information through DosWaitChild. The dead child is retained on
the zombie queue until either the parent dies or issues DosWaitChild.
Glossary 289
290 OS/2 Debugging
List of Abbreviations
Special Characters A
?, Show Internal Command Help 82 a System Dump, Forcing 14
.?, Show External Command Help 148 AAB 291
.A, Format the System Anchor Segment abbreviations 291
(SAS) 149 Absolute, Symbol 284
.B, Select the Communications Port and acronyms 291
Speed 156 Algorithm, Compatibility Region Mapping 275
.C, Display the Common ABIOS Data Area 157 Allocation Table, File 277
.D, Display an OS/2 System Structure 160 ALLSTRICT 1, 71
.H, Display Dump File Header Information 185 Analog Dial-in Telephone Line 7
.I (DF), Show Dump State 186 Anchor Block (AAB), Application 273
.I, Swap in Storage 183 Anchor Segment, System 283
.K, Display User Stack Trace 188 Application Anchor Block (AAB) 273
.LM, Format Loader Structures (MTE, SMTE, OTE Area (TLMA), Thread Local Memory 285
and STE) 190 Arena Header Record, Virtual Memory 287
.M, Format Memory Structures 196 Arena Record, Virtual Memory 287
.MA, Format Memory Arena Records Arithmetic Expressions 74
(VMAR) 197
.MC, Format Memory Context Records
(VMCO) 204
B
B, Breakpoint 84
.MK, Display Memory Lock Information Records
BC, Clear Breakpoints 84
(VMLKI) 206
BD, Disable Breakpoints 85
.ML, Format Memory Alias Records (VMAL) 209
BE, Enable Breakpoints 85
.MO, Format Memory Object Records
Binary Operators 75
(VMOB) 212
BIOS Parameter Block 273
.MP, Format Memory Page Frame Structures
BL, List Breakpoints 86
(PFs) 225
Block (AAB), Application Anchor 273
.MV, Format Memory Virtual Page Structures
Block Management Package (BMP) 274
(VPs) 230
Block, BIOS Parameter 273
.N, Display Dump Information Summary 235
BlockIDs 273
.P, Display Process Status 238
BMP 274, 291
.PB, Display Blocked Thread Information 246
BP, Set or Alter Breakpoint 87
.PQ, Display Scheduler Queue Information 251
BR, Set or Alter a Debug Register
.PU, Display Thread User Space
Breakpoint 89
Information 256
Breakpoint 12, 16, 19, 40, 41, 80, 273
.R, Display User′s Registers 258
Breakpoint, B 84
.REBOOT, Restart the System 264
Breakpoints, Kernel Debugger 38
.S, Set or Display Default Thread Slot 265
BS, Show Timestamped Breakpoint Trace 90
.T, Dump the System Trace Buffer 267
BT, Set Timestamped Breakpoint Trace 91
(AAB), Application Anchor Block 273
Buffer, Translation Lookaside 285
(MQ), Message Queue Header 280
Built-in Functions 76
(QMSG), Queue Message 282
(SMS), Send Message Structure 283
(SQMSG), System Queue Message 283 C
(TLMA), Thread Local Memory Area 285 C, Compare Memory 93
Cable, Modem Data 6
Index 295
Group, Screen 282 Internal Commands (continued)
Group, Symbol 284 DB, Display Memory in Byte Format 96
Guide, Kernel Debugger User 1 DD, Display Memory in Doubleword
Format 97
DG, Display Global Descriptor Table 97
H DI, Display Interrupt Descriptor Table 100
H, Hex Arithmetic 111
DL, Display the Current Local Descriptor
hal 278
Table 101
har 278
DP, Display Page Directory and Table
hco 278
Entries 102
Header (MQ), Message Queue 280
DT, Display a Task State Segment 104
Heap Validation, Virtual Memory Management
DW, Display Memory in Word Format 96
System 21
DX, Display the 286 LoadAll Buffer 106
Heap, Virtual Memory Kernel 287
E, Enter Data into Memory 107
helper, Virtual Device Driver 39
F, Fill Memory with Repeated Data 108
Hex Arithmetic, H 111
G, Go 109
hmte 278
H, Hex Arithmetic 111
hob 278
I, Input from an I/O Port 113
hptda 278
J, Execute Commands Conditionally 114
HSTRICT 1, 71
K, Display Stack Trace from Address 116
L, List Maps, Groups and Symbols 118
I M, Move a Block of Data in Memory 122
I, Input from an I/O Port 113 O, Output to an I/O Port 123
IBM 291 P, PTrace Instruction Execution 124
Identifier, Command Subtree 274 Q, Quit the Dump Formatter 126
Identifier, Process 281 R, Set or Display Current CPU Registers 127
Identifier, Thread 285 S, Search Memory for Data 132
IDT 278, 291 T, Trace Instruction Execution 133
Information block, Physical Arena 281 U, Unassemble 137
Information Block, Process 281 V, Exception/Trap/Fault Vector
Information Block, Thread 285 Commands 139
Information Packet, Register 282 W, Withmap Add/Remove 143
Information Segment, Global 277 Y, Set or Display Dump Formatter and Kernel
Information Segment, Local 279 Debugger Options 144
Input from an I/O Port, I 113 Z, Set, Execute or Display the Default
Installing the Debug Kernel 2 Command 146
Internal Commands 80 Internal Processing Errors 12, 21
?, Show Internal Command Help 82 Internal Processing Errors (IPEs) 279
B, Breakpoint 84 International Business Machines
BC, Clear Breakpoints 84 Corporation 51
BD, Disable Breakpoints 85 Interrupt Descriptor Table 43
BE, Enable Breakpoints 85 Interrupt Descriptor Table (IDT) 278
BL, List Breakpoints 86 Interrupt Gate 277
BP, Set or Alter Breakpoint 87 Interrupt Vector 278
BR, Set or Alter a Debug Register IPE 291
Breakpoint 89 IPEs 279
BS, Show Timestamped Breakpoint Trace 90 ITSO 291
BT, Set Timestamped Breakpoint Trace 91
C, Compare Memory 93
J
D, Display Memory 94
DA, Display Memory in ASCII Format 96
Index 297
PMDF Analyze Menu 58
PMDF Edit Menu 56
S
S, Search Memory for Data 132
PMDF File Menu 55
SAS 283, 292
PMDF Help Menu 60
Scheduler 282
PMDF Mouse Options 61
Screen Group 282
PMDF Options Menu 57
Screen Group Control Block (SGCB) 282
Process 281
SDTA 284, 292
Process Dump Formatter 67
Search Memory for Data, S 132
Process Identifier 16, 39, 40
Segment Prefix, Program 281
Process Identifier (pid) 281
Segment Table Entry (STE) 282
Process Information Block (PIB) 281
Segment, System Anchor 283
Process, Configuration 7
Segment, Task State 284
Processing Errors, Internal 279
Select the Communications Port and Speed,
Program Data Block 281
.B 156
Program Segment Prefix (PSP) 281
Send Message Structure (SMS) 283
PS EXEC 64
Session 283
Pseudo-Objects 281
Set or Alter a Debug Register Breakpoint,
PSP 281, 291
BR 89
PTDA 280, 291
Set or Alter Breakpoint, BP 87
PTE 280, 291
Set or Display Current CPU Registers, R 127
PTrace Instruction Execution, P 124
Set or Display Default Thread Slot, .S 265
PTREE 280, 291
Set or Display Dump Formatter and Kernel
Debugger Options, Y 144
Q Set Timestamped Breakpoint Trace, BT 91
Q, Quit the Dump Formatter 126 Set, Execute or Display the Default Command,
QMSG 291 Z 146
Queue Header (MQ), Message 280 Setup, Debug Terminal 3
Queue Message (QMSG) 282 Setup, Kernel Debugger Local 2
Queue Message (SQMSG), System 283 Setup, Kernel Debugger Remote 6
Quit the Dump Formatter, Q 126 SFN 284, 292
SFT 284, 292
SGCB 282, 292
R Show Dump State, .I (DF) 186
R, Set or Display Current CPU Registers 127 Show External Command Help,.? 148
RAS 282, 291 Show Internal Command Help, ? 82
Record Lock Record (RLR) 282 Show Timestamped Breakpoint Trace, BS 90
Record Management Package (RMP) 282 Slot Number, Thread 286
Reference, Kernel Debugger and Dump SMS 292
Formatter Command 71 SMTE 283, 292
Register Information Packet (RIP) 282 Software, Communications 7
Reliability Availability and Serviceability Speed Modems, Low 10
(RAS) 282 SQMSG 292
Remote Setup, Kernel Debugger 6 States and Description, Thread 252
Required Items to Setup a System 6 STE 282, 292
Restart the System, .REBOOT 264 String Expressions 74
RIP 282, 291 Structure (SMS), Send Message 283
RLR 282, 292 Structure, Current Directory 276
RMP 282, 292 Swap in Storage, .I 183
RUNCHAIN EXEC 63 Swappable Data, Thread 286
Index 299
W
W, Withmap Add/Remove 143
Withmap Add/Remove, W 143
WND 292
Y
Y, Set or Display Dump Formatter and Kernel
Debugger Options 144
Z
Z, Set, Execute or Display the Default
Command 146
Zombie 288
Your feedback is very important to help us maintain the quality of ITSO Bulletins. Please fill out this
questionnaire and return it using one of the following methods:
• Mail it to the address on the back (postage paid in U.S. only)
• Give it to an IBM marketing representative for mailing
• Fax it to: Your International Access Code + 1 914 432 8246
• Send a note to [email protected]
Name Address
Company or Organization
Phone No.
IBML
ITSO Technical Bulletin Evaluation RED000 Cut or Fold
Along Line
SG24-4641-00
NO POSTAGE
NECESSARY
IF MAILED IN THE
UNITED STATES
Cut or Fold
SG24-4641-00 Along Line
IBML
Printed in U.S.A.
SG24-4641-00