svn commit: r340745 - head/contrib/elftoolchain/readelf

Maxim Sobolev sobomax at FreeBSD.org
Wed Nov 21 21:46:07 UTC 2018


Author: sobomax
Date: Wed Nov 21 21:46:06 2018
New Revision: 340745
URL: https://svnweb.freebsd.org/changeset/base/340745

Log:
  Fix CU: output of the --debug-dump=decodedline, the problem there
  is that both file name and current directory is recorded, however
  file name sometimes already contains absolute path. In which case
  prefixing it with directory name results in an invalid pathname.
  
  Only append directory name if the file name does not start with '/'.
  This seems to DTRT.
  
  Approved by:	emaste
  MFC after:	2 weeks
  Differential Revision:	https://reviews.freebsd.org/D18290

Modified:
  head/contrib/elftoolchain/readelf/readelf.c

Modified: head/contrib/elftoolchain/readelf/readelf.c
==============================================================================
--- head/contrib/elftoolchain/readelf/readelf.c	Wed Nov 21 20:15:56 2018	(r340744)
+++ head/contrib/elftoolchain/readelf/readelf.c	Wed Nov 21 21:46:06 2018	(r340745)
@@ -4720,7 +4720,7 @@ dump_dwarf_line_decoded(struct readelf *re)
 		    DW_DLV_OK)
 			dir = NULL;
 		printf("CU: ");
-		if (dir && file)
+		if (dir && file && file[0] != '/')
 			printf("%s/", dir);
 		if (file)
 			printf("%s", file);


More information about the svn-src-head mailing list