This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
RE: GDB frontends, MI-speak and object notation
- From: "Marc Khouzam" <marc dot khouzam at ericsson dot com>
- To: "Dmitry Dzhus" <dima at sphinx dot net dot ru>, <gdb at sources dot redhat dot com>
- Date: Thu, 28 May 2009 09:31:42 -0400
- Subject: RE: GDB frontends, MI-speak and object notation
- References: A<87d49tv3z2.fsf@sphinx.net.ru>
> I wonder how other front-end developers handle GDB/MI output messages.
> In the code I'm working on, regular expressions are used to parse MI
> messages and extract certain values from them. This is pretty
> straightforward to write, but doesn't seem to fully use the
> <structuredness> of MI-speak, and lacks the spirit of MI. I'm
> reviewing
> means of mapping MI (which seems to be a subset of JSON with a few
> cosmetic differences and exceptions) to object-like
> structures so I can
> work with it on a higher level. Has anyone had similar ideas?
Yes, in Eclipse we parse the MI output into a hierarchy of classes
following the MI specification. I agree with you that using
regular expression is loosing the value of MI.
I suggest you write a small parser that would extract
the hierarchical elements of the MI output and create a
structure you can access after.
I can point you to the java code of our parser if you'd like.
Marc