RTEMS Logo

RTEMS 4.6.99.3 On-Line Library


Requirements Analysis

PREV UP NEXT Bookshelf RTEMS Remote Debugger Server Specifications

3.2: Requirements Analysis

[(R1)]:
Worth recalling it. It mainly imposes few restrictions on the binary files type, target processor type as :
[(R2)]:
Our primary targets are Intel and PowerPC. We however do not think implementing RGDBSD for other processors will be a heavy task. It will mainly require :
  1. Implementing exception handling for the target processor,
  2. Interfacing the generic part of RGDBSD with the low level exception handling and make RGDBSD aware of exception used for debugging (usually illegal instruction or dedicated trap, single step),
  3. Making GDB aware of the frame layout pushed on exceptions,
  4. Implement the code for data transfer for the exception frame,
  5. Implement code to copy data cache back to main memory and invalidate instruction cache. This is needed in order to be sure opcode modification used to set breakpoint that use the data cache will be proagated to the instruction cache,

As soon as we will have completed the first core work a document describing how to port it to a new processor should be written. So far we will organize the source tree with processor dependent directories so that port will be as easy as possible. May be a bare processor support should be created,

[(R3)]:
GDB already has an interface for manipulating multi-threaded programs. This interface is rather weak at the moment but it will certainly be improved in the future with the generalization of POSIX thread API on Linux and other operating systems. This implies that either GDB or RGDBSD is able to obtain the list of threads currently executing. The choice of implementing this in GDB or RGDBSD is a tradeof between target code size and simplicity,
[(R4)]:
Regular GDB code contains clients code for debugging over a serial line. However only few functions are implemented. We would like to provide a better support and to uniformize serial line debugging with debugging over Ethernet via the use of SLIP,
[(R5)]:
Regular GDB code contains client code for debugging over Ethernet for VxWorks via the SUN RPC library. So there will be at least one starting point to implement remote debugging over Ethernet via SUN RPC. The Chorus remote debugging code has been disclosed under GPL and also contains code for debugging suing SUN RPC,
[(R6)]:
Due to a classical chicken and egg problems, the remote debugging daemon cannot be used to debug code it uses to function. Thus depending on the API used by RGDBSD, some parts of the target system will not be debuggable via GDB. The most important point is documentation because my feeling is that implementing RGDBSD on a totally different dedicated nano kernel should be possible,
[(R7)]:
RTEMS core executive is a real-time OS which implements priority level scheduling, synchronization objects, and interrupt handling. As mentioned in previous item, we may not debug theses features if RGDBSD uses them. This requirement is thus very strong because it impose that :
  1. RGDBSD is totally interrupt driven (no thread API available),
  2. But it does not use RTEMS interrupt management,
  3. Nor does not use RTEMS exception management,
  4. RGDBSD must provide its own UDP/IP stack as the current FreeBSD code rely on tasks switching and RTEMS provided synchronization object for input path handling,

So our feeling is that the (R7) more or less requires to write a dedicated nano kernel with a very small dedicated UDP/IP stack.

[(R8)]:
GDB remote debugging over Ethernet code communicates with the remote target via the SUN RPC protocol. This requires a UDP/IP protocol and a minimal socket like interface. In RTEMS environment, this feature is currently provided by the FreeBSD stack. Again, if we use the FreeBSD stack itself for remote communication, it will be impossible to debug this stack as a breakpoint in the stack code will stop its execution and there would be no more way to communicate with the target. A solution consists in implementing a minimal, dedicated UDP/IP stack (with at least IP and UDP protocols, a minimal BSD sockets) and a simple SUN RPC library, which will be both dedicated to the debug. We can use RTEMS API to implement it if (R7) is not required. As the two stack will need to share the same chip, a kind of shared filter must be implemented at the bottom of the two stacks so that Ethernet frames can be dynamically directed either to the dedicated UDP/IP debug stack or to the regular FreeBSD stack. The fact that in the current design, the low level ethernet input routine mainly signal a thread should facilitate the design of this filter. The output path is less complicated as it is run by a task and thus can sleep on a synchronization object,
[(R9)]:
This requirement represents what we find reasonable as a first target. However, we can still present to the final user this kind of debugging via different model. RTEMS can be represented as a single threaded system or, because RTEMS is a multitasking system, as an ensemble of separate tasks. In the first representation, the debugger sees only 1 ``task'' without distinguishing the core executive part from the applicative part. This is the simplest way to implement the debugger but also implies that there is no way to protect the core executive. Some of these tasks are system tasks (tasks form the core executive and from the FreeBSD stack), the other ones are tasks implemented by the developer. The developer wants to debug his tasks, and sometimes only one of his tasks. We can provide a way to debug not the entire system but only the concerned task by testing if the current running task is a debugged task (test on the task identifier). GDB offers an API to ``detach'' thread so that if a detached thread hits a breakpoint it is automatically restarted without user intervention,
[(R10)]:
Several developers can work on a large project, each on a specific module. Sometimes only one target is available for everyone. This requirements is not really meaningfull until RTEMS supports dynamic code loading,
[(R11)]:
This requirement heavily depends on the (R7) and (R8) requirements.


PREV UP NEXT Bookshelf RTEMS Remote Debugger Server Specifications

Copyright © 1988-2004 OAR Corporation