old-cross-binutils/gdb/annotate.h
Pedro Alves 9c97429fb1 All annotate_breakpoints_changed calls are along-side
observer_notify_breakpoints_changed calls.  All, except the
init_raw_breakpoint one.  But that one is actually wrong.  The
breakpoint is being constructed at that point, and hasn't been placed
on the breakpoint chain yet.  It would be better placed in
install_breakpoint, and I actually started out that way.  But once the
annotate_breakpoints_changed are parallel to the observer calls, we
can fully move annotations to observers too.

One issue is that this changes the order of annotations a bit.
Before, we'd emit the annotation, and after call "mention()" on the
breakpoint (which prints the breakpoint number, etc.).  But, we call
the observers _after_ mention is called, so the annotation output will
change a little:

void
install_breakpoint (int internal, struct breakpoint *b, int update_gll)
{
  add_to_breakpoint_chain (b);
  set_breakpoint_number (internal, b);
  if (is_tracepoint (b))
    set_tracepoint_count (breakpoint_count);
  if (!internal)
    mention (b);
  observer_notify_breakpoint_created (b);

  if (update_gll)
    update_global_location_list (1);
}

I believe this order doesn't really matter (the frontend needs to wait
for the prompt anyway), so I just adjust the expected output in the
tests.  Emacs in annotations mode doesn't seem to complain.  Couple
that with the previous patch that suppressed duplicated annotations,
and, the fact that some annotations calls were actually missing (were
we do have observer calls), more changes to the tests are needed
anyway.

Tested on x86_64 Fedora 17.

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

	* annotate.c (annotate_breakpoints_changed): Rename to ...
	(annotate_breakpoints_invalid): ... this.  Make static.
	(breakpoint_changed): Adjust.
	(_initialize_annotate): Always install the observers.  Install a
	"breakpoint_created" observer.
	* annotate.h (annotate_breakpoints_changed): Delete declaration.
	* breakpoint.c (set_breakpoint_condition)
	(breakpoint_set_commands, do_map_commands_command)
	(init_raw_breakpoint, clear_command, set_ignore_count)
	(enable_breakpoint_disp): No longer call
	annotate_breakpoints_changed.

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

	* gdb.base/annota1.exp (breakpoints_invalid): New variable.
	Adjust tests to breakpoints-invalid changes.
	* gdb.cp/annota2.exp (breakpoints_invalid, frames_invalid): New
	variables.
	Adjust tests to breakpoints-invalid changes.
2013-01-22 20:19:40 +00:00

102 lines
3.7 KiB
C

/* Annotation routines for GDB.
Copyright (C) 1986-2013 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/>. */
#include "symtab.h"
#include "gdbtypes.h"
extern void annotate_breakpoint (int);
extern void annotate_catchpoint (int);
extern void annotate_watchpoint (int);
extern void annotate_starting (void);
extern void annotate_stopped (void);
extern void annotate_exited (int);
extern void annotate_signalled (void);
extern void annotate_signal_name (void);
extern void annotate_signal_name_end (void);
extern void annotate_signal_string (void);
extern void annotate_signal_string_end (void);
extern void annotate_signal (void);
extern void annotate_breakpoints_headers (void);
extern void annotate_field (int);
extern void annotate_breakpoints_table (void);
extern void annotate_record (void);
extern void annotate_breakpoints_table_end (void);
extern void annotate_frames_invalid (void);
extern void annotate_new_thread (void);
extern void annotate_thread_changed (void);
extern void annotate_display_prompt (void);
struct type;
extern void annotate_field_begin (struct type *);
extern void annotate_field_name_end (void);
extern void annotate_field_value (void);
extern void annotate_field_end (void);
extern void annotate_quit (void);
extern void annotate_error (void);
extern void annotate_error_begin (void);
extern void annotate_value_history_begin (int, struct type *);
extern void annotate_value_begin (struct type *);
extern void annotate_value_history_value (void);
extern void annotate_value_history_end (void);
extern void annotate_value_end (void);
extern void annotate_display_begin (void);
extern void annotate_display_number_end (void);
extern void annotate_display_format (void);
extern void annotate_display_expression (void);
extern void annotate_display_expression_end (void);
extern void annotate_display_value (void);
extern void annotate_display_end (void);
extern void annotate_arg_begin (void);
extern void annotate_arg_name_end (void);
extern void annotate_arg_value (struct type *);
extern void annotate_arg_end (void);
extern void annotate_source (char *, int, int, int,
struct gdbarch *, CORE_ADDR);
extern void annotate_frame_begin (int, struct gdbarch *, CORE_ADDR);
extern void annotate_function_call (void);
extern void annotate_signal_handler_caller (void);
extern void annotate_frame_address (void);
extern void annotate_frame_address_end (void);
extern void annotate_frame_function_name (void);
extern void annotate_frame_args (void);
extern void annotate_frame_source_begin (void);
extern void annotate_frame_source_file (void);
extern void annotate_frame_source_file_end (void);
extern void annotate_frame_source_line (void);
extern void annotate_frame_source_end (void);
extern void annotate_frame_where (void);
extern void annotate_frame_end (void);
extern void annotate_array_section_begin (int, struct type *);
extern void annotate_elt_rep (unsigned int);
extern void annotate_elt_rep_end (void);
extern void annotate_elt (void);
extern void annotate_array_section_end (void);
extern void (*deprecated_annotate_signalled_hook) (void);
extern void (*deprecated_annotate_signal_hook) (void);