public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Pedro Alves <pedro@palves.net>, Tom de Vries <tdevries@suse.de>,
	gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb: use gdb_test_multiple in gdb_breakpoint
Date: Wed, 11 Jan 2023 14:42:33 -0500	[thread overview]
Message-ID: <9280ed47-aa5d-9857-da46-f825b7be2ae2@polymtl.ca> (raw)
In-Reply-To: <aadbcf57-3931-2979-0336-49d75dc3af8a@palves.net>

> As mentioned, this is more of a generic concern of all procedures exposed
> by lib/gdb.exp.  gdb_breakpoint was just one among many.  Seems better to look
> at the overall design/direction rather than just one case in isolation.
> 
> Let's take runto.  It calls gdb_breakpoint (which used to use gdb_expect before your change),
> and then gdb_run_cmd, and then gdb_expect directly.  gdb_run_cmd itself uses gdb_expect.
> gdb_run_cmd may use gdb_reload, which calls gdb_load, which uses gdb_load_cmd, which uses
> gdb_expect.
> 
> So changing any of these gdb_expect to gdb_test_multiple would result in intermediate PASSes
> starting to be emitted.  Depending on refactoring, etc, you'd get different internal PASSes.
> Depending on different target, you'd get wildly different internal PASSes, etc.  You'd get
> a lot more mismatching PASS/FAIL cases when one of the internal gdb_test_multiple's failed.
> Etc.  That doesn't seem like the ideal approach to me.
I don't see that as a big problem.  In fact I like having fine-grained
PASSes or FAILs for the various intermediate steps of the test.  I think
it's fine to get different PASSes on different targets, it represents
what's actually being done.  When debugging a test, I look at the first
FAIL/UNRESOLVED. In the example you gave, if the gdb_load_cmd fails, I'd
appreciate having a FAIL for that, close to the source of the problem,
rather than starting from a later point and having to backtrack.

Plus, the fact that I encountered a few times cases like:

  # Return early if do_something fails
  if { ![do_something] } {
    return
  }

... where do_something would not log anything.  So I broke do_something,
but didn't notice because nothing logged a failure.

However, I can see that having different PASSes in each test can be
annoying if you are diffing test results from two target boards.  That
will add noise in the diff.  When mixing these two concerns, I guess
that we arrive to the "don't tell me when it works, but tell me when it
fails" that gdb_breakpoint and others have.  Maybe it's good after all.

Simon


      reply	other threads:[~2023-01-11 19:42 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-03 19:22 Simon Marchi
2023-01-04  9:15 ` Lancelot SIX
2023-01-04 16:11   ` Simon Marchi
2023-01-04 16:18     ` Lancelot SIX
2023-01-04 16:22       ` Simon Marchi
2023-01-04 17:40         ` Lancelot SIX
2023-01-04 18:02           ` Lancelot SIX
2023-01-04 19:05             ` Simon Marchi
2023-01-04 19:12               ` Lancelot SIX
2023-01-05  9:04 ` Tom de Vries
2023-01-05 16:28   ` Simon Marchi
2023-01-05 16:31     ` Tom de Vries
2023-01-05 16:36       ` Simon Marchi
2023-01-10 15:33     ` Pedro Alves
2023-01-10 15:50       ` Simon Marchi
2023-01-10 19:56         ` Pedro Alves
2023-01-10 20:42           ` Simon Marchi
2023-01-11 19:05             ` Pedro Alves
2023-01-11 19:42               ` Simon Marchi [this message]

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=9280ed47-aa5d-9857-da46-f825b7be2ae2@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@palves.net \
    --cc=tdevries@suse.de \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).