01.01.2013 Views

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

SDB ( l ) SDB ( 1)<br />

NAME<br />

sdb - symbolic debugger<br />

SYNOPSIS<br />

sdb [-w] [-W] [ objfil [ corfil [ directory-list ] ] ]<br />

DESCRIPTION<br />

Sdb is a symbolic debugger that can be used with C programs. It<br />

may be used to examine their object files and core files and to provide<br />

a controlled environment for their execution.<br />

Objfil is normally an executable program file which has been compiled<br />

with the -g (debug) option; if it has not been compiled with<br />

the -g option, or if it is not an executable file, the symbolic capabilities<br />

of sdb will be limited, but the file can still be examined<br />

and the program debugged. The default for objfil is a.out.<br />

Corfil is assumed to be a core image file produced after executing<br />

objfil ; the default for corfil is core. The core file need not be<br />

present. A - in place of corfil will force sdb to ignore any core<br />

image file. The colon separated list of directories (directories-list)<br />

is used to locate the source files used to build objfil .<br />

It is useful to know that at any time there is a current line and<br />

current file . If corfil exists then they are initially set to the line<br />

and file containing the source statement at which the process terminated.<br />

Otherwise, they are set to the first line in main(). The<br />

current line and file may be changed with the source file examination<br />

commands.<br />

Initially sdb has a greater-than character ( > ) prompt, which indicates<br />

that sdb is ready for the user to enter the first command.<br />

After sdb has begun, the prompt is < x >, where x is the name of<br />

the last command given.<br />

By default, warnings are provided if the source files used in producing<br />

objfil cannot be found, or are newer than objfil . This<br />

checking feature and the accompanying warnings may be disabled<br />

by the use of the -W flag.<br />

Names of variables are written just as they are in C. Note that<br />

names in C are now of arbitrary length, sdb will no longer truncate<br />

names. Variables local to a procedure may be accessed using<br />

the form procedure :variable. If no procedure name is given, the<br />

procedure containing the current line is used by default.<br />

It is also possible to refer to structure members as<br />

variable .member, pointers to structure members as<br />

variable -> member and array elements as variable [number].<br />

Pointers may be dereferenced by using the form pointer [0]. Combinations<br />

of these forms may also be used. A number may be<br />

used in place of a structure variable name, in which case the<br />

number is viewed as the address of the structure, and the template<br />

used for the structure is that of the last structure referenced<br />

by sdb. An unqualified structure variable may also be used with<br />

various commands. Generally, sdb will interpret a structure as a<br />

set of variables. Thus, sdb will display the values of all the elements<br />

of a structure when it is requested to display a structure.<br />

- 1 -

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!