Some early changes by Keith Seitz to support the Tcl/Tk GUI.
authorMichael Snyder <msnyder@vmware.com>
Mon, 24 Nov 1997 19:47:05 +0000 (19:47 +0000)
committerMichael Snyder <msnyder@vmware.com>
Mon, 24 Nov 1997 19:47:05 +0000 (19:47 +0000)
Note: these files are still not publically visible; just keeping
their history at this point.

gdb/tracepoint.c
gdb/tracepoint.h

index 4b7a985..25bc3c5 100644 (file)
@@ -47,17 +47,6 @@ extern int info_verbose;
 #define ISATTY(FP)     (isatty (fileno (FP)))
 #endif
 
-/* Walk the following statement or block through all tracepoints.
-   ALL_TRACEPOINTS_SAFE does so even if the statment deletes the current
-   breakpoint.  */
-
-#define ALL_TRACEPOINTS(t)  for (t = tracepoint_chain; t; t = t->next)
-
-#define ALL_TRACEPOINTS_SAFE(t,tmp)    \
-       for (t = tracepoint_chain;      \
-            t ? (tmp = t->next, 1) : 0;\
-            t = tmp)
-
 /* Chain of all tracepoints defined.  */
 struct tracepoint *tracepoint_chain;
 
@@ -200,8 +189,14 @@ set_raw_tracepoint (sal)
   if (sal.symtab == NULL)
     t->source_file = NULL;
   else
-    t->source_file = savestring (sal.symtab->filename,
-                                strlen (sal.symtab->filename));
+    {
+      t->source_file = (char *) xmalloc (strlen (sal.symtab->filename) +
+                                         strlen (sal.symtab->dirname) + 1);
+
+      strcpy (t->source_file, sal.symtab->dirname);
+      strcat (t->source_file, sal.symtab->filename);
+    }
+
   t->language = current_language->la_language;
   t->input_radix = input_radix;
   t->line_number = sal.line;
@@ -270,13 +265,17 @@ trace_command (arg, from_tty)
       t->number = tracepoint_count;
 
       /* If a canonical line spec is needed use that instead of the
-        command string.  */
+         command string.  */
       if (canonical != (char **)NULL && canonical[i] != NULL)
-       t->addr_string = canonical[i];
+        t->addr_string = canonical[i];
       else if (addr_start)
-       t->addr_string = savestring (addr_start, addr_end - addr_start);
+        t->addr_string = savestring (addr_start, addr_end - addr_start);
       if (cond_start)
-       t->cond_string = savestring (cond_start, cond_end - cond_start);
+        t->cond_string = savestring (cond_start, cond_end - cond_start);
+
+      /* Let the UI know of any additions */
+      if (create_tracepoint_hook)
+        create_tracepoint_hook (t);
     }
 
   if (sals.nelts > 1)
@@ -411,6 +410,11 @@ tracepoint_operation (t, from_tty, opcode)
          t2->next = t->next;
          break;
        }
+
+    /* Let the UI know of any deletions */
+    if (delete_tracepoint_hook)
+      delete_tracepoint_hook (t);
+
     if (t->cond_string)
       free (t->cond_string);
     if (t->addr_string)
@@ -430,7 +434,7 @@ tracepoint_operation (t, from_tty, opcode)
 }
 
 /* Utility: parse a tracepoint number and look it up in the list.  */
-static struct tracepoint *
+struct tracepoint *
 get_tracepoint_by_number (arg)
      char **arg;
 {
@@ -1861,4 +1865,3 @@ _initialize_tracepoint ()
 
 #endif
 }
-
index fa6f4eb..d58a7db 100644 (file)
@@ -20,8 +20,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #if !defined (TRACEPOINT_H)
 #define TRACEPOINT_H 1
 
-enum enabled { disabled, enabled };
-
+#if !defined (BREAKPOINT_H)
+enum enable { disabled, enabled };
+#endif
 /* The data structure for an action: */
 struct action_line 
 {
@@ -35,7 +36,7 @@ struct tracepoint
 {
   struct tracepoint *next;
 
-  enum enabled enabled;
+  enum enable enabled;
 
 #if 0
   /* Type of tracepoint (MVS FIXME: needed?). */
@@ -93,5 +94,25 @@ struct tracepoint
   int thread;
 };
 
+/* The tracepont chain of all tracepoints */
+
+extern struct tracepoint *tracepoint_chain;
+
+/* A hook used to notify the UI of tracepoint operations */
+
+void (*create_tracepoint_hook) PARAMS ((struct tracepoint *));
+void (*delete_tracepoint_hook) PARAMS ((struct tracepoint *));
+
+struct tracepoint *get_tracepoint_by_number PARAMS ((char **));
+
+/* Walk the following statement or block through all tracepoints.
+   ALL_TRACEPOINTS_SAFE does so even if the statment deletes the current
+   breakpoint.  */
+
+#define ALL_TRACEPOINTS(t)  for (t = tracepoint_chain; t; t = t->next)
 
+#define ALL_TRACEPOINTS_SAFE(t,tmp)    \
+       for (t = tracepoint_chain;      \
+            t ? (tmp = t->next, 1) : 0;\
+            t = tmp)
 #endif /* TRACEPOINT_H */