Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Nick Roberts <nickrob@snap.net.nz>
Cc: gdb-patches@sources.redhat.com
Subject: Re: PATCH: tests for MI commands
Date: Wed, 27 Jul 2005 00:27:00 -0000	[thread overview]
Message-ID: <20050727002721.GA27261@nevyn.them.org> (raw)
In-Reply-To: <17126.51233.887175.402254@farnswood.snap.net.nz>

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


  reply	other threads:[~2005-07-27  0:27 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-20  4:51 Nick Roberts
2005-07-24 21:19 ` Daniel Jacobowitz
2005-07-26 23:31   ` Nick Roberts
2005-07-27  0:27     ` Daniel Jacobowitz [this message]
2005-07-27  3:04       ` Nick Roberts
2005-07-27  3:55         ` Daniel Jacobowitz
2005-07-27 11:46           ` Nick Roberts
2005-07-27 12:50             ` Bob Rossi
2005-07-27 20:52               ` Nick Roberts
2005-07-27 21:49                 ` Daniel Jacobowitz
2005-07-27 22:09                   ` Nick Roberts
2005-07-27 21:03             ` Mark Kettenis
2005-07-27 22:23               ` Nick Roberts
2005-07-28  0:08                 ` Paul Gilliam
2005-07-28  0:18                 ` Stan Shebs
2005-07-28  0:21                 ` Daniel Jacobowitz
2005-07-28  1:39                   ` Nick Roberts
2005-07-31 22:11                     ` Daniel Jacobowitz
2005-07-31 23:32                       ` Nick Roberts
2005-08-01  1:55                         ` Daniel Jacobowitz
2005-07-27 21:25             ` Mark Kettenis
2005-07-29  7:32           ` Nick Roberts
2005-07-31 21:25             ` Daniel Jacobowitz
2005-07-31 23:32               ` Nick Roberts
2005-08-01  1:57                 ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050727002721.GA27261@nevyn.them.org \
    --to=drow@false.org \
    --cc=gdb-patches@sources.redhat.com \
    --cc=nickrob@snap.net.nz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox