From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6660 invoked by alias); 4 Dec 2011 01:02:24 -0000 Received: (qmail 6544 invoked by uid 22791); 4 Dec 2011 01:02:22 -0000 X-SWARE-Spam-Status: No, hits=-3.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-vx0-f169.google.com (HELO mail-vx0-f169.google.com) (209.85.220.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 04 Dec 2011 01:02:07 +0000 Received: by vcbfk26 with SMTP id fk26so3691662vcb.0 for ; Sat, 03 Dec 2011 17:02:06 -0800 (PST) Received: by 10.52.94.227 with SMTP id df3mr2245480vdb.51.1322960526946; Sat, 03 Dec 2011 17:02:06 -0800 (PST) MIME-Version: 1.0 Received: by 10.52.94.227 with SMTP id df3mr2245464vdb.51.1322960526739; Sat, 03 Dec 2011 17:02:06 -0800 (PST) Received: by 10.220.97.211 with HTTP; Sat, 3 Dec 2011 17:02:06 -0800 (PST) In-Reply-To: <20111203183613.GA15496@host2.jankratochvil.net> References: <201110271909.37066.pedro@codesourcery.com> <20111028174014.GB18885@host1.jankratochvil.net> <201110281917.44839.pedro@codesourcery.com> <20111029194745.GA12850@host1.jankratochvil.net> <20111203183613.GA15496@host2.jankratochvil.net> Date: Sun, 04 Dec 2011 01:02:00 -0000 Message-ID: Subject: Re: ping: Re: [patch] Forbid "run" etc. for use_gdb_stub targets From: Doug Evans To: Jan Kratochvil Cc: Pedro Alves , gdb-patches@sourceware.org, Kevin Pouget , Tom Tromey Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true 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: 2011-12/txt/msg00087.txt.bz2 On Sat, Dec 3, 2011 at 10:36 AM, Jan Kratochvil wrote: > I am a bit reluctant to check it on my own as I already made there some > mistakes before. =A0I see there is more work going on with this code. > > > On Sat, 29 Oct 2011 21:47:45 +0200, Jan Kratochvil wrote: > > On Fri, 28 Oct 2011 20:17:44 +0200, Pedro Alves wrote: >> Isn't this too late though? =A0We do the [target_info exists use_gdb_stu= b] >> check at the top of the test files, before gdbserver_start has had a cha= nce >> of running. =A0So I'm guessing that in the first test that runs right >> after the gdb.server/ tests complete, use_gdb_stub will be wrong at the = top of >> the test, but it'll get fixed by that test, so the following ones are ri= ght. >> If that test file happen to have a use_gdb_stub check, it'll lose. >> We may need to do this closer to gdb_init/default_gdb_init (or an overri= de). > > I have tested it and you are right, I had some wrong dejagnu assumptions. > > Modifying target_info's use_gdb_stub is probably not much correct, theref= ore > there is created global $use_gdb_stub instead. > > Global $use_gdb_stub is intentionally unset before gdb_start to cause err= ors > trying to interpret the value before. =A0Some problem is interpreting > [target_info exists use_gdb_stub] after gdb_start is incorrect but it doe= s not > cause any sanity-check error. > > No regressions on {x86_64,x86_64-m32,i686}-fedora16pre-linux-gnu and with > gdbserver. > > > Thanks, > Jan > > > gdb/testsuite/ > 2011-10-29 =A0Jan Kratochvil =A0 > > =A0 =A0 =A0 =A0* gdb.base/break-entry.exp: Move the target use_gdb_stub t= est before > =A0 =A0 =A0 =A0starting GDB. > =A0 =A0 =A0 =A0* gdb.base/default.exp: Replace target use_gdb_stub checks= by global > =A0 =A0 =A0 =A0$use_gdb_stub. > =A0 =A0 =A0 =A0* gdb.base/display.exp: Likewise. > =A0 =A0 =A0 =A0* gdb.base/ending-run.exp: Likewise. > =A0 =A0 =A0 =A0* gdb.base/list.exp (test_listsize): Likewise. > =A0 =A0 =A0 =A0* gdb.base/setshow.exp: Likewise. > =A0 =A0 =A0 =A0* gdb.base/valgrind-db-attach.exp: Set global use_gdb_stub= to 1. > =A0 =A0 =A0 =A0* lib/gdb.exp (gdb_run_cmd, gdb_start_cmd): Replace target= use_gdb_stub > =A0 =A0 =A0 =A0check by global $use_gdb_stub. > =A0 =A0 =A0 =A0(gdb_test_multiple): Forbid run, start or attach for !$use= _gdb_stub. > =A0 =A0 =A0 =A0(default_gdb_start): Set global use_gdb_stub from target u= se_gdb_stub. > =A0 =A0 =A0 =A0(default_gdb_init): Unset global $use_gdb_stub. > =A0 =A0 =A0 =A0(gdb_continue_to_end, rerun_to_main): Replace target use_g= db_stub check > =A0 =A0 =A0 =A0by global $use_gdb_stub. > =A0 =A0 =A0 =A0* lib/gdbserver-support.exp: Extend comments for set_board= _info > =A0 =A0 =A0 =A0gdb_protocol and gdb,socketport, new comment for set_board= _info > =A0 =A0 =A0 =A0use_gdb_stub. > =A0 =A0 =A0 =A0(gdbserver_start_extended): Set global gdbserver_protocol = and > =A0 =A0 =A0 =A0gdbserver_gdbport. =A0Clear global use_gdb_stub. > =A0 =A0 =A0 =A0* lib/mi-support.exp (default_mi_gdb_start): Set global us= e_gdb_stub > =A0 =A0 =A0 =A0from target use_gdb_stub. > =A0 =A0 =A0 =A0(mi_run_cmd): Replace target use_gdb_stub check by global = $use_gdb_stub. I'd like to get away from conflating anything related to gdb stubs and valgrind / gdbserver.