Fri Sep 4 18:53:57 1992 Roland H. Pesch (pesch@fowanton.cygnus.com)
[deliverable/binutils-gdb.git] / gdb / doc / gdbinv-s.m4
CommitLineData
9bcc06ef
RP
1_dnl__ -*- Texinfo -*-
2_dnl__ Copyright (c) 1990 1991 Free Software Foundation, Inc.
3_dnl__ This file is part of the source for the GDB manual.
54e4cbe8 4@c M4 FRAGMENT $Id$
9bcc06ef
RP
5@c This text diverted to "Remote Debugging" section in general case;
6@c however, if we're doing a manual specifically for one of these, it
7@c belongs up front (in "Getting In and Out" chapter).
9bcc06ef 8_if__(_I960__)
54e4cbe8 9_if__(!_GENERIC__)
9bcc06ef 10@node i960-Nindy Remote, EB29K Remote, Mode Options, Starting _GDBN__
54e4cbe8
RP
11_fi__(!_GENERIC__)
12_if__(_GENERIC__)
13@node i960-Nindy Remote, EB29K Remote, Remote, Remote
14_fi__(_GENERIC__)
9bcc06ef
RP
15@subsection _GDBN__ with a Remote i960 (Nindy)
16
17@cindex Nindy
18@cindex i960
19@dfn{Nindy} is a ROM Monitor program for Intel 960 target systems. When
20_GDBN__ is configured to control a remote Intel 960 using Nindy, you can
21tell _GDBN__ how to connect to the 960 in several ways:
22
23@itemize @bullet
24@item
25Through command line options specifying serial port, version of the
26Nindy protocol, and communications speed;
27
28@item
29By responding to a prompt on startup;
30
31@item
32By using the @code{target} command at any point during your _GDBN__
33session. @xref{Target Commands}.
34
35@end itemize
36
37@menu
0c81306b
RP
38* Nindy Startup:: Startup with Nindy
39* Nindy Options:: Options for Nindy
40* Nindy reset:: Nindy Reset Command
9bcc06ef
RP
41@end menu
42
43@node Nindy Startup, Nindy Options, i960-Nindy Remote, i960-Nindy Remote
44@subsubsection Startup with Nindy
45
46If you simply start @code{_GDBN__} without using any command-line
47options, you are prompted for what serial port to use, @emph{before} you
48reach the ordinary _GDBN__ prompt:
49@example
50Attach /dev/ttyNN -- specify NN, or "quit" to quit:
51@end example
52@noindent
53Respond to the prompt with whatever suffix (after @samp{/dev/tty})
54identifies the serial port you want to use. You can, if you choose,
55simply start up with no Nindy connection by responding to the prompt
56with an empty line. If you do this, and later wish to attach to Nindy,
57use @code{target} (@pxref{Target Commands}).
58
59@node Nindy Options, Nindy reset, Nindy Startup, i960-Nindy Remote
60@subsubsection Options for Nindy
61
62These are the startup options for beginning your _GDBN__ session with a
63Nindy-960 board attached:
64
65@table @code
66@item -r @var{port}
67Specify the serial port name of a serial interface to be used to connect
68to the target system. This option is only available when _GDBN__ is
69configured for the Intel 960 target architecture. You may specify
70@var{port} as any of: a full pathname (e.g. @samp{-r /dev/ttya}), a
71device name in @file{/dev} (e.g. @samp{-r ttya}), or simply the unique
72suffix for a specific @code{tty} (e.g. @samp{-r a}).
73
74@item -O
75(An uppercase letter ``O'', not a zero.) Specify that _GDBN__ should use
76the ``old'' Nindy monitor protocol to connect to the target system.
77This option is only available when _GDBN__ is configured for the Intel 960
78target architecture.
79
80@quotation
81@emph{Warning:} if you specify @samp{-O}, but are actually trying to
82connect to a target system that expects the newer protocol, the connection
83will fail, appearing to be a speed mismatch. _GDBN__ will repeatedly
84attempt to reconnect at several different line speeds. You can abort
85this process with an interrupt.
86@end quotation
87
88@item -brk
89Specify that _GDBN__ should first send a @code{BREAK} signal to the target
90system, in an attempt to reset it, before connecting to a Nindy target.
91
92@quotation
93@emph{Warning:} Many target systems do not have the hardware that this
94requires; it only works with a few boards.
95@end quotation
96
97@end table
98
99The standard @samp{-b} option controls the line speed used on the serial
100port.
101
9bcc06ef 102@node Nindy reset, , Nindy Options, i960-Nindy Remote
54e4cbe8 103@c @group
9bcc06ef
RP
104@subsubsection Nindy Reset Command
105@table @code
106@item reset
107@kindex reset
108For a Nindy target, this command sends a ``break'' to the remote target
109system; this is only useful if the target has been equipped with a
110circuit to perform a hard reset (or some other interesting action) when
111a break is detected.
112@end table
54e4cbe8 113@c @end group
9bcc06ef
RP
114_fi__(_I960__)
115
116_if__(_AMD29K__)
54e4cbe8 117_if__(!_GENERIC__)
9bcc06ef 118@node EB29K Remote, VxWorks Remote, i960-Nindy Remote, Starting _GDBN__
54e4cbe8
RP
119_fi__(!_GENERIC__)
120_if__(_GENERIC__)
121@node EB29K Remote, VxWorks Remote, i960-Nindy Remote, Remote
122_fi__(_GENERIC__)
9bcc06ef
RP
123@subsection _GDBN__ with a Remote EB29K
124
125@cindex EB29K board
126@cindex running 29K programs
127
128To use _GDBN__ from a Unix system to run programs on AMD's EB29K
129board in a PC, you must first connect a serial cable between the PC
130and a serial port on the Unix system. In the following, we assume
131you've hooked the cable between the PC's @file{COM1} port and
132@file{/dev/ttya} on the Unix system.
133
134@menu
0c81306b
RP
135* Comms (EB29K):: Communications Setup
136* _GDBP__-EB29K:: EB29K cross-debugging
137* Remote Log:: Remote Log
9bcc06ef
RP
138@end menu
139
140@node Comms (EB29K), _GDBP__-EB29K, EB29K Remote, EB29K Remote
141@subsubsection Communications Setup
142The next step is to set up the PC's port, by doing something like the
143following in DOS on the PC:
144_0__@example
145C:\> MODE com1:9600,n,8,1,none
146_1__@end example
147@noindent
148This example---run on an MS DOS 4.0 system---sets the PC port to 9600
149bps, no parity, eight data bits, one stop bit, and no ``retry'' action;
150you must match the communications parameters when establishing the Unix
151end of the connection as well.
152@c FIXME: Who knows what this "no retry action" crud from the DOS manual may
153@c mean? It's optional; leave it out? ---pesch@cygnus.com, 25feb91
154
155To give control of the PC to the Unix side of the serial line, type
156the following at the DOS console:
157_0__@example
158C:\> CTTY com1
159_1__@end example
160@noindent
161(Later, if you wish to return control to the DOS console, you can use
162the command @code{CTTY con}---but you must send it over the device that
163had control, in our example over the @file{COM1} serial line).
164
165From the Unix host, use a communications program such as @code{tip} or
166@code{cu} to communicate with the PC; for example,
167@example
168cu -s 9600 -l /dev/ttya
169@end example
170@noindent
171The @code{cu} options shown specify, respectively, the linespeed and the
172serial port to use. If you use @code{tip} instead, your command line
173may look something like the following:
174@example
175tip -9600 /dev/ttya
176@end example
177@noindent
178Your system may define a different name where our example uses
179@file{/dev/ttya} as the argument to @code{tip}. The communications
180parameters, including what port to use, are associated with the
181@code{tip} argument in the ``remote'' descriptions file---normally the
182system table @file{/etc/remote}.
183@c FIXME: What if anything needs doing to match the "n,8,1,none" part of
184@c the DOS side's comms setup? cu can support -o (odd
185@c parity), -e (even parity)---apparently no settings for no parity or
186@c for character size. Taken from stty maybe...? John points out tip
187@c can set these as internal variables, eg ~s parity=none; man stty
188@c suggests that it *might* work to stty these options with stdin or
189@c stdout redirected... ---pesch@cygnus.com, 25feb91
190
191@kindex EBMON
192Using the @code{tip} or @code{cu} connection, change the DOS working
193directory to the directory containing a copy of your 29K program, then
194start the PC program @code{EBMON} (an EB29K control program supplied
195with your board by AMD). You should see an initial display from
196@code{EBMON} similar to the one that follows, ending with the
197@code{EBMON} prompt @samp{#}---
198_0__@example
199C:\> G:
200
201G:\> CD \usr\joe\work29k
202
203G:\USR\JOE\WORK29K> EBMON
204Am29000 PC Coprocessor Board Monitor, version 3.0-18
205Copyright 1990 Advanced Micro Devices, Inc.
206Written by Gibbons and Associates, Inc.
207
208Enter '?' or 'H' for help
209
210PC Coprocessor Type = EB29K
211I/O Base = 0x208
212Memory Base = 0xd0000
213
214Data Memory Size = 2048KB
215Available I-RAM Range = 0x8000 to 0x1fffff
216Available D-RAM Range = 0x80002000 to 0x801fffff
217
218PageSize = 0x400
219Register Stack Size = 0x800
220Memory Stack Size = 0x1800
221
222CPU PRL = 0x3
223Am29027 Available = No
224Byte Write Available = Yes
225
226# ~.
227_1__@end example
228
229Then exit the @code{cu} or @code{tip} program (done in the example by
230typing @code{~.} at the @code{EBMON} prompt). @code{EBMON} will keep
231running, ready for _GDBN__ to take over.
232
233For this example, we've assumed what is probably the most convenient
234way to make sure the same 29K program is on both the PC and the Unix
235system: a PC/NFS connection that establishes ``drive @code{G:}'' on the
236PC as a file system on the Unix host. If you don't have PC/NFS or
237something similar connecting the two systems, you must arrange some
238other way---perhaps floppy-disk transfer---of getting the 29K program
239from the Unix system to the PC; _GDBN__ will @emph{not} download it over the
240serial line.
241
242@node _GDBP__-EB29K, Remote Log, Comms (EB29K), EB29K Remote
243@subsubsection EB29K cross-debugging
244Finally, @code{cd} to the directory containing an image of your 29K
245program on the Unix system, and start _GDBN__---specifying as argument the
246name of your 29K program:
247@example
248cd /usr/joe/work29k
249_GDBP__ myfoo
250@end example
251Now you can use the @code{target} command:
252@example
253target amd-eb /dev/ttya 9600 MYFOO
254@end example
255@c FIXME: test above 'target amd-eb' as spelled, with caps! caps are meant to
256@c emphasize that this is the name as seen by DOS (since I think DOS is
257@c single-minded about case of letters). ---pesch@cygnus.com, 25feb91
258
259@noindent
260In this example, we've assumed your program is in a file called
261@file{myfoo}. Note that the filename given as the last argument to
262@code{target amd-eb} should be the name of the program as it appears to DOS.
263In our example this is simply @code{MYFOO}, but in general it can include
264a DOS path, and depending on your transfer mechanism may not resemble
265the name on the Unix side.
266
267At this point, you can set any breakpoints you wish; when you're ready
268to see your program run on the 29K board, use the _GDBN__ command
269@code{run}.
270
271To stop debugging the remote program, use the _GDBN__ @code{detach}
272command.
273
274To return control of the PC to its console, use @code{tip} or @code{cu}
275once again, after your _GDBN__ session has concluded, to attach to
276@code{EBMON}. You can then type the command @code{q} to shut down
277@code{EBMON}, returning control to the DOS command-line interpreter.
278Type @code{CTTY con} to return command input to the main DOS console,
279and type @kbd{~.} to leave @code{tip} or @code{cu}.
280
281@node Remote Log, , _GDBP__-EB29K, EB29K Remote
282@subsubsection Remote Log
283@kindex eb.log
284@cindex log file for EB29K
285The @code{target amd-eb} command creates a file @file{eb.log} in the
286current working directory, to help debug problems with the connection.
287@file{eb.log} records all the output from @code{EBMON}, including echoes
288of the commands sent to it. Running @samp{tail -f} on this file in
289another window often helps to understand trouble with @code{EBMON}, or
290unexpected events on the PC side of the connection.
291_fi__(_AMD29K__)
292
293_if__(_VXWORKS__)
54e4cbe8 294_if__(!_GENERIC__)
9bcc06ef 295@node VxWorks Remote, , EB29K Remote, Starting _GDBN__
54e4cbe8
RP
296_fi__(!_GENERIC__)
297_if__(_GENERIC__)
298@node VxWorks Remote, , EB29K Remote, Remote
299_fi__(_GENERIC__)
9bcc06ef
RP
300@subsection _GDBN__ and VxWorks
301@cindex VxWorks
302_GDBN__ enables developers to spawn and debug tasks running on networked
303VxWorks targets from a Unix host. Already-running tasks spawned from
304the VxWorks shell can also be debugged. _GDBN__ uses code that runs on
305both the UNIX host and on the VxWorks target. The program
306@code{_GDBP__} is installed and executed on the UNIX host.
307
308The remote debugging interface (RDB) routines are installed and executed
309on the VxWorks target. These routines are included in the VxWorks library
310@file{rdb.a} and are incorporated into the system image when source-level
311debugging is enabled in the VxWorks configuration.
312
54e4cbe8 313@kindex INCLUDE_RDB
37daba7b
RP
314You can define @code{INCLUDE_RDB} in the VxWorks configuration file
315@file{configAll.h} to include the RDB interface routines and spawn the
9bcc06ef
RP
316source debugging task @code{tRdbTask} when VxWorks is booted. For more
317information on configuring and remaking VxWorks, see the @cite{VxWorks
318Programmer's Guide}.
319
320Once you have included the RDB interface in your VxWorks system image
321and set your Unix execution search path to find _GDBN__, you are ready
322to run _GDBN__. From your UNIX host, type:
323
324@smallexample
325% _GDBP__
326@end smallexample
327
328_GDBN__ will come up showing the prompt:
329
330@smallexample
331(_GDBP__)
332@end smallexample
333
334@menu
0c81306b
RP
335* VxWorks connection:: Connecting to VxWorks
336* VxWorks download:: VxWorks Download
337* VxWorks attach:: Running Tasks
9bcc06ef
RP
338@end menu
339
340@node VxWorks connection, VxWorks download, VxWorks Remote, VxWorks Remote
341@subsubsection Connecting to VxWorks
342
343The _GDBN__ command @code{target} lets you connect to a VxWorks target on the
344network. To connect to a target whose host name is ``@code{tt}'', type:
345
346@smallexample
347(_GDBP__) target vxworks tt
348@end smallexample
349
350_GDBN__ will display a message similar to the following:
351
352@smallexample
353Attaching remote machine across net... Success!
354@end smallexample
355
356_GDBN__ will then attempt to read the symbol tables of any object
357modules loaded into the VxWorks target since it was last booted.
358_GDBN__ locates these files by searching the directories listed in the
359command search path (@pxref{Environment}); if it fails to find an
360object file, it will display a message such as:
361
362@smallexample
363prog.o: No such file or directory.
364@end smallexample
365
366This will cause the @code{target} command to abort. When this happens,
367you should add the appropriate directory to the search path, with the
368_GDBN__ command @code{path}, and execute the @code{target} command
369again.
370
371@node VxWorks download, VxWorks attach, VxWorks connection, VxWorks Remote
372@subsubsection VxWorks Download
373
374@cindex download to VxWorks
375If you have connected to the VxWorks target and you want to debug an
376object that has not yet been loaded, you can use the _GDBN__ @code{load}
377command to download a file from UNIX to VxWorks incrementally. The
378object file given as an argument to the @code{load} command is actually
379opened twice: first by the VxWorks target in order to download the code,
380then by _GDBN__ in order to read the symbol table. This can lead to
381problems if the current working directories on the two systems differ.
382It is simplest to set the working directory on both systems to the
383directory in which the object file resides, and then to reference the
384file by its name, without any path. Thus, to load a program
385@file{prog.o}, residing in @file{wherever/vw/demo/rdb}, on VxWorks type:
386
387@smallexample
388-> cd "wherever/vw/demo/rdb"
389@end smallexample
390
391On _GDBN__ type:
392
393@smallexample
394(_GDBP__) cd wherever/vw/demo/rdb
395(_GDBP__) load prog.o
396@end smallexample
397
398_GDBN__ will display a response similar to the following:
399
400@smallexample
401Reading symbol data from wherever/vw/demo/rdb/prog.o... done.
402@end smallexample
403
404You can also use the @code{load} command to reload an object module
405after editing and recompiling the corresponding source file. Note that
406this will cause _GDBN__ to delete all currently-defined breakpoints,
407auto-displays, and convenience variables, and to clear the value
408history. (This is necessary in order to preserve the integrity of
409debugger data structures that reference the target system's symbol
410table.)
411
412@node VxWorks attach, , VxWorks download, VxWorks Remote
413@subsubsection Running Tasks
414
415@cindex running VxWorks tasks
416You can also attach to an existing task using the @code{attach} command as
417follows:
418
419@smallexample
420(_GDBP__) attach @var{task}
421@end smallexample
422
423where @var{task} is the VxWorks hexadecimal task ID. The task can be running
424or suspended when you attach to it. If running, it will be suspended at
425the time of attachment.
426
427_fi__(_VXWORKS__)
This page took 0.071875 seconds and 4 git commands to generate.