aboutsummaryrefslogtreecommitdiff
path: root/gdb/tracepoint.c
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>1997-11-24 19:47:05 +0000
committerMichael Snyder <msnyder@vmware.com>1997-11-24 19:47:05 +0000
commit57c0b026557370112658f492511c959aa0a638b4 (patch)
tree70d1965c76592637a2854ee5bb8bc78ca944f12d /gdb/tracepoint.c
parent6a02d20100566483074af39ab54c2373e0e387c3 (diff)
downloadgdb-57c0b026557370112658f492511c959aa0a638b4.zip
gdb-57c0b026557370112658f492511c959aa0a638b4.tar.gz
gdb-57c0b026557370112658f492511c959aa0a638b4.tar.bz2
Some early changes by Keith Seitz to support the Tcl/Tk GUI.
Note: these files are still not publically visible; just keeping their history at this point.
Diffstat (limited to 'gdb/tracepoint.c')
-rw-r--r--gdb/tracepoint.c41
1 files changed, 22 insertions, 19 deletions
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 4b7a985..25bc3c5 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -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
}
-