patch_subfile_names (struct subfile *subfile, char *name)
{
if (subfile != NULL && subfile->dirname == NULL && subfile->name != NULL
- && subfile->name[strlen (subfile->name) - 1] == '/')
+ && IS_DIR_SEPARATOR (subfile->name[strlen (subfile->name) - 1]))
{
subfile->dirname = subfile->name;
subfile->name = xstrdup (name);
subfile->next;
subfile = subfile->next)
{
- if (strcmp (lbasename (subfile->name), mainbase) == 0)
+ if (filename_cmp (lbasename (subfile->name), mainbase) == 0)
{
++nr_matches;
mainsub_alias = subfile;
{
symtab->dirname = NULL;
}
- symtab->free_code = free_linetable;
- symtab->free_func = NULL;
/* Use whatever language we have been using for this
subfile, not the one that was deduced in allocate_symtab
symtab->language = subfile->language;
/* Save the debug format string (if any) in the symtab. */
- if (subfile->debugformat != NULL)
- {
- symtab->debugformat = obsavestring (subfile->debugformat,
- strlen (subfile->debugformat),
- &objfile->objfile_obstack);
- }
+ symtab->debugformat = subfile->debugformat;
/* Similarly for the producer. */
- if (subfile->producer != NULL)
- symtab->producer = obsavestring (subfile->producer,
- strlen (subfile->producer),
- &objfile->objfile_obstack);
+ symtab->producer = subfile->producer;
/* All symtabs for the main file and the subfiles share a
blockvector, so we need to clear primary for everything
{
xfree ((void *) subfile->line_vector);
}
- if (subfile->debugformat != NULL)
- {
- xfree ((void *) subfile->debugformat);
- }
- if (subfile->producer != NULL)
- xfree (subfile->producer);
nextsub = subfile->next;
xfree ((void *) subfile);
\f
void
-record_debugformat (char *format)
+record_debugformat (const char *format)
{
- current_subfile->debugformat = xstrdup (format);
+ current_subfile->debugformat = format;
}
void
record_producer (const char *producer)
{
- /* The producer is not always provided in the debugging info.
- Do nothing if PRODUCER is NULL. */
- if (producer == NULL)
- return;
-
- current_subfile->producer = xstrdup (producer);
+ current_subfile->producer = producer;
}
/* Merge the first symbol list SRCLIST into the second symbol list