EDB(1) — 5th September 1996
NAME
edb − EPC Interactive Debugger
SYNOPSIS
edb [−?] [−C] [−c core] [−F thread] [−F lwp] [−F fork] [−F nofork] [−F none] [−g] [−P str] [−p str] [−Q install=dir] [−Q gui=program] [−Q help=file] [−Q sb=file] [−Q startup=file] [−s sourcepath] [−softbench] [−x] [−toolkitoption ...] [command-line|PID]
DESCRIPTION
edb is a multi-lingual, interactive, source and machine level debugger implemented by Edinburgh Portable Compilers Ltd. edb is intended to provide support for programmers using EPC’s ANSI C, C++, Modula-2, Pascal-E, Fortran 77 and Fortran 90 compilers. However, on Unix SVR4 platforms, edb may work with other vendors’ compilers provided they generate debugging information in Dwarf 1 format.
When invoked with the -g command line switch, edb presents a graphical user interface for interacting with the debugger. When invoked, it creates an initial window, from which the debugging session can be initiated. An online help facility is available within the graphical user interface. The graphical user interface requires an X server to be running on the display machine. Without the -g switch, edb presents a conventional command line interface, and executes commands from standard input.
Both forms of the edb command may be followed by an optional list of arguments, [command-line|PID]. If the first argument is a number it is interpreted as a process id and edb will attempt to attach to the process. Otherwise this argument is interpreted as the name of an executable program to be debugged and edb will load this file when it starts up, passing to it the remaining aguments. In command line mode, if no argument is given, edb will attempt to load a.out. Programs to be debugged should be compiled with the -g option.
edb can trace multiple processes and multiple threads in a single process.
In the default mode the threads made visible to the user will be the initial thread created by fork and threads created by the threads library call thr_create. The library’s internal threads will not be made visible and nor will the underlying LWPs (Light Weight Processes).
The -Flwp command line switch changes the behaviour of the debugger to trace LWPs instead of threads. In this mode all LWPs are visible and an LWP is treated in a similar manner to a thread in the default mode.
OPTIONS
−? Print help information on command line options.
−C Analyse the most recent core image file named core.pid. If this file was generated by a previous failure in progfile, then edb can be used to examine the state of the program when the core image file was generated.
−c core Specify the name of a core image file to be examined.
−F thread
Follow threads (the default).
−F lwp
Follow LWPs.
−F fork
Follow child processes. This sets the initial value of the fork option to 1 (see the edb option command below).
−F nofork
Do not follow child processes (the default).
−F none
Only follow the initial LWP and do not follow child processes.
−g Use the graphical interface for interacting with the debugger. This requires that an X server be running on the machine that will display the graphical user interface. Standard X Toolkit options may be used with the -g option in addition to other edb options.
−P str Reserved for use by EPC.
−p str Specify a string str to be used as the command line prompt.
−Qinstall=dir
Tell edb that it has been installed somewhere other than the default location. edb will look for the help file and default start-up file beneath the directory dir. See the installation note for a detailed description of installation options.
−Qgui=file
Specify the graphical user interface program used with the -g option.
−Qhelp=file
Specify a help file. edb will look in this file for the text of the help command.
−Qsb=file
Specify the name of the softbench interface shared library.
−Qstartup=file
Specify the name of the default start-up file. edb will execute the commands in this file if the file .edbrc does not exist in the user’s home directory and the -x option has not been specified.
−s sourcepath
Specify an initial value for the sourcepath option (see the edb option command below). This is a search path for source files specified as a colon-separated list of directories.
−softbench
Attempt to open a connection to a Softbench message server. edb supports the Softbench DEBUG message set.
−x Suppress reading the command start-up files.
START-UP
The following things happen when the command line debugger starts up.
If a process id was given as a command line argument edb attempts to attach to that process. Otherwise if an executable was specified edb will attempt to load the file. If no argument is given edb will attempt to load a.out.
If the -c or the -C option has been specified and an executable has been loaded, edb attempts to analyse the core file.
If the file edbrc exists in the current directory and the -x option has not been specified, edb executes the commands in this file.
If the file .edbrc exists in the user’s home directory and the -x option has not been specified, edb executes the commands in this file. If the file .edbrc does not exist in the user’s home directory and the -x option has not been specified, edb executes the commands in the default start-up file.
In command line mode, during normal processing edb executes commands from the standard input.
edb operates in an asynchronous manner: threads and processes may be set running in the background, enabling the user to continue to interact with other threads and processes. Individual threads in a process may be set running while others are held in a stopped state. It is not possible to inspect the registers of a thread that is running. It is not be possible to set running a thread which is not currently running on an LWP. However the registers and local data of such threads may still be inspected.
USAGE
Entering Command Lines
edb command lines normally consist of a command terminated by a newline character. However, if the last character is \ (backslash) then the command line is continued on the following line.
Multiple commands can be entered on a single line by separating them with a ";" character. The commands are then executed sequentially. It is also possible to group commands into a single compound command by enclosing them within braces { ... }. This facility is particularly useful in do clauses (see the trace and break commands).
If an empty command line is entered, by pressing RETURN in response to the edb command prompt, then all commands on the previous command line are repeated.
An escape to the UNIX shell can be made by prefixing a command line with a shell escape character, usually "!". The shell that is chosen is determined from the value of the $SHELL environment variable. If this is not set, then the default shell is the Bourne shell sh. The choice of shell escape character can be set by the option shellchar command.
A command line starting with a # (hash) character is treated as a comment. The remainder of the command line up to and including the terminating newline character is ignored. It is also possible to append a comment to a command line provided the last command is terminated with a semicolon.
Specifying Locations
A number of edb commands require a location to be specified. A location can identify a source-line (a line in the source code), a function-name or a code-address.
A source-line can take the following forms:
line-numbera line in the current file
"file-name" : line-numbera line in the named file
file-name : line-numbera line in the named file
"file-name"first line in the named file
.the current line
$last line in the current file
/ pattern /next line matching pattern
? pattern ?previous line matching pattern
A source-line can be followed by a signed integer which gives a
relative displacement. For example, $-100 means 100 lines from
the bottom of the current file.
A function-name specifies a function in the program. If the
name is not visible in the current scope it can be prefixed by a
file name or a class name. A function-name can take the
following forms:
function-namemeaning
mainfunction main
’_start’function _start
dump.c:printfunction print in file dump.c
"message.c".’show’function show in file message.c
Example::ffunction f member of class Example
A code-address refers to a machine instruction and takes the
following forms:
[∗]hexadecimal-integerabsolute address
∗integerabsolute address
∗.address of the current instruction
∗( expression )expression evaluates to address
Specifying Processes and Threads
Certain commands will accept a job-list which specifies
the processes and threads to which the command applies.
A job list is a list of job numbers.
%pall threads in process p
%p.tthread t in process p
e.g.break %1 %2.1 %2.2 at 10
Execution and Tracing Commands
run [ arguments [ redirections ] ] [ & ]
Start (or restart) executing the current program. All existing jobs
are destroyed.
If arguments are supplied they are passed to the program. If redirections
are supplied edb attempts to emulate a Bourne shell. If neither
arguments nor redirections are supplied, those supplied in the
previous use of run or create will be reused.
edb supports the following redirections:
<fileget standard input from file
>filewrite standard output to file
>>fileappend standard output to file
<&nget standard input from file with descriptor n
>&nwrite standard output to file with descriptor n
<&-close standard input
>&-close standard output
If any of the above is preceded by a digit, the file descriptor
which will be associated with the file is that specified by the
digit (instead of the default 0 or 1). For example, 2>&1
associates file descriptor 2 with the file currently associated
with file descriptor 1. Redirections are evaluated from left to
right.
If & is typed at the end of the command it is run in the background.
The user may continue to type commands at the command line and interact
with other jobs.
load command-line
load prepares a new program for debugging and begins
executing it. exec-file contains the program. load causes edb
to erase all known
break, trace and watch events
and to erase
its context history. The command context is reset to correspond
to the start of the main program.
create [command-line]
Causes the command line to be executed and gains control of the resulting
process, leaving it in a stopped state. If the command line is not
present the command line from the previous create or load and
run commands is used.
By default all existing jobs are destroyed, but when the killoncreate option
is set to 0 (see below) existing jobs are not affected.
attach PID
Gains control of the process denoted by PID and stops all threads in the process.
By default all existing jobs are destroyed, but when the killoncreate option
is set to 0 (see below) existing jobs are not affected.
attach exec-file core-file
Recreates a dead process from the files.
By default all existing jobs are destroyed, but when the killoncreate option
is set to 0 (see below) existing jobs are not affected.
break [job ...] [once]
[if expression] [ignore count] [do command]
break [job ...] [once] [at|in] source−line
[if expression] [ignore count] [do command]
break [job ...] [once] [at|in] code−address
[if expression] [ignore count] [do command]
break [job ...] [once] [at|in] function−name
[if expression] [ignore count] [do command]
The break command sets a break point at a location in the
program and specifies an associated event. The event occurs
when execution has reached the location and expression evaluates
to true (or non-zero). Execution will stop when the specified
event occurs.
If the keyword ignore appears, then the first count times the
event occurs it is ignored, and execution does not stop.
If the keyword once appears, then a temporary break point is
set. The break point is erased as soon as the event occurs.
If no job list appears, the break point is set for all processes
and threads
running the current program; otherwise it is only set for the specified
processes and threads.
The location can be specified as a source-line,
a function-name or a code-address:
•If the argument is a source-line, then the break point is
set at the first instruction corresponding to the source
line. If there are many instances of the source line, for example if
it is in a file included many times, a break point is set on the first
instruction of each instance.
•If the argument is a function-name, then the break point is
set at the first instruction after the function prologue
code. If the function is a C++ virtual function then the break point will
be set on the function in all derived classes. If the function name is
overloaded then the break point will be set on all functions in the set
of overloaded names. Break points may be set on inlined functions.
•If the argument is a code-address, then the break
point is set at that address.
If no location is specified, the break point is set at the
current line or instruction.
If the "if expression" clause is omitted then "if true" is
implied.
If the "do command" clause is present, command
(an edb command) is executed each time the event occurs,
i.e. after a job execution has stopped.
trace [job ...] [once]
[if expression] [ignore count] [do command]
trace [job ...] [once] [at|in] source−line
[if expression] [ignore count] [do command]
trace [job ...] [once] [at|in] code−address
[if expression] [ignore count] [do command]
trace [job ...] [once] [at|in] function−name
[if expression] [ignore count] [do command]
The trace command has the same syntax as the break command and
includes optional clauses specifying a location, a condition,
and a command.
The trace command sets a trace point in the program and
specifies an associated event. When the event occurs, a line of
tracing is printed and execution continues. The event will
occur when execution reaches location and expression evaluates
to true (or non-zero).
If the if-clause is omitted then "if true" is implied.
If the keyword ignore appears, then the first count times the
event occurs it is ignored, and the tracing is not printed.
If the keyword once appears, then a temporary trace point is
set. The trace point is erased as soon as the event occurs.
If a do-clause is present, command (an edb command) is
executed each time the event occurs, after the line of tracing has been
printed.
If no job list appears, the trace is set for processes
and threads
running the current program; otherwise it is only set for the specified
jobs.
The form of tracing depends upon location:
•If location specifies a function, edb will print the name
and parameters of the function.
•If location specifies a source line, the corresponding line
is printed.
•If location specifies an instruction address, the
corresponding disassembled instruction is printed.
watch expression
The watch command sets a watch point on an expression;
execution of any job running the current program
will stop when the
value of the expression changes.
The expression is interpreted as a series of memory regions
which are to be watched; the watch event occurs when the value
of any of these regions changes. Each region corresponds to a
variable in the expression; the mapping from variables to
regions is carried out when the watch command is given.
erase [job ...] [event-number ... ]
The break, trace and watch
points identified with the specified
event numbers are erased. If no event numbers are given then
every active break and trace point is erased. Event numbers are
printed when the break or trace point is set, when the
associated event occurs, and by the events command.
If a job list appears the events are only erased from the specified jobs,
otherwise they are erased from all jobs.
events
Display the locations of all active
break, trace and watch
points and their associated event numbers.
continue [job ...] [ & ]
The continue command resumes execution of the specified
jobs
after they have been stopped by a break
or watch
event, a signal, or a step,
or after a create or attach command. Execution always resumes from the point
at which it was suspended.
If no
job
is specified then the current
job
is restarted.
When & appears at the end of the command the jobs to which the command
applies are run in the background.
The user may continue to type commands at the command line and interact
with other jobs.
step [job] [count]
step over [job] [count]
Execute the specified job a step at a time. In source mode, the step
command executes a step corresponding to at least one line of
source code. In machine mode, the program is stepped by a
single instruction.
If the step over form is used in either mode, a function call
encountered during execution of the program is executed as if it
were a single line or instruction. If the step form is used
then stepping goes into the function.
If count is given, count lines or instructions are stepped.
return function-name
return frame-number
return +increment
return -increment
return [ & ]
The return command causes the current job to be continued until the
activation at the specified stack frame terminates. If a
function name is specified then the return command completes
once the most recent activation of the function has terminated.
If no frame specifier is given then the current frame is
assumed.
display expression
The display command adds the expression to the list
of expressions whose values are to be displayed each time
edb stops.
undisplay display-number
undisplay expression
The undisplay command instructs edb that the given expression
is to be removed from the list of expressions whose values are
displayed each time edb stops. Where a display-number is given
instead of an expression then it is the expression associated
with the display-number which is removed from the list.
info display
The info display command will list all the expressions whose
values are to be displayed each time edb stops.
info break
The info break command will display the locations of all
active break, trace and watch points and their associated
event numbers.
catch [ job ... ] signal [ signal ... ]
catch [ job ... ] syscall [ syscall ... ]
catch [ job ... ]
The catch command nominates Unix signals to be caught by edb.
When a signal is raised the receiving
thread or
process is stopped as if a
break point had been reached. The signal is received by the process
or thread
once the job is restarted unless it was cleared by a cancel
command.
The catch command can also be used to cause jobs to stop on certain system
calls. The following system calls are permitted:
exec, fork,
thread_create and _lwp_create. create may also be used as
an alias for _lwp_create when the -Flwp command line switch
was used or thread_create otherwise.
If the job list appears, the settings of signals or calls are changed for
the specified jobs; otherwise they are changed
for all jobs running the current program.
The catch command with no signal or system call arguments displays
the names of all signals and system calls that will be caught for the
specified jobs, or for the current job.
By default all signals are caught, except SIGCONT, SIGCHLD,
SIGALRM,
SIGHUP, SIGKILL and SIGWAITING.
By default exec and fork are
caught and thread_create and _lwp_create are ignored.
ignore [ job ... ] signal [ signal ... ]
ignore [ job ... ] syscall [ syscall ... ]
ignore [ job ... ]
The ignore command nominates Unix signals to be ignored by edb.
When the signal is raised, it is ignored by edb and handled as
required by the receiving
process or thread.
The ignore command can also be used to cause jobs not to stop on certain
system calls. The following system calls are permitted:
exec, fork,
thread_create and _lwp_create. create may also be used as
an alias for _lwp_create when the -Flwp command line switch
was used or thread_create otherwise.
If the job list appears, the settings of signals or system calls are changed for
the specified jobs; otherwise they are changed
for all jobs running the current program.
The ignore command with no signal arguments displays the names of all
signals and system calls that will be ignored for the specified jobs, or for the
current job.
cancel
The cancel command prevents the signal which stopped the current job
from being delivered to the job when it is restarted.
signals
The signals command displays all signals and whether they are
being caught or ignored by the current job. It also indicates
whether the signals are masked or pending.
kill [ job ... ] [ signal ]
Sends signal to the specified
jobs.
Defaults to SIGKILL and the current
job.
If any
job
that is to receive the signal is stopped it will be restarted
before the signal is sent.
halt [ job ... ]
Causes the specified running
jobs
to stop. Defaults to the current
job.
An error is reported if the job list contains a multi-threaded job.
detach [ job ... ]
The specified
jobs
are released to run on untraced.
These may be either threads or processes.
Defaults to the current job.
Command Context
All edb commands execute in a command context. This context
includes:
•The desired debugging mode: source or machine mode.
•An actual debugging mode which will be used for subsequent commands.
•The current job, which embraces the idea of a current process and a current thread.
•The current program source file. Typically this is a component of
the program being debugged, but it need not be so.
•The current line in the current file.
•The current source language.
•The current function and associated scope.
•The current machine instruction.
•The current stack frame.
Not all the components of the context need be present.
edb
has a number of commands for changing the current context.
When one component of the context is changed,
edb
automatically updates
the others to maintain internal consistency. For example,
frame +1
changes the current function to its immediate caller. The
function, stack frame, scope, language and file components of
the context are all recomputed accordingly. A subsequent
print
command operates in the new context and displays values of
variables in the caller’s stack frame.
The command context can be changed by a number of context
modifier commands. When the context changes, the current
context is pushed onto a history stack. Previous command
contexts can be recovered by the restore command. The history
is erased following each break in execution and reinitialised
with the current execution context as its initial entry. The
option context command may be used to set the size of the
context history, and the context command may be used to display
the contents of the history.
source
The source command instructs edb to function as a source level
debugger. In this mode edb will display all information
relating to the program in high level language terms. However,
if the current context does not provide the required language
information the actual mode will be machine mode. This can
occur when the program executes a function in a file that was
compiled without generating debug information. The source
command sets the desired mode even if it cannot change the
actual mode.
machine
The machine command instructs edb to function as a machine level
debugger. In this mode, edb displays register contents and
machine instructions. In machine mode it is still possible to
view source files with the list command. The machine command
sets the desired mode even if it cannot change the actual mode.
[job] job
job
The job command changes the current
process and thread,
and derives a new command context from it.
A job number of the form %p will set the current job to the
single threaded
process p,
and a number of the form %p.t will set the
current job to thread t in the multi-threaded process p,
where
t andp are numbers
allocated by edb and announced to the user at job creation time.
job without any job number prints the number of the current job.
When a job number is given the keyword job is optional.
When the current job is changed, either by the job command or by
restoring a context variable, the context history is cleared.
Thus a context containing a job cannot
exist after the job has disappeared.
jobs
Prints the execution context of all jobs known to edb.
file "file-name"
file
With an argument, the file command sets the current source file
to the named source file. The current line is set to the first
line in the file. A new command context is derived from the new
source file. The actual mode becomes source mode; the desired
mode is not changed.
Without an argument, the file command displays the path name of
the current file.
The quotes around the file-name are optional in the file command.
line source-line
line
With an argument, the line command sets the current line to
source-line. If source-line includes a file name, the current
file is changed as well. A new command context is derived from
the new current line. The actual mode becomes source mode; the
desired mode is not changed.
Without an argument, the line command displays the current file
name and source line number.
instruction code-address
instruction
With an argument, the instruction command sets the current
instruction to that specified by code-address. A new command
context is derived from the new instruction. The actual mode
becomes machine mode; the desired mode is not changed.
Without an argument, the instruction command displays the
address of the current instruction.
function function-name
function
With an argument, the function command sets the current function
to the named function. A new command context is derived from
the new function.
Without an argument, the function command displays the current
function name.
frame frame-number
frame +increment
frame −increment
frame
With an argument, the frame command sets the current stack frame
to the numbered frame, or to a frame relative to the current
frame. A new command context is derived from the new stack
frame.
If no argument is given, the current stack frame is displayed.
By convention, stack frames are numbered from one upwards, with
the lowest numbers belonging to the newest frames. Each stack
frame identifies a function activation. The frame numbers of
all active functions are
displayed by the stack command.
stack
The stack command displays a stack trace giving frame numbers,
function names and arguments for each stack frame. The current
frame is highlighted.
Optionally the stack trace includes the location of the call that is
in effect. See option stackloc below.
restore
restore number
Command contexts stored in the context history. When the
context is recovered from the history, all more recent entries
are erased. A restore command with no argument restores the
previous command context.
context
The context command displays the current
context history with numbers that may be used in the restore command.
Printing Variables and Listing Code
print
print expression
print/format expression
The print command evaluates the expression in the current
context and prints its value. The value is displayed in source
language terms in an appropriate default format, or in a
specified format.
In source mode, if no expression is supplied, print outputs the
value of every variable local to the current scope.
In machine mode, if no expression is supplied, print outputs the
contents of the machine registers.
When a format is supplied, the value is displayed accordingly.
A format can only be used with values of specific size. The
permitted formats and sizes are as follows:
formatinterpretationsizes (bytes)
cASCII character1, 2, 4
dsigned decimal1, 2, 4
uunsigned decimal1, 2, 4
ounsigned octal1, 2, 4
xunsigned hexany
ffloating point4, 8, 16
gfloating point4, 8, 16
psymbolic address4
spointer to C string4
cstrC stringany
vstrvariable length stringany
fstrfixed length stringany
fcbPascal-E file control blockany
info locals
The info locals command will display the value of every
variable local to the current scope.
dump/format[count][size] expression
dump expression
The dump command displays memory locations in a specified
format. No spaces may appear between format, count and size.
The start address of the memory area to be displayed is
determined by the value of expression. dump then
displays count
blocks of memory, each of the given size. The default value for
count is 1. The default value for size is dependent
on format.
When format is left out a default format of x1w is assumed.
The number of data items printed on each line may be set by the edb
dumpwidth option (see below).
The following formats and size codes are available:
formatinterpretationsizesdefault
cASCII characterb, h, wb
dsigned decimalb, h, ww
uunsigned decimalb, h, ww
ounsigned octalb, h, ww
xunsigned hexb, h, w, d, ew
ffloating pointw, d, ew
gfloating pointw, d, ed
psymbolic addressww
sC string
cstrC string
vstrvariable length string
fstrfixed length string
idisassemble count instrs
Idisassemble count bytes
where
b represents a byte
h represents a half word
w represents a word
d represents a double word
e represents a quad word
xdump expression
The xdump command displays memory locations as hexadecimal ans ascii. The start address of the memory area to be displayed is determined by the value of expression.
The number of lines produced by the xdump command may be set by the edb xdumplines option (see below).
list source-line [, count]
list code-address [, count]
list function-name [, count]
The list command lists a number of source lines starting at a specified source-line location, or disassembles instructions starting at a specified code-address location. If the location is a function-name then source lines will be displayed if edb is in source mode and if the function can be identified in a known source file. Otherwise, the list command disassembles instructions starting at the function’s entry point.
When no location is specified, list displays source lines or machine instructions starting at the current line or instruction, according to whether the mode is "source" or "machine".
The last line or instruction listed becomes the new current location and a new command context is derived from it.
show
show identifier
The show command displays the meanings of identifiers. When an identifier is given, edb displays information that applies in the current context, in terms of the current source language. If no argument is given edb displays information about all identifiers local to the current scope.
Miscellaneous Commands
help
The help command provides minimal help information on edb commands. It is intended as an easily accessible aid for occasional users. For more detailed information look in the edb User’s Reference Manual.
set edb-var = expression
set edb-var
set
edb maintains a set of variables which may be used to store values. An edb variable is identified by its name, which must begin with a "$" character. Values are stored in edb variables by the set command. The first form of the set command assigns a value to an edb variable. The second form displays the current value of a specified edb variable. The third form (no parameters) displays the current values of all edb variables currently defined.
exec statement
The exec command executes statement, a source language statement, in the current context. In this version of edb, only assignment statements are supported.
alias name "definition"
alias name
alias
unalias name
These commands allow aliases to be constructed for edb commands. Once a name has been defined in an alias command, when that name occurs as the first word of a command to edb it is replaced by definition prior to the command being obeyed. When an alias is expanded it is reanalysed for other aliases, which will also be expanded provided recursion does not occur.
An alias command with a name and definition defines (or redefines) that name.
An alias command with only the name displays its current definition.
An alias command without parameters displays the definitions of all aliases.
An unalias command removes the definition of the name.
read path-name
write path-name
The read and write commands are used to read command lines from, and write command lines to, a named file.
The read command can be used to load a set of predefined aliases.
The write command writes to the file all previous command lines obeyed by edb in the current session. The file may be read at the start of another edb session in order to return quickly to the current state.
make arguments
Calls the make command, passing to it any arguments which are specified. If any errors are found, these will be listed in a numbered list after the unprocessed output from the command. If the executable currently being debugged has been updated, the new version of the executable is automatically loaded into edb and any breakpoints reinstalled.
The maximum number of errors listed is controlled by the edb maxerrors option (see below), which defaults to 10. The choice of make program is controlled by the edb make option (see below), which defaults to make.
The list of errors is generated by processing the output of the make command. The internal filter is able to understand error messages generated by most UNIX C compilers and by all EPC compilers when invoked with the -cerrs command line switch. Should it be necessary to recognise some other error message format the internal filter can be replaced by a program specified with by the edb errorfilter option (see below).
The errorfilter program must accept the output from make on its standard input and generate on its standard output a sequence of three line for each error. The first line contains the filename, the second the line number and the third the error message. Spaces are interpreted as part of the filename and must not appear in the line number.
edit
edit "filename"
edit "filename":line
edit function-name
edit number
The edit command invokes an editor. If no arguments are supplied, the source file which constitutes the current context is edited. Supplying a location as a "filename", source-line, or function-name causes the source file for that part of the program to be edited. If a previous make command produced one or more errors, supplying the number of the appropriate error, as given by the make command, will start an edit with the cursor at the line at which the error occurred. The choice of editor is controlled by the edb editor option (see below), which defaults to the setting of the $EDITOR environment variable. If this is not set, the default is vi.
setenv environment-variable value
Sets the value of a variable in the environment passed to the processes created by the run and create commands.
setenv environment-variable
Displays the value of an envirionment variable.
setenv
Displays all envirionment variables.
unsetenv environment-variable
Removes an environment variable.
option name "string"
option name "integer"
option name
option
edb control options can be set or displayed with the option command. edb has several options which are identified by predefined names. Each option has a value, which is either a string or an integer.
An option command with a name and value sets the named option.
An option command with only the name displays its current value.
An option command without parameters displays the values of all options.
The option names and their default settings are shown below.
NameDefault ValueFunction
context40
The size of context history.
Items printed per line by the dump command.
The default editor.
A program to process error messages
from the make command.
Whether child processes will be controlled when a process
already being debugged forks.
When set to a non-zero value this feature is enabled.
Whether the attach and create commands to kill
cause existing processes to be killed.
The default no of lines displayed by the list command.
The number of errors listed by the make command.
The prompt for command lines.
The prompt for continuation lines.
The shell used by shell escape commands.
The character which indicates a shell escape command.
The search path for source files. The path is specified
as a colon-separated list of directories.
If "+" is the first letter in the path
the remainder is appended to the current path.
Whether the stack command displays location information. When set to a non-zero
value the output of the stack command will contain the source line or
address of the call that is in effect.
The no of lines displayed by the xdump command.
dumpwidth1
editor"vi"
errorfilter""
fork0
killoncreate1
listlines10
maxerrors10
prompt"<edb>"
prompt2">"
shell"sh"
shellchar"!"
sourcepath""
stackloc0
xdumplines10
[ repeat ]
The repeat command repeats the previous command line. All
repeated commands have the same effect except list and dump,
which take effect from the last line or instruction displayed.
When commands are entered from the terminal you can repeat the
previous command line simply by pressing the RETURN key. The
empty line is expanded to a repeat command. An empty line in a
command file written by write is expanded to repeat in the file.
quit
The quit command terminates edb and any object program under its
control.
Expressions
The arguments expected by certain edb commands depend upon the
language that is appropriate to the current command context.
For example, when the current language is C and edb is
operating in source mode, expressions in the print command
should also be written in C.
This version of edb provides support for the ANSI C, C++,
Modula-2, Pascal-E, Fortran 77 and Fortran 90 programming languages.
When operating in machine mode expressions and statements are written in
a special assembly level language designed for the particular hardware
platform. This language is like C in that most C operators are
accepted. However all identifiers are considered to be labels, that is
address constants. As in assembler all references to memory must be
explicit.
The identifiers that are visible in machine mode are those identifiers
that appear in the object program’s symbol tables rather than in its debugging
tables. These identifiers may be rather different from the
corresponding identifier in source mode; for example in machine
mode C++ mangled names must be used.
For full details of the supported syntax for expressions refer to
the edb User’s Reference Manual.
RESOURCES
This section describes X11 resources which can be used to alter the appearance and behaviour of edb’s graphical user interface. These may be set in your .Xdefaults file or defined in a system wide resource file. The distributed resource file contains appropriate settings for all of them and includes suggested alternatives for various modes of operation as comments.
Each resource should be preceded by "Edb∗" and followed by ":" and the desired value. For example to configure edb to start up with a stack pane put the following line in your .Xdefaults file:
Edb∗stackPaneToggle.set: True
Fonts
Best effects are obtained using non-proportional fonts
baseFontbase pane labels and job list
viewerFontviewer pane contents and labels
helpFontthe help dialogs
dialogSmallFontsignals and registers dialog
dialogFontall other dialogs
Colours and Shading
The edb graphical user interface is constructed from standard Motif widgets.
So a user who has a knowledge of Motif widgets and an hour or two to spare
should be able to set up the colours to their own satisfaction.
For the rest of us, the distributed resource file,
/usr/lib/X11/app-defaults/Edb,
contains entries to set
the colour and shading of the graphical user interface. As shipped these
entries are all commented out because colours tend to look different on every
screen and setup must be tuned for the screen you are using.
Consequently many users
like to set colour resources globally across all applications using the
same widget set.
Application Resources
The following application resources can be used control how the stack
is displayed.
stackGlobalToLocal
determines the frame order in the stack pane
determines whether arguments are included in the stack display
determines whether qualified names are included in the stack display
stackShowArguments
stackQualifiedNames
The following can be used to control the editor invoked by the
edit command. These may
useXterm
determines whether the editor is run in an xterm
the xterm command used
the edit command used
command change current line
xtermCommand
editCommand
gotoLine
Sizes
The initial size and width of the various graphical elements
can be specified using the following
jobList.width
jobList.visibleItemCount
depth of the job list
width of the command input field and thus of the viewer
depth of the source pane
depth of the data pane
depth of the stack pane
depth of the command pane
width of the context dialog file entry thus width of the dialog
viewerCommandInput.columns
viewerSource.rows
viewerData.visibleItemCount
viewerStack.visibleItemCount
viewerCommand.rows
contextDialog.columns
Configuration
The initial layout and configuration can be specified by the
following
viewerSource.scrollHorizontal
viewerCommand.scrollHorizontal
viewerCommand.wordWrap
If specified, the horizontal scroll bars are present whether or not they are needed. In the case of the command pane, the word wrapping resource is ignored if the scroll bar is present. Note that edb wraps command pane output according to the current width of the pane; the behaviour specified by these two resources affects only those elements which edb chooses not to wrap.
The toggles in the viewer toggle-bar, and thus the initial configuration of panes and auxiliary dialogs can be set using the following
sourcePaneToggle.set
disassemblyToggle.set
dataPaneToggle.set
stackPaneToggle.set
labelsToggle.set
contextDialogToggle.set
registersDialogToggle.set
The layout of the viewer push buttons can be specified using
viewer∗buttonBox.numColumns
FILES
bin/edbthe debugger
./edbrcproject start-up command file
$HOME/.edbrcuser start-up command file
lib/edbrcdefault user start-up file
lib/edbhelphelp command text
lib/edbtoolgraphical user interface program
/usr/lib/X11/app-defaults/Edbdefault resource file for edbtool
EPC — EPC Interactive Debugger