The most usual way to start @value{GDBN} is with one argument,
specifying an executable program:
-@example
+@smallexample
@value{GDBP} @var{program}
-@end example
+@end smallexample
@noindent
You can also start with both an executable program and a core file
specified:
-@example
+@smallexample
@value{GDBP} @var{program} @var{core}
-@end example
+@end smallexample
You can, instead, specify a process ID as a second argument, if you want
to debug a running process:
-@example
+@smallexample
@value{GDBP} @var{program} 1234
-@end example
+@end smallexample
@noindent
would attach @value{GDBN} to process @code{1234} (unless you also have a file
You can optionally have @code{@value{GDBP}} pass any arguments after the
executable file to the inferior using @code{--args}. This option stops
option processing.
-@example
+@smallexample
gdb --args gcc -O2 -c foo.c
-@end example
+@end smallexample
This will cause @code{@value{GDBP}} to debug @code{gcc}, and to set
@code{gcc}'s command-line arguments (@pxref{Arguments}) to @samp{-O2 -c foo.c}.
@noindent
Type
-@example
+@smallexample
@value{GDBP} -help
-@end example
+@end smallexample
@noindent
to display all available options and briefly describe their use
on @file{.syms} files.) A simple @value{GDBN} invocation to do nothing
but build a @file{.syms} file for future use is:
-@example
+@smallexample
gdb -batch -nx -mapped -readnow programname
-@end example
+@end smallexample
@node Mode Options
@subsection Choosing modes
example to download and run a program on another computer; in order to
make this more useful, the message
-@example
+@smallexample
Program exited normally.
-@end example
+@end smallexample
@noindent
(which is ordinarily issued whenever a program running under
@c complete accuracy in these examples; space introduced for clarity.
@c If texinfo enhancements make it unnecessary, it would be nice to
@c replace " @key" by "@key" in the following...
-@example
+@smallexample
(@value{GDBP}) info bre @key{TAB}
-@end example
+@end smallexample
@noindent
@value{GDBN} fills in the rest of the word @samp{breakpoints}, since that is
the only @code{info} subcommand beginning with @samp{bre}:
-@example
+@smallexample
(@value{GDBP}) info breakpoints
-@end example
+@end smallexample
@noindent
You can either press @key{RET} at this point, to run the @code{info
function names in your program that begin with those characters, for
example:
-@example
+@smallexample
(@value{GDBP}) b make_ @key{TAB}
@exdent @value{GDBN} sounds bell; press @key{TAB} again, to see:
make_a_section_from_file make_environ
make_cleanup make_reference_type
make_command make_symbol_completion_list
(@value{GDBP}) b make_
-@end example
+@end smallexample
@noindent
After displaying the available possibilities, @value{GDBN} copies your
@value{GDBN} that it may need to consider more information than usual
when you press @key{TAB} or @kbd{M-?} to request word completion:
-@example
+@smallexample
(@value{GDBP}) b 'bubble( @kbd{M-?}
bubble(double,double) bubble(int,int)
(@value{GDBP}) b 'bubble(
-@end example
+@end smallexample
In some cases, @value{GDBN} can tell that completing a name requires using
quotes. When this happens, @value{GDBN} inserts the quote for you (while
completing as much as it can) if you do not type the quote in the first
place:
-@example
+@smallexample
(@value{GDBP}) b bub @key{TAB}
@exdent @value{GDBN} alters your input line to the following, and rings a bell:
(@value{GDBP}) b 'bubble(
-@end example
+@end smallexample
@noindent
In general, @value{GDBN} can tell that a quote is needed (and inserts it) if
For example, this command:
-@example
+@smallexample
set env USER = foo
-@end example
+@end smallexample
@noindent
tells the debugged program, when subsequently run, that its user is named
You can redirect your program's input and/or output using shell
redirection with the @code{run} command. For example,
-@example
+@smallexample
run > outfile
-@end example
+@end smallexample
@noindent
starts your program, diverting its output to the file @file{outfile}.
commands. It also resets the controlling terminal for the child
process, for future @code{run} commands. For example,
-@example
+@smallexample
tty /dev/ttyb
-@end example
+@end smallexample
@noindent
directs that processes started with subsequent @code{run} commands
whose form varies depending on the particular system. For example, on
LynxOS, you might see
-@example
+@smallexample
[New process 35 thread 27]
-@end example
+@end smallexample
@noindent
when @value{GDBN} notices a new thread. In contrast, on an SGI system,
whose form varies depending on the particular system. For example, on
HP-UX, you see
-@example
+@smallexample
[New thread 2 (system thread 26594)]
-@end example
+@end smallexample
@noindent
when @value{GDBN} notices a new thread.
@end table
@c end table here to get a little more width for example
-@example
+@smallexample
(@value{GDBP}) info threads
* 3 system thread 26607 worker (wptr=0x7b09c318 "@@") \@*
at quicksort.c:137
from /usr/lib/libc.2
1 system thread 27905 0x7b003498 in _brk () \@*
from /usr/lib/libc.2
-@end example
+@end smallexample
@table @code
@kindex thread @var{threadno}
When you issue the @code{watch} command, @value{GDBN} reports
-@example
+@smallexample
Hardware watchpoint @var{num}: @var{expr}
-@end example
+@end smallexample
@noindent
if it was able to set a hardware watchpoint.
raised by calling a library function named @code{__raise_exception}
which has the following ANSI C interface:
-@example
+@smallexample
/* @var{addr} is where the exception identifier is stored.
@var{id} is the exception identifier. */
void __raise_exception (void **addr, void *id);
-@end example
+@end smallexample
@noindent
To make the debugger catch all exceptions before any stack
symbols not referenced in the context of the breakpoint, @value{GDBN}
prints an error message:
-@example
+@smallexample
No symbol "foo" in current context.
-@end example
+@end smallexample
@noindent
@value{GDBN} does
For example, here is how you could use breakpoint commands to print the
value of @code{x} at entry to @code{foo} whenever @code{x} is positive.
-@example
+@smallexample
break foo if x>0
commands
silent
printf "x is %d\n",x
cont
end
-@end example
+@end smallexample
One application for breakpoint commands is to compensate for one bug so
you can test for another. Put a breakpoint just after the erroneous line
so that your program does not stop, and start with the @code{silent}
command so that no output is produced. Here is an example:
-@example
+@smallexample
break 403
commands
silent
set x = y + 4
cont
end
-@end example
+@end smallexample
@node Breakpoint Menus
@subsection Breakpoint menus
attempting to run or continue a program with a breakpoint causes
@value{GDBN} to print an error message:
-@example
+@smallexample
Cannot insert breakpoints.
The same program may be running in another process.
-@end example
+@end smallexample
When this happens, you have three ways to proceed:
(@code{frame}) command shows that execution is stopped at line
@code{206}; yet when we use @code{until}, we get to line @code{195}:
-@example
+@smallexample
(@value{GDBP}) f
#0 main (argc=4, argv=0xf7fffae8) at m4.c:206
206 expand_input();
(@value{GDBP}) until
195 for ( ; argc > 0; NEXTARG) @{
-@end example
+@end smallexample
This happened because, for execution efficiency, the compiler had
generated code for the loop closure test at the end, rather than the
@cindex frameless execution
Some compilers provide a way to compile functions so that they operate
without stack frames. (For example, the @value{GCC} option
-@example
+@smallexample
@samp{-fomit-frame-pointer}
-@end example
+@end smallexample
generates functions without a frame.)
This is occasionally done with heavily used library functions to save
the frame setup time. @value{GDBN} has limited facilities for dealing
@noindent This means that in the function
-@example
+@smallexample
foo (a)
int a;
@{
bar (b);
@}
@}
-@end example
+@end smallexample
@noindent
you can examine and use the variable @code{a} whenever your program is
@c info cannot cope with a :: index entry, but why deprive hard copy readers?
@cindex @code{::}, context for variables/functions
@end iftex
-@example
+@smallexample
@var{file}::@var{variable}
@var{function}::@var{variable}
-@end example
+@end smallexample
@noindent
Here @var{file} or @var{function} is the name of the context for the
make sure @value{GDBN} parses the file name as a single word---for example,
to print a global value of @code{x} defined in @file{f2.c}:
-@example
+@smallexample
(@value{GDBP}) p 'f2.c'::x
-@end example
+@end smallexample
@cindex C@t{++} scope resolution
This use of @samp{::} is very rarely in conflict with the very similar
might not be able to display values for such local variables. If that
happens, @value{GDBN} will print a message like this:
-@example
+@smallexample
No symbol "foo" in current context.
-@end example
+@end smallexample
To solve such problems, either recompile without optimizations, or use a
different debug info format, if the compiler supports several such
following those that hold the first element, and so on. Here is an
example. If a program says
-@example
+@smallexample
int *array = (int *) malloc (len * sizeof (int));
-@end example
+@end smallexample
@noindent
you can print the contents of @code{array} with
-@example
+@smallexample
p *array@@len
-@end example
+@end smallexample
The left operand of @samp{@@} must reside in memory. Array values made
with @samp{@@} in this way behave just like other arrays in terms of
Another way to create an artificial array is to use a cast.
This re-interprets a value as if it were an array.
The value need not be in memory:
-@example
+@smallexample
(@value{GDBP}) p/x (short[2])0x12345678
$1 = @{0x1234, 0x5678@}
-@end example
+@end smallexample
As a convenience, if you leave the array length out (as in
@samp{(@var{type}[])@var{value}}) @value{GDBN} calculates the size to fill
the value (as @samp{sizeof(@var{value})/sizeof(@var{type})}:
-@example
+@smallexample
(@value{GDBP}) p/x (short[])0x12345678
$2 = @{0x1234, 0x5678@}
-@end example
+@end smallexample
Sometimes the artificial array mechanism is not quite enough; in
moderately complex data structures, the elements of interest may not
structures, and you are interested in the values of a field @code{fv}
in each structure. Here is an example of what you might type:
-@example
+@smallexample
set $i = 0
p dtab[$i++]->fv
@key{RET}
@key{RET}
@dots{}
-@end example
+@end smallexample
@node Output Formats
@section Output formats
the nearest preceding symbol. You can use this format used to discover
where (in what function) an unknown address is located:
-@example
+@smallexample
(@value{GDBP}) p/a 0x54320
$3 = 0x54320 <_initialize_vx+396>
-@end example
+@end smallexample
@noindent
The command @code{info symbol 0x54320} yields similar results.
For example, to print the program counter in hex (@pxref{Registers}), type
-@example
+@smallexample
p/x $pc
-@end example
+@end smallexample
@noindent
Note that no space is required before the slash; this is because command
to remove an expression from the list, you specify that number.
The automatic display looks like this:
-@example
+@smallexample
2: foo = 38
3: bar[5] = (struct hack *) 0x3804
-@end example
+@end smallexample
@noindent
This display shows item numbers, expressions and their current values. As with
For example, here @value{GDBN} shows that a variable @code{ptt} points
at another variable @code{t}, defined in @file{hi2.c}:
-@example
+@smallexample
(@value{GDBP}) set print symbol-filename on
(@value{GDBP}) p/a ptt
$4 = 0xe008 <t in hi2.c>
-@end example
+@end smallexample
@quotation
@emph{Warning:} For pointers that point to a local variable, @samp{p/a}
For example, suppose you have just printed a pointer to a structure and
want to see the contents of the structure. It suffices to type
-@example
+@smallexample
p *$
-@end example
+@end smallexample
If you have a chain of structures where the component @code{next} points
to the next one, you can print the contents of the next one with this:
-@example
+@smallexample
p *$.next
-@end example
+@end smallexample
@noindent
You can print successive links in the chain by repeating this
Note that the history records values, not expressions. If the value of
@code{x} is 4 and you type these commands:
-@example
+@smallexample
print x
set x=5
-@end example
+@end smallexample
@noindent
then the value recorded in the value history by the @code{print} command
expression, just as you would set a variable in your program.
For example:
-@example
+@smallexample
set $foo = *object_ptr
-@end example
+@end smallexample
@noindent
would save in @code{$foo} the value contained in the object pointed to by
incremented or a pointer to be advanced. For example, to print
a field from successive elements of an array of structures:
-@example
+@smallexample
set $i = 0
print bar[$i++]->contents
-@end example
+@end smallexample
@noindent
Repeat that command by typing @key{RET}.
register that contains the processor status. For example,
you could print the program counter in hex with
-@example
+@smallexample
p/x $pc
-@end example
+@end smallexample
@noindent
or print the instruction to be executed next with
-@example
+@smallexample
x/i $pc
-@end example
+@end smallexample
@noindent
or add four to the stack pointer@footnote{This is a way of removing
regardless of machine architecture, use @code{return};
see @ref{Returning, ,Returning from a function}.} with
-@example
+@smallexample
set $sp += 4
-@end example
+@end smallexample
Whenever possible, these four standard register names are available on
your machine even though the machine has different canonical mnemonics,
@c size of all overlays. This is intentional to remind the developer
@c that overlays don't necessarily need to be the same size.
-@example
+@smallexample
@group
Data Instruction Larger
Address Space Address Space Address Space
@anchor{A code overlay}A code overlay
@end group
-@end example
+@end smallexample
The diagram (@pxref{A code overlay}) shows a system with separate data
and instruction address spaces. To map an overlay, the program copies
Normally, when @value{GDBN} prints a code address, it includes the name
of the function the address falls in:
-@example
+@smallexample
(gdb) print main
$3 = @{int ()@} 0x11a0 <main>
-@end example
+@end smallexample
@noindent
When overlay debugging is enabled, @value{GDBN} recognizes code in
unmapped overlays, and prints the names of unmapped functions with
asterisks around them. For example, if @code{foo} is a function in an
unmapped overlay, @value{GDBN} prints it this way:
-@example
+@smallexample
(gdb) overlay list
No sections are mapped.
(gdb) print foo
$5 = @{int (int)@} 0x100000 <*foo*>
-@end example
+@end smallexample
@noindent
When @code{foo}'s overlay is mapped, @value{GDBN} prints the function's
name normally:
-@example
+@smallexample
(gdb) overlay list
Section .ov.foo.text, loaded at 0x100000 - 0x100034,
mapped at 0x1016 - 0x104a
(gdb) print foo
$6 = @{int (int)@} 0x1016 <foo>
-@end example
+@end smallexample
When overlay debugging is enabled, @value{GDBN} can find the correct
address for functions and variables in an overlay, whether or not the
@item @code{_ovly_table}:
This variable must be an array of the following structures:
-@example
+@smallexample
struct
@{
/* The overlay's mapped address. */
zero otherwise. */
unsigned long mapped;
@}
-@end example
+@end smallexample
@item @code{_novlys}:
This variable must be a four-byte signed integer, holding the total
You can build the test program using the @code{d10v-elf} GCC
cross-compiler like this:
-@example
+@smallexample
$ d10v-elf-gcc -g -c overlays.c
$ d10v-elf-gcc -g -c ovlymgr.c
$ d10v-elf-gcc -g -c foo.c
$ d10v-elf-gcc -g -c grbx.c
$ d10v-elf-gcc -g overlays.o ovlymgr.o foo.o bar.o \
baz.o grbx.o -Wl,-Td10v.ld -o overlays
-@end example
+@end smallexample
The build process is identical for any other architecture, except that
you must substitute the appropriate compiler and linker script for the
source file were written in C, and @value{GDBN} was parsing Modula-2, a
command such as:
-@example
+@smallexample
print a = b + c
-@end example
+@end smallexample
@noindent
might not have the effect you intended. In C, this means to add
result to ``wrap around'' to lower values---for example, if @var{m} is
the largest integer value, and @var{s} is the smallest, then
-@example
+@smallexample
@var{m} + 1 @result{} @var{s}
-@end example
+@end smallexample
This, too, is specific to individual languages, and in some cases
specific to individual compilers or machines. @xref{Support, ,
@item
Member function calls are allowed; you can use expressions like
-@example
+@smallexample
count = aml->GetOriginal(x, y)
-@end example
+@end smallexample
@vindex this@r{, inside C@t{++} member functions}
@cindex namespace in C@t{++}
(@code{.}) and the @value{GDBN} scope operator (@code{::}). The two have
similar syntax:
-@example
+@smallexample
@var{module} . @var{id}
@var{scope} :: @var{id}
-@end example
+@end smallexample
@noindent
where @var{scope} is the name of a module or a procedure,
@samp{foo} @samp{.} @samp{c}. To allow @value{GDBN} to recognize
@samp{foo.c} as a single symbol, enclose it in single quotes; for example,
-@example
+@smallexample
p 'foo.c'::x
-@end example
+@end smallexample
@noindent
looks up the value of @code{x} in the scope of the file @file{foo.c}.
If no symbol is stored exactly at @var{addr}, @value{GDBN} prints the
nearest symbol and an offset from it:
-@example
+@smallexample
(@value{GDBP}) info symbol 0x54320
_initialize_vx + 396 in section .text
-@end example
+@end smallexample
@noindent
This is the opposite of the @code{info address} command. You can use
For example, for this variable declaration:
-@example
+@smallexample
struct complex @{double real; double imag;@} v;
-@end example
+@end smallexample
@noindent
the two commands give this output:
-@example
+@smallexample
@group
(@value{GDBP}) whatis v
type = struct complex
double imag;
@}
@end group
-@end example
+@end smallexample
@noindent
As with @code{whatis}, using @code{ptype} without an argument refers to
To alter the value of a variable, evaluate an assignment expression.
@xref{Expressions, ,Expressions}. For example,
-@example
+@smallexample
print x=4
-@end example
+@end smallexample
@noindent
stores the value 4 into the variable @code{x}, and then prints the
a new value with just @samp{set width=13}, because @value{GDBN} has the
command @code{set width}:
-@example
+@smallexample
(@value{GDBP}) whatis width
type = double
(@value{GDBP}) p width
$4 = 13
(@value{GDBP}) set width=47
Invalid syntax in expression.
-@end example
+@end smallexample
@noindent
The invalid expression, of course, is @samp{=47}. In
order to actually set the program's variable @code{width}, use
-@example
+@smallexample
(@value{GDBP}) set var width=47
-@end example
+@end smallexample
Because the @code{set} command has many subcommands that can conflict
with the names of program variables, it is a good idea to use the
to set a new value with just @samp{set g=4}, because @value{GDBN} has
the command @code{set gnutarget}, abbreviated @code{set g}:
-@example
+@smallexample
@group
(@value{GDBP}) whatis g
type = double
(@value{GDBP}) show g
The current BFD target is "=4".
@end group
-@end example
+@end smallexample
@noindent
The program variable @code{g} did not change, and you silently set the
@code{gnutarget} to an invalid value. In order to set the variable
@code{g}, use
-@example
+@smallexample
(@value{GDBP}) set var g=4
-@end example
+@end smallexample
@value{GDBN} allows more implicit conversions in assignments than C; you can
freely store an integer value into a pointer variable or vice versa,
to memory location @code{0x83040} as an integer (which implies a certain size
and representation in memory), and
-@example
+@smallexample
set @{int@}0x83040 = 4
-@end example
+@end smallexample
@noindent
stores the value 4 into that memory location.
changes the address of where it @emph{will} run when you continue. For
example,
-@example
+@smallexample
set $pc = 0x485
-@end example
+@end smallexample
@noindent
makes the next @code{continue} command or stepping command execute at
@item target sim
Builtin CPU simulator. @value{GDBN} includes simulators for most architectures.
In general,
-@example
+@smallexample
target sim
load
run
-@end example
+@end smallexample
@noindent
works; however, you cannot assume that a specific memory map, device
drivers, or even basic I/O is available, although some simulators do
Use the @code{set os} command to set the operating system. This tells
@value{GDBN} which kernel object display module to initialize:
-@example
+@smallexample
(@value{GDBP}) set os cisco
-@end example
+@end smallexample
If @code{set os} succeeds, @value{GDBN} will display some information
about the operating system, and will create a new @code{info} command
which can be used to query the target. The @code{info} command is named
after the operating system:
-@example
+@smallexample
(@value{GDBP}) info cisco
List of Cisco Kernel Objects
Object Description
any Any and all objects
-@end example
+@end smallexample
Further subcommands can be used to query about particular objects known
by the kernel.
@item
Insert these lines near the top of your program:
-@example
+@smallexample
set_debug_traps();
breakpoint();
-@end example
+@end smallexample
@item
For the 680x0 stub only, you need to provide a variable called
@code{exceptionHook}. Normally you just use:
-@example
+@smallexample
void (*exceptionHook)() = 0;
-@end example
+@end smallexample
@noindent
but if before calling @code{set_debug_traps}, you set it to point to a
to the target). For example, to use a serial line connected to the
device named @file{/dev/ttyb}:
-@example
+@smallexample
target remote /dev/ttyb
-@end example
+@end smallexample
@cindex TCP port, @code{target remote}
To use a TCP connection, use an argument of the form
@code{@var{host}:port}. For example, to connect to port 2828 on a
terminal server named @code{manyfarms}:
-@example
+@smallexample
target remote manyfarms:2828
-@end example
+@end smallexample
If your remote target is actually running on the same machine as
your debugger session (e.g.@: a simulator of your target running on
the same host), you can omit the hostname. For example, to connect
to port 1234 on your local machine:
-@example
+@smallexample
target remote :1234
-@end example
+@end smallexample
@noindent
Note that the colon is still required here.
and the serial drivers the remote system uses. If you type the
interrupt character once again, @value{GDBN} displays this prompt:
-@example
+@smallexample
Interrupted while waiting for the program.
Give up (and stop debugging it)? (y or n)
-@end example
+@end smallexample
If you type @kbd{y}, @value{GDBN} abandons the remote debugging session.
(If you decide you want to try again later, you can use @samp{target
@value{GDBN} comes up showing the prompt:
-@example
+@smallexample
(vxgdb)
-@end example
+@end smallexample
@menu
* VxWorks Connection:: Connecting to VxWorks
The @value{GDBN} command @code{target} lets you connect to a VxWorks target on the
network. To connect to a target whose host name is ``@code{tt}'', type:
-@example
+@smallexample
(vxgdb) target vxworks tt
-@end example
+@end smallexample
@need 750
@value{GDBN} displays messages like these:
path (@pxref{Environment, ,Your program's environment}); if it fails
to find an object file, it displays a message such as:
-@example
+@smallexample
prog.o: No such file or directory.
-@end example
+@end smallexample
When this happens, add the appropriate directory to the search path with
the @value{GDBN} command @code{path}, and execute the @code{target}
and in @file{@var{hostpath}/vw/demo/rdb} on the host. To load this
program, type this on VxWorks:
-@example
+@smallexample
-> cd "@var{vxpath}/vw/demo/rdb"
-@end example
+@end smallexample
@noindent
Then, in @value{GDBN}, type:
-@example
+@smallexample
(vxgdb) cd @var{hostpath}/vw/demo/rdb
(vxgdb) load prog.o
-@end example
+@end smallexample
@value{GDBN} displays a response similar to this:
You can also attach to an existing task using the @code{attach} command as
follows:
-@example
+@smallexample
(vxgdb) attach @var{task}
-@end example
+@end smallexample
@noindent
where @var{task} is the VxWorks hexadecimal task ID. The task can be running
@c OBSOLETE The next step is to set up the PC's port, by doing something like this
@c OBSOLETE in DOS on the PC:
@c OBSOLETE
-@c OBSOLETE @example
+@c OBSOLETE @smallexample
@c OBSOLETE C:\> MODE com1:9600,n,8,1,none
-@c OBSOLETE @end example
+@c OBSOLETE @end smallexample
@c OBSOLETE
@c OBSOLETE @noindent
@c OBSOLETE This example---run on an MS DOS 4.0 system---sets the PC port to 9600
@c OBSOLETE To give control of the PC to the Unix side of the serial line, type
@c OBSOLETE the following at the DOS console:
@c OBSOLETE
-@c OBSOLETE @example
+@c OBSOLETE @smallexample
@c OBSOLETE C:\> CTTY com1
-@c OBSOLETE @end example
+@c OBSOLETE @end smallexample
@c OBSOLETE
@c OBSOLETE @noindent
@c OBSOLETE (Later, if you wish to return control to the DOS console, you can use
@c OBSOLETE From the Unix host, use a communications program such as @code{tip} or
@c OBSOLETE @code{cu} to communicate with the PC; for example,
@c OBSOLETE
-@c OBSOLETE @example
+@c OBSOLETE @smallexample
@c OBSOLETE cu -s 9600 -l /dev/ttya
-@c OBSOLETE @end example
+@c OBSOLETE @end smallexample
@c OBSOLETE
@c OBSOLETE @noindent
@c OBSOLETE The @code{cu} options shown specify, respectively, the linespeed and the
@c OBSOLETE serial port to use. If you use @code{tip} instead, your command line
@c OBSOLETE may look something like the following:
@c OBSOLETE
-@c OBSOLETE @example
+@c OBSOLETE @smallexample
@c OBSOLETE tip -9600 /dev/ttya
-@c OBSOLETE @end example
+@c OBSOLETE @end smallexample
@c OBSOLETE
@c OBSOLETE @noindent
@c OBSOLETE Your system may require a different name where we show
@c OBSOLETE @code{EBMON} similar to the one that follows, ending with the
@c OBSOLETE @code{EBMON} prompt @samp{#}---
@c OBSOLETE
-@c OBSOLETE @example
+@c OBSOLETE @smallexample
@c OBSOLETE C:\> G:
@c OBSOLETE
@c OBSOLETE G:\> CD \usr\joe\work29k
@c OBSOLETE Byte Write Available = Yes
@c OBSOLETE
@c OBSOLETE # ~.
-@c OBSOLETE @end example
+@c OBSOLETE @end smallexample
@c OBSOLETE
@c OBSOLETE Then exit the @code{cu} or @code{tip} program (done in the example by
@c OBSOLETE typing @code{~.} at the @code{EBMON} prompt). @code{EBMON} keeps
@c OBSOLETE program on the Unix system, and start @value{GDBN}---specifying as argument the
@c OBSOLETE name of your 29K program:
@c OBSOLETE
-@c OBSOLETE @example
+@c OBSOLETE @smallexample
@c OBSOLETE cd /usr/joe/work29k
@c OBSOLETE @value{GDBP} myfoo
-@c OBSOLETE @end example
+@c OBSOLETE @end smallexample
@c OBSOLETE
@c OBSOLETE @need 500
@c OBSOLETE Now you can use the @code{target} command:
@c OBSOLETE
-@c OBSOLETE @example
+@c OBSOLETE @smallexample
@c OBSOLETE target amd-eb /dev/ttya 9600 MYFOO
@c OBSOLETE @c FIXME: test above 'target amd-eb' as spelled, with caps! caps are meant to
@c OBSOLETE @c emphasize that this is the name as seen by DOS (since I think DOS is
@c OBSOLETE @c single-minded about case of letters). ---doc@cygnus.com, 25feb91
-@c OBSOLETE @end example
+@c OBSOLETE @end smallexample
@c OBSOLETE
@c OBSOLETE @noindent
@c OBSOLETE In this example, we've assumed your program is in a file called
for example, @samp{asyncstr 2} below runs @code{asyncstr} on
@code{COM2}.
-@example
+@smallexample
C:\H8300\TEST> asynctsr 2
C:\H8300\TEST> mode com2:9600,n,8,1,p
COM2: 9600, n, 8, 1, p
-@end example
+@end smallexample
@quotation
@emph{Warning:} We have noticed a bug in PC-NFS that conflicts with
options, you are prompted for what serial port to use, @emph{before} you
reach the ordinary @value{GDBN} prompt:
-@example
+@smallexample
Attach /dev/ttyNN -- specify NN, or "quit" to quit:
-@end example
+@end smallexample
@noindent
Respond to the prompt with whatever suffix (after @samp{/dev/tty})
port, and loads and runs a program called @var{prog} through the
debugger:
-@example
+@smallexample
host$ @value{GDBP} @var{prog}
@value{GDBN} is free software and @dots{}
(@value{GDBP}) target mips /dev/ttyb
(@value{GDBP}) load @var{prog}
(@value{GDBP}) run
-@end example
+@end smallexample
@item target mips @var{hostname}:@var{portnumber}
On some @value{GDBN} host configurations, you can specify a TCP
load it on the target. You may also want to add the options @samp{-n} or
@samp{-N} in order to reduce the size of the sections. Example:
-@example
+@smallexample
sparclet-aout-gcc prog.c -Ttext 0x12010000 -g -o prog -N
-@end example
+@end smallexample
You can use @code{objdump} to verify that the addresses are what you intended:
-@example
+@smallexample
sparclet-aout-objdump --headers --syms prog
-@end example
+@end smallexample
@cindex running, on Sparclet
Once you have set
@value{GDBN} comes up showing the prompt:
-@example
+@smallexample
(gdbslet)
-@end example
+@end smallexample
@menu
* Sparclet File:: Setting the file to debug
The @value{GDBN} command @code{file} lets you choose with program to debug.
-@example
+@smallexample
(gdbslet) file prog
-@end example
+@end smallexample
@need 1000
@value{GDBN} then attempts to read the symbol table of @file{prog}.
If it fails
to find a file, it displays a message such as:
-@example
+@smallexample
prog: No such file or directory.
-@end example
+@end smallexample
When this happens, add the appropriate directories to the search paths with
the @value{GDBN} commands @code{path} and @code{dir}, and execute the
The @value{GDBN} command @code{target} lets you connect to a Sparclet target.
To connect to a target on serial port ``@code{ttya}'', type:
-@example
+@smallexample
(gdbslet) target sparclet /dev/ttya
Remote target sparclet connected to /dev/ttya
main () at ../prog.c:3
-@end example
+@end smallexample
@need 750
@value{GDBN} displays messages like these:
-@example
+@smallexample
Connected to ttya.
-@end example
+@end smallexample
@node Sparclet Download
@subsubsection Sparclet download
@file{prog} was linked to text address 0x1201000, with data at 0x12010160
and bss at 0x12010170, in @value{GDBN}, type:
-@example
+@smallexample
(gdbslet) load prog 0x12010000
Loading section .text, size 0xdb0 vma 0x12010000
-@end example
+@end smallexample
If the code is loaded at a different address then what the program was linked
to, you may need to use the @code{section} and @code{add-symbol-file} commands
commands, @code{b}, @code{step}, @code{run}, etc. See the @value{GDBN}
manual for the list of commands.
-@example
+@smallexample
(gdbslet) b main
Breakpoint 1 at 0x12010000: file prog.c, line 3.
(gdbslet) run
(gdbslet) step
4 char *execarg = "hello!";
(gdbslet)
-@end example
+@end smallexample
@node Sparclite
@subsection Fujitsu Sparclite
To connect your ST2000 to the host system, see the manufacturer's
manual. Once the ST2000 is physically attached, you can run:
-@example
+@smallexample
target st2000 @var{dev} @var{speed}
-@end example
+@end smallexample
@noindent
to establish it as your debugging environment. @var{dev} is normally
lot of stupid questions to confirm certain commands. For example, if
you try to run a program which is already running:
-@example
+@smallexample
(@value{GDBP}) run
The program being debugged has been started already.
Start it from the beginning? (y or n)
-@end example
+@end smallexample
If you are willing to unflinchingly face the consequences of your own
commands, you can disable this ``feature'':
single-stepping, but treat them normally during normal execution,
you could define:
-@example
+@smallexample
define hook-stop
handle SIGALRM nopass
end
define hook-continue
handle SIGLARM pass
end
-@end example
+@end smallexample
As a further example, to hook at the begining and end of the @code{echo}
command, and to add extra text to the beginning and end of the message,
you could define:
-@example
+@smallexample
define hook-echo
echo <<<---
end
<<<---Hello World--->>>
(@value{GDBP})
-@end example
+@end smallexample
You can define a hook for any single-word command in @value{GDBN}, but
not for command aliases; you should define a hook for the basic command
not terminate execution of the command file --- execution continues with
the next command.
-@example
+@smallexample
gdb < cmds > log 2>&1
-@end example
+@end smallexample
(The syntax above will vary depending on the shell used.) This example
will execute commands from the file @file{cmds}. All output and errors
A backslash at the end of @var{text} can be used, as in C, to continue
the command onto subsequent lines. For example,
-@example
+@smallexample
echo This is some text\n\
which is continued\n\
onto several lines.\n
-@end example
+@end smallexample
produces the same output as
-@example
+@smallexample
echo This is some text\n
echo which is continued\n
echo onto several lines.\n
-@end example
+@end smallexample
@kindex output
@item output @var{expression}
@c Either this is a bug, or the manual should document what formats are
@c supported.
-@example
+@smallexample
printf (@var{string}, @var{expressions}@dots{});
-@end example
+@end smallexample
For example, you can print two values in hex like this:
several configurations around, with different names) you can set the
Emacs variable @code{gdb-command-name}; for example,
-@example
+@smallexample
(setq gdb-command-name "mygdb")
-@end example
+@end smallexample
@noindent
(preceded by @kbd{M-:} or @kbd{ESC :}, or typed in the @code{*scratch*} buffer, or
In any event, we also recommend that you send bug reports for
@value{GDBN} to this addresses:
-@example
+@smallexample
bug-gdb@@gnu.org
-@end example
+@end smallexample
@strong{Do not send bug reports to @samp{info-gdb}, or to
@samp{help-gdb}, or to any newsgroups.} Most users of @value{GDBN} do
As a last resort, send bug reports on paper to:
-@example
+@smallexample
@sc{gnu} Debugger Bugs
Free Software Foundation Inc.
59 Temple Place - Suite 330
Boston, MA 02111-1307
USA
-@end example
+@end smallexample
The fundamental principle of reporting bugs usefully is this:
@strong{report all the facts}. If you are not sure whether to state a
The release also includes the source for the reference card. You
can format it, using @TeX{}, by typing:
-@example
+@smallexample
make refcard.dvi
-@end example
+@end smallexample
The @value{GDBN} reference card is designed to print in @dfn{landscape}
mode on US ``letter'' size paper;
@value{GDBN} source directory (@file{gdb-@value{GDBVN}}, in the case of
version @value{GDBVN}), you can make the Info file by typing:
-@example
+@smallexample
cd gdb
make gdb.info
-@end example
+@end smallexample
If you want to typeset and print copies of this manual, you need @TeX{},
a program to print its @sc{dvi} output files, and @file{texinfo.tex}, the
subdirectory of the main source directory (for example, to
@file{gdb-@value{GDBVN}/gdb}) and type:
-@example
+@smallexample
make gdb.dvi
-@end example
+@end smallexample
Then give @file{gdb.dvi} to your @sc{dvi} printing program.
For example:
-@example
+@smallexample
cd gdb-@value{GDBVN}
./configure @var{host}
make
-@end example
+@end smallexample
@noindent
where @var{host} is an identifier such as @samp{sun4} or
system does not recognize this automatically when you run a different
shell, you may need to run @code{sh} on it explicitly:
-@example
+@smallexample
sh configure @var{host}
-@end example
+@end smallexample
If you run @code{configure} from a directory that contains source
directories for multiple libraries or programs, such as the
For example, with version @value{GDBVN}, type the following to configure only
the @code{bfd} subdirectory:
-@example
+@smallexample
@group
cd gdb-@value{GDBVN}/bfd
../configure @var{host}
@end group
-@end example
+@end smallexample
You can install @code{@value{GDBP}} anywhere; it has no hardwired paths.
However, you should make sure that the shell on your path (named by
For example, with version @value{GDBVN}, you can build @value{GDBN} in a
separate directory for a Sun 4 like this:
-@example
+@smallexample
@group
cd gdb-@value{GDBVN}
mkdir ../gdb-sun4
../gdb-@value{GDBVN}/configure sun4
make
@end group
-@end example
+@end smallexample
When @code{configure} builds a configuration using a remote source
directory, it creates a tree for the binaries with the same structure
aliases are also supported. The full naming scheme encodes three pieces
of information in the following pattern:
-@example
+@smallexample
@var{architecture}-@var{vendor}-@var{os}
-@end example
+@end smallexample
For example, you can use the alias @code{sun4} as a @var{host} argument,
or as the value for @var{target} in a @code{--target=@var{target}}
several other options not listed here. @inforef{What Configure
Does,,configure.info}, for a full explanation of @code{configure}.
-@example
+@smallexample
configure @r{[}--help@r{]}
@r{[}--prefix=@var{dir}@r{]}
@r{[}--exec-prefix=@var{dir}@r{]}
@r{[}--norecursion@r{]} @r{[}--rm@r{]}
@r{[}--target=@var{target}@r{]}
@var{host}
-@end example
+@end smallexample
@noindent
You may introduce options with a single @samp{-} rather than
@samp{$}, the actual @var{packet-data}, and the terminating character
@samp{#} followed by a two-digit @var{checksum}:
-@example
+@smallexample
@code{$}@var{packet-data}@code{#}@var{checksum}
-@end example
+@end smallexample
@noindent
@cindex checksum, for @value{GDBN} remote
Implementors should note that prior to @value{GDBN} 5.0 the protocol
specification also included an optional two-digit @var{sequence-id}:
-@example
+@smallexample
@code{$}@var{sequence-id}@code{:}@var{packet-data}@code{#}@var{checksum}
-@end example
+@end smallexample
@cindex sequence-id, for @value{GDBN} remote
@noindent
the package was received correctly) or @samp{-} (to request
retransmission):
-@example
+@smallexample
<- @code{$}@var{packet-data}@code{#}@var{checksum}
-> @code{+}
-@end example
+@end smallexample
@noindent
The host (@value{GDBN}) sends @var{command}s, and the target (the
character are two hex digits that indicate the size of the packet.
So:
-@example
+@smallexample
"@code{0* }"
-@end example
+@end smallexample
@noindent
means the same as "0000".
Example sequence of a target being re-started. Notice how the restart
does not get any direct output:
-@example
+@smallexample
<- @code{R00}
-> @code{+}
@emph{target restarts}
-> @code{+}
-> @code{T001:1234123412341234}
<- @code{+}
-@end example
+@end smallexample
Example sequence of a target being stepped by a single instruction:
-@example
+@smallexample
<- @code{G1445...}
-> @code{+}
<- @code{s}
-> @code{+}
-> @code{1455...}
<- @code{+}
-@end example
+@end smallexample
@include gpl.texi
machine-independent part of @value{GDBN}, except that it is used when
setting up a new frame from scratch, as follows:
-@example
- create_new_frame (read_register (FP_REGNUM), read_pc ()));
-@end example
+@smallexample
+create_new_frame (read_register (FP_REGNUM), read_pc ()));
+@end smallexample
@cindex frame pointer register
Other than that, all the meaning imparted to @code{FP_REGNUM} is
possible values of the enumerated data type @code{target_hw_bp_type},
defined by @file{breakpoint.h} as follows:
-@example
+@smallexample
enum target_hw_bp_type
@{
hw_write = 0, /* Common (write) HW watchpoint */
hw_access = 2, /* Access (read or write) HW watchpoint */
hw_execute = 3 /* Execute HW breakpoint */
@};
-@end example
+@end smallexample
@noindent
These two macros should return 0 for success, non-zero for failure.
The overall structure of the table output code is something like this:
-@example
+@smallexample
ui_out_table_begin
ui_out_table_header
@dots{}
ui_out_tuple_end
@dots{}
ui_out_table_end
-@end example
+@end smallexample
Here is the description of table-, tuple- and list-related @code{ui_out}
functions:
The original code was:
-@example
+@smallexample
if (!found_a_breakpoint++)
@{
annotate_breakpoints_headers ();
annotate_breakpoints_table ();
@}
-@end example
+@end smallexample
Here's the new version:
-@example
+@smallexample
nr_printable_breakpoints = @dots{};
if (addressprint)
ui_out_table_body (uiout);
if (nr_printable_breakpoints > 0)
annotate_breakpoints_table ();
-@end example
+@end smallexample
This example, from the @code{print_one_breakpoint} function, shows how
to produce the actual data for the table whose structure was defined
in the above example. The original code was:
-@example
+@smallexample
annotate_record ();
annotate_field (0);
printf_filtered ("%-3d ", b->number);
annotate_field (3);
printf_filtered ("%-3c ", bpenables[(int)b->enable]);
@dots{}
-@end example
+@end smallexample
This is the new version:
-@example
+@smallexample
annotate_record ();
ui_out_tuple_begin (uiout, "bkpt");
annotate_field (0);
annotate_field (3);
ui_out_field_fmt (uiout, "enabled", "%c", bpenables[(int)b->enable]);
@dots{}
-@end example
+@end smallexample
This example, also from @code{print_one_breakpoint}, shows how to
produce a complicated output field using the @code{print_expression}
functions which requires a stream to be passed. It also shows how to
automate stream destruction with cleanups. The original code was:
-@example
+@smallexample
annotate_field (5);
print_expression (b->exp, gdb_stdout);
-@end example
+@end smallexample
The new version is:
-@example
+@smallexample
struct ui_stream *stb = ui_out_stream_new (uiout);
struct cleanup *old_chain = make_cleanup_ui_out_stream_delete (stb);
...
annotate_field (5);
print_expression (b->exp, stb->stream);
ui_out_field_stream (uiout, "what", local_stream);
-@end example
+@end smallexample
This example, also from @code{print_one_breakpoint}, shows how to use
@code{ui_out_text} and @code{ui_out_field_string}. The original code
was:
-@example
+@smallexample
annotate_field (5);
if (b->dll_pathname == NULL)
printf_filtered ("<any library> ");
else
printf_filtered ("library \"%s\" ", b->dll_pathname);
-@end example
+@end smallexample
It became:
-@example
+@smallexample
annotate_field (5);
if (b->dll_pathname == NULL)
@{
ui_out_field_string (uiout, "what", b->dll_pathname);
ui_out_text (uiout, "\" ");
@}
-@end example
+@end smallexample
The following example from @code{print_one_breakpoint} shows how to
use @code{ui_out_field_int} and @code{ui_out_spaces}. The original
code was:
-@example
+@smallexample
annotate_field (5);
if (b->forked_inferior_pid != 0)
printf_filtered ("process %d ", b->forked_inferior_pid);
-@end example
+@end smallexample
It became:
-@example
+@smallexample
annotate_field (5);
if (b->forked_inferior_pid != 0)
@{
ui_out_field_int (uiout, "what", b->forked_inferior_pid);
ui_out_spaces (uiout, 1);
@}
-@end example
+@end smallexample
Here's an example of using @code{ui_out_field_string}. The original
code was:
-@example
+@smallexample
annotate_field (5);
if (b->exec_pathname != NULL)
printf_filtered ("program \"%s\" ", b->exec_pathname);
-@end example
+@end smallexample
It became:
-@example
+@smallexample
annotate_field (5);
if (b->exec_pathname != NULL)
@{
ui_out_field_string (uiout, "what", b->exec_pathname);
ui_out_text (uiout, "\" ");
@}
-@end example
+@end smallexample
Finally, here's an example of printing an address. The original code:
-@example
+@smallexample
annotate_field (4);
printf_filtered ("%s ",
local_hex_string_custom ((unsigned long) b->address, "08l"));
-@end example
+@end smallexample
It became:
-@example
+@smallexample
annotate_field (4);
ui_out_field_core_addr (uiout, "Address", b->address);
-@end example
+@end smallexample
@section Console Printing
@strong{must} be included at the top of the YACC parser, to prevent the
various parsers from defining the same global names:
-@example
+@smallexample
#define yyparse @var{lang}_parse
#define yylex @var{lang}_lex
#define yyerror @var{lang}_error
#define yyexca @var{lang}_exca
#define yyerrflag @var{lang}_errflag
#define yynerrs @var{lang}_nerrs
-@end example
+@end smallexample
At the bottom of your parser, define a @code{struct language_defn} and
initialize it with the right values for your language. Define an
later cleanups appended to the chain (but not yet discarded or
performed). E.g.:
-@example
+@smallexample
make_cleanup (a, 0);
@{
struct cleanup *old = make_cleanup (b, 0);
...
do_cleanups (old);
@}
-@end example
+@end smallexample
@noindent
will call @code{c()} and @code{b()} but will not call @code{a()}. The
called and a forced stack unwind occurs) by ensuring that the
@code{xfree} will always be called:
-@example
+@smallexample
struct cleanup *old = make_cleanup (null_cleanup, 0);
data = xmalloc (sizeof blah);
make_cleanup (xfree, data);
... blah blah ...
do_cleanups (old);
-@end example
+@end smallexample
The second style is try/except. Before it exits, your code-block calls
@code{discard_cleanups} with the old cleanup chain and thus ensures that
code segment, ensures that the file will be closed but only if there is
an error:
-@example
+@smallexample
FILE *file = fopen ("afile", "r");
struct cleanup *old = make_cleanup (close_file, file);
... blah blah ...
discard_cleanups (old);
return file;
-@end example
+@end smallexample
Some functions, e.g. @code{fputs_filtered()} or @code{error()}, specify
that they ``should not be called when cleanups are not in place''. This
A function declaration should not have its name in column zero. A
function definition should have its name in column zero.
-@example
+@smallexample
/* Declaration */
static void foo (void);
/* Definition */
foo (void)
@{
@}
-@end example
+@end smallexample
@emph{Pragmatics: This simplifies scripting. Function definitions can
be found using @samp{^function-name}.}
Pointers are declared using the traditional K&R C style:
-@example
+@smallexample
void *foo;
-@end example
+@end smallexample
@noindent
and not:
-@example
+@smallexample
void * foo;
void* foo;
-@end example
+@end smallexample
@subsection Comments
Block comments must appear in the following form, with no @code{/*}- or
@code{*/}-only lines, and no leading @code{*}:
-@example
+@smallexample
/* Wait for control to return from inferior to debugger. If inferior
gets a signal, we may decide to start it up again instead of
returning. That is why there is a loop in this function. When
this function actually returns it means the inferior should be left
stopped and @value{GDBN} should read more commands. */
-@end example
+@end smallexample
(Note that this format is encouraged by Emacs; tabbing for a multi-line
comment works correctly, and @kbd{M-q} fills the block consistently.)
All include files should be wrapped in:
-@example
+@smallexample
#ifndef INCLUDE_FILE_NAME_H
#define INCLUDE_FILE_NAME_H
header body
#endif
-@end example
+@end smallexample
@subsection Clean Design and Portable Implementation
@code{@var{arch}-@var{xvend}-@var{xos}}. You can test your changes by
running
-@example
+@smallexample
./config.sub @var{xyz}
-@end example
+@end smallexample
@noindent
and
-@example
+@smallexample
./config.sub @code{@var{arch}-@var{xvend}-@var{xos}}
-@end example
+@end smallexample
@noindent
which should both respond with @code{@var{arch}-@var{xvend}-@var{xos}}
From the top level directory (containing @file{gdb}, @file{bfd},
@file{libiberty}, and so on):
-@example
+@smallexample
make -f Makefile.in gdb.tar.gz
-@end example
+@end smallexample
@noindent
This will properly configure, clean, rebuild any files that are
Releases 5.0 and 5.1 used branch and release tags of the form:
-@example
+@smallexample
gdb_N_M-YYYY-MM-DD-branchpoint
gdb_N_M-YYYY-MM-DD-branch
gdb_M_N-YYYY-MM-DD-release
-@end example
+@end smallexample
Release 5.2 is trialing the branch and release tags:
-@example
+@smallexample
gdb_N_M-YYYY-MM-DD-branchpoint
gdb_N_M-branch
gdb_M_N-YYYY-MM-DD-release
-@end example
+@end smallexample
@emph{Pragmatics: The branchpoint and release tags need to identify when
a branch and release are made. The branch tag, denoting the head of the
@end itemize
As an aside, the branch tag name is probably regrettable vis:
-@example
+@smallexample
gdb_N_M-YYYY-MM-DD-@{branch,branchpoint@}
-@end example
+@end smallexample
@subheading Refresh any imported files.
I think something like the below was used:
-@example
+@smallexample
$ d=`date -u +%Y-%m-%d`
$ echo $d
2002-01-24
$ cvs -f -d /cvs/src rtag -b -r gdb_V_V-$d-branchpoint \
gdb_5_1-$d-branch insight+dejagnu
$
-@end example
+@end smallexample
@itemize @bullet
@item
@subheading Establish a few defaults.
-@example
+@smallexample
$ b=gdb_5_1-2001-07-29-branch
$ v=5.1.1
$ t=/sourceware/snapshot-tmp/gdbadmin-tmp
$ which autoconf
/home/gdbadmin/bin/autoconf
$
-@end example
+@end smallexample
NB: Check the autoconf version carefully. You want to be using the
version taken from the binutils snapshot directory. It is most likely
@subheading Check out the relevant modules:
-@example
+@smallexample
$ for m in gdb insight dejagnu
do
( mkdir -p $m && cd $m && cvs -q -f -d /cvs/src co -P -r $b $m )
done
$
-@end example
+@end smallexample
NB: The reading of @file{.cvsrc} is disabled (@file{-f}) so that there
isn't any confusion between what is written here and what your local CVS
Don't forget to update the ChangeLog.
-@example
+@smallexample
$ emacs gdb/src/gdb/NEWS
...
c-x 4 a
c-x c-s c-x c-c
$ cp gdb/src/gdb/NEWS insight/src/gdb/NEWS
$ cp gdb/src/gdb/ChangeLog insight/src/gdb/ChangeLog
-@end example
+@end smallexample
@subsubheading @file{gdb/README}
You'll need to update: the version, the update date, and who did it.
-@example
+@smallexample
$ emacs gdb/src/gdb/README
...
c-x 4 a
c-x c-s c-x c-c
$ cp gdb/src/gdb/README insight/src/gdb/README
$ cp gdb/src/gdb/ChangeLog insight/src/gdb/ChangeLog
-@end example
+@end smallexample
@emph{Maintainer note: Hopefully the README file was reviewed before the
initial branch was cut so just a simple substitute is needed to get it
@subsubheading @file{gdb/version.in}
-@example
+@smallexample
$ echo $v > gdb/src/gdb/version.in
$ emacs gdb/src/gdb/version.in
...
c-x c-s c-x c-c
$ cp gdb/src/gdb/version.in insight/src/gdb/version.in
$ cp gdb/src/gdb/ChangeLog insight/src/gdb/ChangeLog
-@end example
+@end smallexample
@subsubheading @file{dejagnu/src/dejagnu/configure.in}
This is identical to the process used when creating the daily snapshot.
-@example
+@smallexample
$ for m in gdb insight dejagnu
do
( cd $m/src && gmake -f Makefile.in $m.tar.bz2 )
done
-@end example
+@end smallexample
@subheading Check the source files
@kbd{distclean} has the habit of deleting files it shouldn't. Watch out
for the @file{version.in} update @kbd{cronjob}.
-@example
+@smallexample
$ ( cd gdb/src && cvs -f -q -n update )
M djunpack.bat
? proto-toplev
? gdb/doc/gdbint.info-4
? gdb/doc/gdbint.info-5
$
-@end example
+@end smallexample
@emph{Don't worry about the @file{gdb.info-??} or
@file{gdb/p-exp.tab.c}. They were generated (and yes @file{gdb.info-1}
@subheading Re-pack the release with @code{gzip}
-@example
+@smallexample
$ cp */*/*.bz2 .
$ bunzip2 -k -v *.bz2
$ gzip -9 -v *.tar
-@end example
+@end smallexample
NB: A pipe such as @kbd{bunzip2 < xxx.bz2 | gzip -9 > xxx.gz} shouldn't
be used since, in that mode, gzip doesn't know the file name information
@subheading Install on sware
-@example
+@smallexample
$ cp *.bz2 *.gz ~ftp/pub/gdb/releases
-@end example
+@end smallexample
@subheading Create and update the web pages.
from one of the nightly cronjobs and then just edit accordingly.
Something like:
-@example
+@smallexample
$ ~/ss/update-web-docs \
~ftp/pub/gdb/releases/gdb-5.1.1.tar.bz2 \
$PWD/www \
/www/sourceware/htdocs/gdb/5.1.1/onlinedocs \
gdb
-@end example
+@end smallexample
@subheading Something about @file{ANNOUNCEMENT}
Something like:
-@example
+@smallexample
$ d=`date -u +%Y-%m-%d`
$ echo $d
2002-01-24
$ ( cd insight/src/gdb && cvs -f -q update )
$ ( cd insight/src && cvs -f -q tag gdb_5_1_1-$d-release )
-@end example
+@end smallexample
Insight is used since that contains more of the release than GDB (yes
dejagnu doesn't get tagged but I think we can live with that.).
and a mention of any unexpected passes or fails. When the testsuite is
finished, you'll get a summary that looks like this:
-@example
+@smallexample
=== gdb Summary ===
# of expected passes 6016
# of expected failures 183
# of unresolved testcases 3
# of untested testcases 5
-@end example
+@end smallexample
The ideal test run consists of expected passes only; however, reality
conspires to keep us from this ideal. Unexpected failures indicate