source: rtems/doc/rgdb_specs/comm.t @ defc332

4.104.114.84.95
Last change on this file since defc332 was defc332, checked in by Joel Sherrill <joel.sherrill@…>, on 10/06/99 at 17:48:01

Enabled images. Works pretty well for PostScript?. Ghostview does
not like the generated pdf but who knows what that really means.

  • Property mode set to 100644
File size: 4.4 KB
Line 
1@c
2@c  RTEMS Remote Debugger Server Specifications
3@c
4@c  Written by: Eric Valette <valette@crf.canon.fr>
5@c              Emmanuel Raguet <raguet@crf.canon.fr>
6@c
7@c
8@c  $Id$
9@c
10
11@chapter Communication with GDB
12
13The RTEMS remote debugger will be accessed by GDB on a host machine
14through a communication link. We will use the TCP/IP stack included in RTEMS
15: the FreeBSD stack. The communication link will be based based on the UDP protocol
16and the BSD sockets which are parts of the FreeBSD stack. On top of these layers,
17we will plug a module which allows a simple communication between different
18machines (especially between different endianess machines) : the SUN Remote
19Procedure Call (SUN RPC). This code is freely available on the net and comes
20with a BSD like license. With this module, a process can invoke a procedure
21on a remote system. The RTEMS remote debugger will be seen by GDB as a SUN RPC
22server. Commands will be packed by the GDB SUN RPC client and sent to the server.
23This server will unpack these commands, execute them and, if needed, return
24results to the SUN RPC client.
25
26
27Only a minimal subset of the SUN RPC library must be implemented.
28For example, the portmapper related API which allows a dynamic allocation of
29port numbers will not be implemented and some specific UDP port numbers will
30be used to establish the communication between the host and the target. The
31SUN RPC library implements the XDR module (eXternal Data Representation) which
32is a standard way of encoding data in a portable fashion between different endian
33systems. Below are figures describing the additional code and data size for
34the minimal library implementation we currently have already implemented for
35RTEMS :
36
37@example
38$ size -x librpc.a
39text  data bss dec hex filename
400x40e 0x0 0x0 1038 40e rpc_callmsg.o (ex librpc.a)
410x2f1 0x18 0x0 777 309 rpc_prot.o (ex librpc.a)
420x458 0x0 0x0 1112 458 svc.o (ex librpc.a)
430x4f 0x4 0x0 83 53 svc_auth.o (ex librpc.a)
440x75c 0x18 0x0 1908 774 svc_udp.o (ex librpc.a)
450x711 0x4 0x10 1829 725 xdr.o (ex librpc.a)
460x149 0x0 0x0 329 149 xdr_array.o (ex librpc.a)
470x165 0x20 0x0 389 185 xdr_mem.o (ex librpc.a)
48@end example
49
50We have a constraint with the use of the UDP protocol. Because this
51protocol is connectionless, it is impossible, especially for the target, to
52detect if the connection is always active. On the other hand, using the TCP/IP
53protocols seems to be heavy especially if we plan to implement a dedicated micro
54stack for debug in the future. It can be a real problem to let the debugged
55process stopped during a long time even if there is no more debugger connected
56to the system. To avoid such a problem, the target must periodically test the
57connection with the host on another way than the one used to receive the commands.
58We must therefore open two communication ways so we need two fixed UDP port
59numbers.
60
61@enumerate
62@item One port will be used by the debugger to send its commands to the
63debugged process and to receive the result of these commands. View from the
64remote debugger, this port will be called primary port. For this one, we choose
65arbitrarily the port number 2000.
66@item The other socket will be used as secondary port by the target to sometimes
67test the connection between the host and the target. These tests will occur
68in specific situations, when a process will be stopped on a breakpoint, single
69step instruction or other means. This secondary port will also be used by the
70target to signal any change in the behavior of a debugged process (stopped,
71killed, waiting for,...). For the secondary port, we choose the port number
722010.
73@end enumerate
74
75These two port numbers are used by the remote debugger to open the
76two communication sockets. GDB will use its own mean to choose its port numbers
77(probably the Unix portmapper). The figure layer shows the different
78layers we need to implement.
79
80@c
81@c Communications Layers Figure
82@c
83
84@ifset use-ascii
85@example
86@group
87XXXXX reference it in the previous paragraph
88XXXXX insert layers.eps
89XXXXX Caption Communications Layers
90@end group
91@end example
92@end ifset
93
94@ifset use-tex
95@example
96@group
97@c XXXXX reference it in the previous paragraph
98@c XXXXX insert layers.eps
99@c XXXXX Caption Communications Layers
100@end group
101@end example
102@image{layers,,6in}
103@end ifset
104
105
106@ifset use-html
107@c <IMG SRC="layers.jpg" WIDTH=500 HEIGHT=600 ALT="Communications Layers">
108@html
109<IMG SRC="layers.jpg" ALT="Communications Layers">
110@end html
111@end ifset
112
113
114
115
Note: See TracBrowser for help on using the repository browser.