This is the mail archive of the gdb@sources.redhat.com 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/MI Output Syntax


Bob Rossi <bob@brasko.net> wrote:

~"GNU gdb 6.1-debian\n"
~"Copyright 2004 Free Software Foundation, Inc.\n"
~"GDB is free software, covered by the GNU General Public License, and you are\n"
~"welcome to change it and/or distribute copies of it under certain conditions.\n"
~"Type \"show copying\" to see the conditions.\n"
~"There is absolutely no warranty for GDB. Type \"show warranty\" for details.\n"
~"This GDB was configured as \"i386-linux\"."
~"\n"
(gdb)


This looks almost okay to me, it's just got a few differences with
newline characters versus the grammar

  output -> (out-of-band-record)* [result-record] "gdb" NL
  (out-of-band-record)* -> stream_record stream_record stream_record stream_record stream_record stream_record stream_record stream_record
  stream_record -> console_stream_output
  console_stream_output -> "~" C_STRING
  [result-record] ->

It is eight stream-records in a row, where each stream-record is a
console-stream-output.  The gotcha is that the grammar as written does
not allow for a NL after a console-stream-output or a stream-record.

That's clearly a bug in the doco. Any half decent compiler construction course will use a new grammer each year (while stopping cheats, also means that the students get to flush out a few bugs :-).


-> should all the [missing] @var{nl} be moved to @var{output}, that way the're all in the one place.

Rossi writes:
Yes, this could work. However, was the original grammer meant to be
LALR(2)?

rewritable into something needing only one level of look-ahead, which I see is being done.


Andrew




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