Sun Microsystems Sun Workstation 100U System Manager's Manual page 160

Table of Contents

Advertisement

ADBGEN(8)
MAINTENANCE COMMANDS
ADBGEN(8)
NAME
adbgen - generate adb script
SYNOPSIS
/ulr/nb/adb/adblen file.adb ...
DESCRIPTION
Adbgen makes it possible to write odb(l) scripts that do not contain hard-coded dependencies on
structure member offsets. The input to odbgen is a file named file.adb which contains odbgen
header inrormation, then a null line, then the name or a structure, and finally an odb script.
Adbgen only deals with one structure per file; all member names are assumed to be in this struc-
ture. The output of odbgen is an odb script in file. Adbgen operates by generating a C program
which determines structure member offsets and sizes, which in turn generates the odb script.
The header lines, up to the null line, are copied verbatum into the generated C program. Typi-
cally these include C #1nelude statements to include the header files containing the relevant
structure declarations.
The otlb script part may contain any valid tJdb commands (see tJdb(l)), and may also contain
odbgen requests, each enclosed in {}s. Request types are:
1
Print a structure member. The request form is {memberJormot}. Member is a member
name of the 8tructure given earlier, and format is any valid odb format request. For
example, to print the p-pid field of the proc structure as a decimal number, you would
write {p...,pld,d}.
2
Reference a structure member. The request form is {·member,bo8e}. Member is the
member name whose value is desired, and b08e is an odb register name which contains the
base address of the structure. For example, to get the p"'pid field of the proc structure,
you would get the proc structure address in an odb register, say <f, and write
{·p...,pld,<f}.
3
Tell odbgen that the offset is ok. The request rorm is
{OFFSETOK}.
This is userul
after invoking another odb script which moves the odb dot.
4
Get the ,size 01 the 8tructure. The request form
is
{SIZEOF}.
Adbgen replaces this
request with the size or the structure. This is userul in incrementing a pointer to step
through an array of structures.
5
Get the offset to the end of the structure. The request form
is
{END}.
This is userul at
the end of the structure to get tJdb to align the dot for printing the next structure
member.
Adbgen keeps track or the movement of the odb dot and emits odb code to move forward or back-
ward as necessary before printing any structure member in a script. Adbgen's model of the
behavior of odb's dot is simple: it is assumed that the first line of the script is of the form
8trucCoddre88/ odb text and that subsequent lines are of the rorm
+ /
odb text. This causes the
odb dot to move in a sane rashion. Adbgen does not check the script to ensure that these limita-
tions are met. Adbgen also checks the size or the structure member against the size of the odb for-
mat code and warns you if they are not equal.
EXAMPLE
If there were an include file x.h which contained:
struct x {
char
·x_cp;
char
x_c;
int
x_i;
};
Sun
Rele~,
1.1
Last change: 10 November 1983
5

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sun workstation 150u

Table of Contents