Go to file
Carl Love 13f7237241 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>
2022-06-29 10:42:13 +01:00
bfd Automatic date update in version.in 2022-06-29 00:00:23 +00:00
binutils windres: add quotes around preprocessor cmd if needed 2022-06-28 16:53:23 +02:00
config
contrib
cpu
elfcpp
etc
gas RISC-V: Add 'Sstc' extension and its CSRs 2022-06-28 09:08:42 +08:00
gdb gdb/testsuite: fix gdb.base/break-idempotent.exp on ppc 2022-06-29 10:42:13 +01:00
gdbserver gdb+gdbserver/Linux: avoid reading registers while going through shell 2022-06-28 18:11:29 +01:00
gdbsupport Make GDBserver abort on internal error in development mode 2022-06-27 13:55:36 +01:00
gnulib
gold Have gold's File_read::do_read() function check the start parameter 2022-06-27 13:07:40 +01:00
gprof
gprofng gprofng: fix build when BUILD_MAN is false 2022-06-28 21:36:26 -07:00
include RISC-V: Add 'Sstc' extension and its CSRs 2022-06-28 09:08:42 +08:00
intl
ld Re: ld/x86: skip p_align-1 tests with unsuitable compiler 2022-06-29 10:15:55 +09:30
libbacktrace
libctf
libdecnumber
libiberty
opcodes x86: drop stray NoRex64 from XBEGIN 2022-06-29 10:16:22 +02:00
readline
sim
texinfo
zlib
.cvsignore
.editorconfig
.gitattributes
.gitignore
ar-lib
ChangeLog
compile
config-ml.in
config.guess
config.rpath
config.sub
configure [gdb/build] Fix build breaker with --enable-shared 2022-06-27 15:36:19 +02:00
configure.ac [gdb/build] Fix build breaker with --enable-shared 2022-06-27 15:36:19 +02:00
COPYING
COPYING3
COPYING3.LIB
COPYING.LIB
COPYING.LIBGLOSS
COPYING.NEWLIB
depcomp
djunpack.bat
install-sh
libtool.m4
lt~obsolete.m4
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
MAINTAINERS
Makefile.def
Makefile.in
Makefile.tpl
makefile.vms
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
README
README-maintainer-mode
setup.com
src-release.sh
symlink-tree
test-driver
ylwrap

		   README for GNU development tools

This directory contains various GNU compilers, assemblers, linkers, 
debuggers, etc., plus their support routines, definitions, and documentation.

If you are receiving this as part of a GDB release, see the file gdb/README.
If with a binutils release, see binutils/README;  if with a libg++ release,
see libg++/README, etc.  That'll give you info about this
package -- supported targets, how to use it, how to report bugs, etc.

It is now possible to automatically configure and build a variety of
tools with one command.  To build all of the tools contained herein,
run the ``configure'' script here, e.g.:

	./configure 
	make

To install them (by default in /usr/local/bin, /usr/local/lib, etc),
then do:
	make install

(If the configure script can't determine your type of computer, give it
the name as an argument, for instance ``./configure sun4''.  You can
use the script ``config.sub'' to test whether a name is recognized; if
it is, config.sub translates it to a triplet specifying CPU, vendor,
and OS.)

If you have more than one compiler on your system, it is often best to
explicitly set CC in the environment before running configure, and to
also set CC when running make.  For example (assuming sh/bash/ksh):

	CC=gcc ./configure
	make

A similar example using csh:

	setenv CC gcc
	./configure
	make

Much of the code and documentation enclosed is copyright by
the Free Software Foundation, Inc.  See the file COPYING or
COPYING.LIB in the various directories, for a description of the
GNU General Public License terms under which you can copy the files.

REPORTING BUGS: Again, see gdb/README, binutils/README, etc., for info
on where and how to report problems.