Tools: MPW
Apple Developer Connection
Advanced Search
Member Login Log In | Not a Member? Support

MPW Command Reference


DumpPEF

Tool

SYNTAX

DumpPEF pefFile… [-a[nnotate] {-v[erbose]}] [-c[heck]] [-cache on | off]
[-cont[ainer] number] [-dialect cpu[,vec[tor]]] [-do all | optLetters]
[-format {-fmt} fmtParams] [-forks whichForks] [-h] [-ibm]
[-loader {-ldr} all | ldrLetters] [-mark] [-maxlines n] [-ntb]
[-o[ffsets]] [-p] [-pi[data] piLetters] [-sect[ion] s] [-stripped]
[-summarize] [-tb] [-u[nmangle]] [-w] [-w601]

DESCRIPTION

The DumpPEF tool validates and displays the contents of PEF files, with each section appropriately formatted and each field annotated according to section type.

DumpPEF can display the contents of a PEF container stored in either the data fork or a resource. DumpPEF can read containers created with ILink, PPCLink, MakeFlat, or MakePEF.

DumpPEF searches the input file for a 'cfrg' resource indicating the location of the containers. If no 'cfrg' resource exists, DumpPEF assumes that the container occupies the entire data fork. If no 'cfrg' resource exists and the data fork is empty, DumpPEF displays an error message and quits.

Any or all sections can be selectively displayed. The validations check all fields that can be reasonably checked. Errors and warnings are reported as part of the standard output. If you specify the -check option, only the validations are performed, without generating any output (errors or warnings resulting from incorrect fields are reported).

DumpPEF reports a warning if a PowerPC code section does not begin on a longword boundary within the container or the file. It also reports a warning if a 68K code section does not begin on a word boundary within the container or the file. A warning is also reported if a "use in place" section is not properly aligned within the container.

INPUT

PEF container files (pefFile). DumpPEF does not read standard input. If no input files are specified, DumpPEF displays help information.

OUTPUT

DumpPEF writes the formatted file structures and disassembled code to standard output.

STATUS

DumpPEF can return the following status codes:

0

no errors

1

error in parameters or options

2

execution error

3

validation errors reported

4

only POWER instruction warnings were reported (-w601 option specified)

-9

user interrupt

PARAMETERS

pefFile

Specifies one or more PEF files to display. DumpPEF can display multiple PEF containers stored within a single file.

OPTIONS

The option descriptions are grouped into the following functional categories:

Processing Control

Disassembly Control

Output Control

Miscellaneous Options

IMPORTANT
For options that have parameters, the bold parameters are the default values that apply if the option is not specified on the command line. For example, in the case of the -do option, the behavior defined by the h and l parameters applies when the -do option is omitted. •

 
Processing Control

These are the main control options that determine what DumpPEF processes.

-c[heck]

Checks (validates) only. All output to the standard output is suppressed. Only errors and warnings, if any, are reported to the diagnostic output.

-cont[ainer] number

Limits the processing to the specified container. Containers are numbered beginning at 1. This option overrides the -forks option.

-do all | optLetters

Processes the specified PEF sections. You specify either all or selected sections using one or more of the following options (optLetters):

h
r
y
a
c | t
d
p
k
x
l
g
e
b

Main header and section headers
'cfrg' and 'rseg' resources
Section header and string table
All raw data sections (except code and data)
Code (text) section
Data section
Pidata section
Constant section
Exec data section
Loader section (headers, relocations, symbols)
Debug section
Exception section
Traceback section

-loader {-ldr} all | ldrLetters

Provides more precise control over loader section processing than the -do l option. You specify either all or selected loader sections using one or more of the following options (ldrLetters):

h
f
i
r
y
t
c
x
n
a

Loader header
Loader import IDs
Loader import symbol table
Loader relocation header and instructions
Loader string table
Loader hash slot table
Loader export chain table
Loader export symbol table
Loader export symbol names
All except export slot and chain tables

Note
The -do l option is implied by using the -loader option. •

-pi[data] piLetters

Provides more precise control over pidata section processing than the -do p option. You specify one or more of the following options (piLetters):

u
v
i

Display the unpacked data produced by the pidata
Vertical pidata display (each repeat on a new line)
Show only the pidata instructions and no encodings

Note
The -do p option is implied by using the -pidata option. •

-forks whichForks

Processes only the containers in the specified forks. You specify one of the following options (whichForks):

resource {rsrc}

Process only containers in the resource fork

data

Process only containers in the data fork

both {all}

Process all containers in both forks

-sect[ion] s

Limits section relative processing to section s, where s is the section number (starting at 0).

 
Disassembly Control

These options control how the disassembly of the code sections is processed.

-dialect cpu[,vec[tor]]

Sets the disassembly dialect to cpu, where cpu is one of the following:

Power {Pwr}

RS/6000 POWER architecture

PowerPC601 {PPC601}

PowerPC 601 architecture

PowerPC32 {PPC32}

32-bit PowerPC architecture

PowerPC64 {PPC64}

64-bit PowerPC architecture

vec[tor]

vector extensions

Except for vector, only one cpu can be specified. Vector may be combined with any of the others (except Power) separated by a comma or used alone when specifying the default dialect. When vector is specified, AltiVec instructions will be disassembled instead of being treated as illegal instructions. A 'V' flag will appear in the flags column to indicate AltiVec instructions.

Note
This option is applicable only to PowerPC code disassembly. •

