aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCarl Love <cel@us.ibm.com>2022-06-22 16:14:20 +0100
committerAndrew Burgess <aburgess@redhat.com>2022-06-29 10:42:13 +0100
commit13f72372413400410aaa94b7f0e2ff7de663fdcb (patch)
tree1fe93251946f4d1e05fb5dee66f5624e2dd30f04 /include
parent96016a2f00cf86c3e32487724eb747cc20098bc6 (diff)
downloadgdb-13f72372413400410aaa94b7f0e2ff7de663fdcb.zip
gdb-13f72372413400410aaa94b7f0e2ff7de663fdcb.tar.gz
gdb-13f72372413400410aaa94b7f0e2ff7de663fdcb.tar.bz2
gdb/testsuite: fix gdb.base/break-idempotent.exp on ppc
When running the gdb.base/break-idempotent.exp test on ppc, I was seeing some test failures (or rather errors), that looked like this: (gdb) watch local Hardware watchpoint 2: local has_hw_wp_support: Hardware watchpoint detected ERROR: no fileid for gcc2-power8 ERROR: Couldn't send delete breakpoints to GDB. ERROR OCCURED: can't read "gdb_spawn_id": no such variable while executing "expect { -i 1000 -timeout 100 -re ".*A problem internal to GDB has been detected" { fail "$message (GDB internal error)" gdb_internal_erro..." ("uplevel" body line 1) invoked from within What happens is that in break-idempotent.exp we basically do this: if {[prepare_for_testing "failed to prepare" $binfile $srcfile $opts]} { continue } # .... if {![skip_hw_watchpoint_tests]} { test_break $always_inserted "watch" } The problem with this is that skip_hw_watchpoint_tests, includes this: if { [istarget "i?86-*-*"] || [istarget "x86_64-*-*"] || [istarget "ia64-*-*"] || [istarget "arm*-*-*"] || [istarget "aarch64*-*-*"] || ([istarget "powerpc*-*-linux*"] && [has_hw_wp_support]) || [istarget "s390*-*-*"] } { return 0 } For powerpc only we call has_hw_wp_support. This is a caching proc that runs a test within GDB to detect if we have hardware watchpoint support or not. Unfortunately, to run this test we restart GDB, and when the test has completed, we exit GDB. This means that in break-idempotent.exp, when we call skip_hw_watchpoint_tests for the first time on powerpc, GDB will unexpectedly be exited. When we later call delete_breakpoints we see the errors I reported above. The fix is to call skip_hw_watchpoint_tests early, before we start GDB as part of the break-idempotent.exp script, and store the result in a variable, we can then check this variable in the script as needed. After this change break-idempotent.exp runs fine on powerpc. Co-authored-by: Andrew Burgess <aburgess@redhat.com>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions