From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12967 invoked by alias); 15 Sep 2009 00:23:13 -0000 Received: (qmail 12958 invoked by uid 22791); 15 Sep 2009 00:23:13 -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-f180.google.com (HELO mail-px0-f180.google.com) (209.85.216.180) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 15 Sep 2009 00:23:08 +0000 Received: by pxi10 with SMTP id 10so3114246pxi.24 for ; Mon, 14 Sep 2009 17:23:07 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.210.13 with SMTP id i13mr524218wfg.304.1252974187388; Mon, 14 Sep 2009 17:23:07 -0700 (PDT) In-Reply-To: <4AAAB750.8000209@vmware.com> References: <4AAAB750.8000209@vmware.com> From: Hui Zhu Date: Tue, 15 Sep 2009 00:23:00 -0000 Message-ID: Subject: Re: [RFA] reverse debugging tests To: Michael Snyder Cc: "gdb-patches@sourceware.org" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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-09/txt/msg00472.txt.bz2 It works OK with me. Thanks, Hui On Sat, Sep 12, 2009 at 04:47, Michael Snyder wrote: > Note, I've only done one of the several tests here -- > if this change is approved, I'll change the others the same way. > > This patch is to make the reverse debugging tests auto-detect > the targets that they can run on, to eliminate the need for > using a board description file to run them. > > It's tricky, because we have to detect several different kinds > of targets: > 1) Native Linux, which can be detected early, and > 2) Remote targets that answer the qSupported probe appropriately, > which can't be tested until after gdb connects to the target. > > So I've made two changes: > > 1) In place of "if ![target_info exists gdb,can_reverse]" > substitute > +if [istarget "*linux*"] then { > + =A0 =A0if { ![istarget "i?86-*linux*"] && ![istarget "amd64-*linux*"] }= then { > + =A0 =A0 =A0 # test process record on i?86 and amd64 linux > + =A0 =A0 =A0 return; > + =A0 =A0} > +} > > > and > 2) After "runto main", this substitution: > > -if [target_info exists gdb,use_precord] { > - =A0 =A0# Activate process record/replay > - =A0 =A0gdb_test "record" "" "Turn on process record" > - =A0 =A0# FIXME: command ought to acknowledge, so we can test if it succ= eeded. > +if ![target_info exists use_gdb_stub] then { > + =A0 =A0if { [istarget "i?86-*linux*"] || [istarget "amd64-*linux*"] } t= hen { > + =A0 =A0 =A0 # Activate process record/replay > + =A0 =A0 =A0 gdb_test "record" "" "Turn on process record" > + =A0 =A0 =A0 # FIXME: command ought to acknowledge, so we can test if it > succeeded. > + =A0 =A0} > +} > + > +if [target_info exists use_gdb_stub] then { > + =A0 =A0send_gdb "show remote reverse-continue\n" > + =A0 =A0gdb_expect { > + =A0 =A0 =A0 -re ".* currently enabled.*$gdb_prompt " { > + =A0 =A0 =A0 } > + =A0 =A0 =A0 -re ".*$gdb_prompt " { > + =A0 =A0 =A0 =A0 =A0 return > + =A0 =A0 =A0 } > + =A0 =A0} > =A0} > > > 2009-09-11 =A0Michael Snyder =A0 > > =A0 =A0 =A0 =A0* gdb.reverse/step-reverse.exp: Explicitly check for targe= ts > =A0 =A0 =A0 =A0that can support reverse debuggnig. > > Index: step-reverse.exp > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > RCS file: /cvs/src/src/gdb/testsuite/gdb.reverse/step-reverse.exp,v > retrieving revision 1.2 > diff -u -p -r1.2 step-reverse.exp > --- step-reverse.exp =A0 =A014 Jul 2009 20:17:26 -0000 =A0 =A0 =A01.2 > +++ step-reverse.exp =A0 =A011 Sep 2009 19:14:19 -0000 > @@ -20,8 +20,11 @@ > =A0# Test step and next in reverse > =A0# > > -if ![target_info exists gdb,can_reverse] { > - =A0 =A0return > +if [istarget "*linux*"] then { > + =A0 =A0if { ![istarget "i?86-*linux*"] && ![istarget "amd64-*linux*"] }= then { > + =A0 =A0 =A0 # test process record on i?86 and amd64 linux > + =A0 =A0 =A0 return; > + =A0 =A0} > =A0} > > =A0set testfile "step-reverse" > @@ -33,10 +36,23 @@ if { [prepare_for_testing $testfile.exp > > =A0runto main > > -if [target_info exists gdb,use_precord] { > - =A0 =A0# Activate process record/replay > - =A0 =A0gdb_test "record" "" "Turn on process record" > - =A0 =A0# FIXME: command ought to acknowledge, so we can test if it succ= eeded. > +if ![target_info exists use_gdb_stub] then { > + =A0 =A0if { [istarget "i?86-*linux*"] || [istarget "amd64-*linux*"] } t= hen { > + =A0 =A0 =A0 # Activate process record/replay > + =A0 =A0 =A0 gdb_test "record" "" "Turn on process record" > + =A0 =A0 =A0 # FIXME: command ought to acknowledge, so we can test if it > succeeded. > + =A0 =A0} > +} > + > +if [target_info exists use_gdb_stub] then { > + =A0 =A0send_gdb "show remote reverse-continue\n" > + =A0 =A0gdb_expect { > + =A0 =A0 =A0 -re ".* currently enabled.*$gdb_prompt " { > + =A0 =A0 =A0 } > + =A0 =A0 =A0 -re ".*$gdb_prompt " { > + =A0 =A0 =A0 =A0 =A0 return > + =A0 =A0 =A0 } > + =A0 =A0} > =A0} > > =A0# plain vanilla step/next (no count) > >