Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Keith Seitz <keiths@redhat.com>
To: Tom de Vries <tdevries@suse.de>, gdb-patches@sourceware.org
Subject: Re: [PATCH 2/2] [gdb/testsuite] Use try instead of catch
Date: Thu, 22 Oct 2026 07:22:20 -0700	[thread overview]
Message-ID: <4d525a62-ba57-48fa-8bfa-7840c575a425@redhat.com> (raw)
In-Reply-To: <20260925140116.1985238-3-tdevries@suse.de>

Hi,

On 9/25/26 7:01 AM, Tom de Vries wrote:
> Use try instead of catch in a few places in lib/gdb.exp.

I think this series looks good, but I did want to point out
one little thing.

> ---
>   gdb/testsuite/lib/gdb.exp | 230 +++++++++++++++++++++++---------------
>   1 file changed, 139 insertions(+), 91 deletions(-)
> 
> diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
> index 2cfdbdda09d..3496ddd4132 100644
> --- a/gdb/testsuite/lib/gdb.exp
> +++ b/gdb/testsuite/lib/gdb.exp
> @@ -12380,7 +12425,10 @@ gdb_caching_proc have_startup_shell {} {
>   
>   proc dwz_version { } {
>       set dwz_program "dwz"
> -    set res [catch {exec $dwz_program --version} output]
> +    try {
> +	set output [exec $dwz_program --version]
> +    } trap CHILDSTATUS {output} {
> +    }
>   
>       # Don't check the exit value of 'dwz' process as 'dwz' doesn't
>       # exit immediately after displaying the version number, and for

This is a subtle behavioral change. In the case where dwz does not exist
on the system, `dwz_version' used to return {}. With this change, it now
will propogate an error. IIUC this will cause issues with any test on
such a host that does "require dwz_version N". That will now issue an
error instead of eliciting the usual UNSUPPORTED from dejagnu.

Reviewed-By: Keith Seitz <keiths@redhat.com>

Keith


  reply	other threads:[~2026-10-22 14:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-25 14:01 [PATCH 0/2] " Tom de Vries
2026-09-25 14:01 ` [PATCH 1/2] [gdb/testsuite] Simplify core_find Tom de Vries
2026-09-25 14:01 ` [PATCH 2/2] [gdb/testsuite] Use try instead of catch Tom de Vries
2026-10-22 14:22   ` Keith Seitz [this message]
2026-10-23 11:11     ` Tom de Vries
2026-10-23 13:26       ` Keith Seitz

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=4d525a62-ba57-48fa-8bfa-7840c575a425@redhat.com \
    --to=keiths@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --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