forked from Imagelibrary/binutils-gdb
Cope with setting trace points on symbols which do not have an associated directory.
This commit is contained in:
@@ -333,18 +333,26 @@ set_raw_tracepoint (sal)
|
||||
t->source_file = NULL;
|
||||
else
|
||||
{
|
||||
char *p;
|
||||
if (sal.symtab->dirname == NULL)
|
||||
{
|
||||
t->source_file = (char *) xmalloc (strlen (sal.symtab->filename) + 1);
|
||||
strcpy (t->source_file, sal.symtab->filename);
|
||||
}
|
||||
else
|
||||
{
|
||||
char *p;
|
||||
|
||||
t->source_file = (char *) xmalloc (strlen (sal.symtab->filename) +
|
||||
strlen (sal.symtab->dirname) + 2);
|
||||
|
||||
strcpy (t->source_file, sal.symtab->dirname);
|
||||
p = t->source_file;
|
||||
while (*p)
|
||||
p++;
|
||||
if (*(--p) != '/') /* Will this work on Windows? */
|
||||
strcat (t->source_file, "/");
|
||||
strcat (t->source_file, sal.symtab->filename);
|
||||
t->source_file = (char *) xmalloc (strlen (sal.symtab->filename) +
|
||||
strlen (sal.symtab->dirname) + 2);
|
||||
|
||||
strcpy (t->source_file, sal.symtab->dirname);
|
||||
p = t->source_file;
|
||||
while (*p)
|
||||
p++;
|
||||
if (*(--p) != '/') /* Will this work on Windows? */
|
||||
strcat (t->source_file, "/");
|
||||
strcat (t->source_file, sal.symtab->filename);
|
||||
}
|
||||
}
|
||||
|
||||
t->language = current_language->la_language;
|
||||
|
||||
Reference in New Issue
Block a user