-format {-fmt} fmtParams

Specifies code section formatting. The fmtParams parameter uses the following syntax:

on[=fmtOptions] | off[=fmtOptions] |
fmtOptions,on | fmtOptions,off

Specifying -format on (or off) in conjunction with any of the fmtOptions parameters listed below disassembles the code section using the specified formatting.

Specifying -format on with no fmtOptions parameters disassembles the code section using the default formatting options (the bold options in the list below). Specifying -format off with no fmtOptions parameters displays the code section in unformatted hexadecimal, which is the default.

You specify the fmtOptions parameter using one or more of the following characters:

d

Show d(RA) displacements in decimal instead of hexadecimal

f

Show fields (for example, shift/rotate constants) in decimal instead
of hexadecimal

h {$}

Show hexadecimal values with a leading $ instead of 0x

i {s}

Show signed immediates in decimal instead of hexadecimal

m

Show hexadecimal with the smallest even number of digits

p

Show PC-relative values in decimal instead of hexadecimal

u

Show unsigned immediates in decimal instead of hexadecimal

x

Show extended mnemonics (except when -dialect is set to Power)

2

Show negative hexadecimal values in two's complement instead
of negated hexadecimal

-ibm

Formats the disassembly using IBM Assembler conventions for comments and directives. The default is to use Apple PowerPC Assembler conventions.

-ntb

Specifies that there are no traceback tables in the code. Normally, an all zero instruction defines where a traceback table begins. If you know there are no traceback tables in the code, use this option to indicate that all data is to be interpreted as instructions and disassembled. Without this option, if DumpPEF encounters data that appears to be a traceback table, it interprets it as such. If the data is not a traceback table, the output may be confusing.

-tb

Displays traceback tables appropriately formatted and annotated. Normally the display of the traceback information is suppressed. Use the -ntb option if you know there are no tracebacks in the code.

 
Output Control

-a[nnotate] {-v[erbose]}

Annotates every PEF field with information appropriate to that field. This annotation, while more informative, causes much more output than the default format. The default format provides most of the same data but annotates it more briefly and displays it in a wider format. The -annotate format is narrower. The -verbose option is a synonym for -annotate, and produces identical output.

-mark

Generates MPW Shell markers on each title in the output. There is no restriction on the standard output file (that is, it can be an open window) other than the fact that markers are not generated to the output file if that output file is also the window from which you initiated the DumpPEF command.

Note
Multiple PEF files can be specified on the command line, there is only one output file, and the titles are always the same for each file. Therefore, to make the markers unique, DumpPEF prefixes the marker names with a file index number. A dividing line is also generated between each file's markers. The index number is just the count of the number of input files processed. •

-maxlines n

Limits all section displays (except headers) to n lines. Only the first n lines of each section are displayed and processed.

-o[ffsets]

Suppresses the display of the PEF file offsets. The default is to show the file offsets at the left edge of the output for every field displayed.

-stripped

Suppresses titles, break lines, summary information, and offsets. This option is not recommended for multiple PEF container files.

-u[nmangle]

Unmangles C++ names. DumpPEF attempts to unmangle symbols from the loader export symbol table, the loader import symbol table, and traceback tables. This option should only be used if the PEF file is from a C++ compiler.

-w

Suppresses warnings. Only error messages, if any, are shown and counted (for the summary).

-w601

Generates explicit warning messages about the use of POWER instructions and PowerPC 601-specific SPRs when the -dialect PowerPC601 option is specified and the code section is disassembled. The default is to generate a flag in the disassembly, but these instructions are always counted to report in the summary that POWER instructions were used. Use this option to find where these instructions exist in the file and what they are, since the disassembled line is always shown with the warning.

 
Miscellaneous Options

-cache on | off

Enables (on) or disables (off) data caching.

-h

Displays a brief summary of DumpPEF options. This option overrides all other options. The help information is also displayed if no PEF files are specified on the command line.

-p

Writes the version and progress information to the diagnostic output file.

-summarize

Displays a summary of the results of processing each file. The summary is sent to the diagnostic output and is always generated if any errors or warnings are reported.

EXAMPLES

The default options process the headers and imports, and the relocations and exports in the loader section. Code sections are not disassembled. The command below processes the file myLibrary according to the default options.

DumpPEF myLibrary > myLib.pef

This is identical to the following command:

DumpPEF myLibrary -do hl -loader hirx -forks both -cache on ∂
-format off > myLib.pef

In the example below, only the library's exports are displayed.

DumpPEF myLibrary -ldr x > myLib.pef

The following command displays the list of import libraries with which the client application (ClientApp) was linked, along with the list of imported symbols.

DumpPEF ClientApp -loader fi > ClientApp.pef

The command below processes the entire file (-do all) for validation purposes only (-check). If there are any errors or warnings, they are written to the diagnostic file. No standard output file is generated.

DumpPEF myLibrary -check -do all

The example below displays all of the 68K and PowerPC code sections in myLibrary in disassembled form instead of unformatted hexadecimal.

DumpPEF myLibrary -do c -format on

You can use the following command to list only the names of the exports in a single library file (singleLibrary). The resulting output can be sorted and used later for verifying that the library exports the desired routines.

DumpPEF singleLibrary -loader n -stripped

Note
The -stripped option should be used only on single PEF container files. •

SEE ALSO

DumpCode

DumpFile

DumpObj

DumpSYM

DumpXCOFF

 
 


Last Updated December 2000