MOSA-0005: Kernel debugger architecture, interfaces and components

Coordinator
Jan 13, 2009 at 5:45 PM
I've posted an initial, incomplete draft of the new Kernel debugger architecture, interfaces and components RFC in our wiki. Please discuss this RFC in this thread.

Overview:

This RFC discusses the MOSA kernel debugging model. This model describes all components required to build kernel debugging support into a MOSA compliant kernel as well as the interaction with debuggers running on a client system.


Please comment in this thread, as we will need debugging support from the start in order to be able to efficiently write more components for MOSA. Some help from people, which know the GDB protocol or the Win32 kernel debugger protocol are welcome as long as your contribution is not tainted.
Developer
Jan 21, 2009 at 3:28 AM
I don't have anything glaring to correct in this. I would request that interface definitions be given in code rather than in pictures from VS's code explorer. The class diagrams do not show return types, parameters, etc.

I do not know whether Jonathan is still actively watching this list. But he previously did some work on a kernel debugging system that could parse PDB and GDB symbol dumps, along with the start of an XML-based debug dump.

BTW, when it comes to symbol information, are we going to allow selection of the emitted symbol type to be used in a native code stream? Or will the choice of symbols be governed by the native code object format? e.g. usually when you have an ELF file, you think of GDB symbols being included. PE would have PDB. Would GDB symbols be embedded into a PE native code stream, and vice versa?

--S

__grover wrote:

From: __grover

I've posted an initial, incomplete draft of the new Kernel debugger architecture, interfaces and components RFC in our wiki. Please discuss this RFC in this thread.

Overview:

This RFC discusses the MOSA kernel debugging model. This model describes all components required to build kernel debugging support into a MOSA compliant kernel as well as the interaction with debuggers running on a client system.


Please comment in this thread, as we will need debugging support from the start in order to be able to efficiently write more components for MOSA. Some help from people, which know the GDB protocol or the Win32 kernel debugger protocol are welcome as long as your contribution is not tainted.

Coordinator
Jan 21, 2009 at 7:00 AM
I'll add VS interface definitions - I haven't thought in detail of all methods, I'd need some feedback from the debugging protocols (mostly GDB in this case) to get that "right".

Symbol information:

My current plan is to extend mosacl with a -g switch, which will emit debug symbols in a seperate file with a link to the debug information in the emitted binary. The debug format will again be switchable, maybe even multiple formats at once. The current plan is to get GDB support by emitting DWARF2 or STABS symbols initially. I've been hacking through the managed PDB format in order to be able to read Microsofts symbol information and have gotten quite far (shameless plug: Watch my blog at www.michaelruck.de for more.) Finally the compiler needs some work to preserve the mapping from the C# code to the native code emitted. Most of the help needed in this area would be with the symbol information file formats themselves, e.g. to emit DWARF2, STABS, native PDB or to read MDB and CILDB files - The PDB reader is almost done. I'll contact Jonathan about it.

To summarize: We'll be able to read managed PDB, mdb, cildb and we will write at least DWARF2 or STABS in the first place, which allows us to use GDB to debug our files. The symbols will be emitted in a seperate file, since we won't have in-situ debugging for some time, however again a switch can redirect this to the binary if needed. It will be possible to mix PE with DWARF2 symbols, GDB handles this AFAIK.

I've been experimenting the the System.Diagnostics.SymbolStore namespace for this, but I find it in some ways lacking - I'll make the managed PDB reader compatible to it. However we can't write native symbols with the ISymbolWriter - at least PDB symbols - unless I've missed something, as the API is not rich enough.

Mike