Archive for September 30th, 2009

Code Medic on Mac OS X

After months of thinking and scheming, it looks like I have finally fixed Code Medic to work with gdb on OS X. This removes a major blocker for the upcoming release.

In their infinite wisdom, Apple chose to dramatically rewrite the existing MI2 interpreter in their version of gdb instead of creating a new interpreter. Apple’s version does not block while the program is running, but it does refuse to execute most commands, and there does not seem to be any way to change this behavior. In addition, Apple’s version does not push notifications of state changes, e.g., hitting a breakpoint. The net result is that it’s very hard to know when Apple’s gdb will accept a command without constantly pinging it — and that’s what I ended up doing.

I only discovered this after rewriting Code Medic’s gdb module to use MI2. Not that I regret it — MI2 output is much easier to parse — but finding out that it completely broke Code Medic on OS X was not a happy discovery. And you cannot simply download the gdb source and compile it, because it will refuse to compile on OS X! So I had to do it the hard way and put in some extra code that only executes on OS X. The gdb module is a tricky beast, so it took a long time to figure out the right way to modify it, but I’m happy with the result, because the diff is actually quite small!

Add comment September 30th, 2009


 Subscribe in a reader

Follow on twitter

Bookmark and Share

Calendar

September 2009
M T W T F S S
« Aug   Oct »
 123456
78910111213
14151617181920
21222324252627
282930  

Posts by Month

Posts by Category