aboutsummaryrefslogtreecommitdiff
path: root/gdb/tracepoint.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/tracepoint.c')
-rw-r--r--gdb/tracepoint.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 15f5394..2c046c7 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -292,10 +292,16 @@ set_raw_tracepoint (sal)
t->source_file = NULL;
else
{
+ char *p;
+
t->source_file = (char *) xmalloc (strlen (sal.symtab->filename) +
- strlen (sal.symtab->dirname) + 1);
+ strlen (sal.symtab->dirname) + 2);
strcpy (t->source_file, sal.symtab->dirname);
+ p = t->source_file;
+ while (*p++) ;
+ if (*p != '/') /* Will this work on Windows? */
+ strcat (t->source_file, "/");
strcat (t->source_file, sal.symtab->filename);
}