2 _dnl__ Copyright (c) 1990 1991 Free Software Foundation, Inc.
3 _dnl__ This file is part of the source for the GDB manual.
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).
10 @node i960-Nindy Remote, EB29K Remote, Mode Options, Starting _GDBN__
13 @node i960-Nindy Remote, EB29K Remote, Remote, Remote
15 @subsection _GDBN__ with a Remote i960 (Nindy)
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
21 tell _GDBN__ how to connect to the 960 in several ways:
25 Through command line options specifying serial port, version of the
26 Nindy protocol, and communications speed;
29 By responding to a prompt on startup;
32 By using the @code{target} command at any point during your _GDBN__
33 session. @xref{Target Commands}.
38 * Nindy Startup:: Startup with Nindy
39 * Nindy Options:: Options for Nindy
40 * Nindy reset:: Nindy Reset Command
43 @node Nindy Startup, Nindy Options, i960-Nindy Remote, i960-Nindy Remote
44 @subsubsection Startup with Nindy
46 If you simply start @code{_GDBN__} without using any command-line
47 options, you are prompted for what serial port to use, @emph{before} you
48 reach the ordinary _GDBN__ prompt:
50 Attach /dev/ttyNN -- specify NN, or "quit" to quit:
53 Respond to the prompt with whatever suffix (after @samp{/dev/tty})
54 identifies the serial port you want to use. You can, if you choose,
55 simply start up with no Nindy connection by responding to the prompt
56 with an empty line. If you do this, and later wish to attach to Nindy,
57 use @code{target} (@pxref{Target Commands}).
59 @node Nindy Options, Nindy reset, Nindy Startup, i960-Nindy Remote
60 @subsubsection Options for Nindy
62 These are the startup options for beginning your _GDBN__ session with a
63 Nindy-960 board attached:
67 Specify the serial port name of a serial interface to be used to connect
68 to the target system. This option is only available when _GDBN__ is
69 configured 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
71 device name in @file{/dev} (e.g. @samp{-r ttya}), or simply the unique
72 suffix for a specific @code{tty} (e.g. @samp{-r a}).
75 (An uppercase letter ``O'', not a zero.) Specify that _GDBN__ should use
76 the ``old'' Nindy monitor protocol to connect to the target system.
77 This option is only available when _GDBN__ is configured for the Intel 960
81 @emph{Warning:} if you specify @samp{-O}, but are actually trying to
82 connect to a target system that expects the newer protocol, the connection
83 will fail, appearing to be a speed mismatch. _GDBN__ will repeatedly
84 attempt to reconnect at several different line speeds. You can abort
85 this process with an interrupt.
89 Specify that _GDBN__ should first send a @code{BREAK} signal to the target
90 system, in an attempt to reset it, before connecting to a Nindy target.
93 @emph{Warning:} Many target systems do not have the hardware that this
94 requires; it only works with a few boards.
99 The standard @samp{-b} option controls the line speed used on the serial
102 @node Nindy reset, , Nindy Options, i960-Nindy Remote
104 @subsubsection Nindy Reset Command
108 For a Nindy target, this command sends a ``break'' to the remote target
109 system; this is only useful if the target has been equipped with a
110 circuit to perform a hard reset (or some other interesting action) when
118 @node EB29K Remote, VxWorks Remote, i960-Nindy Remote, Starting _GDBN__
121 @node EB29K Remote, VxWorks Remote, i960-Nindy Remote, Remote
123 @subsection _GDBN__ with a Remote EB29K
126 @cindex running 29K programs
128 To use _GDBN__ from a Unix system to run programs on AMD's EB29K
129 board in a PC, you must first connect a serial cable between the PC
130 and a serial port on the Unix system. In the following, we assume
131 you've hooked the cable between the PC's @file{COM1} port and
132 @file{/dev/ttya} on the Unix system.
135 * Comms (EB29K):: Communications Setup
136 * _GDBP__-EB29K:: EB29K cross-debugging
137 * Remote Log:: Remote Log
140 @node Comms (EB29K), _GDBP__-EB29K, EB29K Remote, EB29K Remote
141 @subsubsection Communications Setup
142 The next step is to set up the PC's port, by doing something like the
143 following in DOS on the PC:
145 C:\> MODE com1:9600,n,8,1,none
148 This example---run on an MS DOS 4.0 system---sets the PC port to 9600
149 bps, no parity, eight data bits, one stop bit, and no ``retry'' action;
150 you must match the communications parameters when establishing the Unix
151 end of the connection as well.
152 @c FIXME: Who knows what this "no retry action" crud from the DOS manual may
155 To give control of the PC to the Unix side of the serial line, type
156 the following at the DOS console:
161 (Later, if you wish to return control to the DOS console, you can use
162 the command @code{CTTY con}---but you must send it over the device that
163 had control, in our example over the @file{COM1} serial line).
165 From the Unix host, use a communications program such as @code{tip} or
166 @code{cu} to communicate with the PC; for example,
168 cu -s 9600 -l /dev/ttya
171 The @code{cu} options shown specify, respectively, the linespeed and the
172 serial port to use. If you use @code{tip} instead, your command line
173 may look something like the following:
178 Your system may define a different name where our example uses
179 @file{/dev/ttya} as the argument to @code{tip}. The communications
180 parameters, including what port to use, are associated with the
181 @code{tip} argument in the ``remote'' descriptions file---normally the
182 system 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
192 Using the @code{tip} or @code{cu} connection, change the DOS working
193 directory to the directory containing a copy of your 29K program, then
194 start the PC program @code{EBMON} (an EB29K control program supplied
195 with 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{#}---
201 G:\> CD \usr\joe\work29k
203 G:\USR\JOE\WORK29K> EBMON
204 Am29000 PC Coprocessor Board Monitor, version 3.0-18
205 Copyright 1990 Advanced Micro Devices, Inc.
206 Written by Gibbons and Associates, Inc.
208 Enter '?' or 'H' for help
210 PC Coprocessor Type = EB29K
212 Memory Base = 0xd0000
214 Data Memory Size = 2048KB
215 Available I-RAM Range = 0x8000 to 0x1fffff
216 Available D-RAM Range = 0x80002000 to 0x801fffff
219 Register Stack Size = 0x800
220 Memory Stack Size = 0x1800
223 Am29027 Available = No
224 Byte Write Available = Yes
229 Then exit the @code{cu} or @code{tip} program (done in the example by
230 typing @code{~.} at the @code{EBMON} prompt). @code{EBMON} will keep
231 running, ready for _GDBN__ to take over.
233 For this example, we've assumed what is probably the most convenient
234 way to make sure the same 29K program is on both the PC and the Unix
235 system: a PC/NFS connection that establishes ``drive @code{G:}'' on the
236 PC as a file system on the Unix host. If you don't have PC/NFS or
237 something similar connecting the two systems, you must arrange some
238 other way---perhaps floppy-disk transfer---of getting the 29K program
239 from the Unix system to the PC; _GDBN__ will @emph{not} download it over the
242 @node _GDBP__-EB29K, Remote Log, Comms (EB29K), EB29K Remote
243 @subsubsection EB29K cross-debugging
244 Finally, @code{cd} to the directory containing an image of your 29K
245 program on the Unix system, and start _GDBN__---specifying as argument the
246 name of your 29K program:
251 Now you can use the @code{target} command:
253 target amd-eb /dev/ttya 9600 MYFOO
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
260 In 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.
263 In our example this is simply @code{MYFOO}, but in general it can include
264 a DOS path, and depending on your transfer mechanism may not resemble
265 the name on the Unix side.
267 At this point, you can set any breakpoints you wish; when you're ready
268 to see your program run on the 29K board, use the _GDBN__ command
271 To stop debugging the remote program, use the _GDBN__ @code{detach}
274 To return control of the PC to its console, use @code{tip} or @code{cu}
275 once 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.
278 Type @code{CTTY con} to return command input to the main DOS console,
279 and type @kbd{~.} to leave @code{tip} or @code{cu}.
281 @node Remote Log, , _GDBP__-EB29K, EB29K Remote
282 @subsubsection Remote Log
284 @cindex log file for EB29K
285 The @code{target amd-eb} command creates a file @file{eb.log} in the
286 current working directory, to help debug problems with the connection.
287 @file{eb.log} records all the output from @code{EBMON}, including echoes
288 of the commands sent to it. Running @samp{tail -f} on this file in
289 another window often helps to understand trouble with @code{EBMON}, or
290 unexpected events on the PC side of the connection.
295 @node VxWorks Remote, , EB29K Remote, Starting _GDBN__
298 @node VxWorks Remote, , EB29K Remote, Remote
300 @subsection _GDBN__ and VxWorks
302 _GDBN__ enables developers to spawn and debug tasks running on networked
303 VxWorks targets from a Unix host. Already-running tasks spawned from
304 the VxWorks shell can also be debugged. _GDBN__ uses code that runs on
305 both the UNIX host and on the VxWorks target. The program
306 @code{_GDBP__} is installed and executed on the UNIX host.
308 The remote debugging interface (RDB) routines are installed and executed
309 on 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
311 debugging is enabled in the VxWorks configuration.
314 Defining @code{INCLUDE_RDB} in the VxWorks configuration file
315 @file{configAll.h} includes the RDB interface routines and spawns the
316 source debugging task @code{tRdbTask} when VxWorks is booted. For more
317 information on configuring and remaking VxWorks, see the @cite{VxWorks
320 Once you have included the RDB interface in your VxWorks system image
321 and set your Unix execution search path to find _GDBN__, you are ready
322 to run _GDBN__. From your UNIX host, type:
328 _GDBN__ will come up showing the prompt:
335 * VxWorks connection:: Connecting to VxWorks
336 * VxWorks download:: VxWorks Download
337 * VxWorks attach:: Running Tasks
340 @node VxWorks connection, VxWorks download, VxWorks Remote, VxWorks Remote
341 @subsubsection Connecting to VxWorks
343 The _GDBN__ command @code{target} lets you connect to a VxWorks target on the
344 network. To connect to a target whose host name is ``@code{tt}'', type:
347 (_GDBP__) target vxworks tt
350 _GDBN__ will display a message similar to the following:
353 Attaching remote machine across net... Success!
356 _GDBN__ will then attempt to read the symbol tables of any object
357 modules loaded into the VxWorks target since it was last booted.
358 _GDBN__ locates these files by searching the directories listed in the
359 command search path (@pxref{Environment}); if it fails to find an
360 object file, it will display a message such as:
363 prog.o: No such file or directory.
366 This will cause the @code{target} command to abort. When this happens,
367 you should add the appropriate directory to the search path, with the
368 _GDBN__ command @code{path}, and execute the @code{target} command
371 @node VxWorks download, VxWorks attach, VxWorks connection, VxWorks Remote
372 @subsubsection VxWorks Download
374 @cindex download to VxWorks
375 If you have connected to the VxWorks target and you want to debug an
376 object that has not yet been loaded, you can use the _GDBN__ @code{load}
377 command to download a file from UNIX to VxWorks incrementally. The
378 object file given as an argument to the @code{load} command is actually
379 opened twice: first by the VxWorks target in order to download the code,
380 then by _GDBN__ in order to read the symbol table. This can lead to
381 problems if the current working directories on the two systems differ.
382 It is simplest to set the working directory on both systems to the
383 directory in which the object file resides, and then to reference the
384 file 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:
388 -> cd "wherever/vw/demo/rdb"
394 (_GDBP__) cd wherever/vw/demo/rdb
395 (_GDBP__) load prog.o
398 _GDBN__ will display a response similar to the following:
401 Reading symbol data from wherever/vw/demo/rdb/prog.o... done.
404 You can also use the @code{load} command to reload an object module
405 after editing and recompiling the corresponding source file. Note that
406 this will cause _GDBN__ to delete all currently-defined breakpoints,
407 auto-displays, and convenience variables, and to clear the value
408 history. (This is necessary in order to preserve the integrity of
409 debugger data structures that reference the target system's symbol
412 @node VxWorks attach, , VxWorks download, VxWorks Remote
413 @subsubsection Running Tasks
415 @cindex running VxWorks tasks
416 You can also attach to an existing task using the @code{attach} command as
420 (_GDBP__) attach @var{task}
423 where @var{task} is the VxWorks hexadecimal task ID. The task can be running
424 or suspended when you attach to it. If running, it will be suspended at
425 the time of attachment.