Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Bob Rossi <bob_rossi@cox.net>
To: Nick Roberts <nickrob@snap.net.nz>
Cc: gdb@sources.redhat.com
Subject: Re: asynchronous MI output commands
Date: Sat, 06 May 2006 16:40:00 -0000	[thread overview]
Message-ID: <20060506120656.GJ25114@brasko.net> (raw)
In-Reply-To: <17500.6025.227765.592238@farnswood.snap.net.nz>

On Sat, May 06, 2006 at 03:27:05PM +1200, Nick Roberts wrote:
>  > Starting with this MI output command, 
>  >   -file-list-exec-source-file
>  >   ^done,line="1",file="main.c",fullname="/home/bob/cvs/gdbmi/builddir/src/main.c"
>  >   (gdb)
>  > I get back a parse tree, and from that, I'll define something like,
>  > 
>  > struct file_list_exec_source_file
>  > {
>  >   int line;
>  >   char *filename;
>  >   char *fullname;
>  > };
>  > 
>  > with the correct values filled in.
>  
> Presumably Emacs would need the parser to output Lisp.

Sounds great to me.

>  > So far, I've created the parse tree code, and a small TCL extension
>  > which allows me to grab all of the MI output commands from the
>  > testsuite. I've written all of these output commands to a temporary file,
>  > which I use for input to my drive program.
> 
> Emacs has a Lisp interpreter, of course, so it could take Lisp output from a
> parser and act on it.  AFAIK C isn't interpreted, so how does your program use
> it?

I probably wasn't clear here. I have the MI parser, which just creates
the parse tree. I wrote a small TCL extension that is capable of taking
an MI output command and writing it to a file if the parse passed.

            set parse_result [gdbmi_parse $expect_out(2,string)]
            if [string match "syntax error" $parse_result] then {
              puts "MI_OUTPUT_COMMAND($expect_out(2,string))"
              fail "Syntax check of MI Output Command failed"
            } else {
               puts -nonewline $fileId $expect_out(2,string)
            }
So, after I run the testsuite, I have all the valid MI output commands
from the test suite in /tmp/data.mi.

Then, I have a driver program which reads a file that has MI
descriptions in it (/tmp/data.mi) and parses each of them. I am know
starting to work on the part that takes the parse tree and provides a
semantically correct data structure for the front end to use. The only
reason I wrote the tcl extension is to validate the test suite. It
turned out I was also easily able to gather a bunch of MI output
commands for testing as well.

>  > My question is, should we say it's a bug on GDB's part if reason= isn't
>  > the first pair returned for an asynchronous MI output command? Should I
>  > assume if the MI output command has reason= anywhere in it that it's an
>  > asynchronous command? or should we add an extra piece of information into 
>  > the MI output command stating that the command is asynchronous. 
>  > For instance,
>  > 
>  >   47*stopped,asynchronous,reason="end-stepping-range",thread-id="0", ...
> 
> I think you should assume that if it has *stopped, the output is asynchronous.
> Of course, as we've said before, currently all the output (except possibly for
> a remote target) is synchronous in reality.

OK, I will take your suggestion, as well as Daniel's on this point.
Thanks for the help.

Bob Rossi


  reply	other threads:[~2006-05-06 12:06 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-06  1:26 Bob Rossi
2006-05-06  1:59 ` Daniel Jacobowitz
2006-05-06  2:48   ` Bob Rossi
2006-05-06  3:37     ` Nick Roberts
2006-05-06 15:20       ` Bob Rossi
2006-05-06  4:06     ` Daniel Jacobowitz
2006-05-06  4:05       ` Daniel Jacobowitz
2006-05-06 11:53       ` Bob Rossi
2006-05-06 12:06         ` Bob Rossi
2006-05-06  3:14   ` Bob Rossi
2006-05-06  4:04     ` Nick Roberts
2006-05-06 11:49       ` Daniel Jacobowitz
2006-05-06 11:50         ` Bob Rossi
2006-05-06 16:52           ` Daniel Jacobowitz
2006-05-06 19:45             ` Bob Rossi
2006-05-06 20:37               ` Daniel Jacobowitz
2006-05-07  0:44                 ` Bob Rossi
2006-05-07 20:35                   ` Daniel Jacobowitz
2006-05-07 20:42                     ` Bob Rossi
2006-05-07 22:01                       ` Daniel Jacobowitz
2006-05-08  1:22                         ` Bob Rossi
2006-05-08  2:03                           ` Daniel Jacobowitz
2006-05-09 21:48                             ` Bob Rossi
2006-05-08  6:38                           ` Nick Roberts
2006-05-08 11:28                             ` Bob Rossi
2006-05-08  1:26                         ` Bob Rossi
2006-05-06 11:51       ` Bob Rossi
2006-05-06  3:27 ` Nick Roberts
2006-05-06 16:40   ` Bob Rossi [this message]
     [not found] <1147034156.28828.ezmlm@sourceware.org>
2006-05-07 21:27 ` Bjarke Viksoe
2006-05-07 21:41   ` Daniel Jacobowitz
2006-05-10 12:43     ` Vladimir Prus
2006-05-07 22:30 Bjarke Viksoe
2006-05-07 22:50 ` Daniel Jacobowitz
2006-05-08  0:36   ` Bjarke Viksoe
2006-05-08  1:52     ` Daniel Jacobowitz
2006-05-09  9:46 Alain Magloire
2006-05-10 22:15 Alain Magloire
2006-05-11  3:41 ` Bob Rossi
2006-05-11  8:58   ` Vladimir Prus
2006-05-11 10:48     ` Bob Rossi
2006-05-11 10:52       ` Vladimir Prus
2006-05-11 11:14         ` Bob Rossi
2006-05-11 12:50           ` Vladimir Prus
2006-05-11 14:50             ` Bob Rossi
2006-05-11 15:02 Alain Magloire
2006-05-11 15:42 ` Bob Rossi
2006-05-11 16:40   ` Jim Ingham
2006-05-11 17:03     ` Daniel Jacobowitz
2006-05-11 17:35       ` Jim Ingham
2006-05-11 19:24     ` Bob Rossi
2006-05-11 19:25       ` Jim Ingham
2006-05-12  0:19 Alain Magloire

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060506120656.GJ25114@brasko.net \
    --to=bob_rossi@cox.net \
    --cc=gdb@sources.redhat.com \
    --cc=nickrob@snap.net.nz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox