Binutils with MCST patches
Go to file
Pedro Alves 187d10dd19 There's code in annotate.c and breakpoint.c that is supposed to
suppress multiple breakpoints-invalid annotations when the ignore
count of a breakpoint changes, up until the target actually stops.

But, the code is bogus:

void
annotate_breakpoints_changed (void)
{
  if (annotation_level == 2)
    {
      target_terminal_ours ();
      printf_unfiltered (("\n\032\032breakpoints-invalid\n"));
      if (ignore_count_changed)
	ignore_count_changed = 0;   /* Avoid multiple break annotations.  */
    }
}

The "ignore_count_changed" flag isn't actually guarding the output of
the annotation at all.  It would have been better written something
like:

void
annotate_breakpoints_changed (void)
{
  if (annotation_level == 2 && !ignore_count_changed)
    {
      target_terminal_ours ();
      printf_unfiltered (("\n\032\032breakpoints-invalid\n"));
      ignore_count_changed = 0;   /* Avoid multiple break annotations.  */
    }
}

but, it wasn't.  AFAICS, that goes all the way back to the original
patch'es submission and check in, at
<http://sourceware.org/ml/gdb-patches/1999-q4/msg00106.html>.  I
looked a tar of HP's wdb from 1999, and even though that contains
local changes in the annotate code, this suppression seems borked
there too to me.

The original patch added a test to supposedly exercise this
suppression, but, it actually doesn't.  It merely tests that
"breakpoints-invalid" is output after "stopped", but doesn't check
whether the duplicates supression actually works (IOW, check that only
_one_ annotation is seen).  I was going to simply delete the tests
too, but a following patch will eliminate the duplicates in a
different way (which I needed for a different reason), so instead, I'm
making the tests actually fail if a duplicate annotation is seen.

Worry not, the test doesn't actually fail!  The reason is that
breakpoint.c does:

      else if (b->ignore_count > 0)
	{
	  b->ignore_count--;
	  annotate_ignore_count_change ();
	  bs->stop = 0;
	  /* Increase the hit count even though we don't stop.  */
	  ++(b->hit_count);
	  observer_notify_breakpoint_modified (b);
	}

where the annotate_ignore_count_change call is meant to inform the
"breakpoint_modified" annotation observer to ignore the notification.
All sounds good.  But, the trouble is that nowadays annotate.c only
installs the observers if GDB is started with annotations enabled with
a command line option (gdb --annotate=2):

void
_initialize_annotate (void)
{
  if (annotation_level == 2)
    {
      observer_attach_breakpoint_deleted (breakpoint_changed);
      observer_attach_breakpoint_modified (breakpoint_changed);
    }
}

and annota1.exp, to enable annotations, starts GDB normally, and
afterwards does "set annotate 2", so the observers aren't installed
when annota1.exp is run, and therefore changing the ignore count isn't
triggering any annotation at all...

gdb/
2013-01-22  Pedro Alves  <palves@redhat.com>

	* annotate.c (ignore_count_changed): Delete.
	(annotate_breakpoints_changed): Don't clear ignore_count_changed.
	(annotate_ignore_count_change): Delete.
	(annotate_stopped): Don't emit a delayed breakpoints-changed
	annotation.
	* annotate.h (annotate_ignore_count_change): Delete.
	* breakpoint.c (bpstat_check_breakpoint_conditions): Don't call
	annotate_ignore_count_change.

gdb/testsuite/
2013-01-22  Pedro Alves  <palves@redhat.com>

	* gdb.base/annota1.exp (annotate ignore count change): Add
	expected output for failure case.
2013-01-22 20:08:30 +00:00
bfd daily update 2013-01-21 23:00:04 +00:00
binutils PR binutils/15026 2013-01-18 13:14:35 +00:00
config Remove "-I" from LIBSTDCXX_RAW_CXX_LDFLAGS 2013-01-07 18:25:13 +00:00
cpu Add copyright notices 2012-12-10 12:48:03 +00:00
elfcpp Add copyright notices 2012-12-17 16:56:12 +00:00
etc PR other/46202: implement install-strip. 2010-11-20 19:37:58 +00:00
gas Support size relocation only for ELF 2013-01-18 16:37:08 +00:00
gdb There's code in annotate.c and breakpoint.c that is supposed to 2013-01-22 20:08:30 +00:00
gold gold: enable new dtags by default 2013-01-18 17:44:31 +00:00
gprof Rotate binutils ChangeLog for 2013 2013-01-02 17:06:32 +00:00
include include/opcode/ 2013-01-17 16:09:44 +00:00
intl
ld ld: enable new dtags by default for linux/gnu targets 2013-01-21 08:21:46 +00:00
libdecnumber Merge from GCC. 2012-11-11 10:59:50 +00:00
libiberty merge from gcc 2013-01-07 20:28:44 +00:00
opcodes include/opcode/ 2013-01-17 16:09:44 +00:00
readline Remove some extraneous changes in readline/terminal.c 2012-10-18 18:55:41 +00:00
sim Remove debug output 2013-01-17 09:44:53 +00:00
texinfo
.cvsignore
.gitignore Sync the root .gitignore file with GCC's. 2013-01-11 15:17:35 +00:00
COPYING
COPYING.LIB
COPYING.LIBGLOSS 2013-01-07 Jeff Johnston <jjohnstn@redhat.com> 2013-01-07 21:39:26 +00:00
COPYING.NEWLIB 2012-03-09 Jeff Johnston <jjohnstn@redhat.com> 2012-03-09 20:31:34 +00:00
COPYING3
COPYING3.LIB
ChangeLog * configure.ac: Sync with GCC repo. 2013-01-15 21:47:02 +00:00
MAINTAINERS MAINTAINERS: clarify policy with config/ (and other top level files) 2012-05-12 03:10:17 +00:00
Makefile.def * configure.ac: Sync with GCC repo. 2013-01-15 21:47:02 +00:00
Makefile.in * configure.ac: Sync with GCC repo. 2013-01-15 21:47:02 +00:00
Makefile.tpl * Makefile.tpl (BOOT_ADAFLAGS): Remove -gnata. 2013-01-11 11:48:54 +00:00
README
README-maintainer-mode
compile
config-ml.in * config-ml.in: Don't handle arc-*-elf*. 2011-03-22 20:01:13 +00:00
config.guess * config.guss: Update from config repo. 2013-01-08 22:42:34 +00:00
config.rpath Remove freebsd1 from libtool.m4 macros and config.rpath. 2011-02-13 21:00:14 +00:00
config.sub * config.sub: Update from config repo. 2013-01-11 12:57:41 +00:00
configure * configure.ac: Sync with GCC repo. 2013-01-15 21:47:02 +00:00
configure.ac * configure.ac: Sync with GCC repo. 2013-01-15 21:47:02 +00:00
depcomp
djunpack.bat
install-sh
libtool.m4 PR target/38607 2012-09-14 23:55:22 +00:00
ltgcc.m4
ltmain.sh Backport from Libtool: Fix relink mode to use absolute path if hardcode_minus_L. 2011-01-13 18:52:53 +00:00
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
makefile.vms
missing
mkdep
mkinstalldirs
move-if-change Import move-if-change script from gnulib. 2011-02-12 15:47:02 +00:00
setup.com
src-release Include the <root>/cpu/ dir in GDB releases 2011-08-19 15:48:36 +00:00
symlink-tree
ylwrap

README

		   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.