public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] gprofng: fix the Dwarf reader
@ 2023-03-11 23:50 Vladimir Mezentsev
  0 siblings, 0 replies; only message in thread
From: Vladimir Mezentsev @ 2023-03-11 23:50 UTC (permalink / raw)
  To: bfd-cvs, gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=10577a3b13de151a795fe5f60a64dd2e98bca642

commit 10577a3b13de151a795fe5f60a64dd2e98bca642
Author: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
Date:   Fri Mar 10 16:16:49 2023 -0800

    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.

Diff:
---
 gprofng/src/DwarfLib.cc | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/gprofng/src/DwarfLib.cc b/gprofng/src/DwarfLib.cc
index 64003797d25..90c3e6e95a2 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;
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-11 23:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-11 23:50 [binutils-gdb] gprofng: fix the Dwarf reader Vladimir Mezentsev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).