This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: GDB frontends, MI-speak and object notation


 
> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]