diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 00cc2ab401c..eecaeefed3e 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -5542,7 +5542,8 @@ bpstat_check_breakpoint_conditions (bpstat *bs, thread_info *thread)
 	  catch (const gdb_exception &ex)
 	    {
 	      exception_fprintf (gdb_stderr, ex,
-				 "Error in testing breakpoint condition:\n");
+				 "Error in testing condition for breakpoint %d:\n",
+				 b->number);
 	    }
 	}
       else
diff --git a/gdb/testsuite/gdb.base/bp-cond-failure.c b/gdb/testsuite/gdb.base/bp-cond-failure.c
new file mode 100644
index 00000000000..2a9974b47ce
--- /dev/null
+++ b/gdb/testsuite/gdb.base/bp-cond-failure.c
@@ -0,0 +1,30 @@
+/* Copyright 2022-2023 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+int
+foo ()
+{
+  return 0;	/* Breakpoint here.  */
+}
+
+int
+main ()
+{
+  int res = foo ();
+
+  return res;
+}
diff --git a/gdb/testsuite/gdb.base/bp-cond-failure.exp b/gdb/testsuite/gdb.base/bp-cond-failure.exp
new file mode 100644
index 00000000000..9388b8cf582
--- /dev/null
+++ b/gdb/testsuite/gdb.base/bp-cond-failure.exp
@@ -0,0 +1,114 @@
+# Copyright 2022-2023 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Check the format of the error message given when a breakpoint
+# condition fails.
+#
+# In this case the breakpoint condition does not make use of inferior
+# function calls, instead, the expression used for the breakpoint
+# condition will throw an error when evaluated.
+#
+# We check that the correct breakpoint number appears in the error
+# message, and that the error is reported at the correct source
+# location.
+
+standard_testfile
+
+if { [prepare_for_testing "failed to prepare" ${binfile} "${srcfile}" \
+	  {debug}] == -1 } {
+    return
+}
+
+# Run to main so that we connect to the target if using 'target
+# remote'.  This means that the is_address_zero_readable, and the
+# 'show breakpoint condition-evaluation' checks below will be
+# performed with the remote connection in place.
+if { ![runto_main] } {
+    fail "run to main"
+    return -1
+}
+
+# This test relies on reading address zero triggering a SIGSEGV.
+if { [is_address_zero_readable] } {
+    return
+}
+
+# Where the breakpoint will be placed.
+set bp_line [gdb_get_line_number "Breakpoint here"]
+
+proc run_test { cond_eval } {
+    clean_restart ${::binfile}
+
+    if { ![runto_main] } {
+	fail "run to main"
+	return -1
+    }
+
+    if { $cond_eval ne "auto" } {
+	gdb_test_no_output "set breakpoint condition-evaluation ${cond_eval}"
+    }
+
+    # Setup the conditional breakpoint and record its number.
+    gdb_breakpoint "${::srcfile}:${::bp_line} if (*(int *) 0) == 0"
+    set bp_num [get_integer_valueof "\$bpnum" "*UNKNOWN*"]
+
+    gdb_test "continue" \
+	[multi_line \
+	     "Continuing\\." \
+	     "Error in testing condition for breakpoint ${bp_num}:" \
+	     "Cannot access memory at address 0x0" \
+	     "" \
+	     "Breakpoint ${bp_num}, foo \\(\\) at \[^\r\n\]+:${::bp_line}" \
+	     "${::decimal}\\s+\[^\r\n\]+Breakpoint here\[^\r\n\]+"]
+}
+
+# If we're using a remote target then conditions could be evaulated
+# locally on the host, or on the remote target.  Otherwise, conditions
+# are always evaluated locally.
+#
+# Using "auto" will select the target if the target supports condition
+# evaluation, otherwise, the local host will be used.
+#
+# So, we always include "auto", but then we look at the output of
+# 'show breakpoint condition-evaluation', if this tells us that "auto"
+# is using the target, then we specifically add "host" to the list of
+# modes to check.
+
+set cond_eval_modes { "auto" }
+
+gdb_test_multiple "show breakpoint condition-evaluation" "" {
+    -re -wrap "Breakpoint condition evaluation mode is auto \\(currently target\\)\\." {
+
+	## NOTE: Instead of testing with "auto" and "host" in this
+	## case we only test with "host".  This is because a GDB bug
+	## prevents the "auto" (a.k.a. target) mode from working.
+	##
+	## Don't worry, this will be fixed in a later commit, and this
+	## comment will be removed at that time.
+	##
+	## lappend cond_eval_modes "host"
+
+	set cond_eval_modes { "host" }
+	pass $gdb_test_name
+    }
+
+    -re -wrap "Breakpoint condition evaluation mode is auto \\(currently host\\)\\." {
+	pass $gdb_test_name
+    }
+}
+
+foreach_with_prefix cond_eval $cond_eval_modes {
+    run_test $cond_eval
+}
diff --git a/gdb/testsuite/gdb.base/catch-signal-siginfo-cond.exp b/gdb/testsuite/gdb.base/catch-signal-siginfo-cond.exp
index 182b2f25faa..f400fc03b28 100644
--- a/gdb/testsuite/gdb.base/catch-signal-siginfo-cond.exp
+++ b/gdb/testsuite/gdb.base/catch-signal-siginfo-cond.exp
@@ -18,7 +18,7 @@
 #
 # (gdb) continue
 # Continuing.
-# Error in testing breakpoint condition:
+# Error in testing condition for breakpoint NUM:
 # Selected thread is running.
 #
 # Catchpoint 3 (signal SIGUSR1), 0x0000003615e35877 in __GI_raise (sig=10) at raise.c:56
diff --git a/gdb/testsuite/gdb.base/gnu-ifunc.exp b/gdb/testsuite/gdb.base/gnu-ifunc.exp
index 0a435806409..22462bea233 100644
--- a/gdb/testsuite/gdb.base/gnu-ifunc.exp
+++ b/gdb/testsuite/gdb.base/gnu-ifunc.exp
@@ -281,7 +281,7 @@ proc misc_tests {resolver_attr resolver_debug final_debug} {
 
     # Also test a former patch regression:
     # Continuing.
-    # Error in testing breakpoint condition:
+    # Error in testing condition for breakpoint NUM:
     # Attempt to take address of value not located in memory.
     #
     # Breakpoint 2, main () at ./gdb.base/gnu-ifunc.c:33
diff --git a/gdb/testsuite/gdb.python/py-finish-breakpoint.exp b/gdb/testsuite/gdb.python/py-finish-breakpoint.exp
index b6bd7a63c8f..e5a46874afd 100644
--- a/gdb/testsuite/gdb.python/py-finish-breakpoint.exp
+++ b/gdb/testsuite/gdb.python/py-finish-breakpoint.exp
@@ -188,7 +188,7 @@ with_test_prefix "finish in normal frame" {
     gdb_test "python TestBreakpoint()" "TestBreakpoint init" "set BP in condition"
 
     gdb_test "continue" \
-	"test don't stop: 1.*test don't stop: 2.*test stop.*Error in testing breakpoint condition.*The program being debugged stopped while in a function called from GDB.*" \
+	"test don't stop: 1.*test don't stop: 2.*test stop.*Error in testing condition for breakpoint ${::decimal}.*The program being debugged stopped while in a function called from GDB.*" \
 	"stop in condition function"
 
     gdb_test "continue" "Continuing.*" "finish condition evaluation"
