From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11296 invoked by alias); 27 Jul 2005 00:27:32 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 11271 invoked by uid 22791); 27 Jul 2005 00:27:23 -0000 Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 27 Jul 2005 00:27:23 +0000 Received: from drow by nevyn.them.org with local (Exim 4.52) id 1DxZlZ-00076m-LS; Tue, 26 Jul 2005 20:27:21 -0400 Date: Wed, 27 Jul 2005 00:27:00 -0000 From: Daniel Jacobowitz To: Nick Roberts Cc: gdb-patches@sources.redhat.com Subject: Re: PATCH: tests for MI commands Message-ID: <20050727002721.GA27261@nevyn.them.org> Mail-Followup-To: Nick Roberts , gdb-patches@sources.redhat.com References: <17117.55351.716393.763492@farnswood.snap.net.nz> <20050724211946.GB798@nevyn.them.org> <17126.51233.887175.402254@farnswood.snap.net.nz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <17126.51233.887175.402254@farnswood.snap.net.nz> User-Agent: Mutt/1.5.8i X-SW-Source: 2005-07/txt/msg00203.txt.bz2 On Wed, Jul 27, 2005 at 11:32:49AM +1200, Nick Roberts wrote: > > You had a bunch of changes that only were needed because you added > > initializations between weird->func_ptr = nothing and a0 = '0'; why not > > put them above it, with the others? There might be some problem with > > that I haven't seen... > > The test c_variable-5.8 uses "-var-update *" so I have to change the values of > the added array elements after this test to get a fresh changelist. The > testfile currently stops at "weird->func_ptr = nothing" so it seemed > convenient to add these tests after it. I'm not sure that it would be > simpler, but I can put them above if you prefer. Nah, the way you have it is fine, since there's a convincing reason. > > > ! # Step over "weird->func_ptr = nothing;" > > > ! set line_dct_a0_0 [gdb_get_line_number "a0 = '0';"] > > > mi_step_to do_children_tests {} {.*var-cmd.c} \ > > > ! $line_dct_a0_0 "step \$line_dct_a0_0" > > > > > --- 833,842 ---- > > > > > ! # Step over weird->func_ptr = nothing; > > > mi_step_to do_children_tests {} {.*var-cmd.c} \ > > > ! [expr $line_dct_nothing + 1] "step \$line_dct_nothing + 1" > > > > Please don't do math on line numbers; gdb_get_line_number helps make > > test cases more robust against changes in the test source. > > I was trying to copy existing practice. The testfile seems to use > gdb_get_line_number to get to test blocks and step from there e.g: > > # Step over "struct_declarations.integer = 123;" > mi_step_to do_children_tests {} {.*var-cmd.c} \ > [expr $line_dct_123 + 1] "step \$line_dct_123 + 1" > > The lines: > > set line_dct_a0_0 [gdb_get_line_number "a0 = '0';"] > mi_step_to do_children_tests {} {.*var-cmd.c} \ > $line_dct_a0_0 "step \$line_dct_a0_0" > > are still present but occur later in the file by the comment: > > # Step over struct_declarations.long_array[11] = 5678; > > Is this acceptable or do you want me to use gdb_get_line_number for each > test? It's OK. With the spacing/quoting fixes, go ahead and check it in. In general this is horrid practice, but you aren't really introducing new uses. -- Daniel Jacobowitz CodeSourcery, LLC