Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
To: Tom Tromey <tom@tromey.com>
Cc: <gdb-patches@sourceware.org>
Subject: [PATCH v2] Handle missing catchpoint support in gdb.base/break.exp [PR34535]
Date: Sat, 22 Aug 2026 22:14:02 +0200	[thread overview]
Message-ID: <yddo6etgbg5.fsf_-_@CeBiTec.Uni-Bielefeld.DE> (raw)
In-Reply-To: <87tsonsduj.fsf@tromey.com> (Tom Tromey's message of "Fri, 21 Aug 2026 09:16:52 -0600")

[-- Attachment #1: Type: text/plain, Size: 2366 bytes --]

Hi Tom,

> Rainer> While this patch avoids the failure, I wonder if there's some document
> Rainer> on what it takes to actually implement catchpoints.
>
> There's not really docs on anything.  However, most catchpoints are
> implemented in break-catch-*.c.  Looking at break-catch-fork.c:

thanks for the explanation.  I may give it a try, but probably will go
for lower-hanging fruit first.  In the past, I've repeatedly failed
miserably with patches requiring to dive more deeply into gdb...

> Rainer> +    set test "probe fork catchpoint"
> Rainer> +    gdb_test_multiple "" $test {
> Rainer> +	-re "Your system does not support this type.*" {
> Rainer> +	    unsupported $test
> Rainer> +	}
> Rainer> +	-re "$::gdb_prompt $" {
> Rainer> +	    set ::fork_catchpoints_supported 1
> Rainer> +	    pass $test
> Rainer> +	}
> Rainer> +    }
> Rainer> +}
>  
> Rainer> +    if {!$::fork_catchpoints_supported} {
> Rainer> +	return
> Rainer> +    }
> Rainer> +
> Rainer>      gdb_test "catch fork" "Catchpoint ${::decimal} \\(fork\\)" \
> Rainer>  	"set catch fork, never expected to trigger"
>  
> I think it would be better to just use gdb_test_multiple here, and if
> the "not supported" case is found, just return here.  That would avoid
> starting another gdb.

Good idea.  I did it with the separate test before because the errors
only occur on the "continue" after setting the catchpoints.

So here's the revision: it certainly makes things clearer and simpler.
I think it's better to go for UNSUPPORTED here instead of just skipping
the rest of the test.

---------------------------------------------------------------------------

As detailed in PR PR testsuite/34535, the gdb.base/break.exp test FAILs
on Solaris:

FAIL: gdb.base/break.exp: test_no_break_on_catchpoint: continue until exit (the program exited)

warning: Error inserting catchpoint 2: Your system does not support this type of catchpoint.
warning: Error inserting catchpoint 3: Your system does not support this type of catchpoint.
warning: Error inserting catchpoint 4: Your system does not support this type of catchpoint.

This patch handles that condition.

Tested on x86_64-pc-solaris2.11, sparcv9-sun-solaris2.11, and
x86_64-pc-linux-gnu.

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: sol2-break-no-catchpoint.patch --]
[-- Type: text/x-patch, Size: 766 bytes --]

# HG changeset patch
# Parent  d1c17963050f4ebaae63ff7cfb1eb8e5c5d7fc77
Skip gdb.base/break.exp catchpoint tests without catchpoints [PR34535]

diff --git a/gdb/testsuite/gdb.base/break.exp b/gdb/testsuite/gdb.base/break.exp
--- a/gdb/testsuite/gdb.base/break.exp
+++ b/gdb/testsuite/gdb.base/break.exp
@@ -471,7 +471,14 @@ proc_with_prefix test_no_break_on_catchp
     gdb_test "catch exec" "Catchpoint ${::decimal} \\(exec\\)" \
 	"set catch exec, never expected to trigger"
 
-    gdb_continue_to_end
+    gdb_test_multiple "continue" "" {
+	-re "Your system does not support this type.*" {
+	    unsupported "target does not support this type of catchpoint"
+	}
+	-re "Continuing." {
+	    pass "continue until exit"
+	}
+    }
 }
 
 test_no_break_on_catchpoint

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

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-20 14:12 [PATCH] Skip gdb.base/break.exp catchpoint tests without catchpoints [PR34535] Rainer Orth
2026-08-21 15:16 ` Tom Tromey
2026-08-22 20:14   ` Rainer Orth [this message]
2026-08-27 15:33     ` [PATCH v2] Handle missing catchpoint support in gdb.base/break.exp [PR34535] Tom Tromey

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=yddo6etgbg5.fsf_-_@CeBiTec.Uni-Bielefeld.DE \
    --to=ro@cebitec.uni-bielefeld.de \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.com \
    /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