print_name_only (Sym *self)
{
const char *name = self->name;
- const char *filename;
char *demangled = 0;
- char buf[PATH_MAX];
int size = 0;
if (name)
size = strlen (name);
if ((line_granularity || inline_file_names) && self->file)
{
- filename = self->file->name;
+ const char *filename = self->file->name;
+ char *buf;
+
if (!print_path)
{
filename = strrchr (filename, '/');
filename = self->file->name;
}
}
+ buf = xmalloc (strlen (filename) + 8 + 20 + 16);
if (line_granularity)
{
sprintf (buf, " (%s:%d @ %lx)", filename, self->line_num,
}
printf ("%s", buf);
size += strlen (buf);
+ free (buf);
}
free (demangled);
DBG (DFNDEBUG, printf ("{%d} ", self->cg.top_order));