aboutsummaryrefslogtreecommitdiff
path: root/gprofng/src
diff options
context:
space:
mode:
authorVladimir Mezentsev <vladimir.mezentsev@oracle.com>2023-03-10 16:16:49 -0800
committerVladimir Mezentsev <vladimir.mezentsev@oracle.com>2023-03-11 15:12:08 -0800
commit10577a3b13de151a795fe5f60a64dd2e98bca642 (patch)
tree580fabaf78d07eb1c2308276534c98f50b59f21e /gprofng/src
parentddc6677b170be399dfcc7d81325870ff022ba875 (diff)
downloadgdb-10577a3b13de151a795fe5f60a64dd2e98bca642.zip
gdb-10577a3b13de151a795fe5f60a64dd2e98bca642.tar.gz
gdb-10577a3b13de151a795fe5f60a64dd2e98bca642.tar.bz2
gprofng: fix the Dwarf reader
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.
Diffstat (limited to 'gprofng/src')
-rw-r--r--gprofng/src/DwarfLib.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/gprofng/src/DwarfLib.cc b/gprofng/src/DwarfLib.cc
index 6400379..90c3e6e 100644
--- a/gprofng/src/DwarfLib.cc
+++ b/gprofng/src/DwarfLib.cc
@@ -1779,7 +1779,15 @@ DwrLineRegs::getPath (int fn)
}
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;
}