From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13842 invoked by alias); 28 Jun 2012 03:14:26 -0000 Received: (qmail 13827 invoked by uid 22791); 28 Jun 2012 03:14:25 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 28 Jun 2012 03:14:13 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1Sk5BL-0006Mv-W0 from Yao_Qi@mentor.com ; Wed, 27 Jun 2012 20:14:12 -0700 Received: from SVR-ORW-FEM-03.mgc.mentorg.com ([147.34.97.39]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Wed, 27 Jun 2012 20:14:11 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.1.289.1; Wed, 27 Jun 2012 20:14:10 -0700 From: Yao Qi To: CC: Stan Shebs Subject: Re: [PATCH] Logging for MI Date: Thu, 28 Jun 2012 03:14:00 -0000 Message-ID: <2480929.aLxBbTKcEj@qiyao.dyndns.org> User-Agent: KMail/4.8.3 (Linux/3.3.7-1.fc16.i686; KDE/4.8.3; i686; ; ) In-Reply-To: <4FE80E5E.903@earthlink.net> References: <4FE80E5E.903@earthlink.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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: 2012-06/txt/msg00848.txt.bz2 Hi Stan, Some cents on test case. On Monday, June 25, 2012 12:08:14 AM Stan Shebs wrote: > +pass "Log file has '$logcontent'" > + This is not needed, and cause test summary quite long. > +set mi_log_prompt "\[(\]gdb\[)\] \[\r\n\]+" > + > +if [regexp > "\\^done\[\r\n\]+$mi_log_prompt\\^running\[\r\n\]+\\*running,thread-id=3D= \"al > l\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=3D\"end-stepping-range\",.*\[= \r\n\ > ]+$mi_log_prompt\\^running\[\r\n\]+\\*running,thread-id=3D\"all\"\[\r\n\]= +$mi_ > log_prompt\\*stopped,reason=3D\"end-stepping-range\",.*\[\r\n\]+$mi_log_p= rompt > " $logcontent] { + pass "Log file contents" > +} else { > + fail "Log file contents" > +} > + > +# Now try the redirect, which writes into the file only. > + > +mi_gdb_test "-gdb-set logging redirect on" ".*" "redirect logging on" > + > +# Since all output will be going into the file, just keep sending comman= ds > +# and don't expect anything to appear until logging is turned off. > + > +send_gdb "1001-gdb-set logging on\n" > +send_gdb "1002-exec-step\n" > +send_gdb "1003-exec-next\n" > + > +mi_gdb_test "1004-gdb-set logging off" ".*" "redirect logging off" > + > +set chan [open $milogfile] > +set logcontent [read $chan] > +close $chan > + > +pass "Log file has '$logcontent'" > + Likewise. > +if [regexp > "1001\\^done\[\r\n\]+$mi_log_prompt.*1002\\^running\[\r\n\]+\\*running,th= re > ad-id=3D\"all\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=3D\"end-stepping-= range\" > ,.*\[\r\n\]+$mi_log_prompt.*1003\\^running\[\r\n\]+\\*running,thread-id= =3D\"al > l\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=3D\"end-stepping-range\",.*\[= \r\n\ > ]+$mi_log_prompt" $logcontent] { + pass "Redirect log file contents" > +} else { > + fail "Redirect log file contents" > +} > + > +mi_gdb_exit Add "remote_file host delete ${milogfile}" here? --=20 Yao (=E9=BD=90=E5=B0=A7)