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


On Thu, Jan 06, 2005 at 04:36:13PM -0800, Jim Ingham wrote:
> Sorry for not responding, we're really busy here right now.
> 
> I don't think there is any way to use your parser that won't involve 
> changing the testsuite files.  After all, they are just passing regular 
> expressions, and unless you are ALSO willing to write a parser that 
> turns the mi testsuite regular expressions into some sensible form (not 
> something I would suggest) you are going to have to rewrite these 
> tests.

OK, so rewriting the tests is fine. They are not very complicated.

> I was more thinking of this as a project that you would use to write 
> new tests, and then any time a change in the mi output broke a test 
> case, you could rewrite it using the new form - since you are going to 
> have to rewrite it anyway...

That's sounds OK. However, I would like to rewrite a few of them now, so
that I can test that the parser is working.

> The way that I was thinking to use the parser, is to write a command 
> like: "gdb_mi_parse_output" that would take the mi output, run your 
> parser on it, and turn the result into some Tcl data structure. This 
> would be a C based command, so we would have to build a little Tcl 
> extension to do this, and include it with gdb when we ran the test 
> suite.

Here's the deal, I already have the C function that takes an MI output
command, parses it, and returns a tree that represents the command. 

   int gdbmi_parser_parse_string ( 
       gdbmi_parser_ptr parser, /* a gdbmi parser context */
       const char *mi_command,  /* command the parser should parse */
       gdbmi_output_ptr *pt );  /* The parse tree */

If Tcl is like C (struct, enum's, union's) I could easily put the parse
tree declaration in some common file and generate both the C and the Tcl
data structures. This part could be done in just a few days if I could
get some guidance on how Tcl works.

> The mi output is all basically just nested lists, so you could probably 
> express it as a nested list pretty easily.  I'd have to think a bit 
> about how to design this well.  Anyway, then you could rewrite the test 
> suite cases to just pull fields out of the Tcl data structure, and see 
> if the values were what was expected.

This part I could do also. In fact, I need to do essentially this to
make my front end work. It's all the same code. I think taking this step
would do a lot in the sense of standardizing the output of GDB/MI.

>  Unfortunately, I am definitely not going to have any time to work on 
> this in the next little while, however.

If you could help me with some technical details, I'd be happy to do the
rest of the work. Is this possible or are you just to maxed out?

Thanks,
Bob Rossi


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