Clarify texinfo/
[deliverable/binutils-gdb.git] / gdb / annotate.c
index 8d36676571c1cd73e0b5e6f7411fe6447d12fbda..ee26290a95ec0d58915325316c55a0f01009aeae 100644 (file)
@@ -1,21 +1,22 @@
 /* Annotation routines for GDB.
-   Copyright 1986, 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
+   Copyright 1986, 89, 90, 91, 92, 95, 98, 1999 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 2 of the License, or
-(at your option) any later version.
+   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 2 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.
+   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, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "annotate.h"
@@ -24,7 +25,22 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "gdbtypes.h"
 #include "breakpoint.h"
 \f
-static void print_value_flags PARAMS ((struct type *));
+
+/* Prototypes for local functions. */
+
+extern void _initialize_annotate (void);
+
+static void print_value_flags (struct type *);
+
+static void breakpoint_changed (struct breakpoint *);
+
+void (*annotate_starting_hook) (void);
+void (*annotate_stopped_hook) (void);
+void (*annotate_signalled_hook) (void);
+void (*annotate_signal_hook) (void);
+void (*annotate_exited_hook) (void);
+
+static int ignore_count_changed = 0;
 
 static void
 print_value_flags (t)
@@ -43,9 +59,24 @@ breakpoints_changed ()
     {
       target_terminal_ours ();
       printf_unfiltered ("\n\032\032breakpoints-invalid\n");
+      if (ignore_count_changed)
+       ignore_count_changed = 0;       /* Avoid multiple break annotations. */
     }
 }
 
+/* The GUI needs to be informed of ignore_count changes, but we don't
+   want to provide successive multiple breakpoints-invalid messages
+   that are all caused by the fact that the ignore count is changing
+   (which could keep the GUI very busy).  One is enough, after the
+   target actually "stops". */
+
+void
+annotate_ignore_count_change (void)
+{
+  if (annotation_level > 1)
+    ignore_count_changed = 1;
+}
+
 void
 annotate_breakpoint (num)
      int num;
@@ -54,6 +85,14 @@ annotate_breakpoint (num)
     printf_filtered ("\n\032\032breakpoint %d\n", num);
 }
 
+void
+annotate_catchpoint (num)
+     int num;
+{
+  if (annotation_level > 1)
+    printf_filtered ("\n\032\032catchpoint %d\n", num);
+}
+
 void
 annotate_watchpoint (num)
      int num;
@@ -65,30 +104,54 @@ annotate_watchpoint (num)
 void
 annotate_starting ()
 {
-  if (annotation_level > 1)
+
+  if (annotate_starting_hook)
+    annotate_starting_hook ();
+  else
     {
-      printf_filtered ("\n\032\032starting\n");
+      if (annotation_level > 1)
+       {
+         printf_filtered ("\n\032\032starting\n");
+       }
     }
 }
 
 void
 annotate_stopped ()
 {
-  if (annotation_level > 1)
-    printf_filtered ("\n\032\032stopped\n");
+  if (annotate_stopped_hook)
+    annotate_stopped_hook ();
+  else
+    {
+      if (annotation_level > 1)
+       printf_filtered ("\n\032\032stopped\n");
+    }
+  if (annotation_level > 1 && ignore_count_changed)
+    {
+      ignore_count_changed = 0;
+      breakpoints_changed ();
+    }
 }
 
 void
 annotate_exited (exitstatus)
      int exitstatus;
 {
-  if (annotation_level > 1)
-    printf_filtered ("\n\032\032exited %d\n", exitstatus);
+  if (annotate_exited_hook)
+    annotate_exited_hook ();
+  else
+    {
+      if (annotation_level > 1)
+       printf_filtered ("\n\032\032exited %d\n", exitstatus);
+    }
 }
 
 void
 annotate_signalled ()
 {
+  if (annotate_signalled_hook)
+    annotate_signalled_hook ();
+
   if (annotation_level > 1)
     printf_filtered ("\n\032\032signalled\n");
 }
@@ -124,6 +187,9 @@ annotate_signal_string_end ()
 void
 annotate_signal ()
 {
+  if (annotate_signal_hook)
+    annotate_signal_hook ();
+
   if (annotation_level > 1)
     printf_filtered ("\n\032\032signal\n");
 }
@@ -369,7 +435,7 @@ annotate_source (filename, line, character, mid, pc)
   else
     printf_filtered ("\032\032");
 
-  printf_filtered ("%s:%d:%d:%s:", filename,
+  printf_filtered ("%s:%d:%d:%s:0x", filename,
                   line, character,
                   mid ? "middle" : "beg");
   print_address_numeric (pc, 0, gdb_stdout);
@@ -383,7 +449,7 @@ annotate_frame_begin (level, pc)
 {
   if (annotation_level > 1)
     {
-      printf_filtered ("\n\032\032frame-begin %d ", level);
+      printf_filtered ("\n\032\032frame-begin %d 0x", level);
       print_address_numeric (pc, 0, gdb_stdout);
       printf_filtered ("\n");
     }
This page took 0.031636 seconds and 4 git commands to generate.