source: rtems/doc/rgdb_specs/objectives.t @ 74d3d8ee

4.104.114.84.95
Last change on this file since 74d3d8ee was 64e0f6c4, checked in by Joel Sherrill <joel.sherrill@…>, on 04/02/99 at 17:23:36

Can now produce html, info, and PostScript? without errors. Links
between chapters are correct.

  • Property mode set to 100644
File size: 11.9 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 Objectives
12
13@c XXX reference
14This section is intended to clearly define the current objectives of our work.
15First, we will try here to list some ambitious requirements for the debugger
16in section @b{List of Requirements}. These requirements will deliberately be much more
17ambitious than what we will provide directly ourselves in the hope that the
18Internet development model will enable others to implement some features we
19rejected for man-power reasons in the first step. We are committed to do the
20core work and redistribute it but would appreciate any comment and enhancement.
21Then, in section @b{Requirements Analysis} we will analyze each requirement to see
22what technical problem must be solved if we want to fullfill it. After this
23analysis, we will determine in section @b{Requirements Selection} the requirements we
24chose to implement and the ones we will not. We will then clearly identify the
25limits of our solution in section @b{Implied Restrictions}.
26
27
28@section List of Requirements
29
30We will identify here possible requirements for the type of debug that may be
31provided :
32
33@table @b
34
35@item [(R1)]:
36We want to use GDB as the front-end debugger,
37
38@item [(R2)]:
39We want to support at least Intel and PowerPC as target processor architecture,
40
41@item [(R3)]:
42We want to use the GDB thread debugging interface,
43
44@item [(R4)]:
45We want to be able to debug a remote target over a serial line,
46
47@item [(R5)]:
48We want to be able to debug a remote target over Ethernet,
49
50@item [(R6)]:
51The set of target code path we will be able to debug using RGDBSD must
52be clearly identified. It will be called Debug Path Set (@emph{DPS}) in the
53remaining of this document,
54
55@item [(R7)]:
56@emph{DPS} must include the RTEMS core executive itself,
57
58@item [(R8)]:
59@emph{DPS} must include the FreeBSD stack,
60
61@item [(R9)]:
62@emph{DPS} must include anything but the FreeBSD stack and the RTEMS
63core executive,
64
65@item [(R10)]:
66We want to enable several persons to debug different parts of the code
67running on the target,
68
69@item [(R11)]:
70As much as possible the system must be frozen during a debug session
71so that debugging a particular portion of code does not prevent another part
72from functioning,
73@end table
74
75@section Requirements Analysis
76
77@table @b
78
79@item [(R1)]:
80Worth recalling it. It mainly imposes few restrictions on the binary
81files type, target processor type as :
82
83@itemize @bullet
84
85@item the binary format must be understood by GDB (to find debugging information).
86Elf, Coff and A.out are the main formats currently supported. Elf/Dwarf 2.0
87binary support will be our main target as they are the preferred format for
88Intel and PowerPC processors. No change in GDB will be required for other binaries
89except may be a new configuration file changing the binary/debug file format,
90
91@item the processor must be supported for disassemble/step instruction command,
92
93@item the target system must be supported. As far as I know RTEMS is not currently
94@emph{officially} supported anyway,
95@end itemize
96
97@item [(R2)]:
98Our primary targets are Intel and PowerPC. We however do not think implementing
99RGDBSD for other processors will be a heavy task. It will mainly require :
100
101@enumerate
102@item Implementing exception handling for the target processor,
103
104@item Interfacing the generic part of RGDBSD with the low level exception handling
105and make RGDBSD aware of exception used for debugging (usually illegal instruction
106or dedicated trap, single step),
107
108@item Making GDB aware of the frame layout pushed on exceptions,
109
110@item Implement the code for data transfer for the exception frame,
111
112@item Implement code to copy data cache back to main memory and invalidate instruction
113cache. This is needed in order to be sure opcode modification used to set breakpoint
114that use the data cache will be proagated to the instruction cache,
115@end enumerate
116
117As soon as we will have completed the first core work a document describing
118how to port it to a new processor should be written. So far we will organize
119the source tree with processor dependent directories so that port will be as
120easy as possible. May be a bare processor support should be created,
121
122
123@item [(R3)]:
124GDB already has an interface for manipulating multi-threaded programs.
125This interface is rather weak at the moment but it will certainly be improved
126in the future with the generalization of POSIX thread API on Linux and other
127operating systems. This implies that either GDB or RGDBSD is able to obtain
128the list of threads currently executing. The choice of implementing this in
129GDB or RGDBSD is a tradeof between target code size and simplicity,
130
131@item [(R4)]:
132Regular GDB code contains clients code for debugging over a serial line.
133However only few functions are implemented. We would like to provide a better
134support and to uniformize serial line debugging with debugging over Ethernet
135via the use of SLIP,
136
137@item [(R5)]:
138Regular GDB code contains client code for debugging over Ethernet for
139VxWorks via the SUN RPC library. So there will be at least one starting point
140to implement remote debugging over Ethernet via SUN RPC. The Chorus remote debugging
141code has been disclosed under GPL and also contains code for debugging suing
142SUN RPC,
143
144@item [(R6)]:
145Due to a classical chicken and egg problems, the remote debugging daemon
146cannot be used to debug code it uses to function. Thus depending on the API
147used by RGDBSD, some parts of the target system will not be debuggable via GDB.
148The most important point is documentation because my feeling is that implementing
149RGDBSD on a totally different @emph{dedicated} nano kernel should be possible,
150
151@item [(R7)]:
152RTEMS core executive is a real-time OS which implements priority level
153scheduling, synchronization objects, and interrupt handling. As mentioned in
154previous item, we may not debug theses features if RGDBSD uses them. This requirement
155is thus very strong because it impose that :
156
157@enumerate
158
159@item RGDBSD is totally interrupt driven (no thread API available),
160
161@item But it does not use RTEMS interrupt management,
162
163@item Nor does not use RTEMS exception management,
164
165@item RGDBSD must provide its own UDP/IP stack as the current FreeBSD code rely on
166tasks switching and RTEMS provided synchronization object for input path handling,
167@end enumerate
168
169So our feeling is that the @b{(R7)} more or less requires to write a @emph{dedicated}
170nano kernel with a very small dedicated UDP/IP stack.
171
172
173@item [(R8)]:
174GDB remote debugging over Ethernet code communicates with the remote
175target via the SUN RPC protocol. This requires a UDP/IP protocol and a minimal
176socket like interface. In RTEMS environment, this feature is currently provided
177by the FreeBSD stack. Again, if we use the FreeBSD stack itself for remote communication,
178it will be impossible to debug this stack as a breakpoint in the stack code
179will stop its execution and there would be no more way to communicate with the
180target. A solution consists in implementing a minimal, dedicated UDP/IP stack
181(with at least IP and UDP protocols, a minimal BSD sockets) and a simple SUN
182RPC library, which will be both dedicated to the debug. We can use RTEMS API
183to implement it if @b{(R7)} is not required. As the two stack will need
184to share the same chip, a kind of shared filter must be implemented at the bottom
185of the two stacks so that Ethernet frames can be dynamically directed either
186to the dedicated UDP/IP debug stack or to the regular FreeBSD stack. The fact
187that in the current design, the low level ethernet input routine mainly signal
188a thread should facilitate the design of this filter. The output path is less
189complicated as it is run by a task and thus can sleep on a synchronization object,
190
191@item [(R9)]:
192This requirement represents what we find reasonable as a first target.
193However, we can still present to the final user this kind of debugging via different
194model. RTEMS can be represented as a single threaded system or, because RTEMS
195is a multitasking system, as an ensemble of separate tasks. In the first representation,
196the debugger sees only 1 ``task'' without distinguishing the core executive
197part from the applicative part. This is the simplest way to implement the debugger
198but also implies that there is no way to protect the core executive. Some of
199these tasks are system tasks (tasks form the core executive and from the FreeBSD
200stack), the other ones are tasks implemented by the developer. The developer
201wants to debug his tasks, and sometimes only one of his tasks. We can provide
202a way to debug not the entire system but only the concerned task by testing
203if the current running task is a debugged task (test on the task identifier).
204GDB offers an API to ``detach'' thread so that if a detached thread hits a
205breakpoint it is automatically restarted without user intervention,
206
207@item [(R10)]:
208Several developers can work on a large project, each on a specific
209module. Sometimes only one target is available for everyone. This requirements
210is not really meaningfull until RTEMS supports dynamic code loading,
211
212@item [(R11)]:
213This requirement heavily depends on the @b{(R7)} and @b{(R8)}
214requirements.
215@end table
216
217@section Requirements Selection
218
219
220@subsection Requirement We Will Take Into Account For the First Implementation
221
222@table @b
223
224@item [(R1)]:
225Obviously.
226
227@item [(R2)]:
228As these are our targets. Of course other will be free to contribute.
229We will however document the works that needs to be done in order to port the
230debug code to other processors,
231
232@item [(R3)]:
233We think it is feasible with only few RTEMS modifications,
234
235@item [(R5)]:
236We think serial line debugging is nowadays too restrictive as most equipment
237are now connected via Ethernet,
238
239@item [(R6)]:
240This is a documentation problem and should be fairly easy to describe
241once we have the RGDBSD code,
242
243@item [(R9)]:
244We will try to provide the multi-thread target system presentation,
245@end table
246
247@subsection Requirements We Will Not Implement
248
249@table @b
250
251@item [(R4)]:
252it will not be implemented for the moment. It is just a matter on implementing
253SLIP in the FreeBSD stack and alternative solutions already exist in the meantime,
254
255@item [(R7)]:
256To simplify the first developments, we don't plan to implement a @emph{dedicated}
257nano-kernel to allow the RTEMS kernel to be debugged. It means that, if any
258breakpoint is set in the kernel, unpredictable behaviors can occur. So, developers
259must keep in mind to avoid stopping the kernel. They must also keep in mind,
260in order to not stop the kernel, that the user's tasks must have a lower priority
261than the tasks used for debug. The solution is to use a specific very-high priority
262level for the system tasks used directly or indirectly by RGDBSD. The SYSTEM_TASK
263attribute that already exists should be fine.
264
265@item [(R8)]:
266To avoid increasing the code size and the used memory and because the
267FreeBSD stack doesn't need to be debug any more, we choose not to implement
268a minimal TCP/IP stack but rather to use the FreeBSD one as communication protocol,
269
270@item [(R10)]:
271We will see later when a file system will be available and we can implement
272@b{exec} system call,
273
274@item [(R11)]:
275Without a separate TCP/IP stack it will be hard to freeze the system
276as some interrupts must occur in order to enable the FreeBSD stack to function,
277@end table
278
279@section Implied Restrictions
280
281High priority level must be used for these features :
282
283@itemize @bullet
284
285@item FreeBSD interrupt handling thread,
286
287@item Debugger threads.
288@end itemize
289
290This will allows these tasks not to be stopped when a process is stopped
291in debug mode
292
293If we don't want to use a ``specific'' priority level, we must affect
294priority to each of these tasks as follow :
295
296@itemize @bullet
297
298@item FreeBSD stack (high priority)
299
300@item Debugger (less high priority)
301@end itemize
302
303The user must remember the higher priority level he can use for his
304software in order not to block one of the previous threads and to not put breakpoints
305in part of the code executed by RGDBSD.
306
307
Note: See TracBrowser for help on using the repository browser.