From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4703 invoked by alias); 13 Jul 2009 03:32:08 -0000 Received: (qmail 4693 invoked by uid 22791); 13 Jul 2009 03:32:07 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-px0-f183.google.com (HELO mail-px0-f183.google.com) (209.85.216.183) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 13 Jul 2009 03:32:00 +0000 Received: by pxi13 with SMTP id 13so778764pxi.12 for ; Sun, 12 Jul 2009 20:31:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.105.10 with SMTP id d10mr1256444wfc.89.1247455917210; Sun, 12 Jul 2009 20:31:57 -0700 (PDT) In-Reply-To: <6D19CA8D71C89C43A057926FE0D4ADAA07B71A3E@ecamlmw720.eamcs.ericsson.se> References: <4A5930EE.3040201@vmware.com> <4A5A19FC.9050206@vmware.com> <6D19CA8D71C89C43A057926FE0D4ADAA07B71A36@ecamlmw720.eamcs.ericsson.se> <200907122007.38248.pedro@codesourcery.com> <6D19CA8D71C89C43A057926FE0D4ADAA07B71A3E@ecamlmw720.eamcs.ericsson.se> From: Hui Zhu Date: Mon, 13 Jul 2009 05:34:00 -0000 Message-ID: Subject: Re: Testing of reverse debug commands To: Marc Khouzam , Pedro Alves , Michael Snyder , Jan Kratochvil , Joel Brobecker Cc: gdb-patches ml Content-Type: multipart/mixed; boundary=001636e1fcb6d17caf046e8df6b6 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-07/txt/msg00355.txt.bz2 --001636e1fcb6d17caf046e8df6b6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-length: 3800 On Mon, Jul 13, 2009 at 03:25, Marc Khouzam wrot= e: >> -----Original Message----- >> From: Pedro Alves [mailto:pedro@codesourcery.com] >> Sent: July-12-09 3:08 PM >> To: gdb@sourceware.org >> Cc: Marc Khouzam; Michael Snyder; Jan Kratochvil; Joel >> Brobecker; Hui Zhu >> Subject: Re: Testing of reverse debug commands >> >> On Sunday 12 July 2009 19:49:58, Marc Khouzam wrote: >> >> > From a frontend perspective, the current 'record' command >> is not very >> > good. >> >> > First, there is no MI equivalent, although that is not a big deal. >> > But since it does not report error, the frontend must always assumes >> > that >> > the command worked. >> >> Are you sure that is the case with "record"? =A0I see `error' calls >> in record.c:record_open. =A0If there are some missing, let's add them. > > As usual you are right. :-) > > (gdb) record > &"record\n" > &"Process record target can't debug inferior in asynchronous mode > (target-async).\n" > ^error,msg=3D"Process record target can't debug inferior in asynchronous > mode (target-async)." > (gdb) > > I had made the assumption that 'record stop' was the same as 'record'. > >> > Below you can see that using 'record stop' directly will >> give a ^done >> > instead of an ^error when it fails (although there is an >> error message >> > but we don't parse those in Eclipse). =A0Also, using -interpreter-exec >> > is even worse as even the error message is gone. >> >> Note that "record stop" is really a different command, although >> it shares a common "record" prefix. >> >> > >> > (gdb) >> > record stop >> > &"record stop\n" >> > ~"Process record is not started.\n" >> > ^done >> > (gdb) >> >> > So, I think some improvement would be nice for frontends. >> >> So, is this really an error? =A0Hui seems to have thought >> it wasn't. =A0Hui? =A0If it is, then it's just a matter of >> changing the corresponding printf_unfiltered calls in >> record.c to `error' calls (look for the "Process record >> is..." string). >> Then MI will get an ^error,msg=3D"foo", instead of a ~"foo" + ^done. > > That would be more consistent for a frontend. =A0The frontend > can then decide if this should be reported as an error or simply > accepted. =A0But that is not such a big deal anymore, now that > you pointed out 'record' itself does report an error. > I think the record's query and something is make a lot of troubles. I make a patch for it. Please help me with it. Thanks, Hui 2009-07-13 Hui Zhu * record.c (record_open): Change "query" to "error". (cmd_record_stop): Change "query" to "printf_unfiltered". --- record.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) --- a/record.c +++ b/record.c @@ -436,12 +436,8 @@ record_open (char *name, int from_tty) /* Check if record target is already running. */ if (current_target.to_stratum =3D=3D record_stratum) - { - if (!nquery - (_("Process record target already running, do you want to delete " - "the old record log?"))) - return; - } + error (_("Process record target already running. Use \"record stop\" = to " + "stop record target first.")); /*Reset the beneath function pointers. */ record_beneath_to_resume =3D NULL; @@ -1157,9 +1153,9 @@ cmd_record_stop (char *args, int from_tt { if (current_target.to_stratum =3D=3D record_stratum) { - if (!record_list || !from_tty || query (_("Delete recorded log and " - "stop recording?"))) - unpush_target (&record_ops); + unpush_target (&record_ops); + printf_unfiltered (_("Process record is stoped and all execution " + "log is deleted.\n")); } else printf_unfiltered (_("Process record is not started.\n")); --001636e1fcb6d17caf046e8df6b6 Content-Type: text/plain; charset=US-ASCII; name="prec_remove_query.txt" Content-Disposition: attachment; filename="prec_remove_query.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: f_fx2n4ewp0 Content-length: 1582 LS0tCiByZWNvcmQuYyB8ICAgMTQgKysrKystLS0tLS0tLS0KIDEgZmlsZSBj aGFuZ2VkLCA1IGluc2VydGlvbnMoKyksIDkgZGVsZXRpb25zKC0pCgotLS0g YS9yZWNvcmQuYworKysgYi9yZWNvcmQuYwpAQCAtNDM2LDEyICs0MzYsOCBA QCByZWNvcmRfb3BlbiAoY2hhciAqbmFtZSwgaW50IGZyb21fdHR5KQogCiAg IC8qIENoZWNrIGlmIHJlY29yZCB0YXJnZXQgaXMgYWxyZWFkeSBydW5uaW5n LiAgKi8KICAgaWYgKGN1cnJlbnRfdGFyZ2V0LnRvX3N0cmF0dW0gPT0gcmVj b3JkX3N0cmF0dW0pCi0gICAgewotICAgICAgaWYgKCFucXVlcnkKLQkgIChf KCJQcm9jZXNzIHJlY29yZCB0YXJnZXQgYWxyZWFkeSBydW5uaW5nLCBkbyB5 b3Ugd2FudCB0byBkZWxldGUgIgotCSAgICAgInRoZSBvbGQgcmVjb3JkIGxv Zz8iKSkpCi0JcmV0dXJuOwotICAgIH0KKyAgICBlcnJvciAoXygiUHJvY2Vz cyByZWNvcmQgdGFyZ2V0IGFscmVhZHkgcnVubmluZy4gIFVzZSBcInJlY29y ZCBzdG9wXCIgdG8gIgorCSAgICAgInN0b3AgcmVjb3JkIHRhcmdldCBmaXJz dC4iKSk7CiAKICAgLypSZXNldCB0aGUgYmVuZWF0aCBmdW5jdGlvbiBwb2lu dGVycy4gICovCiAgIHJlY29yZF9iZW5lYXRoX3RvX3Jlc3VtZSA9IE5VTEw7 CkBAIC0xMTU3LDkgKzExNTMsOSBAQCBjbWRfcmVjb3JkX3N0b3AgKGNoYXIg KmFyZ3MsIGludCBmcm9tX3R0CiB7CiAgIGlmIChjdXJyZW50X3RhcmdldC50 b19zdHJhdHVtID09IHJlY29yZF9zdHJhdHVtKQogICAgIHsKLSAgICAgIGlm ICghcmVjb3JkX2xpc3QgfHwgIWZyb21fdHR5IHx8IHF1ZXJ5IChfKCJEZWxl dGUgcmVjb3JkZWQgbG9nIGFuZCAiCi0JICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICJzdG9wIHJlY29yZGluZz8iKSkpCi0JdW5w dXNoX3RhcmdldCAoJnJlY29yZF9vcHMpOworICAgICAgdW5wdXNoX3Rhcmdl dCAoJnJlY29yZF9vcHMpOworICAgICAgcHJpbnRmX3VuZmlsdGVyZWQgKF8o IlByb2Nlc3MgcmVjb3JkIGlzIHN0b3BlZCBhbmQgYWxsIGV4ZWN1dGlvbiAi CisgICAgICAgICAgICAgICAgICAgICAgICAgICAibG9nIGlzIGRlbGV0ZWQu XG4iKSk7CiAgICAgfQogICBlbHNlCiAgICAgcHJpbnRmX3VuZmlsdGVyZWQg KF8oIlByb2Nlc3MgcmVjb3JkIGlzIG5vdCBzdGFydGVkLlxuIikpOwo= --001636e1fcb6d17caf046e8df6b6--