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:
> Hmmm, this are some ideas, what do you think?
>    1. Run gdb through tee and pipe only GDB's stdout to a place where we
>       can validate it's output.
>    2. Have GDB output it's stdout to 2 places somehow, similar to the
>    idea above (except maybe a new GDB logging feature), so that the output 
>    can be parsed.
>    3. Create a new process, that invokes GDB, validates the output, and
>    output's exactly what GDB used to output.
>    4. Somehow parse the output of GDB, through tcl like you are
>    suggesting?

I think we won't get to a solution today.

It's really a problem at the dejagnu/testsuite level.  We've got this
output stream, but it's mixed in with "PASS: foo" and "Executing on
host: bar" in gdb.log.

At the test suite level, the TCL code is holding the output and
could do something with it.  But it's nontrivial for TCL code to
interface with a C library.  (I'm not about to rebuild the 'expect'
binary).

Also this might relate to "separating gdb output from inferior output".

bob> I don't use this rule in the grammar. I have the lexer return NEWLINE.

That's okay, too.  Either way is fine with me.

I'd like your grammar and the reference grammar to be identical,
so that we know that the reference grammar actually works.

Grammar comments:

===

Can you write the terminal symbols in ALL CAPS;
that's the usual style for bison grammars.

I think the terminals are:

  STRING C_STRING CR LF TOKEN
  "(gdb)" "^" "*" "+" "=" "," "~" "@" "&"
  "done" "running" "connected" "error" "exit"
  "stopped"

The literal strings are okay as is, but I'd really like
symbolic terminals capitalized.

===

Hmmm, in my gdb.log, there is a space in "(gdb) ^M", but in
the gdb.texinfo grammar and the new grammar, there is no space.

===

In the result_record rules:

  result_record -> opt_token "^" result_class
  result_record -> opt_token "^" result_class "," opt_result_list

In the second form, if there is a ",", there must be at least
one result.  So the last symbol should be result_list rather
than opt_result_list.

===

Same deal with the async_output rule:

  async_output -> async_class "," opt_result_list

This should be like result_record.  If opt_result_list is empty
then there is no "," .  Example:

  403*stopped^M
  (gdb) ^M

In fact async_output doesn't add much value to the grammar.
How about just:

  async_record -> opt_token async_record_class async_class
  async_record -> opt_token async_record_class async_class "," result_list


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