Syndicate the Cosmos Blog Feed.

NGDB

GDB opened up to .Net. [jonathand]

NGDB

We are using GDB to debug the kernel, why? Because QEMU supports it out-of-the-box.

Today I managed to get it into the managed world :). By using the GDB Remote Serial Protocol I was able to communicate with GDB via ethernet. It isn't that hard, and just needs some really basic knowledge about sockets.

Gripes

It's really nice to see this kind of stuff running alongside .Net, but there are a few gripes. Mostly the fact that the commands that the GDB client support are not supported by the server, such as "info reg eip". It's just a plain mission to find some good byte layouts to read in the registers. I looked in the GDB code but, alas, it's a mess (such is the world of C/++). I think I got them right.

I am considering my options, but it seems to be working now.

Speed

Matthijs was getting about 0.2 ops per second with his std in/out based client. I am getting about 60 ops per second with mine. That's a nice improvement.

Future

We are generally (at least for a long time) going to adopt the GDB protocol for our debugging. Which means, hopefully, I can wire the GDB library I wrote into VS - once we get some debug info from IL2CPU and I come to terms with PDB.

Code

This is the type of code the library allows. It's pretty damn cool!!!


GdbConnection connection = new GdbConnection();
GdbController.Instance = new GdbController(connection);
GdbController.Instance.Extended(); // Open with extend protocol support.

new ContinueCommand().Send(); // Send the Continue command. ("c")