public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [committed][gdb/testsuite] Fix breakpoint detection in gdb.gdb/python-helper.exp
@ 2021-09-29 13:54 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2021-09-29 13:54 UTC (permalink / raw)
  To: gdb-patches

Hi,

With a gdb configured to be somewhat minimal, while still supporting python:
...
$ gdb --configuration
This GDB was configured as follows:
   configure --host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
             --with-auto-load-dir=$debugdir:$datadir/auto-load
             --with-auto-load-safe-path=$debugdir:$datadir/auto-load
             --without-expat
             --with-gdb-datadir=$install/share/gdb (relocatable)
             --with-jit-reader-dir=$install/lib64/gdb (relocatable)
             --without-libunwind-ia64
             --without-lzma
             --without-babeltrace
             --without-intel-pt
             --with-mpfr
             --without-xxhash
             --with-python=/usr
             --with-python-libdir=/usr/lib
             --with-debuginfod
             --without-guile
             --disable-source-highlight
             --with-separate-debug-dir=/usr/lib/debug
             --with-system-gdbinit=$devel/system-gdbinit
...
and using gcc 4.8 to build gdb (causing std::thread not to be used due to
PR28318) I ran into:
...
(gdb) PASS: gdb.gdb/python-helper.exp: start inner gdb
print 1^M
^M
Breakpoint 2, value_print () at src/gdb/valprint.c:1174^M
1174      scoped_value_mark free_values;^M
(xgdb) FAIL: gdb.gdb/python-helper.exp: hit breakpoint in inner gdb (timeout)
...

The problem is that the regexp expects "hit Breakpoint $decimal".  The "hit"
part is missing.

The "hit" is printed by maybe_print_thread_hit_breakpoint, when
show_thread_that_caused_stop returns true:
...
int
show_thread_that_caused_stop (void)
{
  return highest_thread_num > 1;
}
...
Apparently, that's not the case.

Fix this by removing "hit" from the regexp, making the regexp more similar to
what is used in say, continue_to_breakpoint.

Tested on x86_64-linux.

Committed to trunk.

Thanks,
- Tom

[gdb/testsuite] Fix breakpoint detection in gdb.gdb/python-helper.exp

---
 gdb/testsuite/gdb.gdb/python-helper.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.gdb/python-helper.exp b/gdb/testsuite/gdb.gdb/python-helper.exp
index 54c256eb2e0..7013a3a836f 100644
--- a/gdb/testsuite/gdb.gdb/python-helper.exp
+++ b/gdb/testsuite/gdb.gdb/python-helper.exp
@@ -92,7 +92,7 @@ proc test_python_helper {} {
     # just created.
     send_inferior "print 1\n"
     gdb_test_multiple "" "hit breakpoint in inner gdb" {
-	-re "hit Breakpoint $decimal, value_print.*\\(xgdb\\) $" {
+	-re "Breakpoint $decimal, value_print.*\\(xgdb\\) $" {
 	    pass $gdb_test_name
 	}
     }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-09-29 13:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-29 13:54 [committed][gdb/testsuite] Fix breakpoint detection in gdb.gdb/python-helper.exp Tom de Vries

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).