Thu May 21 13:14:25 1998 John Metzler <jmetzler@cygnus.com>
[deliverable/binutils-gdb.git] / gdb / annotate.c
index 73612aa703f13d1ff269119c93e8c55302a1987a..09d31f523539a770e4bb5b1431530bccb10176de 100644 (file)
@@ -1,5 +1,5 @@
 /* Annotation routines for GDB.
-   Copyright 1986, 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
+   Copyright 1986, 1989, 1990, 1991, 1992, 1995 Free Software Foundation, Inc.
 
 This file is part of GDB.
 
@@ -15,13 +15,33 @@ 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., 675 Mass Ave, Cambridge, MA 02139, USA.  */
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "annotate.h"
 #include "value.h"
 #include "target.h"
+#include "gdbtypes.h"
+#include "breakpoint.h"
+\f
+static void print_value_flags PARAMS ((struct type *));
+static void breakpoint_changed PARAMS ((struct breakpoint *));
+
+void (*annotate_starting_hook) PARAMS ((void));
+void (*annotate_stopped_hook) PARAMS ((void));
+void (*annotate_signalled_hook) PARAMS ((void));
+void (*annotate_exited_hook) PARAMS ((void));
 
+static void
+print_value_flags (t)
+     struct type *t;
+{
+  if (can_dereference (t))
+    printf_filtered ("*");
+  else
+    printf_filtered ("-");
+}
+\f
 void
 breakpoints_changed ()
 {
@@ -51,28 +71,49 @@ annotate_watchpoint (num)
 void
 annotate_starting ()
 {
-  if (annotation_level > 1)
-    printf_filtered ("\n\032\032starting\n");
+
+  if (annotate_starting_hook)
+    annotate_starting_hook ();
+  else
+    {
+      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");
+    }
 }
 
 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");
 }
@@ -188,7 +229,7 @@ void
 annotate_field_end ()
 {
   if (annotation_level > 1)
-    printf_filtered ("\n\032\032field-value\n");
+    printf_filtered ("\n\032\032field-end\n");
 }
 \f
 void
@@ -353,7 +394,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);
@@ -367,7 +408,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");
     }
@@ -506,3 +547,19 @@ annotate_array_section_end ()
     printf_filtered ("\n\032\032array-section-end\n");
 }
 
+static void
+breakpoint_changed (b)
+     struct breakpoint *b;
+{
+  breakpoints_changed ();
+}
+
+void
+_initialize_annotate ()
+{
+  if (annotation_level > 1)
+    {
+      delete_breakpoint_hook = breakpoint_changed;
+      modify_breakpoint_hook = breakpoint_changed;
+    }
+}
This page took 0.024888 seconds and 4 git commands to generate.