This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: MI: type prefixes for values
On Fri, Feb 17, 2006 at 09:25:42PM +0200, Eli Zaretskii wrote:
> > Date: Fri, 17 Feb 2006 14:04:18 -0500
> > From: Daniel Jacobowitz <drow@false.org>
> > Cc: Vladimir Prus <ghost@cs.msu.su>, gdb@sources.redhat.com
> >
> > To correct the record, he's not parsing MI here. He's parsing the
> > value encapsulated within MI, the bit in quotes here:
> > value="4000"
> > or:
> > value="{int (int)} 0xffffffff <sym>"
>
> I understood that part.
>
> > There's no grammar describing what goes in the value string.
>
> How do you mean ``there's no grammar''? Do you mean it cannot be
> written? Or do you mean it was not written yet? If the latter, then
> if I needed to write a code to parse this, I'd write down a formal
> definition of what I'll expect, before writing code to parse that.
I mean that there's no documented grammar, which in turn means (among
other things) that GDB doesn't guarantee its contents as part of a
stable interface. Parsing it is a bad idea; either it's opaque, or it
isn't.
Writing a grammar for it would be difficult-to-impractical. For
functions, it could be any C function type; for arrays, it could be
a list of anything GDB considers a value.
--
Daniel Jacobowitz
CodeSourcery