 |
OpenVMS Alpha System Analysis Tools Manual
SDA can also read symbols from an image .EXE or .STB produced by the
linker. The STB and EXE files only contain universal symbols. The STB
file, however, can be forced to have global symbols for the image if
you use the SYMBOL_TABLE=GLOBAL option in the linker options file.
A number of ready-built symbol table files ship with OpenVMS Alpha.
They can be found in the directory SYS$LOADABLE_IMAGES, and all have
names of the form xyzDEF.STB. Of these files, SDA automatically reads
REQSYSDEF.STB on activation. You can add the symbols in the other files
to SDA's symbol table using the READ command. Table 2-4 lists the
files that OpenVMS Alpha provides in SYS$LOADABLE_IMAGES that define
data structure offsets.
The following MACRO program, GLOBALS.MAR, shows how to obtain symbols
in addition to those in SYS$BASE_IMAGE.EXE, other executive images
listed in Table 4-1, and the symbol table files that are listed in
Table 2-4:
.TITLE GLOBALS
; n.b. on following lines GLOBAL must be capitalized
$PHDDEF GLOBAL ; Process header definitions
$DDBDEF GLOBAL ; Device data block
$UCBDEF GLOBAL ; Unit control block
$VCBDEF GLOBAL ; Volume control block
$ACBDEF GLOBAL ; AST control block
$IRPDEF GLOBAL ; I/O request packet
; more can be inserted here
.END
|
Use the following command to generate an object module file containing
the globals defined in the program:
$MACRO GLOBALS+SYS$LIBRARY:LIB/LIBRARY /OBJECT=GLOBALS.STB
|
Examples
#1 |
SDA> READ SDA$READ_DIR:SYSDEF.STB
%SDA-I-READSYM, 10010 symbols read from SYS$COMMON:[SYSEXE]SYSDEF.STB;1
|
The READ command causes SDA to add all the global symbols in
SDA$READ_DIR:SYSDEF.STB to the SDA symbol table. Such symbols are
useful when you are formatting an I/O data structure, such as a unit
control block or an I/O request packet.
#2 |
SDA> SHOW STACK
Process stacks (on CPU 00)
--------------------------
Current operating stack (KERNEL):
00000000.7FF95CD0 FFFFFFFF.80430CE0 SCH$STATE_TO_COM+00040
00000000.7FF95CD8 00000000.00000000
00000000.7FF95CE0 FFFFFFFF.81E9CB04 LNM$SEARCH_ONE_C+000E4
00000000.7FF95CE8 FFFFFFFF.8007A988 PROCESS_MANAGEMENT_NPRO+0E988
SP =>00000000.7FF95CF0 00000000.00000000
00000000.7FF95CF8 00000000.006080C1
00000000.7FF95D00 FFFFFFFF.80501FDC
00000000.7FF95D08 FFFFFFFF.81A5B720
.
.
.
SDA> READ/IMAGE SYS$LOADABLE_IMAGES:PROCESS_MANAGEMENT
%SDA-I-READSYM, 767 symbols read from SYS$COMMON:[SYS$LDR]PROCESS_MANAGEMENT.STB;1
SDA> SHOW STACK
Process stacks (on CPU 00)
--------------------------
Current operating stack (KERNEL):
00000000.7FF95CD0 FFFFFFFF.80430CE0 SCH$FIND_NEXT_PROC
00000000.7FF95CD8 00000000.00000000
00000000.7FF95CE0 FFFFFFFF.81E9CB04 LNM$SEARCH_ONE_C+000E4
00000000.7FF95CE8 FFFFFFFF.8007A988 SCH$INTERRUPT+00068
SP =>00000000.7FF95CF0 00000000.00000000
00000000.7FF95CF8 00000000.006080C1
00000000.7FF95D00 FFFFFFFF.80501FDC
00000000.7FF95D08 FFFFFFFF.81A5B720
.
.
.
|
The initial SHOW STACK command contains an address that SDA resolves
into an offset from the PROCESS_MANAGEMENT executive image. The READ
command loads the corresponding symbols into the SDA symbol table such
that the reissue of the SHOW STACK command subsequently identifies the
same location as an offset within a specific process management routine.
REPEAT
Repeats execution of the last command issued. On terminal devices, the
KP0 key performs the same function as the REPEAT command with no
parameter or qualifier.
Format
REPEAT [count|/UNTIL=condition]
Parameter
count
Number of times the previous command is to be repeated. The default is
a single repeat.
Qualifier
/UNTIL=condition
Defines a condition that terminates the REPEAT command. By default,
there is no terminating condition.
Description
The REPEAT command is useful for stepping through a linked list of data
structures, or for examining a sequence of memory locations. When used
with ANALYZE/SYSTEM, it allows the changing state of a system location
or data structure to be monitored.
Examples
1. SDA> SPAWN CREATE SDATEMP.COM
SEARCH 0:3FFFFFFF 12345678
SET PROCESS/NEXT
^Z
SDA> SET PROCESS NULL
SDA> @SDATEMP
SDA> REPEAT/UNTIL = BADPROC
|
This example demonstrates how to search the address space of each
process in a system or dump a given pattern.
2. SDA> SHOW CALL_FRAME
Call Frame Information
----------------------
Stack Frame Procedure Descriptor
Flags: Base Register = FP, Jacket, Native
Procedure Entry: FFFFFFFF.80080CE0 MMG$RETRANGE_C+00180
Return address on stack = FFFFFFFF.8004CF30 EXCEPTION_NPRO+00F30
Registers saved on stack
------------------------
7FF95E80 FFFFFFFF.FFFFFFFD Saved R2
7FF95E88 FFFFFFFF.8042DBC0 Saved R3 EXCEPTION_NPRW+03DC0
7FF95E90 FFFFFFFF.80537240 Saved R4
7FF95E98 00000000.00000000 Saved R5
7FF95EA0 FFFFFFFF.80030960 Saved R6 MMG$IMGRESET_C+00200
7FF95EA8 00000000.7FF95EC0 Saved R7
7FF95EB0 FFFFFFFF.80420E68 Saved R13 MMG$ULKGBLWSL E
7FF95EB8 00000000.7FF95F70 Saved R29
.
.
.
SDA> SHOW CALL_FRAME/NEXT_FP
Call Frame Information
----------------------
Stack Frame Procedure Descriptor
Flags: Base Register = FP, Jacket, Native
Procedure Entry: FFFFFFFF.80F018D0 IMAGE_MANAGEMENT_PRO+078D0
Return address on stack = FFFFFFFF.8004CF30 EXCEPTION_NPRO+00F30
Registers saved on stack
------------------------
7FF95F90 FFFFFFFF.FFFFFFFB Saved R2
7FF95F98 FFFFFFFF.8042DBC0 Saved R3 EXCEPTION_ NPRW+03DC0
7FF95FA0 00000000.00000000 Saved R5
7FF95FA8 00000000.7FF95FC0 Saved R7
7FF95FB0 FFFFFFFF.80EF8D20 Saved R13 ERL$DEVINF O+00C20
7FF95FB8 00000000.7FFA0450 Saved R29
.
.
.
SDA> REPEAT
Call Frame Information
----------------------
Stack Frame Procedure Descriptor
Flags: Base Register = FP, Jacket, Native
Procedure Entry: FFFFFFFF.80F016A0 IMAGE_MANAGEMENT_PRO+076A0
Return address on stack = 00000000.7FF2451C
Registers saved on stack
------------------------
7FFA0470 00000000.7FEEA890 Saved R13
7FFA0478 00000000.7FFA0480 Saved R29
.
.
.
|
The first SHOW CALL_FRAME displays the call frame indicated by the
current FP value. Because the /NEXT_FP qualifier to the instruction
displays the call frame indicated by the saved FP in the current call
frame, you can use the REPEAT command to repeat the SHOW
CALL_FRAME/NEXT_FP command and follow a chain of call frames.
SEARCH
Scans a range of memory locations for all occurrences of a specified
value.
Format
SEARCH [/qualifier] range [=] expression
Parameters
range
Location in memory to be searched. A location can be represented by any
valid SDA expression. To search a range of locations, use the following
syntax:
m:n
|
Range of locations to be searched, from
m to
n
|
m;n
|
Range of locations to be searched, starting at
m and continuing for
n bytes
|
expression
Value for which SDA is to search. SDA evaluates the
expression and searches the specified
range of memory for the resulting value. For a
description of SDA expressions, see Section 2.6.2.
If you do not use an equals sign to separate range and
expression, then you must insert a space between them.
Qualifiers
/LENGTH={QUADWORD|LONGWORD|WORD
|BYTE }
Specifies the size of the expression value that the
SEARCH command uses for matching. If you do not specify the /LENGTH
qualifier, the SEARCH command uses a longword length by default.
/MASK=n
Allows the SEARCH command finer qranularity in its matches. It compares
only the given bits of a byte, word, longword, or quadword. To compare
bits when matching, you set the bits in the mask; to ignore bits when
matching, you clear the bits in the mask.
/PHYSICAL
Specifies that the addresses used to define the range of locations to
be searched are physical addresses.
/STEPS={QUADWORD|LONGWORD|WORD
|BYTE|value }
Specifies the step factor of the search through the specified memory
range. After the SEARCH command has performed the
comparison between the value of expression and memory
location, it adds the specified step factor to the address of the
memory location. The resulting location is the next location to undergo
the comparison. If you do not specify the /STEPS qualifier, the SEARCH
command uses a step factor of a longword.
Description
SEARCH displays each location as each value is found. If you press
Ctrl/T while using the SEARCH command, the system displays how far the
search has progressed. The progress display is always output to the
terminal even if a SET OUTPUT <file> command has previously been
entered.
Examples
#1 |
SDA> SEARCH GB81F0;500 B41B0000
Searching from FFFFFFFF.800B81F0 to FFFFFFFF.800B86EF in LONGWORD steps for B41B0000...
Match at FFFFFFFF.800B86E4 B41B0000
|
This SEARCH command finds the value B41B0000 in the longword at
FFFFFFFF.800B86E4.
#2 |
SDA> SEARCH 80000000;200/STEPS=BYTE 82
Searching from FFFFFFFF.80000000 to FFFFFFFF.800001FF in BYTE steps for 00000082...
Match at FFFFFFFF.8000012C 00000082
|
This SEARCH command finds the value 00000082 in the longword at
FFFFFFFF.8000012C.
#3 |
SDA> SEARCH/LENGTH=WORD 80000000;100 10
Match at FFFFFFFF.80000030 0010
Match at FFFFFFFF.80000040 0010
Match at FFFFFFFF.80000090 0010
Match at FFFFFFFF.800000A0 0010
Match at FFFFFFFF.800000C0 0010
5 matches found
|
This SEARCH command finds the value 0010 in the words at
FFFFFFFF.80000030, FFFFFFFF.80000040, FFFFFFFF.80000090,
FFFFFFFF.800000A0, FFFFFFFF.800000C0.
#4 |
SDA> SEARCH/MASK=FF000000 80000000;40 20000000
Searching from FFFFFFFF.80000000 to FFFFFFFF.8000003F in LONGWORD steps for 20000000...
(Using search mask of FF000000)
Match at FFFFFFFF.80000000 201F0104
Match at FFFFFFFF.80000010 201F0001
2 matches found
|
This SEARCH command finds the value 20 in the upper byte of the
longwords at FFFFFFFF.80000000 and FFFFFFFF.80000010, regardless of the
contents of the lower 3 bytes.
SET CPU
When analyzing a system dump, selects a processor to become the current
CPU for SDA. (You cannot use this command when analyzing the running
system.)
Format
SET CPU cpu-id
Parameter
cpu-id
Numeric value from 0016 to 1F16 indicating the
identity of the processor to be made the current CPU. If you specify a
value outside this range or a cpu-id of a processor
that was not active at the time of the system failure, SDA displays the
following message:
%SDA-E-CPUNOTVLD, CPU not booted or CPU number out of range
|
Qualifiers
None.
Description
When you invoke SDA to examine a system dump, the current CPU context
for SDA defaults to that of the processor that caused the system to
fail. When analyzing a system failure from a multiprocessing system,
you may find it useful to examine the context of another processor in
the configuration.
The SET CPU command changes the current CPU context for SDA to that of
the processor indicated by cpu-id. The CPU specified
by this command becomes the current CPU for SDA until you either exit
from SDA or change the CPU context for SDA by issuing one of the
following commands:
SET CPU cpu-id
SHOW CPU cpu-id
SHOW CRASH
SHOW MACHINE_CHECK cpu-id
The following commands also change the CPU context for SDA if the
process-name, pcb-address, or index
number (nn) refers to a current process:
SET PROCESS process-name
SET PROCESS/ADDRESS=pcb-address
SET PROCESS/INDEX=nn
SHOW PROCESS process-name
SHOW PROCESS/ADDRESS=pcb-address
SHOW PROCESS/INDEX=nn
Changing CPU context can cause an implicit change in process context
under the following circumstances:
- If there is a current process on the CPU made current, SDA changes
its process context to that of that CPU's current process.
- If there is no current process on the CPU made current, the SDA
process context is undefined and no process-specific information is
available until you set the SDA process context to that of a specific
process.
See Section 2.5 for further discussion of the way in which SDA
maintains its context information.
SET ERASE_SCREEN
Enables or disables the automatic clearing of the screen before each
new page of SDA output.
Format
SET ERASE_SCREEN {ON|OFF}
Parameters
ON
Enables the screen to be erased before SDA outputs a new heading. This
setting is the default.
OFF
Disables the erasing of the screen.
Qualifiers
None.
Description
SDA's usual behavior is to erase the screen and then show the data. By
setting the OFF parameter, the clear screen action is
replaced by a blank line. This action does not affect what is written
to a file when the SET LOG or SET OUTPUT commands are used.
Examples
#1 |
SDA> SET ERASE_SCREEN ON
|
The clear screen action is now enabled.
#2 |
SDA> SET ERASE_SCREEN OFF
|
The clear screen action is disabled.
SET FETCH
Sets the default size and access method of address data used when SDA
evaluates an expression that includes the @ unary operator.
Format
SET FETCH [{QUADWORD|LONGWORD|WORD|BYTE}][,][{PHYSICAL|VIRTUAL}]
Parameters
QUADWORD
Sets the default size to 8 bytes.
LONGWORD
Sets the default size to 4 bytes.
WORD
Sets the default size to 2 bytes.
BYTE
Sets the default size to 1 byte.
PHYSICAL
Sets the default access method to physical addresses.
VIRTUAL
Sets the default access method to virtual addresses.
You can specify only one parameter out of each group. If you are
changing both size and access method, separate the two parameters by
spaces or a comma. Include a comma only if you are specifying a
parameter from both groups. See examples 5 and 6.
Qualifiers
None.
Description
Sets the default size and/or default access method of address data used
by the @ unary operator in commands such as EXAMINE and EVALUATE. SDA
uses the current default size unless it is overridden by the ^Q, ^L,
^W, or ^B qualifier on the @ unary operator in an expression. SDA uses
the current default access method unless it is overridden by the ^P or
^V qualifier on the @ unary operator in an expression.
Examples
#1 |
SDA> EXAMINE MMG$GQ_SHARED_VA_PTES
MMG$GQ_SHARED_VA_PTES: FFFFFFFD.FF7FE000 ".`a....."
|
This example shows the location's contents of a 64-bit virtual address.
#2 |
SDA> SET FETCH LONG
SDA> EXAMINE @MMG$GQ_SHARED_VA_PTES
%SDA-E-NOTINPHYS, FFFFFFFF.FF7FE000 : virtual data not in physical memory
|
This example shows a failure because the SET FETCH LONG causes SDA to
assume that it should take the lower 32 bits of the location's contents
as a longword value, sign-extend them, and use that value as an address.
#3 |
SDA> EXAMINE @^QMMG$GQ_SHARED_VA_PTES
FFFFFFFD.FF7FE000: 000001D0.40001119 "...@..."
|
This example shows the correct results by overriding the SET FETCH LONG
with the ^Q qualifier on the @ operator. SDA takes the full 64 bits of
the location's contents and uses that value as an address.
#4 |
SDA> SET FETCH QUAD
SDA> EXAMINE @MMG$GQ_SHARED_VA_PTES
FFFFFFFD.FF7FE000: 000001D0.40001119 "...@..."
|
This example shows the correct results by changing the default fetch
size to a quadword.
#5 |
SDA> SET FETCH PHYSICAL
SDA> EXAMINE /PHYSICAL @0
|
This command uses the contents of the physical location 0 as the
physical address of the location to be examined.
#6 |
SDA> SET FETCH QUADWORD, PHYSICAL
|
This command sets the default fetch size and default access method at
the same time.
SET LOG
Initiates or discontinues the recording of an SDA session in a text
file.
Format
SET [NO]LOG filespec
Parameter
filespec
Name of the file in which you want SDA to log your commands and their
output. The default filespec is
SYS$DISK:[default_dir]filename.LOG, where SYS$DISK and
[default-dir] represent the disk and directory specified in
your last DCL command SET DEFAULT. You must specify a file name.
Qualifiers
None.
Description
The SET LOG command echoes the commands and output of an SDA session to
a log file. The SET NOLOG command terminates this behavior.
The following differences exist between the SET LOG command and the SET
OUTPUT command:
- When logging is in effect, your commands and their results are
still displayed on your terminal. The SET OUTPUT command causes the
displays to be redirected to the output file and they no longer appear
on the screen.
- If an SDA command requires that you press Return to produce
successive screens of display, the log file produced by SET LOG will
record only those screens that are actually displayed. SET OUTPUT,
however, sends the entire output of any SDA commands to its listing
file.
- The SET LOG command produces a log file with a default file type of
.LOG; the SET OUTPUT command produces a listing file whose default file
type is .LIS.
- The SET OUTPUT command can generate a table of contents, each item
of which refers to a display written to its listing file. SET OUTPUT
also produces running heads for each page of output. The SET LOG
command does not produce these items in its log file.
If you use the SET OUTPUT command to redirect output to a listing file,
a SET LOG command to direct the same output to a log file is
ineffective until output is restored to the terminal.
|