gprofng/ChangeLog
2023-03-10 Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
gprofng/src/DwarfLib.cc (DwrLineRegs::getPath): Add a DW_AT_comp_dir
string if the directoty table has relative names.
}
if (dir == NULL || *dir == 0)
return fnp->path;
- fnp->path = canonical_path (dbe_sprintf ("%s/%s", dir, fnp->fname));
+
+ char *dir1 = NULL;
+ if (*dir != '/')
+ dir1 = dir_names->get(0)->fname;
+ if (dir1 && *dir != 0)
+ fnp->path = dbe_sprintf ("%s/%s/%s", dir1, dir, fnp->fname);
+ else
+ fnp->path = dbe_sprintf ("%s/%s", dir, fnp->fname);
+ fnp->path = canonical_path (fnp->path);
return fnp->path;
}